From patchwork Fri Apr 21 17:50:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 675864 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp988952wrs; Fri, 21 Apr 2023 10:51:11 -0700 (PDT) X-Google-Smtp-Source: AKy350ZFRHHWgmvuruukbek2voTCN7VYlfE+wMRe6QsmtKeDt3cT0h59uzQ2ifPCgY2LTIQF8zUj X-Received: by 2002:a05:6a20:8429:b0:ee:b3f4:4ddf with SMTP id c41-20020a056a20842900b000eeb3f44ddfmr7983909pzd.48.1682099471438; Fri, 21 Apr 2023 10:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682099471; cv=none; d=google.com; s=arc-20160816; b=hF9hBVRTlbal88q+u0IoWxxV4P+uCZo/IxQ+lFlkPr9mebv1g5TIShE31bNGTXbTnw x1Mda3LsjXPXPX08IPLvowKsoLbCgnqq2Jya5M75ytHM7LGLcQUSBAL1LExcSI05cTz4 kjxObuuXf5EzAdElt5f5fhE1A4s5M85waUD1vVTOhr4N3XlHjshecQRQ+2Esbg8MdO1D uL6L2f6PBkCepmem+WQ/yEbr6U2ZFqdHFjKoULfQLLwEVEo8xVZvwC++St/IxOyEr4G2 FSNnd+A6KiKaVTVSvX2uLU8V7WNK6dpksc0Hj2PBni193ZR8u7BwdyHQ0F8oEjTfkYJj IBSQ== 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=9M4VklkPUP9LQAx7j6705xNhGlImo+VZpdlYtgzaSQU=; b=rdY9gyb4zQDskI/5l/c+oATbXbfe6uiR6M+DrFsJwQ+03HzxGeyRrAviscEE0JXpHb 4cDz448f0r0uodWOv0MR1H2oefSFe3V8w6TKY0eAmXxElzLNYvxiR2+E4mbRaFNwskp1 3GKeUQ93sLGMVkYkfF4GATm0PzzbWFPHQx7FT5REmzJXb2jKVNT2pNqT51tGyeuzusBI llHz5duKhZNQ52VpmXr0jMdyJiGtrdy8AQg98oZzZ5SwcbXbBI2igXGmjs+FMDAwZAmE KilspX08FSPE+7KiwEfHdzUVKXlV27js7rSLoOSYZg7lNY/QdXw/LdEwKMu7j6uEzNe0 x0Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uHf1pypr; 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 n3-20020a6543c3000000b005133f65dc69si4656938pgp.219.2023.04.21.10.51.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Apr 2023 10:51:11 -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=uHf1pypr; 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 2A67A86371; Fri, 21 Apr 2023 19:50:53 +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="uHf1pypr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EC83C86356; Fri, 21 Apr 2023 19:50:48 +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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) (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 69BAB86359 for ; Fri, 21 Apr 2023 19:50:46 +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-x236.google.com with SMTP id 38308e7fff4ca-2a7a74fa8e6so796621fa.1 for ; Fri, 21 Apr 2023 10:50:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682099445; x=1684691445; 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=9M4VklkPUP9LQAx7j6705xNhGlImo+VZpdlYtgzaSQU=; b=uHf1pyprNluF5TCEI3urUOhwImpYREAcdW+aomyrfDBrOs+RDsg/58U0x9nFSwzv0W Rr1OHC+LQ41yipnZ9/8eOVf+Q2uHV7G6SPgpJbGIZ8QvSCHqjsmy09PWdI+7867bW08u svuApVRkqvcqRK8OrpXrQUMxDr41Ryl0m8q4DXHuQdXNw/wbvEwMEe13q34aqvkQAmEP aSGLsL1foqLPkyAkRge8QI2gewKRBKvJv82kTgucG+XWgjIgwuMIbZf9w8tOZ2Xj0qrB hHHA2qweybQZ4NLm0a1Y+AmMKiMW/GvqTu7Umx0pJVvDcz63ipuXlP0vsrM5/315YH6o Gibg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682099445; x=1684691445; 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=9M4VklkPUP9LQAx7j6705xNhGlImo+VZpdlYtgzaSQU=; b=EpmfPN3np00QK7xWShTneF7JFrzrNq1WthNoieVkmGH8faAApottq70q2f/GVtSXGM Y/b7PH2oq+J+UphQaQ5ePsFQcNi312HtXGlIN6GgVxSPvQ//UUQu6IeS0UmP4ePvliiA og96Wb3acFLJfHgLBjwJQMGsV5rTQ+cc422NkXfBPbaiiA6yr/DGWEk5iSwR5QHMyOre 0jigeGpd2rVroScGDkZma8AYC1fzOfKKJiOkjjEFiWG0MfAuoopbC1DeqitQ9i5GoEdL eI855MZjzIHBdHVkjOtq0V6IIPZU1fQlUVjpgj3zZyKkKniofU+wUZP5n4O0VdqgcjO1 brEA== X-Gm-Message-State: AAQBX9di7e07DQ1mDnFsNZ4Zz7ekfxxuhndGvQHGKCryyQjuTiTyIJIU dJJGIouClPtG+7h03RMccsMzew== X-Received: by 2002:a2e:6d02:0:b0:2a7:970a:1c1b with SMTP id i2-20020a2e6d02000000b002a7970a1c1bmr1425766ljc.3.1682099445635; Fri, 21 Apr 2023 10:50:45 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id u24-20020a2e8558000000b002a7aa25c3b6sm674256ljj.88.2023.04.21.10.50.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Apr 2023 10:50:45 -0700 (PDT) From: Vladimir Zapolskiy To: Tom Rini , Simon Glass , Ramon Fried , Dzmitry Sankouski Cc: Konrad Dybcio , Bhupesh Sharma , u-boot@lists.denx.de Subject: [PATCH v3 1/9] misc: add Qualcomm GENI SE QUP device driver Date: Fri, 21 Apr 2023 20:50:33 +0300 Message-Id: <20230421175041.275566-2-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230421175041.275566-1-vladimir.zapolskiy@linaro.org> References: <20230421175041.275566-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 b5707a15c504..fc4c893334d3 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..281a5ec819a9 --- /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 size; +} + +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, +};