From patchwork Thu Mar 30 19:47:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 668613 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp115554wrt; Thu, 30 Mar 2023 12:51:26 -0700 (PDT) X-Google-Smtp-Source: AKy350a/WaRNBpfUEfdxu7vLJ/INjybfl56BQMpbItoNOOrqkMpVKx3XJFkwq1V4EkXFIWwHIj5Z X-Received: by 2002:a17:902:d04b:b0:1a1:dd05:39fa with SMTP id l11-20020a170902d04b00b001a1dd0539famr18398842pll.48.1680205886726; Thu, 30 Mar 2023 12:51:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680205886; cv=none; d=google.com; s=arc-20160816; b=WcUxN0ayECjVy1EOK1vLNNv1XdqtJUanYAuIyv1uUP5qw6Cw7yBR0wjydU2A485B2C nJN6BksurRzmfYMrhrcLr0ks1TI8LCvmnvEVhCAqQYvHzV4CF9Fd5MtgpHCFIsX2CKf3 lPPEeodB+s1TPokywooq9gWrZO8oIDQBhJgQ/+BpPjPPXbDHvVlkVfkPGrZIgv+l7E4X kBipSaxbBEP2/BuObYTLpnzk7iPVSkNelPmkKKCO5naxKX1M1bu9awetdhzuRZ/K3lWj q3ECEnrYj/RTl8jKTAggoxUHxqLespHKA9wwOTWEq8EUbQlHavoSef24Ty1C9LUylXcJ G0zA== 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=C51MK1KcefWJ36AuEHQetqDNKOl8igZ4IuAkCAatPeM=; b=n1ekUfqbReAxNCo7WVn4rRtGxGgroHp/uFQyvweOuEvhYwtHsS5qgke5dG9qKElmJ0 C+FDICfNIq9iLzkDObskC12L/FkSsodsG3eDtUkwUxIFPibWt/CqhzoB06TOdW4qMTou kQ0F3y1tzVGc4xmYgfYeTbW/2/jEZVlJ+H5MoB0UqfOM0svdmPWx3CXQGqjVSHTt0idV DLugPQ3sVnK31PlrXZ6yte0h5S4A36wQ0IoVmTT8+TnHKEpXcS6AlkF/vMiOzfMh9Ipx lshx5Q+B057CsDRHZ3ZLBH4UcnqDFq2ivjJenoZq63lM+VGMvOtdkamixXXNKSq3c4xq N/0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X7rq7jcf; 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 u16-20020a63df10000000b005138c1f1fbbsi430985pgg.548.2023.03.30.12.51.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 12:51:26 -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=X7rq7jcf; 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 A42DF86182; Thu, 30 Mar 2023 21:51:07 +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="X7rq7jcf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2986C85EF3; Thu, 30 Mar 2023 21:47:45 +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-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) (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 3D0A18574A for ; Thu, 30 Mar 2023 21:47:42 +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-lj1-x22e.google.com with SMTP id 38308e7fff4ca-29bd5a3f8d6so496301fa.1 for ; Thu, 30 Mar 2023 12:47:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680205661; 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=C51MK1KcefWJ36AuEHQetqDNKOl8igZ4IuAkCAatPeM=; b=X7rq7jcfIVUpFF3HIhkbZjmWHu6OIQZwvtQj4UDQla0h7jCBW7ojlSwE9/6jkCRGk5 u54H5yJhJ0spONstGtovHGRNA5uUMZt0Ce5RnEyBXgtdWsqOzImwXwAwFESOmD7tm1bz aDF2R3v44fYitggwMLdinrqjt3w149K2MFo+Uk8OSITtemkE8Oyt+y4gqEQHUXc7h5Ys KnBfyVx9GXozQS5Z55pnqr+4BXAgWhUkQD4knY9SfvzGFJRdKMr+BPa6fRjEgLRKcKJw aHqWo8F9DMeodxYVGzh72wXYuGPt/eXrEcCsFuTCjGQXKJBLMK+HZxLopptvxuDhn4k9 vPhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680205661; 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=C51MK1KcefWJ36AuEHQetqDNKOl8igZ4IuAkCAatPeM=; b=n7i0NYvONeQahNnK+A3oTNeXHd3aCwEOi3Y7jeUq+LavYJxDfhZOnGUMDHWyfhtE6s TLFfAqSKldjwFiA24KLXU6wPlOTOpbsHALFpzyixQQ1FoDmI7QonVvXRXDBVPCYBYXog otFDyp9FtA9Zsu7IVPQHDIECr71WvGHlkD2PGRMzU/mD412yoFenHR/7P2OblQx53riB BQJv/wiv7uc+e6Q28XSUcwue4mWPM40jLSVk835NWZKRlZC9WIQsQjt8wECSgw5/uy9U pg7OVxffH5PvBoO9QxonBd+G9IPTkJdGgq/ay6BQRFj9Bu0LGWtxa9tS+OilaSXv5KoO AkBA== X-Gm-Message-State: AAQBX9eGo4kQ2JvYyKKf4wBe1nB7zeZxE7DzuHWORAH2zO/qmLnRmaza PWkmOYjVS/wKQtgFgbhbJWFaXw== X-Received: by 2002:a2e:be85:0:b0:298:a8bc:b4d4 with SMTP id a5-20020a2ebe85000000b00298a8bcb4d4mr1169538ljr.4.1680205661325; Thu, 30 Mar 2023 12:47:41 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id i19-20020a2e8093000000b0029f3e2efbb9sm46674ljg.90.2023.03.30.12.47.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 12:47:40 -0700 (PDT) From: Vladimir Zapolskiy To: Tom Rini , Simon Glass Cc: Ramon Fried , Konrad Dybcio , Bhupesh Sharma , u-boot@lists.denx.de Subject: [PATCH 1/6] misc: add Qualcomm GENI SE QUP device driver Date: Thu, 30 Mar 2023 22:47:31 +0300 Message-Id: <20230330194736.2400593-2-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230330194736.2400593-1-vladimir.zapolskiy@linaro.org> References: <20230330194736.2400593-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 30 Mar 2023 21:50:39 +0200 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 | 6 ++++++ drivers/misc/Makefile | 1 + drivers/misc/qcom-geni-se.c | 42 +++++++++++++++++++++++++++++++++++++ 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 b5707a15c504..348e1ab407ad 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -511,6 +511,12 @@ 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" + 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..4f1775b11f62 --- /dev/null +++ b/drivers/misc/qcom-geni-se.c @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Qualcomm Generic Interface (GENI) Serial Engine (SE) Wrapper + * + * (C) Copyright 2023 Vladimir Zapolskiy + */ + +#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, + .bind = dm_scan_fdt_dev, + .ops = &geni_se_qup_ops, + .flags = DM_FLAG_PRE_RELOC, +};