From patchwork Wed Apr 12 14:29:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 672636 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:184:0:0:0:0 with SMTP id p4csp369641wrx; Wed, 12 Apr 2023 07:30:34 -0700 (PDT) X-Google-Smtp-Source: AKy350Yp70FCacWiVlPc2DeL0Qxu+LI8yppA/hfSFedthLigHAiho4HrITElbm1K6wXtE1fxlagR X-Received: by 2002:ac8:5782:0:b0:3e4:e035:b5ae with SMTP id v2-20020ac85782000000b003e4e035b5aemr3492244qta.25.1681309834086; Wed, 12 Apr 2023 07:30:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681309834; cv=none; d=google.com; s=arc-20160816; b=yzWLrb2Nikdp/wKO5I3He92xojBIFv++keUnWSk37bJSSh2RDb1/z0mwR2ljdc9SvD OaANzCarSYu/vYmzWwwfJxCCA3csVE8W9RPi6mO8vtd2zBVsEFpOGH7VPB/6UmGgVP8P ii1fTVOZCSI5yBaB9h9IBVyzCIM4hi/YzRPKkPQYA/OWwBUXNHwekI/e9mEluWgwuR8u CCLO9qK74dVdWHH6hFRX1th9y8jfRHwYgnq7tYOGmOYz6x0obU4Avt9GTHW33MmQSLyy poKnhqaJITV62hJUt96A4fA/auslGsqxaTArcRsSVidJl851DJ8+7eapiUO+k2gpnsWk fW4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=f5albaxkC9QwjUU9wkRAz8fu89F0BGgw9MKtk/ySzXY=; b=SeeTWGfTiLCE9iYaWyprf9FQQMJ95YFxErK1fgEcs4gHPKYkn00B6whMNERakngRF+ 0a+Ww0VjmLAXyaG64STiKV69faI/myV9/DN+j+sIkp5gmlxf3kuRADleAG4i5W07EshE pAI/z9KmfY9k+ckZYY/hR0VaxIHln3zJUQD2rztNofgVA46sdJV2IC5CgE8btHd/eKpL prQb6IcCdlDU4uIMC2mQU3Iw+gv4A3p8+UBiMkGkZEn8QxOwPE7GyZG1LzYZEXqKFLmT c3/HaUa1KmyoSkRewYAdu74l9opJmLgRy5xelRfaZvUDRBSOxjaJ5rj2mHPK9lth52Gd JrHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vp12xO64; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id bk28-20020a05620a1a1c00b0074586e65b0esi10860515qkb.491.2023.04.12.07.30.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 07:30:34 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vp12xO64; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 694F885F94; Wed, 12 Apr 2023 16:30:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="vp12xO64"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C4DCD85F85; Wed, 12 Apr 2023 16:30:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CD18285F70 for ; Wed, 12 Apr 2023 16:30:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=vladimir.zapolskiy@linaro.org Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4ec81439f04so197544e87.0 for ; Wed, 12 Apr 2023 07:30:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681309811; x=1683901811; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=f5albaxkC9QwjUU9wkRAz8fu89F0BGgw9MKtk/ySzXY=; b=vp12xO64fQswKMuEZIucTNbKlQgkvzPAOI+m8fO2dSKH8/t+SWqTgyqDnZVlo2dfOO dsiOxVHNMFj1eKOvsnDLDXwgzd1PrfcTAkXpi2S8GcU9OEvJwSmLJPASkdi0ZSBJGXgB JLvdYdEdgk+OuthLvPwq2ZOap1TfdzYZLaYwQjRQI6S5b97AhAIguvi6Bwq6vs32dUMS l+RjLkK3WkbndgKht+x0W7dSV0IRB6dzbumBTGl6gaq3K+JWJCvTLFUcKfuzQ9nFQSUQ CacNMyvpiR11woigMHmMzwqhxdze8WOi2WHqW4IBkZc6rsXQS94HSZKhKn39vcq9yxWl dWMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681309811; x=1683901811; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f5albaxkC9QwjUU9wkRAz8fu89F0BGgw9MKtk/ySzXY=; b=KrCd+Bjk6WdJ4DvqvuyRzI9IUxQ82hw6JZRsZy0P6A9zfjytcj1z3IQrSgXTCo8tck XwSpIupTilFHgt9x5uMFhCAwhfE4Aep697NtrUyfj4iuMDc0EqT1JjYy9Y3XtPuN/0l/ H2DOheb0h6iHk5/qjzJzT60l+u+JrgYjijxD+gRXW5NQOadzzVHh1edfK3H9u4yWlFEm vZDpvrEGnPYn3qZstTkGyJ4cAw+Q/bwBJGTAq/5b5n4JSHkMlW4GeKK3d5kAxjK1ukyZ FzSPa/WkCvti7mt73x1qCfiLKJX8yS2Lhs9XaTPxwzoalkfrcZ1NZSqkZlGRrGQruRaR TnfQ== X-Gm-Message-State: AAQBX9dRyIEX9qruPQwSM9cQzVfnG7YXdZ631kpmLxIA6URfDe6fG+/4 NNZrBNuJwBPg0u2WyYA8lC/B/w== X-Received: by 2002:a2e:a815:0:b0:2a7:9987:571d with SMTP id l21-20020a2ea815000000b002a79987571dmr710762ljq.0.1681309811212; Wed, 12 Apr 2023 07:30:11 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id z2-20020a2e8e82000000b002a7729eea3dsm1861054ljk.88.2023.04.12.07.30.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 07:30:10 -0700 (PDT) From: Vladimir Zapolskiy To: Tom Rini , Simon Glass Cc: Ramon Fried , Konrad Dybcio , Bhupesh Sharma , u-boot@lists.denx.de Subject: [PATCH v2 1/9] misc: add Qualcomm GENI SE QUP device driver Date: Wed, 12 Apr 2023 17:29:58 +0300 Message-Id: <20230412143006.80946-2-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> References: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean This change adds a Qualcomm GENI SE QUP device driver as a wrapper for actually enabled and used serial devices found on a board. At the moment the driver is pretty simple, its intention is to populate childred devices and provide I/O mem read interface to them as clients, this is needed for GENI UART driver to set up a proper clock divider and provide the actually asked baud rate. Signed-off-by: Vladimir Zapolskiy Reviewed-by: Konrad Dybcio --- drivers/misc/Kconfig | 7 +++++++ drivers/misc/Makefile | 1 + drivers/misc/qcom-geni-se.c | 41 +++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 drivers/misc/qcom-geni-se.c diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 4e1ae03e9fd4..04460f1acb25 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -511,6 +511,13 @@ config WINBOND_W83627 legacy UART or other devices in the Winbond Super IO chips on X86 platforms. +config QCOM_GENI_SE + bool "Qualcomm GENI Serial Engine Driver" + depends on ARCH_SNAPDRAGON + help + The driver manages Generic Interface (GENI) firmware based + Qualcomm Technologies, Inc. Universal Peripheral (QUP) Wrapper. + config QFW bool help diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index 3b792f2a14ce..52aed096021f 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -60,6 +60,7 @@ obj-$(CONFIG_NUVOTON_NCT6102D) += nuvoton_nct6102d.o obj-$(CONFIG_P2SB) += p2sb-uclass.o obj-$(CONFIG_PCA9551_LED) += pca9551_led.o obj-$(CONFIG_$(SPL_)PWRSEQ) += pwrseq-uclass.o +obj-$(CONFIG_QCOM_GENI_SE) += qcom-geni-se.o ifdef CONFIG_QFW obj-y += qfw.o obj-$(CONFIG_QFW_PIO) += qfw_pio.o diff --git a/drivers/misc/qcom-geni-se.c b/drivers/misc/qcom-geni-se.c new file mode 100644 index 000000000000..b1443ad66d26 --- /dev/null +++ b/drivers/misc/qcom-geni-se.c @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Qualcomm Generic Interface (GENI) Serial Engine (SE) Wrapper + * + * Copyright (C) 2023 Linaro Ltd. + */ + +#include +#include +#include +#include + +static int geni_se_qup_read(struct udevice *dev, int offset, + void *buf, int size) +{ + fdt_addr_t base = dev_read_addr(dev); + + if (size != sizeof(u32)) + return -EINVAL; + + *(u32 *)buf = readl(base + offset); + + return 0; +} + +static struct misc_ops geni_se_qup_ops = { + .read = geni_se_qup_read, +}; + +static const struct udevice_id geni_se_qup_ids[] = { + { .compatible = "qcom,geni-se-qup" }, + {} +}; + +U_BOOT_DRIVER(geni_se_qup) = { + .name = "geni_se_qup", + .id = UCLASS_MISC, + .of_match = geni_se_qup_ids, + .ops = &geni_se_qup_ops, + .flags = DM_FLAG_PRE_RELOC, +};