From patchwork Thu Aug 4 14:27:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 595321 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp482709maz; Thu, 4 Aug 2022 07:28:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR5TOgx0zymBp+XTa1ND1PxQEXPjkDCj0+T5eoytYdUQiHuA3OnqlqvKkHwsutCC1CfI3UQl X-Received: by 2002:a05:6602:2c44:b0:67d:588:f282 with SMTP id x4-20020a0566022c4400b0067d0588f282mr882464iov.139.1659623283466; Thu, 04 Aug 2022 07:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659623283; cv=none; d=google.com; s=arc-20160816; b=mpRtgqViSoJRCVRxYABoVeljSQxuKZEl5RKDyxqQ+Gezx2D4M7Fzgz0XgX0+QmXHYu PhWaNJI1jSgHR8DmMQi/p3xNssAn++m0gjUmRrKy2BelzOcnY/+z7n74Dvp4SkUz82cI V8vTH2+EcrJYjLdIUDkKBW9lZMulxab6d2FvL768DVTS3mUq+UrzdwaKnpeUnk9TL3B2 G5Yb7IzKEtNI2/qYzKhYRzwSbfRERimLLJjVh+xcytiunPU3S/WXJSY/U1fgUSYh8bRh /M1eHSOjNGGrQ3BzKwdXkPsDcIZSk6CgfxIPPjS+jvgaDqeNIa9RO5TKUeBRPBk3atvx wSwg== 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=v+pfX6es8CHC9xAMSEq36DCNMELGDC6lb1HC78aXRFY=; b=OqEUmFOgrZWBXa9Zyds3OImPdHd1ahSG8ziF1UYam0z5pu/LcvkQqeDFhkvo9e1j15 2+cCYzhU+/VR+h40r3qS02xTbekuqSWl1u/IajFPAkJ3x9JlYO2CffLQzyZU3ocKZOfe gQ5MxSU4uNdsM1C1Xh6SBfIxidWfJuE0CcZ+vw3KhI6MFbbioAiuD5l3dsIRpAduENSL D7CCq7tpSUgeOJOieh2Bk6Yj3nyCzC8ok/cLpACj8vI/Vms6hD3CWEOsgJTDAOrTVXvo ph5THiwD0EwImlkT48EcyFtl5mNLNyaJU/I3BU7qiYJpFPrTu1qaAk7UmrLhnerAPZCf fk4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b0y8NHRM; 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 b15-20020a92c56f000000b002dd0fee7698si1168242ilj.162.2022.08.04.07.28.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:28:03 -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=b0y8NHRM; 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 B76B3841E3; Thu, 4 Aug 2022 16:27:59 +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="b0y8NHRM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 97D86845E3; Thu, 4 Aug 2022 16:27:58 +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-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) (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 EE54983EDE for ; Thu, 4 Aug 2022 16:27:55 +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=sumit.garg@linaro.org Received: by mail-pl1-x630.google.com with SMTP id z19so43131plb.1 for ; Thu, 04 Aug 2022 07:27:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=v+pfX6es8CHC9xAMSEq36DCNMELGDC6lb1HC78aXRFY=; b=b0y8NHRMimuZ132nOUuM5Hm8P9hUTDHEX/QWf0JpCL2smutxbM0vohsFl7UqSrhRoD 822O33FQXo58skpjq2YWtLf+LQFlvqbAEJVIz/eBAbVMH16go3T1BXqIimRe74KiB6DT 0sw+f/lmrrCUHP16cS538pMSZah9ki3LlfJoLDA7ff/QTNDnuS7Jpm4ICkvac+xCHwBM C1rn3InkXAyGr7lWpq1KZUhJcrCRwkARSj7IDDgf0jD9U4hNqd2de7+vTrgM6rNtQeYq 4ztOll1sgfRN6/ITWidOBGL/32RieZiD0vfwy2LvyqtEd/JwSFSkvBGKVKPK41uMp8t4 vSiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=v+pfX6es8CHC9xAMSEq36DCNMELGDC6lb1HC78aXRFY=; b=E7vEXAncUqoJPUc3KIEbL7t5c44oygChBj0g7WeaW/fbSJJtUTVaiJFKH05R9tGJoN QdDM7u4FQisrBFbqaZk2dTS7MOmh8flNi5JlLBf2SVlN5ekPk7AVAuGLpcmQBY0ixJJr M5QmMezoT/PYfD065zwqQ+SnrS75MO4w4o2YILfWKvFCl3kZcKgwUC1JzjpK1twPWomy L5IuDdaixY8IZUUb7BxEW4GrvkUtSNgjj2LozzDEkR55xLtqQCGoBbhoNTx4LMf6U3hX 2TNefntt++OspUmBn3JO1RInqmfFbxwxXPOSiW08ajU99rYkXQYmxdG6fANDM1E9Njp3 S0QA== X-Gm-Message-State: ACgBeo1qvoM3If3YOcsD+moVYT8YXiGVngzaRKKLuKzwqDLeamrQ9cQ8 49NFbOIh1u+Tp4DNftCoBYiYg1vze8mS1A== X-Received: by 2002:a17:902:7143:b0:16d:986c:f2f9 with SMTP id u3-20020a170902714300b0016d986cf2f9mr2222904plm.42.1659623273823; Thu, 04 Aug 2022 07:27:53 -0700 (PDT) Received: from localhost.localdomain ([122.162.196.218]) by smtp.gmail.com with ESMTPSA id h185-20020a6253c2000000b0052cdb06c125sm1013549pfb.159.2022.08.04.07.27.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:27:53 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: rfried.dev@gmail.com, jorge.ramirez.ortiz@gmail.com, sjg@chromium.org, trini@konsulko.com, stephan@gerhold.net, mario.six@gdsys.cc, dsankouski@gmail.com, robert.marko@sartura.hr, luka.kovacic@sartura.hr, luka.perkov@sartura.hr, jh80.chung@samsung.com, nicolas.dechesne@linaro.org, vinod.koul@linaro.org, mworsfold@impinj.com, lgillham@impinj.com, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH 01/13] phy: Move qcom SoCs specific phy drivers to qcom folder Date: Thu, 4 Aug 2022 19:57:09 +0530 Message-Id: <20220804142721.536556-2-sumit.garg@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804142721.536556-1-sumit.garg@linaro.org> References: <20220804142721.536556-1-sumit.garg@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.6 at phobos.denx.de X-Virus-Status: Clean Signed-off-by: Sumit Garg --- drivers/phy/Kconfig | 15 +-------------- drivers/phy/Makefile | 3 +-- drivers/phy/qcom/Kconfig | 13 +++++++++++++ drivers/phy/qcom/Makefile | 2 ++ drivers/phy/{ => qcom}/msm8916-usbh-phy.c | 0 drivers/phy/{ => qcom}/phy-qcom-ipq4019-usb.c | 0 6 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 drivers/phy/qcom/Kconfig create mode 100644 drivers/phy/qcom/Makefile rename drivers/phy/{ => qcom}/msm8916-usbh-phy.c (100%) rename drivers/phy/{ => qcom}/phy-qcom-ipq4019-usb.c (100%) diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index c25b42c68f..cf4d5908d7 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig @@ -143,12 +143,6 @@ config STI_USB_PHY used by USB2 and USB3 Host controllers available on STiH407 SoC families. -config PHY_QCOM_IPQ4019_USB - tristate "Qualcomm IPQ4019 USB PHY driver" - depends on PHY && ARCH_IPQ40XX - help - Support for the USB PHY-s on Qualcomm IPQ40xx SoC-s. - config PHY_RCAR_GEN2 tristate "Renesas R-Car Gen2 USB PHY" depends on PHY && RCAR_GEN2 @@ -220,14 +214,6 @@ config MESON_AXG_MIPI_PCIE_ANALOG_PHY This is the generic phy driver for the Amlogic Meson AXG MIPI PCIe Analog PHY. -config MSM8916_USB_PHY - bool "Qualcomm MSM8916 USB PHY support" - depends on PHY - help - Support the USB PHY in msm8916 - - This PHY is found on qualcomm dragonboard410c development board. - config OMAP_USB2_PHY bool "Support OMAP's USB2 PHY" depends on PHY @@ -298,5 +284,6 @@ config PHY_XILINX_ZYNQMP source "drivers/phy/rockchip/Kconfig" source "drivers/phy/cadence/Kconfig" source "drivers/phy/ti/Kconfig" +source "drivers/phy/qcom/Kconfig" endmenu diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile index d95439c425..a3b9f3c5b1 100644 --- a/drivers/phy/Makefile +++ b/drivers/phy/Makefile @@ -21,7 +21,6 @@ obj-$(CONFIG_PHY_SANDBOX) += sandbox-phy.o obj-$(CONFIG_$(SPL_)PIPE3_PHY) += ti-pipe3-phy.o obj-$(CONFIG_AM654_PHY) += phy-ti-am654.o obj-$(CONFIG_STI_USB_PHY) += sti_usb_phy.o -obj-$(CONFIG_PHY_QCOM_IPQ4019_USB) += phy-qcom-ipq4019-usb.o obj-$(CONFIG_PHY_RCAR_GEN2) += phy-rcar-gen2.o obj-$(CONFIG_PHY_RCAR_GEN3) += phy-rcar-gen3.o obj-$(CONFIG_PHY_STM32_USBPHYC) += phy-stm32-usbphyc.o @@ -30,7 +29,6 @@ obj-$(CONFIG_MESON_GXL_USB_PHY) += meson-gxl-usb2.o obj-$(CONFIG_MESON_G12A_USB_PHY) += meson-g12a-usb2.o meson-g12a-usb3-pcie.o obj-$(CONFIG_MESON_AXG_MIPI_DPHY) += meson-axg-mipi-dphy.o obj-$(CONFIG_MESON_AXG_MIPI_PCIE_ANALOG_PHY) += meson-axg-mipi-pcie-analog.o -obj-$(CONFIG_MSM8916_USB_PHY) += msm8916-usbh-phy.o obj-$(CONFIG_OMAP_USB2_PHY) += omap-usb2-phy.o obj-$(CONFIG_KEYSTONE_USB_PHY) += keystone-usb-phy.o obj-$(CONFIG_MT7620_USB_PHY) += mt7620-usb-phy.o @@ -42,3 +40,4 @@ obj-$(CONFIG_PHY_IMX8MQ_USB) += phy-imx8mq-usb.o obj-$(CONFIG_PHY_XILINX_ZYNQMP) += phy-zynqmp.o obj-y += cadence/ obj-y += ti/ +obj-y += qcom/ diff --git a/drivers/phy/qcom/Kconfig b/drivers/phy/qcom/Kconfig new file mode 100644 index 0000000000..f685a6455e --- /dev/null +++ b/drivers/phy/qcom/Kconfig @@ -0,0 +1,13 @@ +config MSM8916_USB_PHY + bool "Qualcomm MSM8916 USB PHY support" + depends on PHY + help + Support the USB PHY in msm8916 + + This PHY is found on qualcomm dragonboard410c development board. + +config PHY_QCOM_IPQ4019_USB + tristate "Qualcomm IPQ4019 USB PHY driver" + depends on PHY && ARCH_IPQ40XX + help + Support for the USB PHY-s on Qualcomm IPQ40xx SoC-s. diff --git a/drivers/phy/qcom/Makefile b/drivers/phy/qcom/Makefile new file mode 100644 index 0000000000..4a340e33c8 --- /dev/null +++ b/drivers/phy/qcom/Makefile @@ -0,0 +1,2 @@ +obj-$(CONFIG_PHY_QCOM_IPQ4019_USB) += phy-qcom-ipq4019-usb.o +obj-$(CONFIG_MSM8916_USB_PHY) += msm8916-usbh-phy.o diff --git a/drivers/phy/msm8916-usbh-phy.c b/drivers/phy/qcom/msm8916-usbh-phy.c similarity index 100% rename from drivers/phy/msm8916-usbh-phy.c rename to drivers/phy/qcom/msm8916-usbh-phy.c diff --git a/drivers/phy/phy-qcom-ipq4019-usb.c b/drivers/phy/qcom/phy-qcom-ipq4019-usb.c similarity index 100% rename from drivers/phy/phy-qcom-ipq4019-usb.c rename to drivers/phy/qcom/phy-qcom-ipq4019-usb.c From patchwork Thu Aug 4 14:27:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 595323 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp483047maz; Thu, 4 Aug 2022 07:28:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR7XnlDm90yvGsMTWFMjHCncLTA556B6dN7fNzjRReW6Y9vpqSzpT5LRmlKQhJT/iUh3yGCg X-Received: by 2002:a05:6e02:1ca5:b0:2df:3283:b4a8 with SMTP id x5-20020a056e021ca500b002df3283b4a8mr1050436ill.131.1659623308820; Thu, 04 Aug 2022 07:28:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659623308; cv=none; d=google.com; s=arc-20160816; b=CBJtnNh4+3DtsK1vtwJkJ20XhW5buVZBm5g0G/aWIS79GuorxFSAEpL1lCthlGqS7q e/sF6vuF9Q9QjASlxIcehs7SPPaUlv8BaSILxh53Z4cUii/T7t/zeIruurb4fwrb1rIZ PETgKhEbrJgIvt8Gqcy0dUvPpopqi4kN53FNmpiFW82vk66Q6PHuzyj/Wz48SbPm04wa qFB9R07XVkMbEi5/Jsch+JoJEDpDCthXD+YU00lkMHmn0fGw2Ytg0hQggZMbNU8urlIN J8S6P98eX0lwW2MNlpc8xrApt/H0X/jSeC/3vjOELxCeBT7qDnDAAD85+oGSYJhyawHV i4Vw== 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=jhaBD8HitCKIVcliq4ZFKlpSMUuxYXyRbYamv1K4ejg=; b=rZBvTOroBQZB3Bb84wh4luGdzbXfY/5N1hqZXL14fzugmllV2PVd6famd5XL6JHfA3 PfIfGkyHmIIiKszcNEXZsRxAfMJHy0kCVXuE55DZOzQ7EYS4QdXJDqyiQWaDWNB91D1D oEGBvVkznvsGQoTwwlwfzT08bI7zGL+6KT4hyIigbz238z1/eqQ8Hws+9BkBbNA2eET8 QCd3oHruimitabhXdsmPuGPZomQJQUzSbrB9PBn/02LLyS0r0q5Q0uKr8Go4hj6gAowq COjaeH4IPu6JVpwGF/LX8WMjCWgnPDljEyxtZ2h5ZNUYF8Zw8XfxJlDKxNROW5oH/62D yWyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CuXrwtJd; 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 z10-20020a056e0203ca00b002df347e51fesi1250250ilr.93.2022.08.04.07.28.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:28:28 -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=CuXrwtJd; 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 11E5084567; Thu, 4 Aug 2022 16:28:08 +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="CuXrwtJd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2F7138482A; Thu, 4 Aug 2022 16:28:06 +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-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) (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 040EF841CC for ; Thu, 4 Aug 2022 16:28:03 +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=sumit.garg@linaro.org Received: by mail-pj1-x1034.google.com with SMTP id t22so11835613pjy.1 for ; Thu, 04 Aug 2022 07:28:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jhaBD8HitCKIVcliq4ZFKlpSMUuxYXyRbYamv1K4ejg=; b=CuXrwtJdW02NsqVrWl+Db/eesD5S40faHPne4O9GWady1DzOGO5ieI5DFwywwpzs68 qEfaYWHeu9izoIoE/gQoN8eeXHzkCS8ICRTiqhwugkTTtl4iTO0vDqzhp+AlZYDQ1vF9 4G/Gmfsi3czsJJLxyKT5goZENU63t1njzMI/NpiIVovkLT5vLbFMxGpuGeV+5Zefc1hF 4E8R5el+1Mj6h/XnbRmDal7HkVv6gRxaULhTwRqrHKS4U4FqywJJvb1/XhI8q8L6IJic gkxj2azUBN9vwV0VhCn5M+6YhLyBJPKwm4p/Dqq6ebDpukfNn9UWhvBt3KmdMnbX0KVf bsNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jhaBD8HitCKIVcliq4ZFKlpSMUuxYXyRbYamv1K4ejg=; b=gHHZcMKQHnc7G4ZfdzGzWoLvHTR9e0LStHPfsy2ARxjYPptOox1UBkdRU5PLlDXun9 QVYq4gq/rUaINP1XRIKK/RY5xnCRWTtgSfReE9+3fBDcAbpGk/P0YGOwrH6vJjbb8zlC p63DRkvIWKmRsB/M3qnMCKTXT5v73CAof7fPXP2iJWlWVfRBTP3pV5yLLAJZzyH3Gn8T c1fnoGIS/c3TbnHdwKd7syMPMYpTYUeyePeBcz9SZHQkL0VqpPyA2MVgwdg9C6voPTfd StP88tPCIxDXHgIVFagR4We55ND90RPTfny/9Q/WeuiTkRKvBKnLRZ3xSyG79td32Mix Rx+g== X-Gm-Message-State: ACgBeo2wXwOAKddkuYwCSZmB8SUr5hzsCkUW9FxEPmrJ+OJx27Emgi65 mO5wwlIRef0CQk1Db3S4LmcY7a5ZrgyvOg== X-Received: by 2002:a17:902:b692:b0:16f:87a0:ddbb with SMTP id c18-20020a170902b69200b0016f87a0ddbbmr1065200pls.35.1659623280894; Thu, 04 Aug 2022 07:28:00 -0700 (PDT) Received: from localhost.localdomain ([122.162.196.218]) by smtp.gmail.com with ESMTPSA id h185-20020a6253c2000000b0052cdb06c125sm1013549pfb.159.2022.08.04.07.27.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:28:00 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: rfried.dev@gmail.com, jorge.ramirez.ortiz@gmail.com, sjg@chromium.org, trini@konsulko.com, stephan@gerhold.net, mario.six@gdsys.cc, dsankouski@gmail.com, robert.marko@sartura.hr, luka.kovacic@sartura.hr, luka.perkov@sartura.hr, jh80.chung@samsung.com, nicolas.dechesne@linaro.org, vinod.koul@linaro.org, mworsfold@impinj.com, lgillham@impinj.com, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH 02/13] phy: Add support for drivers to enable USB on QCS404 SoC Date: Thu, 4 Aug 2022 19:57:10 +0530 Message-Id: <20220804142721.536556-3-sumit.garg@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804142721.536556-1-sumit.garg@linaro.org> References: <20220804142721.536556-1-sumit.garg@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.6 at phobos.denx.de X-Virus-Status: Clean QCS404 SoC supports two types of PHY, one supports high speed mode or USB2 PHY and the other supports super speed mode or USB3 PHY. So add corresponding PHY drivers. Signed-off-by: Sumit Garg --- drivers/phy/qcom/Kconfig | 16 ++ drivers/phy/qcom/Makefile | 2 + drivers/phy/qcom/phy-qcom-usb-hs-28nm.c | 250 ++++++++++++++++++++++++ drivers/phy/qcom/phy-qcom-usb-ss.c | 154 +++++++++++++++ 4 files changed, 422 insertions(+) create mode 100644 drivers/phy/qcom/phy-qcom-usb-hs-28nm.c create mode 100644 drivers/phy/qcom/phy-qcom-usb-ss.c diff --git a/drivers/phy/qcom/Kconfig b/drivers/phy/qcom/Kconfig index f685a6455e..f4ca174805 100644 --- a/drivers/phy/qcom/Kconfig +++ b/drivers/phy/qcom/Kconfig @@ -11,3 +11,19 @@ config PHY_QCOM_IPQ4019_USB depends on PHY && ARCH_IPQ40XX help Support for the USB PHY-s on Qualcomm IPQ40xx SoC-s. + +config PHY_QCOM_USB_HS_28NM + tristate "Qualcomm 28nm High-Speed PHY" + depends on PHY && ARCH_SNAPDRAGON + help + Enable this to support the Qualcomm Synopsys DesignWare Core 28nm + High-Speed PHY driver. This driver supports the Hi-Speed PHY which + is usually paired with either the ChipIdea or Synopsys DWC3 USB + IPs on MSM SOCs. + +config PHY_QCOM_USB_SS + tristate "Qualcomm USB Super-Speed PHY driver" + depends on PHY && ARCH_SNAPDRAGON + help + Enable this to support the Super-Speed USB transceiver on various + Qualcomm chipsets. diff --git a/drivers/phy/qcom/Makefile b/drivers/phy/qcom/Makefile index 4a340e33c8..2113f178c0 100644 --- a/drivers/phy/qcom/Makefile +++ b/drivers/phy/qcom/Makefile @@ -1,2 +1,4 @@ obj-$(CONFIG_PHY_QCOM_IPQ4019_USB) += phy-qcom-ipq4019-usb.o obj-$(CONFIG_MSM8916_USB_PHY) += msm8916-usbh-phy.o +obj-$(CONFIG_PHY_QCOM_USB_HS_28NM) += phy-qcom-usb-hs-28nm.o +obj-$(CONFIG_PHY_QCOM_USB_SS) += phy-qcom-usb-ss.o diff --git a/drivers/phy/qcom/phy-qcom-usb-hs-28nm.c b/drivers/phy/qcom/phy-qcom-usb-hs-28nm.c new file mode 100644 index 0000000000..14c3d8394d --- /dev/null +++ b/drivers/phy/qcom/phy-qcom-usb-hs-28nm.c @@ -0,0 +1,250 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2022 Sumit Garg + * + * Based on Linux driver + */ + +#include +#include +#include +#include +#include +#include +#include + +/* PHY register and bit definitions */ +#define PHY_CTRL_COMMON0 0x078 +#define SIDDQ BIT(2) + +struct hsphy_init_seq { + int offset; + int val; + int delay; +}; + +struct hsphy_data { + const struct hsphy_init_seq *init_seq; + unsigned int init_seq_num; +}; + +struct hsphy_priv { + void __iomem *base; + struct clk_bulk clks; + struct reset_ctl phy_rst; + struct reset_ctl por_rst; + const struct hsphy_data *data; +}; + +static int hsphy_power_on(struct phy *phy) +{ + struct hsphy_priv *priv = dev_get_priv(phy->dev); + u32 val; + + val = readb(priv->base + PHY_CTRL_COMMON0); + val &= ~SIDDQ; + writeb(val, priv->base + PHY_CTRL_COMMON0); + + return 0; +} + +static int hsphy_power_off(struct phy *phy) +{ + struct hsphy_priv *priv = dev_get_priv(phy->dev); + u32 val; + + val = readb(priv->base + PHY_CTRL_COMMON0); + val |= SIDDQ; + writeb(val, priv->base + PHY_CTRL_COMMON0); + + return 0; +} + +static int hsphy_reset(struct hsphy_priv *priv) +{ + int ret; + + ret = reset_assert(&priv->phy_rst); + if (ret) + return ret; + + udelay(10); + + ret = reset_deassert(&priv->phy_rst); + if (ret) + return ret; + + udelay(80); + + return 0; +} + +static void hsphy_init_sequence(struct hsphy_priv *priv) +{ + const struct hsphy_data *data = priv->data; + const struct hsphy_init_seq *seq; + int i; + + /* Device match data is optional. */ + if (!data) + return; + + seq = data->init_seq; + + for (i = 0; i < data->init_seq_num; i++, seq++) { + writeb(seq->val, priv->base + seq->offset); + if (seq->delay) + udelay(seq->delay); + } +} + +static int hsphy_por_reset(struct hsphy_priv *priv) +{ + int ret; + u32 val; + + ret = reset_assert(&priv->por_rst); + if (ret) + return ret; + + /* + * The Femto PHY is POR reset in the following scenarios. + * + * 1. After overriding the parameter registers. + * 2. Low power mode exit from PHY retention. + * + * Ensure that SIDDQ is cleared before bringing the PHY + * out of reset. + */ + val = readb(priv->base + PHY_CTRL_COMMON0); + val &= ~SIDDQ; + writeb(val, priv->base + PHY_CTRL_COMMON0); + + /* + * As per databook, 10 usec delay is required between + * PHY POR assert and de-assert. + */ + udelay(10); + ret = reset_deassert(&priv->por_rst); + if (ret) + return ret; + + /* + * As per databook, it takes 75 usec for PHY to stabilize + * after the reset. + */ + udelay(80); + + return 0; +} + +static int hsphy_clk_init(struct udevice *dev, struct hsphy_priv *priv) +{ + int ret; + + ret = clk_get_bulk(dev, &priv->clks); + if (ret == -ENOSYS || ret == -ENOENT) + return 0; + if (ret) + return ret; + + ret = clk_enable_bulk(&priv->clks); + if (ret) { + clk_release_bulk(&priv->clks); + return ret; + } + + return 0; +} + +static int hsphy_init(struct phy *phy) +{ + struct hsphy_priv *priv = dev_get_priv(phy->dev); + int ret; + + ret = hsphy_clk_init(phy->dev, priv); + if (ret) + return ret; + + ret = hsphy_reset(priv); + if (ret) + return ret; + + hsphy_init_sequence(priv); + + hsphy_por_reset(priv); + if (ret) + return ret; + + return 0; +} + +static int hsphy_probe(struct udevice *dev) +{ + struct hsphy_priv *priv = dev_get_priv(dev); + int ret; + + priv->base = (void *)dev_read_addr(dev); + if ((ulong)priv->base == FDT_ADDR_T_NONE) + return -EINVAL; + + ret = reset_get_by_name(dev, "phy", &priv->phy_rst); + if (ret) + return ret; + + ret = reset_get_by_name(dev, "por", &priv->por_rst); + if (ret) + return ret; + + priv->data = (const struct hsphy_data *)dev_get_driver_data(dev); + + return 0; +} + +static struct phy_ops hsphy_ops = { + .power_on = hsphy_power_on, + .power_off = hsphy_power_off, + .init = hsphy_init, +}; + +/* + * The macro is used to define an initialization sequence. Each tuple + * is meant to program 'value' into phy register at 'offset' with 'delay' + * in us followed. + */ +#define HSPHY_INIT_CFG(o, v, d) { .offset = o, .val = v, .delay = d, } + +static const struct hsphy_init_seq init_seq_femtophy[] = { + HSPHY_INIT_CFG(0xc0, 0x01, 0), + HSPHY_INIT_CFG(0xe8, 0x0d, 0), + HSPHY_INIT_CFG(0x74, 0x12, 0), + HSPHY_INIT_CFG(0x98, 0x63, 0), + HSPHY_INIT_CFG(0x9c, 0x03, 0), + HSPHY_INIT_CFG(0xa0, 0x1d, 0), + HSPHY_INIT_CFG(0xa4, 0x03, 0), + HSPHY_INIT_CFG(0x8c, 0x23, 0), + HSPHY_INIT_CFG(0x78, 0x08, 0), + HSPHY_INIT_CFG(0x7c, 0xdc, 0), + HSPHY_INIT_CFG(0x90, 0xe0, 20), + HSPHY_INIT_CFG(0x74, 0x10, 0), + HSPHY_INIT_CFG(0x90, 0x60, 0), +}; + +static const struct hsphy_data data_femtophy = { + .init_seq = init_seq_femtophy, + .init_seq_num = ARRAY_SIZE(init_seq_femtophy), +}; + +static const struct udevice_id hsphy_ids[] = { + { .compatible = "qcom,usb-hs-28nm-femtophy", .data = (ulong)&data_femtophy }, + { } +}; + +U_BOOT_DRIVER(qcom_usb_hs_28nm) = { + .name = "qcom-usb-hs-28nm", + .id = UCLASS_PHY, + .of_match = hsphy_ids, + .ops = &hsphy_ops, + .probe = hsphy_probe, + .priv_auto = sizeof(struct hsphy_priv), +}; diff --git a/drivers/phy/qcom/phy-qcom-usb-ss.c b/drivers/phy/qcom/phy-qcom-usb-ss.c new file mode 100644 index 0000000000..4e816879c6 --- /dev/null +++ b/drivers/phy/qcom/phy-qcom-usb-ss.c @@ -0,0 +1,154 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2022 Sumit Garg + * + * Based on Linux driver + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define PHY_CTRL0 0x6C +#define PHY_CTRL1 0x70 +#define PHY_CTRL2 0x74 +#define PHY_CTRL4 0x7C + +/* PHY_CTRL bits */ +#define REF_PHY_EN BIT(0) +#define LANE0_PWR_ON BIT(2) +#define SWI_PCS_CLK_SEL BIT(4) +#define TST_PWR_DOWN BIT(4) +#define PHY_RESET BIT(7) + +struct ssphy_priv { + void __iomem *base; + struct clk_bulk clks; + struct reset_ctl com_rst; + struct reset_ctl phy_rst; +}; + +static inline void ssphy_updatel(void __iomem *addr, u32 mask, u32 val) +{ + writel((readl(addr) & ~mask) | val, addr); +} + +static int ssphy_do_reset(struct ssphy_priv *priv) +{ + int ret; + + ret = reset_assert(&priv->com_rst); + if (ret) + return ret; + + ret = reset_assert(&priv->phy_rst); + if (ret) + return ret; + + udelay(10); + + ret = reset_deassert(&priv->com_rst); + if (ret) + return ret; + + ret = reset_deassert(&priv->phy_rst); + if (ret) + return ret; + + return 0; +} + +static int ssphy_power_on(struct phy *phy) +{ + struct ssphy_priv *priv = dev_get_priv(phy->dev); + int ret; + + ret = ssphy_do_reset(priv); + if (ret) + return ret; + + writeb(SWI_PCS_CLK_SEL, priv->base + PHY_CTRL0); + ssphy_updatel(priv->base + PHY_CTRL4, LANE0_PWR_ON, LANE0_PWR_ON); + ssphy_updatel(priv->base + PHY_CTRL2, REF_PHY_EN, REF_PHY_EN); + ssphy_updatel(priv->base + PHY_CTRL4, TST_PWR_DOWN, 0); + + return 0; +} + +static int ssphy_power_off(struct phy *phy) +{ + struct ssphy_priv *priv = dev_get_priv(phy->dev); + + ssphy_updatel(priv->base + PHY_CTRL4, LANE0_PWR_ON, 0); + ssphy_updatel(priv->base + PHY_CTRL2, REF_PHY_EN, 0); + ssphy_updatel(priv->base + PHY_CTRL4, TST_PWR_DOWN, TST_PWR_DOWN); + + return 0; +} + +static int ssphy_clk_init(struct udevice *dev, struct ssphy_priv *priv) +{ + int ret; + + ret = clk_get_bulk(dev, &priv->clks); + if (ret == -ENOSYS || ret == -ENOENT) + return 0; + if (ret) + return ret; + + ret = clk_enable_bulk(&priv->clks); + if (ret) { + clk_release_bulk(&priv->clks); + return ret; + } + + return 0; +} + +static int ssphy_probe(struct udevice *dev) +{ + struct ssphy_priv *priv = dev_get_priv(dev); + int ret; + + priv->base = (void *)dev_read_addr(dev); + if ((ulong)priv->base == FDT_ADDR_T_NONE) + return -EINVAL; + + ret = ssphy_clk_init(dev, priv); + if (ret) + return ret; + + ret = reset_get_by_name(dev, "com", &priv->com_rst); + if (ret) + return ret; + + ret = reset_get_by_name(dev, "phy", &priv->phy_rst); + if (ret) + return ret; + + return 0; +} + +static struct phy_ops ssphy_ops = { + .power_on = ssphy_power_on, + .power_off = ssphy_power_off, +}; + +static const struct udevice_id ssphy_ids[] = { + { .compatible = "qcom,usb-ss-28nm-phy" }, + { } +}; + +U_BOOT_DRIVER(qcom_usb_ss) = { + .name = "qcom-usb-ss", + .id = UCLASS_PHY, + .of_match = ssphy_ids, + .ops = &ssphy_ops, + .probe = ssphy_probe, + .priv_auto = sizeof(struct ssphy_priv), +}; From patchwork Thu Aug 4 14:27:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 595324 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp483217maz; Thu, 4 Aug 2022 07:28:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR7mZKUPQWaLx+M+dzFpnxUJhxlCD+XL0AG+kCmWVFLsyop/W9tp2RyqG7xlFv6qAV6PWMRT X-Received: by 2002:a6b:6707:0:b0:67b:d457:39cf with SMTP id b7-20020a6b6707000000b0067bd45739cfmr899819ioc.179.1659623320107; Thu, 04 Aug 2022 07:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659623320; cv=none; d=google.com; s=arc-20160816; b=q0tKqSaSgiBVGBHyqB0QwUsq359Ta4FiA5l8YKu1FOCwcMe7x8QV7hZWTVPx0rdKwA oKM/KwvfbeaZTc4OuXI6xLG4rJJd3tyCQhIcCkjnKHvp0lhRcTx0Y0aFbWTPE0wMueGG 4YbXM8ysJQSNwgSgesqZMpzs6g2W0/p4nvti7mzeCIqBaXM7KdKrVifmtAnzkjOcGEit Q902RvEL3ylHsk8PpK3Dajz8ub5SsZahFPaOIppNIZFvetr1DZEHStIF0SZ2YlxHRpvY 9nfvbXija4IOie9OPcMq1HGUKxPFLb/B/aGiL4ATvgMvOT8+P/GE0YQEVzgPz6rwsAJM sokA== 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=XYW+mee8J4gKG0B4BKN9YdV6f8WW+oho2MMLftdhBAc=; b=HNmz8afQxqXOxuu0WPvMq5MDCgv6emP5X71MYDDGtbayMM+skf3eCX1ChPXjM606BW /EvR+9VAEVpkLzPd86xta+8v44R8oibsWvraTlwgvhDFKz/2OKpkr9WKQs/Nje+cRw1m IKAhcYkPeHbgPOwJhCY4cRDfAZ6FmFRjPdP2IDaTp0xZ7PlHndSQQv7lTDokz/eIBL+t oDNpQF8LeH3qeZzI1C8rNA1PeKlDKgb0YvKJTVz5M/vjNzj4xO8ZYnMagf8QgOz5kR+8 +ldUkCBcBIv943A8FGNuBYuXnGXdvUnsvC5QuZbJxT8FZGl14+pEFMdthM1uW954Qb95 nw8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pyQrMXrz; 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 b8-20020a029a08000000b00342a251f3b2si1223628jal.56.2022.08.04.07.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:28:40 -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=pyQrMXrz; 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 883D884832; Thu, 4 Aug 2022 16:28:14 +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="pyQrMXrz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 64A178482D; Thu, 4 Aug 2022 16:28:13 +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-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) (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 A1DDA84834 for ; Thu, 4 Aug 2022 16:28:09 +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=sumit.garg@linaro.org Received: by mail-pf1-x431.google.com with SMTP id h28so13155400pfq.11 for ; Thu, 04 Aug 2022 07:28:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XYW+mee8J4gKG0B4BKN9YdV6f8WW+oho2MMLftdhBAc=; b=pyQrMXrzvxqptKS+BGoyo4ANQRB1DpNLori1JXngMYUoZGAM+s9KK+LYp/mBaRi5GO MBKCVMEKG/hlph2hBJaqCT7jJXKlI7+UbYRzyxn9Dhg9RcY8RVzABHy2DdgU9Fh7JYs7 ipppLq5AuH/h1Ug8UG99k2DPaNUaOj3ynMRshOAuAoxy0iwpAFitw7LRNftdeg8oeLqJ Xr09hueitEfD91D4ex8Wv4h7OU7Jf3mtN3Pq+RNCyAB5xJee338fiOBEcoVL1xaq18vP UpfjOxC/LvaMqnCFc54P/PEpP0E6NTVzXcYrJuSN6RpaWztMVrWAukjSeYKsDa8A8McH dXPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XYW+mee8J4gKG0B4BKN9YdV6f8WW+oho2MMLftdhBAc=; b=VC5ga9ysHmXcmw4kBLZrglrUlVGmtPaH1oKtMpLjWZ70/xjyUZ2wqjVmG+HS232iqi YERFiyyglxwiIc9JgIERElsopBgvgDpqjswgdRkHGvAwDWY7fKwuw38ENPbFTPJS6NAQ 2CcqsxXMKuPuA0Nt9KS0fLT7Xa4nXA/f7MJVcwfFf4W4aHWXPIUAcpg5jsp0RQwc3zdg vMRtPi6IFhZeKCm52m/+wEwHTuoVtG2ZMk+ILkzGW6zNbVtgyYtmpFFQfeItmKhQ4xdq bV8TdNiUhZJvBD90D/eKRRxGo0eEzZ1vzSXeoR7PgA4TD26HB4hk4+FYsglniOWA+Sg8 MguA== X-Gm-Message-State: ACgBeo377i0PfkKgB/DXIUE0LFJPdKQuIbQapUITo88LfUUfNaBufLtp 4fg6IeW/moA6dFU4Imvx0GUofDuGs074pQ== X-Received: by 2002:a65:498b:0:b0:412:8e4:2842 with SMTP id r11-20020a65498b000000b0041208e42842mr1842580pgs.71.1659623287689; Thu, 04 Aug 2022 07:28:07 -0700 (PDT) Received: from localhost.localdomain ([122.162.196.218]) by smtp.gmail.com with ESMTPSA id h185-20020a6253c2000000b0052cdb06c125sm1013549pfb.159.2022.08.04.07.28.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:28:07 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: rfried.dev@gmail.com, jorge.ramirez.ortiz@gmail.com, sjg@chromium.org, trini@konsulko.com, stephan@gerhold.net, mario.six@gdsys.cc, dsankouski@gmail.com, robert.marko@sartura.hr, luka.kovacic@sartura.hr, luka.perkov@sartura.hr, jh80.chung@samsung.com, nicolas.dechesne@linaro.org, vinod.koul@linaro.org, mworsfold@impinj.com, lgillham@impinj.com, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH 03/13] reset: Convert ipq4019 driver to a generic Qcom driver Date: Thu, 4 Aug 2022 19:57:11 +0530 Message-Id: <20220804142721.536556-4-sumit.garg@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804142721.536556-1-sumit.garg@linaro.org> References: <20220804142721.536556-1-sumit.garg@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.6 at phobos.denx.de X-Virus-Status: Clean Since the base functionality remains the same for a reset driver on Qcom SoCs, so leverage that to convert ipq4019 specific reset driver to a generic Qcom reset driver. With that one just need to provide SoC specific reset table. Signed-off-by: Sumit Garg --- drivers/reset/Kconfig | 9 ++-- drivers/reset/Makefile | 2 +- .../reset/{reset-ipq4019.c => reset-qcom.c} | 46 ++++++++++--------- 3 files changed, 30 insertions(+), 27 deletions(-) rename drivers/reset/{reset-ipq4019.c => reset-qcom.c} (79%) diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index 69a7b4ccba..4cb0ba0850 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig @@ -156,13 +156,12 @@ config RESET_IMX7 help Support for reset controller on i.MX7/8 SoCs. -config RESET_IPQ419 - bool "Reset driver for Qualcomm IPQ40xx SoCs" - depends on DM_RESET && ARCH_IPQ40XX +config RESET_QCOM + bool "Reset driver for Qualcomm SoCs" + depends on DM_RESET && (ARCH_SNAPDRAGON || ARCH_IPQ40XX) default y help - Support for reset controller on Qualcomm - IPQ40xx SoCs. + Support for reset controller on Qualcomm SoCs. config RESET_SIFIVE bool "Reset Driver for SiFive SoC's" diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile index 97e3a782c0..0620b62809 100644 --- a/drivers/reset/Makefile +++ b/drivers/reset/Makefile @@ -24,7 +24,7 @@ obj-$(CONFIG_RESET_MTMIPS) += reset-mtmips.o obj-$(CONFIG_RESET_SUNXI) += reset-sunxi.o obj-$(CONFIG_RESET_HISILICON) += reset-hisilicon.o obj-$(CONFIG_RESET_IMX7) += reset-imx7.o -obj-$(CONFIG_RESET_IPQ419) += reset-ipq4019.o +obj-$(CONFIG_RESET_QCOM) += reset-qcom.o obj-$(CONFIG_RESET_SIFIVE) += reset-sifive.o obj-$(CONFIG_RESET_SYSCON) += reset-syscon.o obj-$(CONFIG_RESET_RASPBERRYPI) += reset-raspberrypi.o diff --git a/drivers/reset/reset-ipq4019.c b/drivers/reset/reset-qcom.c similarity index 79% rename from drivers/reset/reset-ipq4019.c rename to drivers/reset/reset-qcom.c index 7f0bd85ad6..40f436ede4 100644 --- a/drivers/reset/reset-ipq4019.c +++ b/drivers/reset/reset-qcom.c @@ -1,8 +1,10 @@ // SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2020 Sartura Ltd. + * Copyright (c) 2022 Linaro Ltd. * * Author: Robert Marko + * Sumit Garg * * Based on Linux driver */ @@ -10,12 +12,11 @@ #include #include #include -#include #include #include #include -struct ipq4019_reset_priv { +struct qcom_reset_priv { phys_addr_t base; }; @@ -24,7 +25,9 @@ struct qcom_reset_map { u8 bit; }; -static const struct qcom_reset_map gcc_ipq4019_resets[] = { +#ifdef CONFIG_ARCH_IPQ40XX +#include +static const struct qcom_reset_map gcc_qcom_resets[] = { [WIFI0_CPU_INIT_RESET] = { 0x1f008, 5 }, [WIFI0_RADIO_SRIF_RESET] = { 0x1f008, 4 }, [WIFI0_RADIO_WARM_RESET] = { 0x1f008, 3 }, @@ -97,11 +100,12 @@ static const struct qcom_reset_map gcc_ipq4019_resets[] = { [GCC_MPM_BCR] = {0x24000, 0}, [GCC_SPDM_BCR] = {0x25000, 0}, }; +#endif -static int ipq4019_reset_assert(struct reset_ctl *rst) +static int qcom_reset_assert(struct reset_ctl *rst) { - struct ipq4019_reset_priv *priv = dev_get_priv(rst->dev); - const struct qcom_reset_map *reset_map = gcc_ipq4019_resets; + struct qcom_reset_priv *priv = dev_get_priv(rst->dev); + const struct qcom_reset_map *reset_map = gcc_qcom_resets; const struct qcom_reset_map *map; u32 value; @@ -114,10 +118,10 @@ static int ipq4019_reset_assert(struct reset_ctl *rst) return 0; } -static int ipq4019_reset_deassert(struct reset_ctl *rst) +static int qcom_reset_deassert(struct reset_ctl *rst) { - struct ipq4019_reset_priv *priv = dev_get_priv(rst->dev); - const struct qcom_reset_map *reset_map = gcc_ipq4019_resets; + struct qcom_reset_priv *priv = dev_get_priv(rst->dev); + const struct qcom_reset_map *reset_map = gcc_qcom_resets; const struct qcom_reset_map *map; u32 value; @@ -130,19 +134,19 @@ static int ipq4019_reset_deassert(struct reset_ctl *rst) return 0; } -static const struct reset_ops ipq4019_reset_ops = { - .rst_assert = ipq4019_reset_assert, - .rst_deassert = ipq4019_reset_deassert, +static const struct reset_ops qcom_reset_ops = { + .rst_assert = qcom_reset_assert, + .rst_deassert = qcom_reset_deassert, }; -static const struct udevice_id ipq4019_reset_ids[] = { +static const struct udevice_id qcom_reset_ids[] = { { .compatible = "qcom,gcc-reset-ipq4019" }, { } }; -static int ipq4019_reset_probe(struct udevice *dev) +static int qcom_reset_probe(struct udevice *dev) { - struct ipq4019_reset_priv *priv = dev_get_priv(dev); + struct qcom_reset_priv *priv = dev_get_priv(dev); priv->base = dev_read_addr(dev); if (priv->base == FDT_ADDR_T_NONE) @@ -151,11 +155,11 @@ static int ipq4019_reset_probe(struct udevice *dev) return 0; } -U_BOOT_DRIVER(ipq4019_reset) = { - .name = "ipq4019_reset", +U_BOOT_DRIVER(qcom_reset) = { + .name = "qcom_reset", .id = UCLASS_RESET, - .of_match = ipq4019_reset_ids, - .ops = &ipq4019_reset_ops, - .probe = ipq4019_reset_probe, - .priv_auto = sizeof(struct ipq4019_reset_priv), + .of_match = qcom_reset_ids, + .ops = &qcom_reset_ops, + .probe = qcom_reset_probe, + .priv_auto = sizeof(struct qcom_reset_priv), }; From patchwork Thu Aug 4 14:27:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 595325 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp483362maz; Thu, 4 Aug 2022 07:28:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR4aGyiMKS4NQRylPcTytH6xKacpoKbLjP+cPJnkTfqKdxQpcLZrJvVd+EZ3xT5C5AqXvzkZ X-Received: by 2002:a05:6638:dcb:b0:33f:8242:4131 with SMTP id m11-20020a0566380dcb00b0033f82424131mr911794jaj.80.1659623330915; Thu, 04 Aug 2022 07:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659623330; cv=none; d=google.com; s=arc-20160816; b=fknyh9eDydD1rwIgA265SEWuQuTwdPr/wOFRaqQWO4KJkOx0tDCxjz6gDsK19aSCqz grG1RA/FZTmq0in35uwUz6fKFdNVP5yCqNJlEDA7T1yhGt9GvvV9AkzPRdgFX/61oo/f XLxrqZSRFWRYmw/4uBt669qjBBFSPsAzPF9+Zv7vvJfiqx/puHHMeB5iqabvDejljZXo MdQ341tFqBICdZpD2xLSls+xgZX/+rkOspW1EqDTGUEtjwtO+oVwxOyN2LuNNLdx9RsE S2gM8mYBIwDgkD+P7Yo5vKkANHXNU7UDICuK0lvsJLeUDEMi29/Jr/dMLJZY22UxHsfk h4Uw== 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=S+5T3iBBusOu9QspCzeD/s7a5Z45FJtPQGvvUCxoivw=; b=hEAvbhr1q7M9n51OgSZBklP7q2PBE8QSgsQ8l/os/hPk7FXmqek+FaH9djWm7m9Q94 ios5+TEFAlErthOJ4yRhYOuxzFwq5Hk2qi1Gt/Sx0ksDYN4k7gOvit7Cn5ILQS22aaXt hkcYZcHG2VBybNyE3VsPaszIGAQ0G4rRJHC1jz49LnA2c0Qt9+lOPdZeAhWDNIUrmxEr XkqpRmkxH1xKEi+vaDKAvUNQRw+Uh4YsqLvZDqFy6ZnyKZ2aBl66aCkBTvLZLfUWmNgZ 3Hbozrb5EjlBy+ULUZ7VQcW+lS4aBtO20ilAbBXR1OCcjtq6+kVjgY5jMpearAlpgitZ JeJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WyrMcgxH; 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 x15-20020a056e021caf00b002dc3137eee9si1236035ill.153.2022.08.04.07.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:28:50 -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=WyrMcgxH; 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 3765E8483C; Thu, 4 Aug 2022 16:28:21 +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="WyrMcgxH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 34AEA8483C; Thu, 4 Aug 2022 16:28:19 +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-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) (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 BD12484837 for ; Thu, 4 Aug 2022 16:28:16 +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=sumit.garg@linaro.org Received: by mail-pj1-x102e.google.com with SMTP id h21-20020a17090aa89500b001f31a61b91dso5447862pjq.4 for ; Thu, 04 Aug 2022 07:28:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=S+5T3iBBusOu9QspCzeD/s7a5Z45FJtPQGvvUCxoivw=; b=WyrMcgxH8DdDmRnBG5IgbRpIFju7CQo9qXhYXD7+3adAujdcaOH6miTgcXnQufjFik fOcXlt9SKB0i7uA6T9mrBf0oK8Ks7NPr3KS6DQPidpRfHwyI8VOkkKA7W+/BDwiPHIQz 4W+32oSRSziLrTZUTvw/883+rsxUY8GrThqOfFFNKlJX1ko52Po01YVeat9PrK4e4Toi Fl0r8ueLs/Z7zQOnHSXcSTFZLm4/Xw8Y6lKE0wpDm0jPO1g0FQvYkLDCc+baBjt1Yevd H3arCAfYAyeXVqPkl5pHLwfUEKCMN1X3rBA8RPxyVlYgrRyaoLjwUUO5Sz/avU13cLRT 2vNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=S+5T3iBBusOu9QspCzeD/s7a5Z45FJtPQGvvUCxoivw=; b=PetPH7Yt62A156nbf4hnydT18M0rXflh4IoVmLyTwqisn6IbSeQ34CE3yOo7gUp+fA CzWWI3vz4cHl905qV1L1zn2SyxMoIECZ9pPJ6YVUo631xgNACrBLftGMUlMi5aM8BgDO oDjnu1vdJEdyAqJvwNjrFSik751h/U47qnuswpe2X/rCPZKcGT3auPTGeBIUBkjVX9yH Xkrdy+VyDVUAAoiUk9LPma9pB7g5KnZ7rwQBDhYHFOALYL/bN7SRslKqP3S3O3GZWFVt J683p0PaSdPn3TKN2Y11GjKcglamg41792ENhP8odOT1VbxmVq+bmqgqYEIN1U7WRW9M l5Ug== X-Gm-Message-State: ACgBeo1kPOBC2d49VD6783G25TIxjPIfqh8JFIOYmdhuYp9ROfi4gUk2 BJal5OlqqYOwguZgVbHi7KtbgaHrdL7Nrw== X-Received: by 2002:a17:903:244c:b0:16e:fa53:a54c with SMTP id l12-20020a170903244c00b0016efa53a54cmr2094303pls.46.1659623294886; Thu, 04 Aug 2022 07:28:14 -0700 (PDT) Received: from localhost.localdomain ([122.162.196.218]) by smtp.gmail.com with ESMTPSA id h185-20020a6253c2000000b0052cdb06c125sm1013549pfb.159.2022.08.04.07.28.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:28:14 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: rfried.dev@gmail.com, jorge.ramirez.ortiz@gmail.com, sjg@chromium.org, trini@konsulko.com, stephan@gerhold.net, mario.six@gdsys.cc, dsankouski@gmail.com, robert.marko@sartura.hr, luka.kovacic@sartura.hr, luka.perkov@sartura.hr, jh80.chung@samsung.com, nicolas.dechesne@linaro.org, vinod.koul@linaro.org, mworsfold@impinj.com, lgillham@impinj.com, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH 04/13] reset: qcom: Add support for QCS404 SoC reset table Date: Thu, 4 Aug 2022 19:57:12 +0530 Message-Id: <20220804142721.536556-5-sumit.garg@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804142721.536556-1-sumit.garg@linaro.org> References: <20220804142721.536556-1-sumit.garg@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.6 at phobos.denx.de X-Virus-Status: Clean Signed-off-by: Sumit Garg --- drivers/reset/reset-qcom.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/reset/reset-qcom.c b/drivers/reset/reset-qcom.c index 40f436ede4..94315e76d5 100644 --- a/drivers/reset/reset-qcom.c +++ b/drivers/reset/reset-qcom.c @@ -102,6 +102,35 @@ static const struct qcom_reset_map gcc_qcom_resets[] = { }; #endif +#ifdef CONFIG_TARGET_QCS404EVB +#include +static const struct qcom_reset_map gcc_qcom_resets[] = { + [GCC_GENI_IR_BCR] = { 0x0F000 }, + [GCC_CDSP_RESTART] = { 0x18000 }, + [GCC_USB_HS_BCR] = { 0x41000 }, + [GCC_USB2_HS_PHY_ONLY_BCR] = { 0x41034 }, + [GCC_QUSB2_PHY_BCR] = { 0x4103c }, + [GCC_USB_HS_PHY_CFG_AHB_BCR] = { 0x0000c, 1 }, + [GCC_USB2A_PHY_BCR] = { 0x0000c, 0 }, + [GCC_USB3_PHY_BCR] = { 0x39004 }, + [GCC_USB_30_BCR] = { 0x39000 }, + [GCC_USB3PHY_PHY_BCR] = { 0x39008 }, + [GCC_PCIE_0_BCR] = { 0x3e000 }, + [GCC_PCIE_0_PHY_BCR] = { 0x3e004 }, + [GCC_PCIE_0_LINK_DOWN_BCR] = { 0x3e038 }, + [GCC_PCIEPHY_0_PHY_BCR] = { 0x3e03c }, + [GCC_PCIE_0_AXI_MASTER_STICKY_ARES] = { 0x3e040, 6}, + [GCC_PCIE_0_AHB_ARES] = { 0x3e040, 5 }, + [GCC_PCIE_0_AXI_SLAVE_ARES] = { 0x3e040, 4 }, + [GCC_PCIE_0_AXI_MASTER_ARES] = { 0x3e040, 3 }, + [GCC_PCIE_0_CORE_STICKY_ARES] = { 0x3e040, 2 }, + [GCC_PCIE_0_SLEEP_ARES] = { 0x3e040, 1 }, + [GCC_PCIE_0_PIPE_ARES] = { 0x3e040, 0 }, + [GCC_EMAC_BCR] = { 0x4e000 }, + [GCC_WDSP_RESTART] = {0x19000}, +}; +#endif + static int qcom_reset_assert(struct reset_ctl *rst) { struct qcom_reset_priv *priv = dev_get_priv(rst->dev); @@ -141,6 +170,7 @@ static const struct reset_ops qcom_reset_ops = { static const struct udevice_id qcom_reset_ids[] = { { .compatible = "qcom,gcc-reset-ipq4019" }, + { .compatible = "qcom,gcc-reset-qcs404" }, { } }; From patchwork Thu Aug 4 14:27:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 595326 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp483501maz; Thu, 4 Aug 2022 07:29:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR40ydP5SpFV9g0MqsXqPE+5jevm+0uJjbz9gpNpJul+CecFLc0ceaY4/7GKISwtZdRfG5OL X-Received: by 2002:a92:ce81:0:b0:2dc:fbec:d023 with SMTP id r1-20020a92ce81000000b002dcfbecd023mr936083ilo.155.1659623342349; Thu, 04 Aug 2022 07:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659623342; cv=none; d=google.com; s=arc-20160816; b=REkePcFTTkM2XG8eqLB5H+DPWJMBuSlTorAgVMUxkhzue/Nq6UWz4LsMczgIx4YyTK DMjcsSiz8Ennsw/AKK7OnVqgPrn1Ke9aM3w6h9saXkxgF+7q/WcpqVmGZxi40B6amPZW RFywWXExSg8sn6ZGN4NW8JGA9zv3flLhGROM/HARjbUCIQtYWLo4/grS1ApgJDEBj7MK DDwVIK89dfFhabx2DUtu67IG/80Mc9Bsj3jXyA/EsVdt0D97HbEbDmzWOeMGKsFl5C1y OuIvCcaeLqcmpnQDxEnzJWdRdX463ZtdKpDPj9ODMiDU19FtuSU8frATNMXjF6aAeLh/ aRXA== 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=n8ZV7deAMWxPRp/abPiV62nVG30UOpD+HnhIhBtuOL0=; b=Tj8Bpy8sKNNgxK+TuHeax/PrEI70DD0doTpatZDVLJ0y/Fqlfsd73NvSce6PCLi3F5 Mi9z0rThsgnqylEfxXXtpbhVEhldKqgw9ZqFpf8BkZVLYgEKUlTKvjTO/45wF10mdrU3 r4w0cEb0U+nDiFbvWLGx1jewLGTapHxBXaA/QDFKcSGLCBARUsOLBYZzNLb+n/kIDSFP MXO/c9u5N30DR25nrkjNaTOuqfxKd5Jn7ypvlfdfQOGBVSgoh2IhS30IzeywofCbXSFc R5ZxUOs8iRImV5GBy5Lx7EmRPMxjB6Wz3cfPTthl1mKZMQHUOPFcAXjOGMzeY4p8cWDC mZlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kZ5+ano5; 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 r21-20020a056638131500b003427273245fsi1905961jad.45.2022.08.04.07.29.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:29:02 -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=kZ5+ano5; 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 5D21684840; Thu, 4 Aug 2022 16:28:28 +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="kZ5+ano5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CF2D284842; Thu, 4 Aug 2022 16:28:26 +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-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) (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 C1CB68484C for ; Thu, 4 Aug 2022 16:28:23 +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=sumit.garg@linaro.org Received: by mail-pj1-x1030.google.com with SMTP id gj1so4757395pjb.0 for ; Thu, 04 Aug 2022 07:28:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=n8ZV7deAMWxPRp/abPiV62nVG30UOpD+HnhIhBtuOL0=; b=kZ5+ano5IR6mxzjObyScmfKrBl4u/jYZFuguibcfFLkGmIuzRLADJbwYt4KYZW127T vEE6GU/RHZ2qlypXSmjcpApm2usDMf5sU3zThlpSSgYleuoWKb7CRERQwKNI/E776/cv I9KglvNyBpn4q0yp6sfIwK0JKUha5zitzBlrqF7q1vLaLgpV4x3dUBkyeBLzb6ZPu/W+ bUqPKqX6AFTF+6nKc0rmuk0zmcXSKs1sh4L9eP7grx3FkuxhCxAic26PkCw4uwlCRbxk IQtgdg0ySGPZWlk0gcNTOk2w8ohiFNBC19MGDqFGPjP4+5ekZdgNuLOYyV//Ujys+HHC dbUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=n8ZV7deAMWxPRp/abPiV62nVG30UOpD+HnhIhBtuOL0=; b=QoD0PlNvo3WykDCStl8liNVCTHpwEhG9xnr18N46azAWFs69g3A53t5yGoIJ7p2AS4 jkm39a3Hd6D9fCFY7DqOFp2aufizwMElL9h8WaBsbmabFO3+ZUM6b69pBbkhXq7YgjHD 73WCQf4NNzKiHIOeU0sflqLOGdducJHfTlRg7SqGAb1eqUN+3oCacU6hfjWGcHZ1iktL 8YTReV8VumFWx+/HgqGhmFrXwRiYswSF4f7ksDUc4muiYrvUqa3g7pK6N6wzR5canwOH Xa8iRlEl9ECO7rlD/1y89kGUEq9LC/2n7KKdP+2V93vz4rdRnLLC6JdroX5ANtZX2QUT ORdA== X-Gm-Message-State: ACgBeo32YAdxReXCIsKY3N3NBD16gCXsY2mzGWgFDkq8vSFgNQ4O6OkE 27DSnV81gwDXQuwcx6BzXn5SZta4ZevMgQ== X-Received: by 2002:a17:90b:164e:b0:1f5:3408:2125 with SMTP id il14-20020a17090b164e00b001f534082125mr10915258pjb.157.1659623301907; Thu, 04 Aug 2022 07:28:21 -0700 (PDT) Received: from localhost.localdomain ([122.162.196.218]) by smtp.gmail.com with ESMTPSA id h185-20020a6253c2000000b0052cdb06c125sm1013549pfb.159.2022.08.04.07.28.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:28:21 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: rfried.dev@gmail.com, jorge.ramirez.ortiz@gmail.com, sjg@chromium.org, trini@konsulko.com, stephan@gerhold.net, mario.six@gdsys.cc, dsankouski@gmail.com, robert.marko@sartura.hr, luka.kovacic@sartura.hr, luka.perkov@sartura.hr, jh80.chung@samsung.com, nicolas.dechesne@linaro.org, vinod.koul@linaro.org, mworsfold@impinj.com, lgillham@impinj.com, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH 05/13] dts: qcs404-evb: Add reset controller node Date: Thu, 4 Aug 2022 19:57:13 +0530 Message-Id: <20220804142721.536556-6-sumit.garg@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804142721.536556-1-sumit.garg@linaro.org> References: <20220804142721.536556-1-sumit.garg@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.6 at phobos.denx.de X-Virus-Status: Clean Signed-off-by: Sumit Garg --- arch/arm/dts/qcs404-evb.dts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/dts/qcs404-evb.dts b/arch/arm/dts/qcs404-evb.dts index 09687e1fd3..1b280efff6 100644 --- a/arch/arm/dts/qcs404-evb.dts +++ b/arch/arm/dts/qcs404-evb.dts @@ -54,6 +54,12 @@ #size-cells = <0x0>; }; + reset: gcc-reset@1800000 { + compatible = "qcom,gcc-reset-qcs404"; + reg = <0x1800000 0x80000>; + #reset-cells = <1>; + }; + debug_uart: serial@78b1000 { compatible = "qcom,msm-uartdm-v1.4"; reg = <0x78b1000 0x200>; From patchwork Thu Aug 4 14:27:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 595327 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp483672maz; Thu, 4 Aug 2022 07:29:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR7ug5EuIpuUeqykicqazq4nUdQfOYtCzButtBZ8sR/Pgn0jlf1K+Z6WERl773gA4Pdn4W3b X-Received: by 2002:a05:6e02:1847:b0:2dd:18c7:51c3 with SMTP id b7-20020a056e02184700b002dd18c751c3mr1015468ilv.29.1659623354723; Thu, 04 Aug 2022 07:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659623354; cv=none; d=google.com; s=arc-20160816; b=NE6ka9q7FKmRALWEyNYRtI1bFunr/g2SE/rt3h3n/bYE7kYLKICLp8qov2EyjhQEQ1 AqtcpIWZ5xQP5Kk2b/+8YXHWF6/bj2wQwcpjtxcN9k2xWhCaYBF54oO/dQm9wYgH+n3C vLCPcSfAnALVR5prF++eEftGM6X5JSI0SyUZ8CWALK6/e1gwWqXpkDon3PbJOSsitnUm v/Q2EkoCIQZONDMdvdzefyQhfc0m5sJSfCN9XOjxSNNXzdtoJYU8hoxcZGnAos8JF3vc UG18zrxm83Qf85Z4wUY0tlRCKkcSdP+Drkm+c/OV1AFuBHwOgxYW+DqPrC4ui5Y2rr6w 3Rzw== 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=c9clITLruDMjvhmflOHHviOI+jVnFMTLiumVq3/LvEE=; b=LEyZijHWcktVApx7icKf//X4uGqxai34WZOZd9dwktkA7E0VFmB7aP/qE44XQSUSot i/Bpzl+1W8LU+GyjN51GTRDI9aX6K/gX/8sSy5HjbNIUkM38z98GY+b76klQx+dAQHkW SulEj/FshZvI1R4i4EKmQW3ErESZSid65U/6BEWN2H5uzVohRJeJ8gO0QmY5EwOGFHsp E+l6SN+TsGtyP09eI58qrN+Y9irwPYTTiQnouA2mKFrJDaBu2mhcSWgP9aOcL09EP5vI IfaJs5cmGx71flGJc2MLXvHOnzvkV/Ikd093MxgsZXqp5Or0TpFi0X6twl0yfbYlkQ5A ddtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ip4D9IET; 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 x15-20020a056e021caf00b002dc3137eee9si1236703ill.153.2022.08.04.07.29.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:29:14 -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=Ip4D9IET; 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 5A83084856; Thu, 4 Aug 2022 16:28:35 +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="Ip4D9IET"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 84AE68484F; Thu, 4 Aug 2022 16:28:33 +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-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) (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 DDCB184825 for ; Thu, 4 Aug 2022 16:28:30 +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=sumit.garg@linaro.org Received: by mail-pj1-x102c.google.com with SMTP id q7-20020a17090a7a8700b001f300db8677so5802934pjf.5 for ; Thu, 04 Aug 2022 07:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=c9clITLruDMjvhmflOHHviOI+jVnFMTLiumVq3/LvEE=; b=Ip4D9IETsI+530uxK8lCaCdJJa1A/ikYlvx8vsGfLO0dNOydWMiodXpUXrrKqcH3qU 1mJr97Zb/z5JEb2oX6+kZsKYDwThcxlr/UDzydbq7u6MOOc4dQ+ezaE7UHvSZvQ1o15k RzRhlBA5VL07AOhjWiUMg1dBpjVDlsSX6CESsA0aHcSr2jsYhwUGNfjDTtmMbzt9WSbv YgBb3YgWg8NQI7pDMlTCuPJVG/0e6UJX6SdqTVQFhGcAScVRHeNniTn9gRsJ5rJvReDr vHimUHSWLsAOXelqGk9SQheLRa3wDgWFYknacMq7t1YokWxk3JNOtH9ILc5WCzjAQ35e Qflg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=c9clITLruDMjvhmflOHHviOI+jVnFMTLiumVq3/LvEE=; b=ugAEN+0No98aW+ulz19GdrjugnxNfnUAa1bLjInBNlc6UjPPE1F4xNa9o+ivpLObAU ZMGe7UbgBo7FiphpboA7tkFixJlJ/j8Jn2wc9jmppmqN1L7OiTWQA7vBRWAFgdYezrHi knEh6156d4qHH0Tjx4H0WJnAHye30TZ3UL4dNAo7CyVn4RE53odq7Y5oGP3IDBeEQBZ8 +HUJh82lGZ1aKQvxq+FrkKfqRWaTCaIogtnB649ye2foGGuPWUpvBNNJs/9Y4iLsMWee jwroIJrrxzm90mlbR5KuEjD8qDjdfEuCS1qvg82Lv4or6hFKCocd7//Pbw+U8B51BQpN dp4g== X-Gm-Message-State: ACgBeo0yaR5xfET5omdCixWXGXKNaaIIvoYE4NdeDtlNzqeqqWBgb1ro uJDy5izC2FWbmzohwreANjDzTZ7nSYBwWg== X-Received: by 2002:a17:902:e804:b0:16f:4a25:b5be with SMTP id u4-20020a170902e80400b0016f4a25b5bemr2215695plg.171.1659623309077; Thu, 04 Aug 2022 07:28:29 -0700 (PDT) Received: from localhost.localdomain ([122.162.196.218]) by smtp.gmail.com with ESMTPSA id h185-20020a6253c2000000b0052cdb06c125sm1013549pfb.159.2022.08.04.07.28.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:28:28 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: rfried.dev@gmail.com, jorge.ramirez.ortiz@gmail.com, sjg@chromium.org, trini@konsulko.com, stephan@gerhold.net, mario.six@gdsys.cc, dsankouski@gmail.com, robert.marko@sartura.hr, luka.kovacic@sartura.hr, luka.perkov@sartura.hr, jh80.chung@samsung.com, nicolas.dechesne@linaro.org, vinod.koul@linaro.org, mworsfold@impinj.com, lgillham@impinj.com, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH 06/13] clocks: qcom: Add clock enable callback support Date: Thu, 4 Aug 2022 19:57:14 +0530 Message-Id: <20220804142721.536556-7-sumit.garg@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804142721.536556-1-sumit.garg@linaro.org> References: <20220804142721.536556-1-sumit.garg@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.6 at phobos.denx.de X-Virus-Status: Clean Drivers like USB, ethernet etc. uses ".enable" hook to enable clocks. So add corresponding support for Qcom clock drivers. Signed-off-by: Sumit Garg --- arch/arm/mach-snapdragon/clock-apq8016.c | 5 +++++ arch/arm/mach-snapdragon/clock-apq8096.c | 5 +++++ arch/arm/mach-snapdragon/clock-qcs404.c | 5 +++++ arch/arm/mach-snapdragon/clock-sdm845.c | 5 +++++ arch/arm/mach-snapdragon/clock-snapdragon.c | 7 +++++++ 5 files changed, 27 insertions(+) diff --git a/arch/arm/mach-snapdragon/clock-apq8016.c b/arch/arm/mach-snapdragon/clock-apq8016.c index 6e4a0ccb90..23a37a1714 100644 --- a/arch/arm/mach-snapdragon/clock-apq8016.c +++ b/arch/arm/mach-snapdragon/clock-apq8016.c @@ -111,3 +111,8 @@ ulong msm_set_rate(struct clk *clk, ulong rate) return 0; } } + +int msm_enable(struct clk *clk) +{ + return 0; +} diff --git a/arch/arm/mach-snapdragon/clock-apq8096.c b/arch/arm/mach-snapdragon/clock-apq8096.c index e5011be8f2..66184596d5 100644 --- a/arch/arm/mach-snapdragon/clock-apq8096.c +++ b/arch/arm/mach-snapdragon/clock-apq8096.c @@ -93,3 +93,8 @@ ulong msm_set_rate(struct clk *clk, ulong rate) return 0; } } + +int msm_enable(struct clk *clk) +{ + return 0; +} diff --git a/arch/arm/mach-snapdragon/clock-qcs404.c b/arch/arm/mach-snapdragon/clock-qcs404.c index bb8a6fe067..230d7779a7 100644 --- a/arch/arm/mach-snapdragon/clock-qcs404.c +++ b/arch/arm/mach-snapdragon/clock-qcs404.c @@ -77,3 +77,8 @@ ulong msm_set_rate(struct clk *clk, ulong rate) return 0; } + +int msm_enable(struct clk *clk) +{ + return 0; +} diff --git a/arch/arm/mach-snapdragon/clock-sdm845.c b/arch/arm/mach-snapdragon/clock-sdm845.c index f69be80898..d6df0365af 100644 --- a/arch/arm/mach-snapdragon/clock-sdm845.c +++ b/arch/arm/mach-snapdragon/clock-sdm845.c @@ -91,3 +91,8 @@ ulong msm_set_rate(struct clk *clk, ulong rate) return 0; } } + +int msm_enable(struct clk *clk) +{ + return 0; +} diff --git a/arch/arm/mach-snapdragon/clock-snapdragon.c b/arch/arm/mach-snapdragon/clock-snapdragon.c index 5652d2fa36..fda7098274 100644 --- a/arch/arm/mach-snapdragon/clock-snapdragon.c +++ b/arch/arm/mach-snapdragon/clock-snapdragon.c @@ -20,6 +20,7 @@ #define CBCR_BRANCH_OFF_BIT BIT(31) extern ulong msm_set_rate(struct clk *clk, ulong rate); +extern int msm_enable(struct clk *clk); /* Enable clock controlled by CBC soft macro */ void clk_enable_cbc(phys_addr_t cbcr) @@ -126,8 +127,14 @@ static ulong msm_clk_set_rate(struct clk *clk, ulong rate) return msm_set_rate(clk, rate); } +static int msm_clk_enable(struct clk *clk) +{ + return msm_enable(clk); +} + static struct clk_ops msm_clk_ops = { .set_rate = msm_clk_set_rate, + .enable = msm_clk_enable, }; static const struct udevice_id msm_clk_ids[] = { From patchwork Thu Aug 4 14:27:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 595328 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp483846maz; Thu, 4 Aug 2022 07:29:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR7w1kOK58TsAb5PtMu1dAboMGRahQ/tyiWY3PSCFkuBWQEGLCmaKfmluZtF7xg95CmE/yd5 X-Received: by 2002:a6b:5f0d:0:b0:67b:da10:933e with SMTP id t13-20020a6b5f0d000000b0067bda10933emr863998iob.56.1659623366639; Thu, 04 Aug 2022 07:29:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659623366; cv=none; d=google.com; s=arc-20160816; b=atswJKlhriwH7PI1cGCBOWw3dhjBL5Fr6NhRf0WqHriIcOn9IqWvVWdOlzGyHOT2ot aiFiCSn8GC412empBsvYdbjhZlJYijpzMp6CEiQpVlQ2i4GjCdsFuHIyDOBQSBDGoI2z MLB+gdAqslP2sdSrUDa1eWl4c2ioHO6cwpcnYR4fnx5IQoGSfIUxPTQnEuCPuJtnvlSV ifkDiQLQ7TKK7NGF1z1NPvNTQyv0d80ooRY9uKrA7OK74I/GptZVKuW5yVAH2Ih3Efve vBR3RiuS1nF5qIhY5c0iwJyONvxH4xGbQ+41librAG1YT0k9GEDFWSAzYfN+T6fQ4wkt ymLw== 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=JtOgAwHpeQmlkG5zdYdP71cCGCACF9BBuMHLcoeHnr4=; b=Ql3Li80KhMX/2mB4IBqMFCQOp5PH156oM50ftpVvLazAeZCnXkjsO/OBHaELiaWflq 2E6KJYe7Yg244QNp5B25EZs1rnoWDrrcyqAc0vVPmvAk7mar435epa7npwyE1Opcqsvq 8GHRAoC04K/1PWQkNlCTcSYYbx+9h+odIwOqs/HlTK4VlTKj7X80LVgSsYH/V6CtxBw/ 2r1ROGxeK0LBUzJ7j9QVr6ogEuAqhMWn8086GOh9h7fomxbNV4xEYC4Ekc8o0cAXYn0d RNseW066JMKPCx5BBPx47uD1pV9akZtNdwoyaM3/0ya3eZrNjT8sjMjvjl3TG8oTrR8W 2NQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="C2/m6hAc"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id b5-20020a92c285000000b002cac7a4c1d3si1277770ilp.97.2022.08.04.07.29.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:29:26 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="C2/m6hAc"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 B9DF08484C; Thu, 4 Aug 2022 16:28: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=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="C2/m6hAc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DF2CA84849; Thu, 4 Aug 2022 16:28:40 +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-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (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 542D484849 for ; Thu, 4 Aug 2022 16:28:38 +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=sumit.garg@linaro.org Received: by mail-pl1-x62d.google.com with SMTP id p18so13149plr.8 for ; Thu, 04 Aug 2022 07:28:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JtOgAwHpeQmlkG5zdYdP71cCGCACF9BBuMHLcoeHnr4=; b=C2/m6hAca3alWRfFb2sOWjbQ9JRMyEJKN28BlF0MgzAHestOs/AAQx8/mZ/+dizEyg Z43SUdsxio+ONL4ZmCx6H5F8sAwj8/OLtR1xttC1YU85BeUa6oM0nm0bW6lq+6/Blnzz /ITB4xXB2VOUDxFObm+tbF6gq1/4WZi15HoWElWEEpRawkSj8Lvuyu3I1zx963XRtjFv tGMLMN7dQn/PWo7KO2C5tBXHvLTD5nqwf9fz432BS2j6870wIJlacUYG/xk4+ZQyAOZC oi7K9RAfUQXJof5jgdl7nTS0m5xvww88+3hAxf5ekOOJtjqyXwRPb8jnI939Bb9K4Ml8 sr+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JtOgAwHpeQmlkG5zdYdP71cCGCACF9BBuMHLcoeHnr4=; b=G1LlGScG9HZizmosPPTrJzaEnFsjtef3TZfCc85lVxyvYzUXX3zgtn9OoZF8SsMg10 76vtRnLbQuuobpuk8IbNX6XaCFK6N7Kvrqj0Kpdm3eijStjbMwdlVjow8YWMZZzLDgHX 2SOmSulmcFzTEbDMFLswFgjD3lTMYuC4cg6lN+JMxlUTBWd4PjBxJYLntUhdGOCHlyet mANos5L5cU9B3u5ma52xHcKL8bKJUD1EthpD2lhQcNkXZH9PSsmyipf/ZOzWC7nVgnU6 Mr2qsUHnL+JrkZgHAZuDCd2YXqRw1fhdkOL35DSxn5kr8ZCzlgJxXazLMoBwQTGvwixP nOKw== X-Gm-Message-State: ACgBeo0X7jSbiUN+UF4z7hmMv4/LAE038l03tVKhggLa7nT0Bsyef4Xr c790eNSflKcoG0HPrCz4XAqPRfVk211PNg== X-Received: by 2002:a17:90a:150:b0:1f3:1dc7:c9f0 with SMTP id z16-20020a17090a015000b001f31dc7c9f0mr2429441pje.237.1659623316363; Thu, 04 Aug 2022 07:28:36 -0700 (PDT) Received: from localhost.localdomain ([122.162.196.218]) by smtp.gmail.com with ESMTPSA id h185-20020a6253c2000000b0052cdb06c125sm1013549pfb.159.2022.08.04.07.28.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:28:35 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: rfried.dev@gmail.com, jorge.ramirez.ortiz@gmail.com, sjg@chromium.org, trini@konsulko.com, stephan@gerhold.net, mario.six@gdsys.cc, dsankouski@gmail.com, robert.marko@sartura.hr, luka.kovacic@sartura.hr, luka.perkov@sartura.hr, jh80.chung@samsung.com, nicolas.dechesne@linaro.org, vinod.koul@linaro.org, mworsfold@impinj.com, lgillham@impinj.com, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH 07/13] clocks: qcs404: Add support for USB clocks Date: Thu, 4 Aug 2022 19:57:15 +0530 Message-Id: <20220804142721.536556-8-sumit.garg@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804142721.536556-1-sumit.garg@linaro.org> References: <20220804142721.536556-1-sumit.garg@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.6 at phobos.denx.de X-Virus-Status: Clean Add support for USB controller and PHY clocks for QCS404 SoC. Signed-off-by: Sumit Garg --- arch/arm/mach-snapdragon/clock-qcs404.c | 35 +++++++++++++++++++ .../include/mach/sysmap-qcs404.h | 17 +++++++++ 2 files changed, 52 insertions(+) diff --git a/arch/arm/mach-snapdragon/clock-qcs404.c b/arch/arm/mach-snapdragon/clock-qcs404.c index 230d7779a7..6fe92afe8d 100644 --- a/arch/arm/mach-snapdragon/clock-qcs404.c +++ b/arch/arm/mach-snapdragon/clock-qcs404.c @@ -47,6 +47,14 @@ static struct pll_vote_clk gpll0_vote_clk = { .vote_bit = BIT(0), }; +static const struct bcr_regs usb30_master_regs = { + .cfg_rcgr = USB30_MASTER_CFG_RCGR, + .cmd_rcgr = USB30_MASTER_CMD_RCGR, + .M = USB30_MASTER_M, + .N = USB30_MASTER_N, + .D = USB30_MASTER_D, +}; + ulong msm_set_rate(struct clk *clk, ulong rate) { struct msm_clk_priv *priv = dev_get_priv(clk->dev); @@ -80,5 +88,32 @@ ulong msm_set_rate(struct clk *clk, ulong rate) int msm_enable(struct clk *clk) { + struct msm_clk_priv *priv = dev_get_priv(clk->dev); + + switch (clk->id) { + case GCC_USB30_MASTER_CLK: + clk_enable_cbc(priv->base + USB30_MASTER_CBCR); + clk_rcg_set_rate_mnd(priv->base, &usb30_master_regs, 4, 0, 0, + CFG_CLK_SRC_GPLL0); + break; + case GCC_SYS_NOC_USB3_CLK: + clk_enable_cbc(priv->base + SYS_NOC_USB3_CBCR); + break; + case GCC_USB30_SLEEP_CLK: + clk_enable_cbc(priv->base + USB30_SLEEP_CBCR); + break; + case GCC_USB30_MOCK_UTMI_CLK: + clk_enable_cbc(priv->base + USB30_MOCK_UTMI_CBCR); + break; + case GCC_USB_HS_PHY_CFG_AHB_CLK: + clk_enable_cbc(priv->base + USB_HS_PHY_CFG_AHB_CBCR); + break; + case GCC_USB2A_PHY_SLEEP_CLK: + clk_enable_cbc(priv->base + USB_HS_PHY_CFG_AHB_CBCR); + break; + default: + return 0; + } + return 0; } diff --git a/arch/arm/mach-snapdragon/include/mach/sysmap-qcs404.h b/arch/arm/mach-snapdragon/include/mach/sysmap-qcs404.h index 4dc96b9fbc..e448faad2d 100644 --- a/arch/arm/mach-snapdragon/include/mach/sysmap-qcs404.h +++ b/arch/arm/mach-snapdragon/include/mach/sysmap-qcs404.h @@ -37,4 +37,21 @@ #define SDCC_APPS_CBCR(n) (((n) * 0x1000) + 0x41018) #define SDCC_AHB_CBCR(n) (((n) * 0x1000) + 0x4101C) +/* USB-3.0 controller clock control registers */ +#define SYS_NOC_USB3_CBCR (0x26014) +#define USB30_BCR (0x39000) +#define USB3PHY_BCR (0x39008) +#define USB30_MASTER_CBCR (0x3900C) +#define USB30_SLEEP_CBCR (0x39010) +#define USB30_MOCK_UTMI_CBCR (0x39014) +#define USB30_MOCK_UTMI_CMD_RCGR (0x3901C) +#define USB30_MOCK_UTMI_CFG_RCGR (0x39020) +#define USB30_MASTER_CMD_RCGR (0x39028) +#define USB30_MASTER_CFG_RCGR (0x3902C) +#define USB30_MASTER_M (0x39030) +#define USB30_MASTER_N (0x39034) +#define USB30_MASTER_D (0x39038) +#define USB2A_PHY_SLEEP_CBCR (0x4102C) +#define USB_HS_PHY_CFG_AHB_CBCR (0x41030) + #endif From patchwork Thu Aug 4 14:27:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 595329 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp483984maz; Thu, 4 Aug 2022 07:29:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR7+zqrN85dhg7qYGVhPB80oNx6O+q5QvUNuLGrY5vXgKE5QYlVqE2RvbfLFoRSiL2FVvtfz X-Received: by 2002:a5e:dd46:0:b0:67c:99c4:ce3b with SMTP id u6-20020a5edd46000000b0067c99c4ce3bmr861720iop.13.1659623377972; Thu, 04 Aug 2022 07:29:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659623377; cv=none; d=google.com; s=arc-20160816; b=hEXP+wQTF6OgPBss2IIgTapd8TD7nQc7CUssIpXwCrmjb7EBQMxargR/younqphDBp /M1PkQo9ppROPIbYMLY7J5FP9s57CZNXuOkvQ7BpFd73XJoNaKYPuXfIq8xYF1wAOvCI cpuQzRmOiKvWM15Zceiwb9Sx98TTEKzJrZ2G1nBwcre3x2bgIH5KmoDAKpaZnMF0zF5V E59IIgsW7wWLlgt/Y6++RuEU98M0mXaLQNK++dvrmMvdjNkXaQcHw3PZy2JJ4EdizSkh QhXJvLITMqgKCnZwX+SY8U/FiXfEZKUsIz0je+R6slVB9IrTNnWuPjDQ4FcgYpJdVNXi 9wQA== 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=+C0wegH9ETELdYcO2y+fqOabPqVe8TOMLFQoRXRh8+A=; b=vQpC4+ce3ftrLjH3cI4uqmP84qND1HRvneYcRTnh+OlfOf8JKf4B44NTEHxPGiIi/6 gsYJKZQ0cdxLVU9djsVy/2M9vJ9rDR9ZVVXDEOcwrs1fj/TZmrppXtjT+TNr7cai2AHL giUt8vca1IRRIaKHw7xZ4h5VajRiz8ZNGD/uZMona1YqSZOMxxiUaDPLPha/uzVCGGZz kWr6n6FmLJfWmxooUt1jcsImAMMCZW6d013I/ui7RtbVC+fm6mYDT0W9KS9fsXFXbrH4 HJS6MKLClHAR6piX/YCd64I7dmw97PMroUgxBT+ETBdSPVCocIhByXoUy4XKBuH6EgHp zdHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xI1kOs2R; 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 j13-20020a056e02154d00b002dd46c8095bsi1267404ilu.107.2022.08.04.07.29.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:29:37 -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=xI1kOs2R; 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 E684A8485F; Thu, 4 Aug 2022 16:28:47 +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="xI1kOs2R"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2718084863; Thu, 4 Aug 2022 16:28:47 +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-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) (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 5CF808485A for ; Thu, 4 Aug 2022 16:28:44 +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=sumit.garg@linaro.org Received: by mail-pj1-x102c.google.com with SMTP id q7-20020a17090a7a8700b001f300db8677so5803781pjf.5 for ; Thu, 04 Aug 2022 07:28:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+C0wegH9ETELdYcO2y+fqOabPqVe8TOMLFQoRXRh8+A=; b=xI1kOs2RFCnGIOWPXA8yPo0PgV7rq6XJPP4kajjYUwoIn8KkKL71fOHVkTEmQg7ZHP XUQZAEwcGBn9+w0YicrOz21XGXhiIhEUSCnSyuXDYephh+2iPRVrfDIH4uX0/79wGkpM NqNmboPhrzzXmYN7mVK+7Kz95YU+8li37XSK0MOy0zermLw90I1+k8H3selXHju+ofrQ kyiEHgVfIaxpfpDhlHyX+irmjehlZSAyFggHHDRCvxOipkeT/b+unjjQYfZQihBKy4G6 9Tl07NJzyDkQ+5YiOucf+Oue8CXtR16IFBMOfiebch5f9bwvQ/XxHZjo5Ltsf1Mu1yLZ rF4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+C0wegH9ETELdYcO2y+fqOabPqVe8TOMLFQoRXRh8+A=; b=CwA/k4HzD/F9s4orOvFK+Mw4NsT66j0FQ3qV+KYvUrOf0UP3x8Efh478Xwi/DBn/9E OUO/J7F47cXOsstFK7czc+xaplP8n5ybCaNHbxnKb7fhH1B40IKum80jWqSI4ky1Strq O53cU5/ktCcws6ujDt158VgnKm2YblCpfufdE74RcEvaSsKrckDfmdwcg9IauxJGn/Ta gY489ES++B3DysTpDU3ubYj2HruvgA8QdQ1UUjOqdY1SNIksrIytCZgH1b6tV/WMbkYV P+DiA7FfiNaCIYQCYz+jHwq/utdcjl70tR3jljzmA+o4AwZfmWHTZfx0IsvpEcYywAkg qxvw== X-Gm-Message-State: ACgBeo3SAXVQKhM9bunAJKKCEHPjJYVLGedDeXr+QZAFEN0h2Fa/i8Ai rjUsv1wZhUoKluqM5dCAUlEjYUONY7Op5A== X-Received: by 2002:a17:902:bf0b:b0:16e:f089:87f2 with SMTP id bi11-20020a170902bf0b00b0016ef08987f2mr2156279plb.87.1659623323681; Thu, 04 Aug 2022 07:28:43 -0700 (PDT) Received: from localhost.localdomain ([122.162.196.218]) by smtp.gmail.com with ESMTPSA id h185-20020a6253c2000000b0052cdb06c125sm1013549pfb.159.2022.08.04.07.28.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:28:43 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: rfried.dev@gmail.com, jorge.ramirez.ortiz@gmail.com, sjg@chromium.org, trini@konsulko.com, stephan@gerhold.net, mario.six@gdsys.cc, dsankouski@gmail.com, robert.marko@sartura.hr, luka.kovacic@sartura.hr, luka.perkov@sartura.hr, jh80.chung@samsung.com, nicolas.dechesne@linaro.org, vinod.koul@linaro.org, mworsfold@impinj.com, lgillham@impinj.com, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH 08/13] dts: qcs404-evb: Add USB controller and PHY nodes Date: Thu, 4 Aug 2022 19:57:16 +0530 Message-Id: <20220804142721.536556-9-sumit.garg@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804142721.536556-1-sumit.garg@linaro.org> References: <20220804142721.536556-1-sumit.garg@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.6 at phobos.denx.de X-Virus-Status: Clean QCS404 SoC provides support for two USB controllers: one USB3 and the other one being USB2. The USB3 controller supports further 2 PHY: one high speed PHY and the other super speed PHY. The USB2 controller supports a single high speed PHY. So add corresponding DT nodes. Signed-off-by: Sumit Garg --- arch/arm/dts/qcs404-evb.dts | 87 +++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/arch/arm/dts/qcs404-evb.dts b/arch/arm/dts/qcs404-evb.dts index 1b280efff6..2e3a0c6958 100644 --- a/arch/arm/dts/qcs404-evb.dts +++ b/arch/arm/dts/qcs404-evb.dts @@ -52,6 +52,7 @@ reg = <0x1800000 0x80000>; #address-cells = <0x1>; #size-cells = <0x0>; + #clock-cells = <1>; }; reset: gcc-reset@1800000 { @@ -81,6 +82,92 @@ mmc-ddr-1_8v; mmc-hs400-1_8v; }; + + usb3_phy: phy@78000 { + compatible = "qcom,usb-ss-28nm-phy"; + #phy-cells = <0>; + reg = <0x78000 0x400>; + clocks = <&gcc GCC_USB_HS_PHY_CFG_AHB_CLK>, + <&gcc GCC_USB3_PHY_PIPE_CLK>; + clock-names = "ahb", "pipe"; + resets = <&reset GCC_USB3_PHY_BCR>, + <&reset GCC_USB3PHY_PHY_BCR>; + reset-names = "com", "phy"; + }; + + usb2_phy_prim: phy@7a000 { + compatible = "qcom,usb-hs-28nm-femtophy"; + #phy-cells = <0>; + reg = <0x7a000 0x200>; + clocks = <&gcc GCC_USB_HS_PHY_CFG_AHB_CLK>, + <&gcc GCC_USB2A_PHY_SLEEP_CLK>; + clock-names = "ahb", "sleep"; + resets = <&reset GCC_USB_HS_PHY_CFG_AHB_BCR>, + <&reset GCC_USB2A_PHY_BCR>; + reset-names = "phy", "por"; + }; + + usb2_phy_sec: phy@7c000 { + compatible = "qcom,usb-hs-28nm-femtophy"; + #phy-cells = <0>; + reg = <0x7c000 0x200>; + clocks = <&gcc GCC_USB_HS_PHY_CFG_AHB_CLK>, + <&gcc GCC_USB2A_PHY_SLEEP_CLK>; + clock-names = "ahb", "sleep"; + resets = <&reset GCC_QUSB2_PHY_BCR>, + <&reset GCC_USB2_HS_PHY_ONLY_BCR>; + reset-names = "phy", "por"; + }; + + usb3: usb@7678800 { + compatible = "qcom,dwc3"; + reg = <0x7678800 0x400>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + clocks = <&gcc GCC_USB30_MASTER_CLK>, + <&gcc GCC_SYS_NOC_USB3_CLK>, + <&gcc GCC_USB30_SLEEP_CLK>, + <&gcc GCC_USB30_MOCK_UTMI_CLK>; + clock-names = "core", "iface", "sleep", "mock_utmi"; + + dwc3@7580000 { + compatible = "snps,dwc3"; + reg = <0x7580000 0xcd00>; + phys = <&usb2_phy_prim>, <&usb3_phy>; + phy-names = "usb2-phy", "usb3-phy"; + dr_mode = "host"; + snps,has-lpm-erratum; + snps,hird-threshold = /bits/ 8 <0x10>; + snps,usb3_lpm_capable; + maximum-speed = "super-speed"; + }; + }; + + usb2: usb@79b8800 { + compatible = "qcom,dwc3"; + reg = <0x79b8800 0x400>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + clocks = <&gcc GCC_USB_HS_SYSTEM_CLK>, + <&gcc GCC_PCNOC_USB2_CLK>, + <&gcc GCC_USB_HS_INACTIVITY_TIMERS_CLK>, + <&gcc GCC_USB20_MOCK_UTMI_CLK>; + clock-names = "core", "iface", "sleep", "mock_utmi"; + + dwc3@78c0000 { + compatible = "snps,dwc3"; + reg = <0x78c0000 0xcc00>; + phys = <&usb2_phy_sec>; + phy-names = "usb2-phy"; + dr_mode = "peripheral"; + snps,has-lpm-erratum; + snps,hird-threshold = /bits/ 8 <0x10>; + snps,usb3_lpm_capable; + maximum-speed = "high-speed"; + }; + }; }; }; From patchwork Thu Aug 4 14:27:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 595330 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp484139maz; Thu, 4 Aug 2022 07:29:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR4gCVTZgeSK8OCdS1CmM8GchlS3WT6ElskRo7TFQDx+0dmcR7/7YU9SpUd7HcCnfz8y6ykD X-Received: by 2002:a05:6e02:1c23:b0:2dc:e497:8b12 with SMTP id m3-20020a056e021c2300b002dce4978b12mr970582ilh.151.1659623389568; Thu, 04 Aug 2022 07:29:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659623389; cv=none; d=google.com; s=arc-20160816; b=Bb08tVnUR/TyWn5TTJ8XT4z7vVAQAFmBNLGdBJ/BkgRoG2R8C4h5KStq6ON1HyqYYA WUVgGToCOW+xC5g28dNzICkw/rKS5AhFSoGuvj+b5G82Ne0yk7uHmdB27SlkpRZR0MwH kcWiNAD1aJmsiq1/tCVuR4Zc1Ps/sGhvCxw3bTjbxPq3FRLO1IB3Leq5Ah91yW0oVL7g ROssgD49VqURR/wlwN2mv4bKun88MjL440sZfO9+8Oam2gVlf+FvHkCsWNae8kX4m9Ly YONcpi7k32sBF8LV6I7U0nbK6h1VEzd3PBLExr38R5PZwJ4Zj3DxOe9oYi/FPo3S0A8+ SVHQ== 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=ok0ruxOG0sLX3LUeEGjgX3gpFZdWs+sSCU9ZvaoKdkY=; b=DIMgSk0j1s5POZo6ftAUo9jK8iJh+jAJCPD01FjAYftdRp9TgmqWX1wVryk9wMNSiE ufn3+wyukdatQn/rIAYgg6Edpr1njetZAX0+HfQeqi4kdjj65kIuiBLrzoH/1srcPSX7 QokoaVX9H9k7hJmX15eMwzzdNXOH+8t9+SUQOL5cxSW0kl1SZ7uNDdnY4eYYS7m9Htl8 OZLbDJvs1zQGZ5HQkExeoyGaffGGiHIByoqDsLZvVe0V7h5Kpa/kNh3UKUZmU/Uyqn/1 3mIfaB0//utFzcR3vaHPrepWfue+qYQ8s81CTUxkLZwcOq++ZlqnRctdBh2aPJFpcUOy feww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l08Va5RN; 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 e33-20020a026d61000000b00342a6a584d2si992099jaf.44.2022.08.04.07.29.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:29:49 -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=l08Va5RN; 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 3644784861; Thu, 4 Aug 2022 16:28:59 +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="l08Va5RN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E488F84861; Thu, 4 Aug 2022 16:28:57 +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-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) (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 BA6248485B for ; Thu, 4 Aug 2022 16:28: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=sumit.garg@linaro.org Received: by mail-pf1-x433.google.com with SMTP id b133so19505028pfb.6 for ; Thu, 04 Aug 2022 07:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ok0ruxOG0sLX3LUeEGjgX3gpFZdWs+sSCU9ZvaoKdkY=; b=l08Va5RNDtOQ/H8cmAMdoNhZTs/TwWLwienxYgs7UtHULJ1qIao5CM2J7f0hL4YMhY LMKxkbEJPqQq6Rn9ZvWwQb+BRnfLT2Dd6XqXAmdKvSlPmznjMzzpGC5LyheLjm/ObNNi Iogwm54MsnpAEOoXVXLNH4AKQrDIKSa0aiL47DLX0fdzPagFB/V1RgnFjm0V9JKMyN/c nYSQCUsalzFViIxoRsTBp6xuQUiyuJwbPkyAIrDMGcLTQ1hYymTwbHO2ZP7Ux+u10sQS Eu/KEUojiS3qBSse8H8o/9JYPuTknJCcv5TJbW1MP9cXR/yhNMdiUorKg0VJaAGuIA4i hb0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ok0ruxOG0sLX3LUeEGjgX3gpFZdWs+sSCU9ZvaoKdkY=; b=Oqv3vb/0NQMF2Dt54wOfXwx++AwmN5liyyTEg400VNCWiLzpu381mqYSQPWrL0WmnU xG9/KTsDfxsz9gtrZDZsC4OEdUeL7wH/mcIDL+YcBLm6UCt2TQupZ8mQngG5P/Z1046+ QoUWdo6ZrTxyWABiVLyezYbGnwYlRAzsIDkKefRz05nP5obvvVSnfTABRAGrRxv+Me0R 6RarFquN5/PrWtJ/iW1KTwzKkbeBzFi3av9fgBpyar7ItQ45w/o5L15BmCNLPGlH6fHx NKoR6bV/leuTCylPu7cS7aLsqwdsPJ5MiM8h6XsPn2tFrAgL/EmGL8FeXUgMRbPv6znm dYrQ== X-Gm-Message-State: ACgBeo2qtwSDJ+d/0XDs9qaNNL7Kpo0vqlwKkA8qE+OGCjuy43nm54t4 ZNnEVtYFJnuGhWSRDRo6lYofbq7eJArMbw== X-Received: by 2002:a63:5a58:0:b0:41c:7d4c:8fd5 with SMTP id k24-20020a635a58000000b0041c7d4c8fd5mr1926717pgm.92.1659623331487; Thu, 04 Aug 2022 07:28:51 -0700 (PDT) Received: from localhost.localdomain ([122.162.196.218]) by smtp.gmail.com with ESMTPSA id h185-20020a6253c2000000b0052cdb06c125sm1013549pfb.159.2022.08.04.07.28.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:28:51 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: rfried.dev@gmail.com, jorge.ramirez.ortiz@gmail.com, sjg@chromium.org, trini@konsulko.com, stephan@gerhold.net, mario.six@gdsys.cc, dsankouski@gmail.com, robert.marko@sartura.hr, luka.kovacic@sartura.hr, luka.perkov@sartura.hr, jh80.chung@samsung.com, nicolas.dechesne@linaro.org, vinod.koul@linaro.org, mworsfold@impinj.com, lgillham@impinj.com, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH 09/13] pmic: Convert pm8916 driver to a generic Qcom PMIC driver Date: Thu, 4 Aug 2022 19:57:17 +0530 Message-Id: <20220804142721.536556-10-sumit.garg@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804142721.536556-1-sumit.garg@linaro.org> References: <20220804142721.536556-1-sumit.garg@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.6 at phobos.denx.de X-Virus-Status: Clean Since both pm8916.c and pm8916_gpio.c are already supporting multiple Qcom SoCs, it makes sense to rename these drivers to pmic_qcom.c and qcom_pmic_gpio.c respectively. Also, these driver can be extended to support additional functionality if required for other Qcom SoCs. Along with this import latest DT binding: qcom,spmi-pmic.txt from Linux kernel and thereby remove pm8916.txt. Signed-off-by: Sumit Garg --- configs/dragonboard410c_defconfig | 4 +- configs/dragonboard820c_defconfig | 4 +- configs/dragonboard845c_defconfig | 4 +- configs/sandbox64_defconfig | 4 +- configs/sandbox_defconfig | 4 +- configs/sandbox_flattree_defconfig | 4 +- configs/sandbox_noinst_defconfig | 4 +- configs/sandbox_spl_defconfig | 4 +- configs/sandbox_vpl_defconfig | 4 +- configs/starqltechn_defconfig | 4 +- doc/device-tree-bindings/pmic/pm8916.txt | 18 --- .../pmic/qcom,spmi-pmic.txt | 94 +++++++++++++++ drivers/gpio/Kconfig | 10 +- drivers/gpio/Makefile | 2 +- .../gpio/{pm8916_gpio.c => qcom_pmic_gpio.c} | 108 +++++++++--------- drivers/power/pmic/Kconfig | 8 +- drivers/power/pmic/Makefile | 2 +- drivers/power/pmic/{pm8916.c => pmic_qcom.c} | 42 +++---- 18 files changed, 200 insertions(+), 124 deletions(-) delete mode 100644 doc/device-tree-bindings/pmic/pm8916.txt create mode 100644 doc/device-tree-bindings/pmic/qcom,spmi-pmic.txt rename drivers/gpio/{pm8916_gpio.c => qcom_pmic_gpio.c} (67%) rename drivers/power/pmic/{pm8916.c => pmic_qcom.c} (52%) diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig index 2bf759d843..fa6476ed1a 100644 --- a/configs/dragonboard410c_defconfig +++ b/configs/dragonboard410c_defconfig @@ -43,7 +43,7 @@ CONFIG_FASTBOOT_BUF_ADDR=0x91000000 CONFIG_FASTBOOT_FLASH=y CONFIG_FASTBOOT_FLASH_MMC_DEV=0 CONFIG_MSM_GPIO=y -CONFIG_PM8916_GPIO=y +CONFIG_QCOM_PMIC_GPIO=y CONFIG_LED=y CONFIG_LED_GPIO=y CONFIG_MMC_SDHCI=y @@ -52,7 +52,7 @@ CONFIG_PHY=y CONFIG_PINCTRL=y CONFIG_PINCONF=y CONFIG_DM_PMIC=y -CONFIG_PMIC_PM8916=y +CONFIG_PMIC_QCOM=y CONFIG_MSM_SERIAL=y CONFIG_SPMI_MSM=y CONFIG_USB=y diff --git a/configs/dragonboard820c_defconfig b/configs/dragonboard820c_defconfig index 2ede13fed1..6b4483bf69 100644 --- a/configs/dragonboard820c_defconfig +++ b/configs/dragonboard820c_defconfig @@ -36,12 +36,12 @@ CONFIG_ENV_EXT4_INTERFACE="mmc" CONFIG_ENV_EXT4_DEVICE_AND_PART="0:1" CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_CLK=y -CONFIG_PM8916_GPIO=y +CONFIG_QCOM_PMIC_GPIO=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_MSM=y CONFIG_PINCTRL=y CONFIG_PINCONF=y CONFIG_DM_PMIC=y -CONFIG_PMIC_PM8916=y +CONFIG_PMIC_QCOM=y CONFIG_MSM_SERIAL=y CONFIG_SPMI_MSM=y diff --git a/configs/dragonboard845c_defconfig b/configs/dragonboard845c_defconfig index cf1a1d25cf..a69d82761a 100644 --- a/configs/dragonboard845c_defconfig +++ b/configs/dragonboard845c_defconfig @@ -20,10 +20,10 @@ CONFIG_CMD_GPIO=y # CONFIG_NET is not set CONFIG_CLK=y CONFIG_MSM_GPIO=y -CONFIG_PM8916_GPIO=y +CONFIG_QCOM_PMIC_GPIO=y CONFIG_PINCTRL=y CONFIG_DM_PMIC=y -CONFIG_PMIC_PM8916=y +CONFIG_PMIC_QCOM=y CONFIG_MSM_GENI_SERIAL=y CONFIG_SPMI_MSM=y CONFIG_LMB_MAX_REGIONS=64 diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig index 6553568e76..537495d159 100644 --- a/configs/sandbox64_defconfig +++ b/configs/sandbox64_defconfig @@ -127,7 +127,7 @@ CONFIG_FASTBOOT_FLASH=y CONFIG_FASTBOOT_FLASH_MMC_DEV=0 CONFIG_GPIO_HOG=y CONFIG_DM_GPIO_LOOKUP_LABEL=y -CONFIG_PM8916_GPIO=y +CONFIG_QCOM_PMIC_GPIO=y CONFIG_SANDBOX_GPIO=y CONFIG_I2C_CROS_EC_TUNNEL=y CONFIG_I2C_CROS_EC_LDO=y @@ -179,7 +179,7 @@ CONFIG_DM_PMIC=y CONFIG_PMIC_ACT8846=y CONFIG_DM_PMIC_PFUZE100=y CONFIG_DM_PMIC_MAX77686=y -CONFIG_PMIC_PM8916=y +CONFIG_PMIC_QCOM=y CONFIG_PMIC_RK8XX=y CONFIG_PMIC_S2MPS11=y CONFIG_DM_PMIC_SANDBOX=y diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index 572cf8edd8..72a7b5bb76 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -169,7 +169,7 @@ CONFIG_FASTBOOT_FLASH=y CONFIG_FASTBOOT_FLASH_MMC_DEV=0 CONFIG_GPIO_HOG=y CONFIG_DM_GPIO_LOOKUP_LABEL=y -CONFIG_PM8916_GPIO=y +CONFIG_QCOM_PMIC_GPIO=y CONFIG_SANDBOX_GPIO=y CONFIG_DM_HWSPINLOCK=y CONFIG_HWSPINLOCK_SANDBOX=y @@ -230,7 +230,7 @@ CONFIG_PMIC_ACT8846=y CONFIG_DM_PMIC_PFUZE100=y CONFIG_DM_PMIC_MAX77686=y CONFIG_DM_PMIC_MC34708=y -CONFIG_PMIC_PM8916=y +CONFIG_PMIC_QCOM=y CONFIG_PMIC_RK8XX=y CONFIG_PMIC_S2MPS11=y CONFIG_DM_PMIC_SANDBOX=y diff --git a/configs/sandbox_flattree_defconfig b/configs/sandbox_flattree_defconfig index a71ce77c40..a8aeedc75c 100644 --- a/configs/sandbox_flattree_defconfig +++ b/configs/sandbox_flattree_defconfig @@ -99,7 +99,7 @@ CONFIG_DM_DEMO_SHAPE=y CONFIG_DFU_SF=y CONFIG_GPIO_HOG=y CONFIG_DM_GPIO_LOOKUP_LABEL=y -CONFIG_PM8916_GPIO=y +CONFIG_QCOM_PMIC_GPIO=y CONFIG_SANDBOX_GPIO=y CONFIG_I2C_CROS_EC_TUNNEL=y CONFIG_I2C_CROS_EC_LDO=y @@ -153,7 +153,7 @@ CONFIG_PMIC_ACT8846=y CONFIG_DM_PMIC_PFUZE100=y CONFIG_DM_PMIC_MAX77686=y CONFIG_DM_PMIC_MC34708=y -CONFIG_PMIC_PM8916=y +CONFIG_PMIC_QCOM=y CONFIG_PMIC_S2MPS11=y CONFIG_DM_PMIC_SANDBOX=y CONFIG_PMIC_S5M8767=y diff --git a/configs/sandbox_noinst_defconfig b/configs/sandbox_noinst_defconfig index 9ee70c29c1..aa8868acba 100644 --- a/configs/sandbox_noinst_defconfig +++ b/configs/sandbox_noinst_defconfig @@ -126,7 +126,7 @@ CONFIG_DM_DEMO_SIMPLE=y CONFIG_DM_DEMO_SHAPE=y CONFIG_SPL_FIRMWARE=y CONFIG_GPIO_HOG=y -CONFIG_PM8916_GPIO=y +CONFIG_QCOM_PMIC_GPIO=y CONFIG_SANDBOX_GPIO=y CONFIG_I2C_CROS_EC_TUNNEL=y CONFIG_I2C_CROS_EC_LDO=y @@ -177,7 +177,7 @@ CONFIG_PMIC_ACT8846=y CONFIG_DM_PMIC_PFUZE100=y CONFIG_DM_PMIC_MAX77686=y CONFIG_DM_PMIC_MC34708=y -CONFIG_PMIC_PM8916=y +CONFIG_PMIC_QCOM=y CONFIG_PMIC_RK8XX=y CONFIG_PMIC_S2MPS11=y CONFIG_DM_PMIC_SANDBOX=y diff --git a/configs/sandbox_spl_defconfig b/configs/sandbox_spl_defconfig index ec2d26d443..da55d609de 100644 --- a/configs/sandbox_spl_defconfig +++ b/configs/sandbox_spl_defconfig @@ -127,7 +127,7 @@ CONFIG_DM_DEMO_SIMPLE=y CONFIG_DM_DEMO_SHAPE=y CONFIG_SPL_FIRMWARE=y CONFIG_GPIO_HOG=y -CONFIG_PM8916_GPIO=y +CONFIG_QCOM_PMIC_GPIO=y CONFIG_SANDBOX_GPIO=y CONFIG_I2C_CROS_EC_TUNNEL=y CONFIG_I2C_CROS_EC_LDO=y @@ -180,7 +180,7 @@ CONFIG_PMIC_ACT8846=y CONFIG_DM_PMIC_PFUZE100=y CONFIG_DM_PMIC_MAX77686=y CONFIG_DM_PMIC_MC34708=y -CONFIG_PMIC_PM8916=y +CONFIG_PMIC_QCOM=y CONFIG_PMIC_RK8XX=y CONFIG_PMIC_S2MPS11=y CONFIG_DM_PMIC_SANDBOX=y diff --git a/configs/sandbox_vpl_defconfig b/configs/sandbox_vpl_defconfig index 0d946b4ad7..aa701c8111 100644 --- a/configs/sandbox_vpl_defconfig +++ b/configs/sandbox_vpl_defconfig @@ -136,7 +136,7 @@ CONFIG_DM_DEMO_SIMPLE=y CONFIG_DM_DEMO_SHAPE=y CONFIG_SPL_FIRMWARE=y CONFIG_GPIO_HOG=y -CONFIG_PM8916_GPIO=y +CONFIG_QCOM_PMIC_GPIO=y CONFIG_SANDBOX_GPIO=y CONFIG_I2C_CROS_EC_TUNNEL=y CONFIG_I2C_CROS_EC_LDO=y @@ -185,7 +185,7 @@ CONFIG_PMIC_ACT8846=y CONFIG_DM_PMIC_PFUZE100=y CONFIG_DM_PMIC_MAX77686=y CONFIG_DM_PMIC_MC34708=y -CONFIG_PMIC_PM8916=y +CONFIG_PMIC_QCOM=y CONFIG_PMIC_RK8XX=y CONFIG_PMIC_S2MPS11=y CONFIG_DM_PMIC_SANDBOX=y diff --git a/configs/starqltechn_defconfig b/configs/starqltechn_defconfig index 2d07767b61..4f84f5f974 100644 --- a/configs/starqltechn_defconfig +++ b/configs/starqltechn_defconfig @@ -23,10 +23,10 @@ CONFIG_CMD_BMP=y # CONFIG_DM_STDIO is not set CONFIG_CLK=y CONFIG_MSM_GPIO=y -CONFIG_PM8916_GPIO=y +CONFIG_QCOM_PMIC_GPIO=y CONFIG_PINCTRL=y CONFIG_DM_PMIC=y -CONFIG_PMIC_PM8916=y +CONFIG_PMIC_QCOM=y # CONFIG_REQUIRE_SERIAL_CONSOLE is not set CONFIG_SPMI_MSM=y CONFIG_DM_VIDEO=y diff --git a/doc/device-tree-bindings/pmic/pm8916.txt b/doc/device-tree-bindings/pmic/pm8916.txt deleted file mode 100644 index 15c598b8c4..0000000000 --- a/doc/device-tree-bindings/pmic/pm8916.txt +++ /dev/null @@ -1,18 +0,0 @@ -Qualcomm pm8916 PMIC - -This PMIC is connected using SPMI bus so should be child of SPMI bus controller. - -Required properties: -- compatible: "qcom,spmi-pmic"; -- reg: SPMI Slave ID, size (ignored) -- #address-cells: 0x1 (peripheral ID) -- #size-cells: 0x1 (size of peripheral register space) - -Example: - -pm8916@0 { - compatible = "qcom,spmi-pmic"; - reg = <0x0 0x1>; - #address-cells = <0x1>; - #size-cells = <0x1>; -}; diff --git a/doc/device-tree-bindings/pmic/qcom,spmi-pmic.txt b/doc/device-tree-bindings/pmic/qcom,spmi-pmic.txt new file mode 100644 index 0000000000..eb78e3ae77 --- /dev/null +++ b/doc/device-tree-bindings/pmic/qcom,spmi-pmic.txt @@ -0,0 +1,94 @@ + Qualcomm SPMI PMICs multi-function device bindings + +The Qualcomm SPMI series presently includes PM8941, PM8841 and PMA8084 +PMICs. These PMICs use a QPNP scheme through SPMI interface. +QPNP is effectively a partitioning scheme for dividing the SPMI extended +register space up into logical pieces, and set of fixed register +locations/definitions within these regions, with some of these regions +specifically used for interrupt handling. + +The QPNP PMICs are used with the Qualcomm Snapdragon series SoCs, and are +interfaced to the chip via the SPMI (System Power Management Interface) bus. +Support for multiple independent functions are implemented by splitting the +16-bit SPMI slave address space into 256 smaller fixed-size regions, 256 bytes +each. A function can consume one or more of these fixed-size register regions. + +Required properties: +- compatible: Should contain one of: + "qcom,pm660", + "qcom,pm660l", + "qcom,pm7325", + "qcom,pm8004", + "qcom,pm8005", + "qcom,pm8019", + "qcom,pm8028", + "qcom,pm8110", + "qcom,pm8150", + "qcom,pm8150b", + "qcom,pm8150c", + "qcom,pm8150l", + "qcom,pm8226", + "qcom,pm8350c", + "qcom,pm8841", + "qcom,pm8901", + "qcom,pm8909", + "qcom,pm8916", + "qcom,pm8941", + "qcom,pm8950", + "qcom,pm8953", + "qcom,pm8994", + "qcom,pm8998", + "qcom,pma8084", + "qcom,pmd9635", + "qcom,pmi8950", + "qcom,pmi8962", + "qcom,pmi8994", + "qcom,pmi8998", + "qcom,pmk8002", + "qcom,pmk8350", + "qcom,pmr735a", + "qcom,smb2351", + or generalized "qcom,spmi-pmic". +- reg: Specifies the SPMI USID slave address for this device. + For more information see: + Documentation/devicetree/bindings/spmi/spmi.yaml + +Required properties for peripheral child nodes: +- compatible: Should contain "qcom,xxx", where "xxx" is a peripheral name. + +Optional properties for peripheral child nodes: +- interrupts: Interrupts are specified as a 4-tuple. For more information + see: + Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.yaml +- interrupt-names: Corresponding interrupt name to the interrupts property + +Each child node of SPMI slave id represents a function of the PMIC. In the +example below the rtc device node represents a peripheral of pm8941 +SID = 0. The regulator device node represents a peripheral of pm8941 SID = 1. + +Example: + + spmi { + compatible = "qcom,spmi-pmic-arb"; + + pm8941@0 { + compatible = "qcom,pm8941", "qcom,spmi-pmic"; + reg = <0x0 SPMI_USID>; + + rtc { + compatible = "qcom,rtc"; + interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "alarm"; + }; + }; + + pm8941@1 { + compatible = "qcom,pm8941", "qcom,spmi-pmic"; + reg = <0x1 SPMI_USID>; + + regulator { + compatible = "qcom,regulator"; + regulator-name = "8941_boost"; + }; + }; + }; diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index aaa152fae7..39dfdac195 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -303,14 +303,14 @@ config CMD_PCA953X legacy GPIO interface. Several subcommands are provided which mirror the standard 'gpio' command. It should use that instead. -config PM8916_GPIO - bool "Qualcomm PM8916 PMIC GPIO/keypad driver" - depends on DM_GPIO && PMIC_PM8916 +config QCOM_PMIC_GPIO + bool "Qualcomm generic PMIC GPIO/keypad driver" + depends on DM_GPIO && PMIC_QCOM help Support for GPIO pins and power/reset buttons found on - Qualcomm PM8916 PMIC. + Qualcomm SoCs PMIC. Default name for GPIO bank is "pm8916". - Power and reset buttons are placed in "pm8916_key" bank and + Power and reset buttons are placed in "pwkey_qcom" bank and have gpio numbers 0 and 1 respectively. config PCF8575_GPIO diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index d7552762d0..ff6dcc332f 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -64,7 +64,7 @@ obj-$(CONFIG_OCTEON_GPIO) += octeon_gpio.o obj-$(CONFIG_MVEBU_GPIO) += mvebu_gpio.o obj-$(CONFIG_MSM_GPIO) += msm_gpio.o obj-$(CONFIG_$(SPL_)PCF8575_GPIO) += pcf8575_gpio.o -obj-$(CONFIG_$(SPL_TPL_)PM8916_GPIO) += pm8916_gpio.o +obj-$(CONFIG_$(SPL_TPL_)QCOM_PMIC_GPIO) += qcom_pmic_gpio.o obj-$(CONFIG_MT7620_GPIO) += mt7620_gpio.o obj-$(CONFIG_MT7621_GPIO) += mt7621_gpio.o obj-$(CONFIG_MSCC_SGPIO) += mscc_sgpio.o diff --git a/drivers/gpio/pm8916_gpio.c b/drivers/gpio/qcom_pmic_gpio.c similarity index 67% rename from drivers/gpio/pm8916_gpio.c rename to drivers/gpio/qcom_pmic_gpio.c index 7ad95784a8..e9232a007f 100644 --- a/drivers/gpio/pm8916_gpio.c +++ b/drivers/gpio/qcom_pmic_gpio.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Qualcomm pm8916 pmic gpio driver - part of Qualcomm PM8916 PMIC + * Qualcomm generic pmic gpio driver * * (C) Copyright 2015 Mateusz Kulikowski */ @@ -19,7 +19,7 @@ /* Register maps */ -/* Type and subtype are shared for all pm8916 peripherals */ +/* Type and subtype are shared for all PMIC peripherals */ #define REG_TYPE 0x4 #define REG_SUBTYPE 0x5 @@ -47,14 +47,14 @@ #define REG_EN_CTL 0x46 #define REG_EN_CTL_ENABLE (1 << 7) -struct pm8916_gpio_bank { +struct qcom_gpio_bank { uint32_t pid; /* Peripheral ID on SPMI bus */ }; -static int pm8916_gpio_set_direction(struct udevice *dev, unsigned offset, - bool input, int value) +static int qcom_gpio_set_direction(struct udevice *dev, unsigned offset, + bool input, int value) { - struct pm8916_gpio_bank *priv = dev_get_priv(dev); + struct qcom_gpio_bank *priv = dev_get_priv(dev); uint32_t gpio_base = priv->pid + REG_OFFSET(offset); int ret; @@ -101,20 +101,20 @@ static int pm8916_gpio_set_direction(struct udevice *dev, unsigned offset, REG_EN_CTL_ENABLE); } -static int pm8916_gpio_direction_input(struct udevice *dev, unsigned offset) +static int qcom_gpio_direction_input(struct udevice *dev, unsigned offset) { - return pm8916_gpio_set_direction(dev, offset, true, 0); + return qcom_gpio_set_direction(dev, offset, true, 0); } -static int pm8916_gpio_direction_output(struct udevice *dev, unsigned offset, - int value) +static int qcom_gpio_direction_output(struct udevice *dev, unsigned offset, + int value) { - return pm8916_gpio_set_direction(dev, offset, false, value); + return qcom_gpio_set_direction(dev, offset, false, value); } -static int pm8916_gpio_get_function(struct udevice *dev, unsigned offset) +static int qcom_gpio_get_function(struct udevice *dev, unsigned offset) { - struct pm8916_gpio_bank *priv = dev_get_priv(dev); + struct qcom_gpio_bank *priv = dev_get_priv(dev); uint32_t gpio_base = priv->pid + REG_OFFSET(offset); int reg; @@ -134,9 +134,9 @@ static int pm8916_gpio_get_function(struct udevice *dev, unsigned offset) } } -static int pm8916_gpio_get_value(struct udevice *dev, unsigned offset) +static int qcom_gpio_get_value(struct udevice *dev, unsigned offset) { - struct pm8916_gpio_bank *priv = dev_get_priv(dev); + struct qcom_gpio_bank *priv = dev_get_priv(dev); uint32_t gpio_base = priv->pid + REG_OFFSET(offset); int reg; @@ -147,10 +147,10 @@ static int pm8916_gpio_get_value(struct udevice *dev, unsigned offset) return !!(reg & REG_STATUS_VAL_MASK); } -static int pm8916_gpio_set_value(struct udevice *dev, unsigned offset, - int value) +static int qcom_gpio_set_value(struct udevice *dev, unsigned offset, + int value) { - struct pm8916_gpio_bank *priv = dev_get_priv(dev); + struct qcom_gpio_bank *priv = dev_get_priv(dev); uint32_t gpio_base = priv->pid + REG_OFFSET(offset); /* Set the output value of the gpio */ @@ -158,17 +158,17 @@ static int pm8916_gpio_set_value(struct udevice *dev, unsigned offset, REG_CTL_OUTPUT_MASK, !!value); } -static const struct dm_gpio_ops pm8916_gpio_ops = { - .direction_input = pm8916_gpio_direction_input, - .direction_output = pm8916_gpio_direction_output, - .get_value = pm8916_gpio_get_value, - .set_value = pm8916_gpio_set_value, - .get_function = pm8916_gpio_get_function, +static const struct dm_gpio_ops qcom_gpio_ops = { + .direction_input = qcom_gpio_direction_input, + .direction_output = qcom_gpio_direction_output, + .get_value = qcom_gpio_get_value, + .set_value = qcom_gpio_set_value, + .get_function = qcom_gpio_get_function, }; -static int pm8916_gpio_probe(struct udevice *dev) +static int qcom_gpio_probe(struct udevice *dev) { - struct pm8916_gpio_bank *priv = dev_get_priv(dev); + struct qcom_gpio_bank *priv = dev_get_priv(dev); int reg; priv->pid = dev_read_addr(dev); @@ -187,33 +187,33 @@ static int pm8916_gpio_probe(struct udevice *dev) return 0; } -static int pm8916_gpio_of_to_plat(struct udevice *dev) +static int qcom_gpio_of_to_plat(struct udevice *dev) { struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); uc_priv->gpio_count = dev_read_u32_default(dev, "gpio-count", 0); uc_priv->bank_name = dev_read_string(dev, "gpio-bank-name"); if (uc_priv->bank_name == NULL) - uc_priv->bank_name = "pm8916"; + uc_priv->bank_name = "qcom_pmic"; return 0; } -static const struct udevice_id pm8916_gpio_ids[] = { +static const struct udevice_id qcom_gpio_ids[] = { { .compatible = "qcom,pm8916-gpio" }, { .compatible = "qcom,pm8994-gpio" }, /* 22 GPIO's */ { .compatible = "qcom,pm8998-gpio" }, { } }; -U_BOOT_DRIVER(gpio_pm8916) = { - .name = "gpio_pm8916", +U_BOOT_DRIVER(qcom_pmic_gpio) = { + .name = "qcom_pmic_gpio", .id = UCLASS_GPIO, - .of_match = pm8916_gpio_ids, - .of_to_plat = pm8916_gpio_of_to_plat, - .probe = pm8916_gpio_probe, - .ops = &pm8916_gpio_ops, - .priv_auto = sizeof(struct pm8916_gpio_bank), + .of_match = qcom_gpio_ids, + .of_to_plat = qcom_gpio_of_to_plat, + .probe = qcom_gpio_probe, + .ops = &qcom_gpio_ops, + .priv_auto = sizeof(struct qcom_gpio_bank), }; @@ -222,14 +222,14 @@ U_BOOT_DRIVER(gpio_pm8916) = { #define KPDPWR_ON_INT_BIT 0 #define RESIN_ON_INT_BIT 1 -static int pm8941_pwrkey_get_function(struct udevice *dev, unsigned offset) +static int qcom_pwrkey_get_function(struct udevice *dev, unsigned offset) { return GPIOF_INPUT; } -static int pm8941_pwrkey_get_value(struct udevice *dev, unsigned offset) +static int qcom_pwrkey_get_value(struct udevice *dev, unsigned offset) { - struct pm8916_gpio_bank *priv = dev_get_priv(dev); + struct qcom_gpio_bank *priv = dev_get_priv(dev); int reg = pmic_reg_read(dev->parent, priv->pid + PON_INT_RT_STS); @@ -247,14 +247,14 @@ static int pm8941_pwrkey_get_value(struct udevice *dev, unsigned offset) } } -static const struct dm_gpio_ops pm8941_pwrkey_ops = { - .get_value = pm8941_pwrkey_get_value, - .get_function = pm8941_pwrkey_get_function, +static const struct dm_gpio_ops qcom_pwrkey_ops = { + .get_value = qcom_pwrkey_get_value, + .get_function = qcom_pwrkey_get_function, }; -static int pm8941_pwrkey_probe(struct udevice *dev) +static int qcom_pwrkey_probe(struct udevice *dev) { - struct pm8916_gpio_bank *priv = dev_get_priv(dev); + struct qcom_gpio_bank *priv = dev_get_priv(dev); int reg; priv->pid = dev_read_addr(dev); @@ -273,31 +273,31 @@ static int pm8941_pwrkey_probe(struct udevice *dev) return 0; } -static int pm8941_pwrkey_of_to_plat(struct udevice *dev) +static int qcom_pwrkey_of_to_plat(struct udevice *dev) { struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); uc_priv->gpio_count = 2; uc_priv->bank_name = dev_read_string(dev, "gpio-bank-name"); if (uc_priv->bank_name == NULL) - uc_priv->bank_name = "pm8916_key"; + uc_priv->bank_name = "pwkey_qcom"; return 0; } -static const struct udevice_id pm8941_pwrkey_ids[] = { +static const struct udevice_id qcom_pwrkey_ids[] = { { .compatible = "qcom,pm8916-pwrkey" }, { .compatible = "qcom,pm8994-pwrkey" }, { .compatible = "qcom,pm8998-pwrkey" }, { } }; -U_BOOT_DRIVER(pwrkey_pm89xx) = { - .name = "pwrkey_pm89xx", +U_BOOT_DRIVER(pwrkey_qcom) = { + .name = "pwrkey_qcom", .id = UCLASS_GPIO, - .of_match = pm8941_pwrkey_ids, - .of_to_plat = pm8941_pwrkey_of_to_plat, - .probe = pm8941_pwrkey_probe, - .ops = &pm8941_pwrkey_ops, - .priv_auto = sizeof(struct pm8916_gpio_bank), + .of_match = qcom_pwrkey_ids, + .of_to_plat = qcom_pwrkey_of_to_plat, + .probe = qcom_pwrkey_probe, + .ops = &qcom_pwrkey_ops, + .priv_auto = sizeof(struct qcom_gpio_bank), }; diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig index 66b16b06e0..0478f2aa1d 100644 --- a/drivers/power/pmic/Kconfig +++ b/drivers/power/pmic/Kconfig @@ -216,10 +216,10 @@ config PMIC_MAX8997 - MUIC - Others -config PMIC_PM8916 - bool "Enable Driver Model for Qualcomm PM8916 PMIC" +config PMIC_QCOM + bool "Enable Driver Model for Qualcomm generic PMIC" ---help--- - The PM8916 is a PMIC connected to one (or several) processors + The Qcom PMIC is connected to one (or several) processors with SPMI bus. It has 2 slaves with several peripherals: - 18x LDO - 4x GPIO @@ -229,7 +229,7 @@ config PMIC_PM8916 - Vibrator drivers - Others - Driver binding info: doc/device-tree-bindings/pmic/pm8916.txt + Driver binding info: doc/device-tree-bindings/pmic/qcom,spmi-pmic.txt config PMIC_RK8XX bool "Enable support for Rockchip PMIC RK8XX" diff --git a/drivers/power/pmic/Makefile b/drivers/power/pmic/Makefile index f73b326255..e1d3545490 100644 --- a/drivers/power/pmic/Makefile +++ b/drivers/power/pmic/Makefile @@ -20,7 +20,7 @@ obj-$(CONFIG_PMIC_ACT8846) += act8846.o obj-$(CONFIG_PMIC_AS3722) += as3722.o as3722_gpio.o obj-$(CONFIG_$(SPL_)PMIC_AXP) += axp.o obj-$(CONFIG_PMIC_MAX8997) += max8997.o -obj-$(CONFIG_PMIC_PM8916) += pm8916.o +obj-$(CONFIG_PMIC_QCOM) += pmic_qcom.o obj-$(CONFIG_$(SPL_TPL_)PMIC_RK8XX) += rk8xx.o obj-$(CONFIG_PMIC_RN5T567) += rn5t567.o obj-$(CONFIG_PMIC_TPS65090) += tps65090.o diff --git a/drivers/power/pmic/pm8916.c b/drivers/power/pmic/pmic_qcom.c similarity index 52% rename from drivers/power/pmic/pm8916.c rename to drivers/power/pmic/pmic_qcom.c index 5f4386d4ad..ad8daf43f0 100644 --- a/drivers/power/pmic/pm8916.c +++ b/drivers/power/pmic/pmic_qcom.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Qualcomm pm8916 pmic driver + * Qualcomm generic pmic driver * * (C) Copyright 2015 Mateusz Kulikowski */ @@ -13,19 +13,19 @@ #define PID_MASK (0xFF << PID_SHIFT) #define REG_MASK 0xFF -struct pm8916_priv { +struct pmic_qcom_priv { uint32_t usid; /* Slave ID on SPMI bus */ }; -static int pm8916_reg_count(struct udevice *dev) +static int pmic_qcom_reg_count(struct udevice *dev) { return 0xFFFF; } -static int pm8916_write(struct udevice *dev, uint reg, const uint8_t *buff, - int len) +static int pmic_qcom_write(struct udevice *dev, uint reg, const uint8_t *buff, + int len) { - struct pm8916_priv *priv = dev_get_priv(dev); + struct pmic_qcom_priv *priv = dev_get_priv(dev); if (len != 1) return -EINVAL; @@ -35,9 +35,9 @@ static int pm8916_write(struct udevice *dev, uint reg, const uint8_t *buff, *buff); } -static int pm8916_read(struct udevice *dev, uint reg, uint8_t *buff, int len) +static int pmic_qcom_read(struct udevice *dev, uint reg, uint8_t *buff, int len) { - struct pm8916_priv *priv = dev_get_priv(dev); + struct pmic_qcom_priv *priv = dev_get_priv(dev); int val; if (len != 1) @@ -52,20 +52,20 @@ static int pm8916_read(struct udevice *dev, uint reg, uint8_t *buff, int len) return 0; } -static struct dm_pmic_ops pm8916_ops = { - .reg_count = pm8916_reg_count, - .read = pm8916_read, - .write = pm8916_write, +static struct dm_pmic_ops pmic_qcom_ops = { + .reg_count = pmic_qcom_reg_count, + .read = pmic_qcom_read, + .write = pmic_qcom_write, }; -static const struct udevice_id pm8916_ids[] = { +static const struct udevice_id pmic_qcom_ids[] = { { .compatible = "qcom,spmi-pmic" }, { } }; -static int pm8916_probe(struct udevice *dev) +static int pmic_qcom_probe(struct udevice *dev) { - struct pm8916_priv *priv = dev_get_priv(dev); + struct pmic_qcom_priv *priv = dev_get_priv(dev); priv->usid = dev_read_addr(dev); @@ -75,12 +75,12 @@ static int pm8916_probe(struct udevice *dev) return 0; } -U_BOOT_DRIVER(pmic_pm8916) = { - .name = "pmic_pm8916", +U_BOOT_DRIVER(pmic_qcom) = { + .name = "pmic_qcom", .id = UCLASS_PMIC, - .of_match = pm8916_ids, + .of_match = pmic_qcom_ids, .bind = dm_scan_fdt_dev, - .probe = pm8916_probe, - .ops = &pm8916_ops, - .priv_auto = sizeof(struct pm8916_priv), + .probe = pmic_qcom_probe, + .ops = &pmic_qcom_ops, + .priv_auto = sizeof(struct pmic_qcom_priv), }; From patchwork Thu Aug 4 14:27:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 595331 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp484331maz; Thu, 4 Aug 2022 07:30:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR5LICLiLw6N/jQfPa++EKx5CQ+qX7Gm0lCfrTZWBfU3BuD7Cs7lT7k39CAlTFU0O/8J0Oy5 X-Received: by 2002:a05:6638:3183:b0:341:63da:2f37 with SMTP id z3-20020a056638318300b0034163da2f37mr983497jak.237.1659623401302; Thu, 04 Aug 2022 07:30:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659623401; cv=none; d=google.com; s=arc-20160816; b=rY7ClxOMPttYw8xeDY4yocTji9hu/EPaW0MnS27JaewD5VNn/StHtV5zZPfq5kIyTL 8i+6jiK+9IwJ1myatjFzxEfY3HhHPd0DVEdO7a54/przw5Zmedjo2XHg4IbUo5svpneU TtQ1pxgat+ux6x4lbZqYyF05ZuvAjsJpO1czs/D8Yq2UAPmK7bwmGbqXudNReCvitvou e3EwXrtLnIMQhMTG6GYEtPrmJjhSonoP4LE6C8uIJiLSccmnTvY3XLFu13zmqMWJSLKb xUJPxrfbaM6ro/WAoNJn5aLbl1rvDrJzEOKxF1OEgJvfELrjZkLu5u7cFEO4XXF7Pqp6 s9mw== 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=KK7kE+Fwoy4t0bE4cd6Xsho7n164CKoBSu6EWO9auq8=; b=vq+cWGQpJfIh42ZqnWReuTM49bA9nPiLQm4pUPNT9RN87IJsil65JovWVreCzxGsZY 35Ds0xrPyUY5xW1NisPjFyKglw2A/hWc5/VZXsb82UGWzV3RXGar9od5AbFEF0zvMQBT y+OqYIJU6ho0f9HFo3l4fw2sFInokosY6XMDmnSQnI7XCR+ghMcr9gSJtW1QdkWKETnc /f98MEY45GAh63oOGaD5aIc5909VFegzdsvA+p+0QwGR3GnL/oM6BlXzBpHT3VFdpQkw m4XJhX27U0aS6GFk/6Ob4nYvd90GpZx+WW+gMSeQ4jdFQHT1+bQzbNkmSnIGQLbcGEC8 VBhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LX2HAP2C; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id 202-20020a6b01d3000000b006734fae53d3si1209020iob.7.2022.08.04.07.30.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:30:01 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LX2HAP2C; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 08D0484869; Thu, 4 Aug 2022 16:29: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="LX2HAP2C"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C054D84869; Thu, 4 Aug 2022 16:29:04 +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-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) (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 8428C8486B for ; Thu, 4 Aug 2022 16:29:00 +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=sumit.garg@linaro.org Received: by mail-pj1-x102f.google.com with SMTP id b4so9525509pji.4 for ; Thu, 04 Aug 2022 07:29:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KK7kE+Fwoy4t0bE4cd6Xsho7n164CKoBSu6EWO9auq8=; b=LX2HAP2CSrsgZ8TqrQuSvDLBPViLE9R6VNPx1RFwKpg4bzcMj0XD27S5nHWkfBsP1C HQo4uKb7NZONsIJdAG1aVFC+lzLMVzfwWJmMZ82Wzpd4Jpn4Lu3tFy3/dYB2bsTKrg/7 Sk63usi4GgID3CQ/n5ZnN3C5ewU18J8KxupHRKMyNk3fWQLC4SuDegNE2Nc+NvJS5qiJ mAUGUm4P5+89yi+0lREy1MMYj/rZAR/hvkKqtOnHfN2LE0uaEbbZ5Zv9onIY9PWoMI76 7v/0QCRAN1t1f30pVmW6N7FftXEu6d0AQ/tIReoQIbAKSpSIkVgOEf13xYAU7S+dTJh4 zJow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KK7kE+Fwoy4t0bE4cd6Xsho7n164CKoBSu6EWO9auq8=; b=lEYZPmmOmHMhlLA4MR2CxzUUQNKTxsXPdRROovWnlm6JlcZwYiWpEKmQPbb4IJfFrn fYlTvReB3WoMrhDjSm0rQlUgGwyv2yApxBJ7Kr8qBmOPtvFFj59gG/qTHdcsiqonhJZ/ oQ0bURFgCzcQY+BgCfDLG2lsiSaOspGyINi/OMPDgZAglm3fazml7MHGOhJ6SjruOfoc C7y1NeWLwUFs1qGO7tVY4HjYUX6i4GKe1X/X1K3Lwmroop3w9rPYEO0+GytDfsdpKR6/ iWG+mTOLQyFuDVn2bVayZe8OxP/JRpQ4msrwpqJYXdSfeaWLD5fTgbu9d07UEWuRre8g HILg== X-Gm-Message-State: ACgBeo3JeBk9L5l+44lcHJUeO5N8/B/vyaDGgZZ7g59JKPVwCaqb2PGh YVfLVoUUwX6DpwtPunULwWAAe9X6G/7R5w== X-Received: by 2002:a17:90b:1c85:b0:1f1:d78a:512b with SMTP id oo5-20020a17090b1c8500b001f1d78a512bmr10878742pjb.92.1659623338576; Thu, 04 Aug 2022 07:28:58 -0700 (PDT) Received: from localhost.localdomain ([122.162.196.218]) by smtp.gmail.com with ESMTPSA id h185-20020a6253c2000000b0052cdb06c125sm1013549pfb.159.2022.08.04.07.28.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:28:58 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: rfried.dev@gmail.com, jorge.ramirez.ortiz@gmail.com, sjg@chromium.org, trini@konsulko.com, stephan@gerhold.net, mario.six@gdsys.cc, dsankouski@gmail.com, robert.marko@sartura.hr, luka.kovacic@sartura.hr, luka.perkov@sartura.hr, jh80.chung@samsung.com, nicolas.dechesne@linaro.org, vinod.koul@linaro.org, mworsfold@impinj.com, lgillham@impinj.com, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH 10/13] gpio: qcom_pmic: Add support for GPIO LV/MV subtype Date: Thu, 4 Aug 2022 19:57:18 +0530 Message-Id: <20220804142721.536556-11-sumit.garg@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804142721.536556-1-sumit.garg@linaro.org> References: <20220804142721.536556-1-sumit.garg@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.6 at phobos.denx.de X-Virus-Status: Clean GPIO LV (low voltage)/MV (medium voltage) subtypes have different features and register mappings than 4CH/8CH subtypes. Add support for LV and MV subtypes. With GPIO LV/MV subtype available, add "qcom,pms405-gpio" compatible which requires support for GPIO MV subtype. Signed-off-by: Sumit Garg --- drivers/gpio/qcom_pmic_gpio.c | 96 +++++++++++++++++++++++++++-------- 1 file changed, 76 insertions(+), 20 deletions(-) diff --git a/drivers/gpio/qcom_pmic_gpio.c b/drivers/gpio/qcom_pmic_gpio.c index e9232a007f..3be1be8692 100644 --- a/drivers/gpio/qcom_pmic_gpio.c +++ b/drivers/gpio/qcom_pmic_gpio.c @@ -23,6 +23,15 @@ #define REG_TYPE 0x4 #define REG_SUBTYPE 0x5 +/* GPIO peripheral type and subtype out_values */ +#define REG_TYPE_VAL 0x10 +#define REG_SUBTYPE_GPIO_4CH 0x1 +#define REG_SUBTYPE_GPIOC_4CH 0x5 +#define REG_SUBTYPE_GPIO_8CH 0x9 +#define REG_SUBTYPE_GPIOC_8CH 0xd +#define REG_SUBTYPE_GPIO_LV 0x10 +#define REG_SUBTYPE_GPIO_MV 0x11 + #define REG_STATUS 0x08 #define REG_STATUS_VAL_MASK 0x1 @@ -33,6 +42,10 @@ #define REG_CTL_MODE_INOUT 0x20 #define REG_CTL_MODE_OUTPUT 0x10 #define REG_CTL_OUTPUT_MASK 0x0F +#define REG_CTL_LV_MV_MODE_MASK 0x3 +#define REG_CTL_LV_MV_MODE_INPUT 0x0 +#define REG_CTL_LV_MV_MODE_INOUT 0x2 +#define REG_CTL_LV_MV_MODE_OUTPUT 0x1 #define REG_DIG_VIN_CTL 0x41 #define REG_DIG_VIN_VIN0 0 @@ -40,6 +53,10 @@ #define REG_DIG_PULL_CTL 0x42 #define REG_DIG_PULL_NO_PU 0x5 +#define REG_LV_MV_OUTPUT_CTL 0x44 +#define REG_LV_MV_OUTPUT_CTL_MASK 0x80 +#define REG_LV_MV_OUTPUT_CTL_SHIFT 7 + #define REG_DIG_OUT_CTL 0x45 #define REG_DIG_OUT_CTL_CMOS (0x0 << 4) #define REG_DIG_OUT_CTL_DRIVE_L 0x1 @@ -49,6 +66,7 @@ struct qcom_gpio_bank { uint32_t pid; /* Peripheral ID on SPMI bus */ + bool lv_mv_type; /* If subtype is GPIO_LV(0x10) or GPIO_MV(0x11) */ }; static int qcom_gpio_set_direction(struct udevice *dev, unsigned offset, @@ -56,6 +74,7 @@ static int qcom_gpio_set_direction(struct udevice *dev, unsigned offset, { struct qcom_gpio_bank *priv = dev_get_priv(dev); uint32_t gpio_base = priv->pid + REG_OFFSET(offset); + uint32_t reg_ctl_val; int ret; /* Disable the GPIO */ @@ -64,16 +83,31 @@ static int qcom_gpio_set_direction(struct udevice *dev, unsigned offset, if (ret < 0) return ret; - /* Select the mode */ - if (input) - ret = pmic_reg_write(dev->parent, gpio_base + REG_CTL, - REG_CTL_MODE_INPUT); - else - ret = pmic_reg_write(dev->parent, gpio_base + REG_CTL, - REG_CTL_MODE_INOUT | (value ? 1 : 0)); + /* Select the mode and output */ + if (priv->lv_mv_type) { + if (input) + reg_ctl_val = REG_CTL_LV_MV_MODE_INPUT; + else + reg_ctl_val = REG_CTL_LV_MV_MODE_INOUT; + } else { + if (input) + reg_ctl_val = REG_CTL_MODE_INPUT; + else + reg_ctl_val = REG_CTL_MODE_INOUT | !!value; + } + + ret = pmic_reg_write(dev->parent, gpio_base + REG_CTL, reg_ctl_val); if (ret < 0) return ret; + if (priv->lv_mv_type && !input) { + ret = pmic_reg_write(dev->parent, + gpio_base + REG_LV_MV_OUTPUT_CTL, + !!value << REG_LV_MV_OUTPUT_CTL_SHIFT); + if (ret < 0) + return ret; + } + /* Set the right pull (no pull) */ ret = pmic_reg_write(dev->parent, gpio_base + REG_DIG_PULL_CTL, REG_DIG_PULL_NO_PU); @@ -118,19 +152,30 @@ static int qcom_gpio_get_function(struct udevice *dev, unsigned offset) uint32_t gpio_base = priv->pid + REG_OFFSET(offset); int reg; - /* Set the output value of the gpio */ reg = pmic_reg_read(dev->parent, gpio_base + REG_CTL); if (reg < 0) return reg; - switch (reg & REG_CTL_MODE_MASK) { - case REG_CTL_MODE_INPUT: - return GPIOF_INPUT; - case REG_CTL_MODE_INOUT: /* Fallthrough */ - case REG_CTL_MODE_OUTPUT: - return GPIOF_OUTPUT; - default: - return GPIOF_UNKNOWN; + if (priv->lv_mv_type) { + switch (reg & REG_CTL_LV_MV_MODE_MASK) { + case REG_CTL_LV_MV_MODE_INPUT: + return GPIOF_INPUT; + case REG_CTL_LV_MV_MODE_INOUT: /* Fallthrough */ + case REG_CTL_LV_MV_MODE_OUTPUT: + return GPIOF_OUTPUT; + default: + return GPIOF_UNKNOWN; + } + } else { + switch (reg & REG_CTL_MODE_MASK) { + case REG_CTL_MODE_INPUT: + return GPIOF_INPUT; + case REG_CTL_MODE_INOUT: /* Fallthrough */ + case REG_CTL_MODE_OUTPUT: + return GPIOF_OUTPUT; + default: + return GPIOF_UNKNOWN; + } } } @@ -154,8 +199,14 @@ static int qcom_gpio_set_value(struct udevice *dev, unsigned offset, uint32_t gpio_base = priv->pid + REG_OFFSET(offset); /* Set the output value of the gpio */ - return pmic_clrsetbits(dev->parent, gpio_base + REG_CTL, - REG_CTL_OUTPUT_MASK, !!value); + if (priv->lv_mv_type) + return pmic_clrsetbits(dev->parent, + gpio_base + REG_LV_MV_OUTPUT_CTL, + REG_LV_MV_OUTPUT_CTL_MASK, + !!value << REG_LV_MV_OUTPUT_CTL_SHIFT); + else + return pmic_clrsetbits(dev->parent, gpio_base + REG_CTL, + REG_CTL_OUTPUT_MASK, !!value); } static const struct dm_gpio_ops qcom_gpio_ops = { @@ -177,13 +228,17 @@ static int qcom_gpio_probe(struct udevice *dev) /* Do a sanity check */ reg = pmic_reg_read(dev->parent, priv->pid + REG_TYPE); - if (reg != 0x10) + if (reg != REG_TYPE_VAL) return log_msg_ret("bad type", -ENXIO); reg = pmic_reg_read(dev->parent, priv->pid + REG_SUBTYPE); - if (reg != 0x5 && reg != 0x1) + if (reg != REG_SUBTYPE_GPIO_4CH && reg != REG_SUBTYPE_GPIOC_4CH && + reg != REG_SUBTYPE_GPIO_LV && reg != REG_SUBTYPE_GPIO_MV) return log_msg_ret("bad subtype", -ENXIO); + priv->lv_mv_type = reg == REG_SUBTYPE_GPIO_LV || + reg == REG_SUBTYPE_GPIO_MV; + return 0; } @@ -203,6 +258,7 @@ static const struct udevice_id qcom_gpio_ids[] = { { .compatible = "qcom,pm8916-gpio" }, { .compatible = "qcom,pm8994-gpio" }, /* 22 GPIO's */ { .compatible = "qcom,pm8998-gpio" }, + { .compatible = "qcom,pms405-gpio" }, { } }; From patchwork Thu Aug 4 14:27:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 595332 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp484535maz; Thu, 4 Aug 2022 07:30:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR7yA1iadU90XRQBYXl0+lex9T1q1fkj4jSAggG3iQjYVXqoHqVy10NERXiSzI5Ns8Jma5gO X-Received: by 2002:a92:ca47:0:b0:2de:a702:7a20 with SMTP id q7-20020a92ca47000000b002dea7027a20mr985223ilo.307.1659623412327; Thu, 04 Aug 2022 07:30:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659623412; cv=none; d=google.com; s=arc-20160816; b=jVLQjkRS04yIaQCTT5uZk8D2RMDurUyqaHTSkgWkLCOjPle5pBEc1V8s1Zuo6DlAXF kUcSS4x1PS8onEGt1XymYPTuMjN2J+9CF5NpOQJ60BAhgFIUU3Ft6DG6ZEq6MTBwNkob Vmb9bZvsgMpYvAo+5ywUJNW9jVhMpWZzU3foZA34Q/B18Xw8zRzwbrwJQgrVqM9opAUk FCFetBai3KD4goxSkS/E3lYFAPZq6++SUl0ngBu9tqObQaqtHXP1m7ydt5CQfREdiVd8 bz3+3DJ3F6m+IS1d0uHphXNoJHSKj7qkmXSmXZstmcwesvnP6BXCt3NACCZ5YwtHMuz4 oB3w== 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=yIWM5DObeDSFVOvT3rQTbHbJrMhNLuWr1HQ0dafUi0I=; b=cNV4RqAxeSzkc0WdUUYow5T9pB+sEd30vpIS2udNDqrLU6XxaKDv7hNg9b0qnxhXTb zUX84xR+VhxgU3VZUWzydrPNU/zzAKg5hKv8Jj9MwSdmbPydGVoh7hpl7Yvji/XXLXCc dR3pUqRjmU3Zphnqachbmu5RC2Z9zHSdpbba1mIHPMq0jP98+lvA4tgcij3HLVceI0+f QkcDC0DggW8/2zx80nfzRPi8C/fgtBw1dfR+wgzZ8E1CEG9tmH3v4HrN+3h860+CFe2M AUFd4Mf7+ETMo/br6vZrzB7K+uCMQUzDHKufq2vmkQZojodW9tFYMyeAtR86gKkrp3bm oeJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dhggUOSt; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id y2-20020a056e021be200b002de101e727fsi1251543ilv.116.2022.08.04.07.30.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:30:12 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dhggUOSt; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 0B4DF8486B; Thu, 4 Aug 2022 16:29:12 +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="dhggUOSt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F1F798486F; Thu, 4 Aug 2022 16:29:09 +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-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) (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 5C6C38486F for ; Thu, 4 Aug 2022 16:29: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=sumit.garg@linaro.org Received: by mail-pf1-x431.google.com with SMTP id u133so12844048pfc.10 for ; Thu, 04 Aug 2022 07:29:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yIWM5DObeDSFVOvT3rQTbHbJrMhNLuWr1HQ0dafUi0I=; b=dhggUOStMwYg4dcoGpwQqtLDuF3U4O4XnKnITW0OukU7sosTdH1QKH3Law7nVSKxOR 4lVFVpkysBdhYi3+hK/Ki4dsLPfufxBCPySeEJK4ENwV9TlAgperLf/IvaoBKpVJ39u0 FyVyh1ZmlA9l7TFDx+swXBAy+m88QTZGSsAd0rdk8NQTuzLPPc8FMzHfmKKlJRCiXuml Q623jKSNFvkP09jQji4kgjREgKZV524fJGmU/Ja38lZJT/fBCe4JftzoOdHNSYqTVzdF QD8b85yGJaXpFrYYLO4X6ilkWGJleciOgb+1TUmS07PKrR7xXfOLedg7MEIocvDoS4Kr eLIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yIWM5DObeDSFVOvT3rQTbHbJrMhNLuWr1HQ0dafUi0I=; b=Kl/32Yu9Y/MIsutIaMaJAKyaRypyOW1r+Bed/rQSuFA+N1HCUzeM3FniXevX7yhU2o Y4JxHfwXm3zowA0WA1YFij23nBJWQPtiX1xtdzA/f0BMpfVGbv1l3FiEV6Wzspkx1GEo w6yhoxzGNv01ZoZXcX2ZDI4Jv04ScPj4IWFYHP2wwbrqTqHc4X1rq9+dr+XYpJimoJeY cM06IsYdOxLOakJZInT7BOPB1UOgCwtRyaflyCwum9usE/xE33RDkOjHb+WQDO0fCjlw 9WCNw+q3IaI2iqTTvU1nWh5S/MS0B3YmPXD6MUSLkkyG6FMJ5NG7xe7WEv8z9EGGLLls vh4w== X-Gm-Message-State: ACgBeo1vrw+yHoLmjXWe7Jdoi5P22BqtNj1FSHzVBb9NfQCcifp6SYsy Ub22ggGCFvCa2QwYyCYHd1ZjvCwtfPip1w== X-Received: by 2002:aa7:88d1:0:b0:52e:f8e:aab5 with SMTP id k17-20020aa788d1000000b0052e0f8eaab5mr2227296pff.63.1659623345487; Thu, 04 Aug 2022 07:29:05 -0700 (PDT) Received: from localhost.localdomain ([122.162.196.218]) by smtp.gmail.com with ESMTPSA id h185-20020a6253c2000000b0052cdb06c125sm1013549pfb.159.2022.08.04.07.28.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:29:05 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: rfried.dev@gmail.com, jorge.ramirez.ortiz@gmail.com, sjg@chromium.org, trini@konsulko.com, stephan@gerhold.net, mario.six@gdsys.cc, dsankouski@gmail.com, robert.marko@sartura.hr, luka.kovacic@sartura.hr, luka.perkov@sartura.hr, jh80.chung@samsung.com, nicolas.dechesne@linaro.org, vinod.koul@linaro.org, mworsfold@impinj.com, lgillham@impinj.com, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH 11/13] dts: qcs404-evb: Add PMIC GPIO controller node Date: Thu, 4 Aug 2022 19:57:19 +0530 Message-Id: <20220804142721.536556-12-sumit.garg@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804142721.536556-1-sumit.garg@linaro.org> References: <20220804142721.536556-1-sumit.garg@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.6 at phobos.denx.de X-Virus-Status: Clean PMIC GPIOs are special GPIOs which are accessible through SPMI bus. So add corresponding DT nodes. Signed-off-by: Sumit Garg --- arch/arm/dts/qcs404-evb.dts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/arm/dts/qcs404-evb.dts b/arch/arm/dts/qcs404-evb.dts index 2e3a0c6958..0639af8fe3 100644 --- a/arch/arm/dts/qcs404-evb.dts +++ b/arch/arm/dts/qcs404-evb.dts @@ -168,6 +168,31 @@ maximum-speed = "high-speed"; }; }; + + spmi@200f000 { + compatible = "qcom,spmi-pmic-arb"; + reg = <0x200f000 0x1000 + 0x2400000 0x400000 + 0x2c00000 0x400000>; + #address-cells = <0x1>; + #size-cells = <0x1>; + + pms405_0: pms405@0 { + compatible = "qcom,spmi-pmic"; + reg = <0x0 0x1>; + #address-cells = <0x1>; + #size-cells = <0x1>; + + pms405_gpios: pms405_gpios@c000 { + compatible = "qcom,pms405-gpio"; + reg = <0xc000 0x400>; + gpio-controller; + gpio-count = <12>; + #gpio-cells = <2>; + gpio-bank-name="pmic"; + }; + }; + }; }; }; From patchwork Thu Aug 4 14:27:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 595333 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp484709maz; Thu, 4 Aug 2022 07:30:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR7TOvJ2dllSPyZJ/xuY6h0eGR62to6WqrSq3/8Rn7JIrJp8DPN8hAsiahybNEzunYV7Z4Cs X-Received: by 2002:a6b:c3c3:0:b0:67f:f487:987e with SMTP id t186-20020a6bc3c3000000b0067ff487987emr894550iof.0.1659623423531; Thu, 04 Aug 2022 07:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659623423; cv=none; d=google.com; s=arc-20160816; b=Q8IVaEnm+rYp7bWeceI6f1HRzcR/PHtUGBzJrP0K/2kJ5wN4pvlKZBbE//a0g4+M2X PoKEMGclEzIwpC4iCP5/KSYzcGwVM1Mq3wG40BSIjCkhfSfJXs5rC/Y6eOzARQVXqfS3 ZOIKNKCsgdnd1sEflbjXh3YSEHr5Jn24/mGoyB5xfjBBaWA+jvtiCVwdzs67ztsoEJQg eA+iopcau2eNK/2BOKpBamcSi+ie3OPiE7QooprDXaffMzJf9oqW8qDazwsYAIDOILgE JWRpflLRMGmxz3jO8MpRklGXwqsVv4L5MDnhY0ic2RxDwwfu7r7y54oPl3A4RhqnaYby wFxA== 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=Ww/ChQlSZtm4GQEIVVvjedI8VyEY7u19rBa29ITtpgk=; b=VGOBW0bNbIb9p8vsc0prUyia8l85dgYv91GuW5t6Rbe8eAov/+rz+CwbiJJBurdUcg Sir4OSFvYNkSr4dcboI+UJfUxAy+ZfoufWR7tULUrgjMr1KsbGrjFEpsAdkEhbpB/PQu bVmeEwNxuaAUhZ46KnbHF1R3uFpFxuSudv7XUYa516PBUj4Tcv3NrKDUGp0WWe+d+3Cr KuXQ9fbKYdydUbbJSQ+YfcfdpDwcQGwJggO6nRASEMpEOoJStfj6zzALH3Jxc78y+ols Hr5bdAKUhFNVomKx8pgNnVUXfwzUDbHlnBf/WVgSPZVf1AbpHJ9o8weUgQ1LA/z+VgAj 7Hvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FdTPhqnp; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id i5-20020a92df05000000b002df0ad8e54esi1227505ilp.168.2022.08.04.07.30.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:30:23 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FdTPhqnp; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 3E9A784878; Thu, 4 Aug 2022 16:29:18 +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="FdTPhqnp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DCF1B84871; Thu, 4 Aug 2022 16:29:16 +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-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) (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 7AEC384886 for ; Thu, 4 Aug 2022 16:29:14 +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=sumit.garg@linaro.org Received: by mail-pj1-x102f.google.com with SMTP id t2-20020a17090a4e4200b001f21572f3a4so5857896pjl.0 for ; Thu, 04 Aug 2022 07:29:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ww/ChQlSZtm4GQEIVVvjedI8VyEY7u19rBa29ITtpgk=; b=FdTPhqnpiKUds1Kgni0fhHozTrH/EVZVsjgb8vK6HgRWlhWSpodgSYeNGZdEERWylS Y4Wwpu845WlXqz4o9s+TGYZAJCZ1dev8OOl8h/acjoLYEk9tbamqIyHb5J2u0zOp2SZL 9LkDDe+nxdrZZnCknPu3jYhsPF6f3VO+5kMyIW7EqWE1rxk7dCrrdLhAA/w0yZlvn1uF 2b8OnH3h1nc9u4iibOeolUcr1g+169IK9QWV9HYCRA2CIwtMRQ7daJHry+yCEQFBXPLj 5fDXFskP35mncSvQWYOMwVOy/UoF4IlkwjzpmlCldBQU2lK7Rf5in/9SF4sSg0RxcLIo x7bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ww/ChQlSZtm4GQEIVVvjedI8VyEY7u19rBa29ITtpgk=; b=nFRJa1l+nfeBJfwwiBy3l5tyE03lmAerxj0TLiJGbtQnQpXY+VcCtOcSnb+e6M41TX k+pTXjJGOvsEych1RuX8kQ082Iu/41d8jUmpNLc/EnAam28L7V2TDyaBG+ZP1KpcxPC3 uHhl4JANY8hCyUn3QQpmWBVsGKxAyUgfhFIILwyF9tAUtQrJHs6Mv6+Za9RcFyBY9FKj IcwaqXVfW7rqfjUpwDe1ZQjkqF9fzrBYZEGPbs+GIWe15WbCrkGxTceckElz2Tf2qu1T sDVUhY4Wg8TCqHZXW/VQyMevgOsE8I8srMFbG1KJFAbbDsVXKisyvrnYLDi2AuBwPOSD bmOA== X-Gm-Message-State: ACgBeo39Kjn7j02rc+BTCwg/NHNXolgAxF3P9xTNHcmUlHIOz6BvSMsh 0js39mRctOp/Kmgp6jArH+T70qwJ8bUKzQ== X-Received: by 2002:a17:902:b58a:b0:16e:f91a:486b with SMTP id a10-20020a170902b58a00b0016ef91a486bmr2229631pls.119.1659623352680; Thu, 04 Aug 2022 07:29:12 -0700 (PDT) Received: from localhost.localdomain ([122.162.196.218]) by smtp.gmail.com with ESMTPSA id h185-20020a6253c2000000b0052cdb06c125sm1013549pfb.159.2022.08.04.07.29.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:29:12 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: rfried.dev@gmail.com, jorge.ramirez.ortiz@gmail.com, sjg@chromium.org, trini@konsulko.com, stephan@gerhold.net, mario.six@gdsys.cc, dsankouski@gmail.com, robert.marko@sartura.hr, luka.kovacic@sartura.hr, luka.perkov@sartura.hr, jh80.chung@samsung.com, nicolas.dechesne@linaro.org, vinod.koul@linaro.org, mworsfold@impinj.com, lgillham@impinj.com, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH 12/13] board: qcs404-evb: Enable USB3 specific PMIC GPIO Date: Thu, 4 Aug 2022 19:57:20 +0530 Message-Id: <20220804142721.536556-13-sumit.garg@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804142721.536556-1-sumit.garg@linaro.org> References: <20220804142721.536556-1-sumit.garg@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.6 at phobos.denx.de X-Virus-Status: Clean For USB3 host controller to detect devices on the bus it is required to enable a PMIC GPIO: usb_vbus_boost_pin. So enable that during board specific initialization. And since this PMIC GPIO parsing is quite u-boot specific, so add a DT override to qcs404-evb-uboot.dtsi to represent usb_vbus_boost_pin. Signed-off-by: Sumit Garg --- arch/arm/dts/qcs404-evb-uboot.dtsi | 6 ++++++ board/qualcomm/qcs404-evb/qcs404-evb.c | 29 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/arch/arm/dts/qcs404-evb-uboot.dtsi b/arch/arm/dts/qcs404-evb-uboot.dtsi index c18080a483..c73d71e8c7 100644 --- a/arch/arm/dts/qcs404-evb-uboot.dtsi +++ b/arch/arm/dts/qcs404-evb-uboot.dtsi @@ -22,3 +22,9 @@ }; }; }; + +&pms405_gpios { + usb_vbus_boost_pin { + gpios = <&pms405_gpios 2 0>; + }; +}; diff --git a/board/qualcomm/qcs404-evb/qcs404-evb.c b/board/qualcomm/qcs404-evb/qcs404-evb.c index f1e6e7f7eb..249dca7e72 100644 --- a/board/qualcomm/qcs404-evb/qcs404-evb.c +++ b/board/qualcomm/qcs404-evb/qcs404-evb.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -24,6 +25,34 @@ int dram_init(void) int board_init(void) { + struct udevice *pmic_gpio; + struct gpio_desc usb_vbus_boost_pin; + int ret, node; + + ret = uclass_get_device_by_name(UCLASS_GPIO, + "pms405_gpios@c000", + &pmic_gpio); + if (ret < 0) { + printf("Failed to find pms405_gpios@c000 node.\n"); + return ret; + } + + node = fdt_subnode_offset(gd->fdt_blob, dev_of_offset(pmic_gpio), + "usb_vbus_boost_pin"); + if (node < 0) { + printf("Failed to find usb_hub_reset_pm dt node.\n"); + return node; + } + ret = gpio_request_by_name_nodev(offset_to_ofnode(node), "gpios", 0, + &usb_vbus_boost_pin, 0); + if (ret < 0) { + printf("Failed to request usb_hub_reset_pm gpio.\n"); + return ret; + } + + dm_gpio_set_dir_flags(&usb_vbus_boost_pin, + GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE); + return 0; } From patchwork Thu Aug 4 14:27:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 595334 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp484923maz; Thu, 4 Aug 2022 07:30:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR4kLfy/ASrCgCbHdOsWO4gvdpVWiZ5f6bRLQfzikAPCa1CjjwO0kqwXMqPnUFG6zKJqu0lV X-Received: by 2002:a05:6638:25cb:b0:341:6546:1534 with SMTP id u11-20020a05663825cb00b0034165461534mr945942jat.308.1659623435558; Thu, 04 Aug 2022 07:30:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659623435; cv=none; d=google.com; s=arc-20160816; b=Sb/Okj0ju/as1jj29i28FxLaWUunf4yJysjVMEtB1lC7FtsP0itXBIu/sfKYfdxtr7 H8CnMkGC1HgsurIh78208ZIRJnkvr0ytJn4FRJIuWt1hRpK9M34+rrNK5zZSuhHBPDrT xGTrUx/S/lCm8StM/YvD2JPEEidQEr3IyOcW914Cu2TW/zbsFp0Qn+LH4hiK5aMQdZAJ qmTtzoVFqDqQXoieqhn55Ari+4YlVN/LB7tSSBD3WY6U9JhkGgNxKs971cfqD5/CgyxO D8bKZ9/IdosEiUjowtGxyGj8dAE2EEJDJbwETc4Ax0mkz/0FVWqeHKsIwBdx1SoV+wGf TR2w== 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=tCBV+cKT2X3q/bYf/GfJaCD+awMXY/QS/2+raukO8uQ=; b=BznmqxTtRJTUKZTcf6k/ffpBpSH/7JCMc2DzoVrFS1ddf2g78RuU7Ng1AjG+yRCJ6Q +xUxddtQJu1NhkK4oMHhmPNbwaX7n0mAbFlAGqtIUzV+5pfzQNHYK5eBxe3QM8labPDR 45DQ1eGjahGgFU81Lz2BzquCR65JnzkQWgEQRv7FpXAPDuXoZqLag+10R8KLb7AI4esw 4BICs6N5uT18Sm3BkSsrImtXQvqc+jmiJUu2ecjZBFo3RAwi6F2f/Y0PI6+oxwqCYUdK z/NfdWtokKbHleggK9zLJDB5LAAzp/uRkTvzLyDA9nSd2gnPRxzSm0Wi3HvU+sx9A+EH DqNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f76ZUVlX; 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 e1-20020a926901000000b002dd1b437acfsi967146ilc.77.2022.08.04.07.30.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:30:35 -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=f76ZUVlX; 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 55B0B84880; Thu, 4 Aug 2022 16:29:26 +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="f76ZUVlX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A0CD884886; Thu, 4 Aug 2022 16:29:24 +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, UPPERCASE_50_75 autolearn=no autolearn_force=no version=3.4.2 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) (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 4653084880 for ; Thu, 4 Aug 2022 16:29: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=sumit.garg@linaro.org Received: by mail-pj1-x102a.google.com with SMTP id x2-20020a17090ab00200b001f4da5cdc9cso5506557pjq.0 for ; Thu, 04 Aug 2022 07:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tCBV+cKT2X3q/bYf/GfJaCD+awMXY/QS/2+raukO8uQ=; b=f76ZUVlX7NLXd2F2RQmzNlekRp430K/aEWEdweLFkHpmk6V6Za3GBPL1RQcCPjmqi7 WBbvul5HQs3HB1Lx7ZEX4EBpzLmYumN8he0gtePHngySVmVS3sQ8T5IMP353TpLPjVj5 2oyCqpS9MfgYCNWMD46ytQHXJZr3emFhTCJZ1MdlytD8iv+pNiT+hqLhIWHAdDmdOSXl 9kdzLGhcyk81S0bTuRY3P7JHWlr+q04uZb0f5JZfXD7bcBs3oPpzvuZsqmAu/tfwvD7S l6NMEJupLF4tXZ3nE6INLHQywBxTy02XdYTJmdASOIX762PEslz3wZbNGrLL+lzIprZp Lkfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tCBV+cKT2X3q/bYf/GfJaCD+awMXY/QS/2+raukO8uQ=; b=Hs2PUFRZLeTSsv6GgA7Mq3SKrDCIEW/8KwchGVWiVyc2xV9TjOZi/jT7ocEsrm59ay V9HB0hKwjkk7OIyEtFTmNY8xZ8bPo2zbSfFw0+8uxLt6YtmjlLD71YpIKYYScA3w7RJj YYMrrabi8JdxT7h/UUEifP4j159zIlIILMMXvrKoNc1KgZjfNsQdvae4ygf8OTMzldCo LtZyX7E86MhACGe5a79eg40f/pYiS73HTPzIwdV7eeziG34goJfh9PCEOnOpyn1mpv+r M/b7qUwRLp9VCSxOpgfNqyNFpYXEFYaDjIw28YWLW3klN98HSp6uSI3U5kYo77s59YF3 xI+Q== X-Gm-Message-State: ACgBeo3eTJjqjpXNwdQJ0JKJV+G/yyOLVH+x5dVKXZ2yVGzNPTlBp5uS zZeE6AuWhN3aBvscS6Er9P5eoxaYgVFRCA== X-Received: by 2002:a17:90b:384e:b0:1f5:6330:8294 with SMTP id nl14-20020a17090b384e00b001f563308294mr4044933pjb.35.1659623360284; Thu, 04 Aug 2022 07:29:20 -0700 (PDT) Received: from localhost.localdomain ([122.162.196.218]) by smtp.gmail.com with ESMTPSA id h185-20020a6253c2000000b0052cdb06c125sm1013549pfb.159.2022.08.04.07.29.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:29:19 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: rfried.dev@gmail.com, jorge.ramirez.ortiz@gmail.com, sjg@chromium.org, trini@konsulko.com, stephan@gerhold.net, mario.six@gdsys.cc, dsankouski@gmail.com, robert.marko@sartura.hr, luka.kovacic@sartura.hr, luka.perkov@sartura.hr, jh80.chung@samsung.com, nicolas.dechesne@linaro.org, vinod.koul@linaro.org, mworsfold@impinj.com, lgillham@impinj.com, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH 13/13] qcs404evb_defconfig: Enable USB configs Date: Thu, 4 Aug 2022 19:57:21 +0530 Message-Id: <20220804142721.536556-14-sumit.garg@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804142721.536556-1-sumit.garg@linaro.org> References: <20220804142721.536556-1-sumit.garg@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.6 at phobos.denx.de X-Virus-Status: Clean Enable USB config options along with its dependencies like PHY, RESET, PMIC GPIO etc. config options. Signed-off-by: Sumit Garg --- configs/qcs404evb_defconfig | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/configs/qcs404evb_defconfig b/configs/qcs404evb_defconfig index d45f6b2348..432d5d50c1 100644 --- a/configs/qcs404evb_defconfig +++ b/configs/qcs404evb_defconfig @@ -27,6 +27,7 @@ CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y +CONFIG_CMD_USB=y # CONFIG_NET is not set CONFIG_CLK=y CONFIG_MMC_HS400_SUPPORT=y @@ -35,4 +36,21 @@ CONFIG_MMC_SDHCI_ADMA=y CONFIG_MMC_SDHCI_MSM=y CONFIG_PINCTRL=y CONFIG_MSM_SERIAL=y +CONFIG_SPMI_MSM=y +CONFIG_DM_PMIC=y +CONFIG_PMIC_QCOM=y +CONFIG_QCOM_PMIC_GPIO=y +CONFIG_MISC=y +CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_STORAGE=y +CONFIG_USB_DWC3=y +CONFIG_USB_DWC3_GENERIC=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_DWC3=y +CONFIG_DM_RESET=y +CONFIG_RESET_QCOM=y +CONFIG_PHY=y +CONFIG_PHY_QCOM_USB_HS_28NM=y +CONFIG_PHY_QCOM_USB_SS=y CONFIG_LMB_MAX_REGIONS=64