From patchwork Thu Sep 10 11:09:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 1361521 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=iru9shyo; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BnGP83085z9sSJ for ; Thu, 10 Sep 2020 21:09:32 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A9A0F82314; Thu, 10 Sep 2020 13:09:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sartura.hr 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=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.b="iru9shyo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2AB1E82314; Thu, 10 Sep 2020 13:09:20 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,UPPERCASE_50_75,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) (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 B1F0E81F67 for ; Thu, 10 Sep 2020 13:09:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=robert.marko@sartura.hr Received: by mail-ej1-x641.google.com with SMTP id i22so8094620eja.5 for ; Thu, 10 Sep 2020 04:09:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=d9UfuC63eJESndMGNognzByUB0qjoj5wn9bKfodECpE=; b=iru9shyopgvGj233X3S3HKKBwpm/7mCiVZDegZeQZcx4VEZlzk790f1EcsWzSFZ1cy OkX24NDX1WGa24nGUBy0z27IRNIBBoRPr0/8kXbdhG9RN6Al1BVDWNkd5HHtZ3VjeVAJ UnB//ZAyL1H9fNnRphJGBwmXoZ2Jlunb8ExDeayy7JXgAVgYBJokVCcbGFEe1cSHs+Ii s/S8iZ6HYxWfRvU1WfHCT/PcixXLgt9QaMfF9MSBNDAl51z9cjHmI0ev0jGrVziW9S40 syCMlQM85fHsVvPuwb2KhdguZlNFDQez92nmpSTuuB10JKFnffoT/anehyZZgpVlcGgR Whpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=d9UfuC63eJESndMGNognzByUB0qjoj5wn9bKfodECpE=; b=VoqoEfa+giP9Brju4BffjSZ3nWs2wwnNTMEKZLqvJ5b2F/xPu0TkWHNiJ3UHgd3NlH szBKTLy05WiXWD3NZ1bJfBgvNVo+20js2LomvfQG1iBbbyJbqyOtFs38iaHaspVQiWM7 A4gfG2OiDiwGjXyvdRG0w2hCIvf/p6UN557lh530AV8qIEzDs1K+/R+HusWcT5QNEvO9 yRSHJrWQ2K4oDci8RvjZJEvGUbPnFpcGABM0RGCtR9ZbR6TOLyqV9iftWRaT0UVV/+Hr cXjyQyDmY8YHKqd8bNEEoD7hL7bExxFCyxsGHVwcG7GcqGIFF2setgjvW6joxkbdeDw/ dF/w== X-Gm-Message-State: AOAM532ufQZyhTEo7ynXGa3rucTvscO5VhtMVXDGzyglfCn3OMBD6c+p TnyFE4KtNEvYfI11RyUy6sL4KWDh1k9ThRBFGrmu0f0S816JxN5biEjf4rC80OClaz9CVFccZIL OiUAsHo5Op6HCAbn0VQ8oj+fxLI+67qqAEv6L0uC4mvgBNqNmOnOexXOvdU8tPeO3NRXuO9rk X-Google-Smtp-Source: ABdhPJzETBb4Qd/9Gg7XSR9ghy0O+mI0CyIh94ThOY5ouievlgY4ehJmq4mkc0WWZvHHRjDXpBeWXQ== X-Received: by 2002:a17:906:4c51:: with SMTP id d17mr8040088ejw.28.1599736156911; Thu, 10 Sep 2020 04:09:16 -0700 (PDT) Received: from localhost.localdomain (dh207-97-133.xnet.hr. [88.207.97.133]) by smtp.googlemail.com with ESMTPSA id z21sm6499564eja.72.2020.09.10.04.09.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 04:09:16 -0700 (PDT) From: Robert Marko To: u-boot@lists.denx.de Cc: Robert Marko , Luka Perkov Subject: [PATCH v2 1/8] dt-bindings: clock: import Qualcomm IPQ4019 bindings Date: Thu, 10 Sep 2020 13:09:01 +0200 Message-Id: <20200910110908.67881-2-robert.marko@sartura.hr> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200910110908.67881-1-robert.marko@sartura.hr> References: <20200910110908.67881-1-robert.marko@sartura.hr> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean Import Qualcomm IPQ4019 GCC bindings from Linux. This will enable using bindings instead of raw clock numbers both in the driver and DTS like Linux does. Signed-off-by: Robert Marko Cc: Luka Perkov --- MAINTAINERS | 1 + include/dt-bindings/clock/qcom,ipq4019-gcc.h | 96 ++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 include/dt-bindings/clock/qcom,ipq4019-gcc.h diff --git a/MAINTAINERS b/MAINTAINERS index 101f4e185d..fa73c4e025 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -237,6 +237,7 @@ M: Luka Kovacic M: Luka Perkov S: Maintained F: arch/arm/mach-ipq40xx/ +F: include/dt-bindings/clock/qcom,ipq4019-gcc.h ARM MARVELL KIRKWOOD ARMADA-XP ARMADA-38X ARMADA-37XX ARMADA-7K/8K M: Stefan Roese diff --git a/include/dt-bindings/clock/qcom,ipq4019-gcc.h b/include/dt-bindings/clock/qcom,ipq4019-gcc.h new file mode 100644 index 0000000000..7130e222e4 --- /dev/null +++ b/include/dt-bindings/clock/qcom,ipq4019-gcc.h @@ -0,0 +1,96 @@ +/* Copyright (c) 2015 The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +#ifndef __QCOM_CLK_IPQ4019_H__ +#define __QCOM_CLK_IPQ4019_H__ + +#define GCC_DUMMY_CLK 0 +#define AUDIO_CLK_SRC 1 +#define BLSP1_QUP1_I2C_APPS_CLK_SRC 2 +#define BLSP1_QUP1_SPI_APPS_CLK_SRC 3 +#define BLSP1_QUP2_I2C_APPS_CLK_SRC 4 +#define BLSP1_QUP2_SPI_APPS_CLK_SRC 5 +#define BLSP1_UART1_APPS_CLK_SRC 6 +#define BLSP1_UART2_APPS_CLK_SRC 7 +#define GCC_USB3_MOCK_UTMI_CLK_SRC 8 +#define GCC_APPS_CLK_SRC 9 +#define GCC_APPS_AHB_CLK_SRC 10 +#define GP1_CLK_SRC 11 +#define GP2_CLK_SRC 12 +#define GP3_CLK_SRC 13 +#define SDCC1_APPS_CLK_SRC 14 +#define FEPHY_125M_DLY_CLK_SRC 15 +#define WCSS2G_CLK_SRC 16 +#define WCSS5G_CLK_SRC 17 +#define GCC_APSS_AHB_CLK 18 +#define GCC_AUDIO_AHB_CLK 19 +#define GCC_AUDIO_PWM_CLK 20 +#define GCC_BLSP1_AHB_CLK 21 +#define GCC_BLSP1_QUP1_I2C_APPS_CLK 22 +#define GCC_BLSP1_QUP1_SPI_APPS_CLK 23 +#define GCC_BLSP1_QUP2_I2C_APPS_CLK 24 +#define GCC_BLSP1_QUP2_SPI_APPS_CLK 25 +#define GCC_BLSP1_UART1_APPS_CLK 26 +#define GCC_BLSP1_UART2_APPS_CLK 27 +#define GCC_DCD_XO_CLK 28 +#define GCC_GP1_CLK 29 +#define GCC_GP2_CLK 30 +#define GCC_GP3_CLK 31 +#define GCC_BOOT_ROM_AHB_CLK 32 +#define GCC_CRYPTO_AHB_CLK 33 +#define GCC_CRYPTO_AXI_CLK 34 +#define GCC_CRYPTO_CLK 35 +#define GCC_ESS_CLK 36 +#define GCC_IMEM_AXI_CLK 37 +#define GCC_IMEM_CFG_AHB_CLK 38 +#define GCC_PCIE_AHB_CLK 39 +#define GCC_PCIE_AXI_M_CLK 40 +#define GCC_PCIE_AXI_S_CLK 41 +#define GCC_PCNOC_AHB_CLK 42 +#define GCC_PRNG_AHB_CLK 43 +#define GCC_QPIC_AHB_CLK 44 +#define GCC_QPIC_CLK 45 +#define GCC_SDCC1_AHB_CLK 46 +#define GCC_SDCC1_APPS_CLK 47 +#define GCC_SNOC_PCNOC_AHB_CLK 48 +#define GCC_SYS_NOC_125M_CLK 49 +#define GCC_SYS_NOC_AXI_CLK 50 +#define GCC_TCSR_AHB_CLK 51 +#define GCC_TLMM_AHB_CLK 52 +#define GCC_USB2_MASTER_CLK 53 +#define GCC_USB2_SLEEP_CLK 54 +#define GCC_USB2_MOCK_UTMI_CLK 55 +#define GCC_USB3_MASTER_CLK 56 +#define GCC_USB3_SLEEP_CLK 57 +#define GCC_USB3_MOCK_UTMI_CLK 58 +#define GCC_WCSS2G_CLK 59 +#define GCC_WCSS2G_REF_CLK 60 +#define GCC_WCSS2G_RTC_CLK 61 +#define GCC_WCSS5G_CLK 62 +#define GCC_WCSS5G_REF_CLK 63 +#define GCC_WCSS5G_RTC_CLK 64 +#define GCC_APSS_DDRPLL_VCO 65 +#define GCC_SDCC_PLLDIV_CLK 66 +#define GCC_FEPLL_VCO 67 +#define GCC_FEPLL125_CLK 68 +#define GCC_FEPLL125DLY_CLK 69 +#define GCC_FEPLL200_CLK 70 +#define GCC_FEPLL500_CLK 71 +#define GCC_FEPLL_WCSS2G_CLK 72 +#define GCC_FEPLL_WCSS5G_CLK 73 +#define GCC_APSS_CPU_PLLDIV_CLK 74 +#define GCC_PCNOC_AHB_CLK_SRC 75 + +#endif From patchwork Thu Sep 10 11:09:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 1361522 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=OFtS2Omz; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BnGPN0Sm7z9sSJ for ; Thu, 10 Sep 2020 21:09:43 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8296682329; Thu, 10 Sep 2020 13:09:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sartura.hr 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=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.b="OFtS2Omz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6DDDC82316; Thu, 10 Sep 2020 13:09:21 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) (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 136A581260 for ; Thu, 10 Sep 2020 13:09:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=robert.marko@sartura.hr Received: by mail-ej1-x641.google.com with SMTP id nw23so8087569ejb.4 for ; Thu, 10 Sep 2020 04:09:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+IgE86ahwb2/JSHGl6IqPs8qQVq9kV6evYDG7lIaIOM=; b=OFtS2Omz0W07m1D1uyAuzxqq+OBapRV/SpluXEwMvSNd2rlOI4YhRbl6JS2v9ci3wt EXPBC2GIi2gQ4EfAB3HO1ufarKvBiKAxciRnsQL+IoMWL+SOoGK5FAhper13RJrCI94a 7EAsWpQOvJ99w52kBCe7hSxAwBKJnCH1RTNJhU9p0efHZxqpWia+0Dw7mzx5gUnJ8xTS lIACkNARiE8fPIuMrZfaa5KUF97usWolMs2L8F3jZXas53tdt8MGPPhu5mWbxCBAzLbH lO+BfggpQqZlENoOEeOhP18NsvnnOpUQ8dUuEPFYuSEzUBMITc5NLiGXlV41qETCLu25 A9oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+IgE86ahwb2/JSHGl6IqPs8qQVq9kV6evYDG7lIaIOM=; b=TnzX+VO4kbp7kr2TRP70+bAotYXxRYdewD+Ju3eSJVqhl2z+Nq2Ho8r1s5j9OG5XFS my4YAVCNyngzVnufevYl0OLhaWkCXKkt0fmpj3zbWU0Kcl+22ED1z8oxm1SKJXb03E/w S2NAUhCOMia1bAgMO8wMXHlgW3y2sUx6z/H5BR2d4nd6I0ef5BP4ZWOHsPLdGANW47Gv 9x3JIlwJ6JF7EB2xVN94JIQ25njqYHQ5mc2Ed0ZNnqrmrKu8Z1TYWadRsd083gwlz6kV BtDRVIP4lNtHRmCDQN74b/RLtpkOExnrYaXzDlhwEV3Wh3ibR+oRoCf44NUzsfbaOjmu gDRg== X-Gm-Message-State: AOAM530ywTbEFoHQsm8siJhGuuqMT8o8heV/P2Wmpdxhfqmi+m1JffrY vXw+7dsFQocHM6eZw03R0mgzhdopgjtXZWLtLwYSuaT+1hhRQ4Wnd8PpQZT91phzgj4dnv1EAWz SY3sLDsnfvSh/Cg+SDvTE4dMTgHSzDJDzobEEe6jJmnFSyPogWjhLRkjSrN33Oklp87ZkpZAL X-Google-Smtp-Source: ABdhPJw85Qk9hJZbLf6ZOZxvCsv0TCXZ7jBpNkCZlC1OXxRVYEdaxueOlGZgyZeJgsrfdmHKXHvPrQ== X-Received: by 2002:a17:906:b881:: with SMTP id hb1mr8002936ejb.207.1599736158370; Thu, 10 Sep 2020 04:09:18 -0700 (PDT) Received: from localhost.localdomain (dh207-97-133.xnet.hr. [88.207.97.133]) by smtp.googlemail.com with ESMTPSA id z21sm6499564eja.72.2020.09.10.04.09.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 04:09:17 -0700 (PDT) From: Robert Marko To: u-boot@lists.denx.de Cc: Robert Marko , Luka Perkov Subject: [PATCH v2 2/8] IPQ40xx: clk: Use dt-bindings instead of hardcoding Date: Thu, 10 Sep 2020 13:09:02 +0200 Message-Id: <20200910110908.67881-3-robert.marko@sartura.hr> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200910110908.67881-1-robert.marko@sartura.hr> References: <20200910110908.67881-1-robert.marko@sartura.hr> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean Its common to use dt-bindings instead of hard-coding clocks or resets. So lets use the imported Linux GCC bindings on IPQ40xx target. Signed-off-by: Robert Marko Cc: Luka Perkov --- arch/arm/dts/qcom-ipq4019.dtsi | 3 ++- arch/arm/mach-ipq40xx/clock-ipq4019.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm/dts/qcom-ipq4019.dtsi b/arch/arm/dts/qcom-ipq4019.dtsi index 5f78bc5ab9..7b3b5e0248 100644 --- a/arch/arm/dts/qcom-ipq4019.dtsi +++ b/arch/arm/dts/qcom-ipq4019.dtsi @@ -10,6 +10,7 @@ #include "skeleton.dtsi" #include #include +#include / { #address-cells = <1>; @@ -61,7 +62,7 @@ blsp1_uart1: serial@78af000 { compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm"; reg = <0x78af000 0x200>; - clock = <&gcc 26>; + clock = <&gcc GCC_BLSP1_UART1_APPS_CLK>; bit-rate = <0xFF>; status = "disabled"; u-boot,dm-pre-reloc; diff --git a/arch/arm/mach-ipq40xx/clock-ipq4019.c b/arch/arm/mach-ipq40xx/clock-ipq4019.c index 7cf98a203c..83a688e625 100644 --- a/arch/arm/mach-ipq40xx/clock-ipq4019.c +++ b/arch/arm/mach-ipq40xx/clock-ipq4019.c @@ -13,6 +13,8 @@ #include #include +#include + struct msm_clk_priv { phys_addr_t base; }; @@ -20,7 +22,7 @@ struct msm_clk_priv { ulong msm_set_rate(struct clk *clk, ulong rate) { switch (clk->id) { - case 26: /*UART1*/ + case GCC_BLSP1_UART1_APPS_CLK: /*UART1*/ /* This clock is already initialized by SBL1 */ return 0; break; From patchwork Thu Sep 10 11:09:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 1361524 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=ZIM+Iud0; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BnGPb6zgRz9sTp for ; Thu, 10 Sep 2020 21:09:54 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7D5728233E; Thu, 10 Sep 2020 13:09:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sartura.hr 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=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.b="ZIM+Iud0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DE6A982338; Thu, 10 Sep 2020 13:09:22 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) (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 7A419822FB for ; Thu, 10 Sep 2020 13:09:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=robert.marko@sartura.hr Received: by mail-ej1-x643.google.com with SMTP id e23so8101299eja.3 for ; Thu, 10 Sep 2020 04:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2mF5V9WsGy/J36E9ZlfVjdQK7aTyahRXokv0dn4vI6A=; b=ZIM+Iud0SmIQnBuHYcAUlGi2QvYGAGkr3+sYSRUn+KhxvznslKZxTBiife+ky3Uokh PfkYFyX3WM0/R/u0qtqdoEOL0bKVy6MPPlB0iXYJWgbATijNJk7RZuxy7D2ZKLRg/8I1 6N2LqybLpHXzPqavRx3K3t8QcUjhd/kbYfS6qwWkyfw/VDC91dG5/ws7f9+9fPhq8oZo 7I5ecpiaYhzSaGIGNmdbIpJ5nUIvfKlDUMnLSarZJBROA329EOVT+m2qLx5MQc0UiRMk +L6MqzshNy6Zk3GJYv0R9JHkZNfSdUNp/jrhPIndabWVJ2kYgouECZHWw/25Oxn/UUF5 GamQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2mF5V9WsGy/J36E9ZlfVjdQK7aTyahRXokv0dn4vI6A=; b=W19W+P0NxVT4aYDAL6f1BlwFEHTioIzNGrpS9Fd1gbqHOG+3aDxC8rzreOvSQ7wqfn OQk3qAMopdzrAYGzALKvNpNJxPPQEb3NRIrnoOlsvefnVERYlpdlptK9gk9mCTSiFMPU lKzTZbpmg0/aCLKkpHl8Q/xeUwxLT9DwDlT4AskBbjLXjQqziWn0gYleoxKd/2crW9Cf SwCBD8Ohc2rWno3Avh6uYOwFLQuyhIKt1mVqv/rtH0yIMv7CYpox1Rw0qTlijCcevsfZ fStS21H8TAd2yTYUvHIDM9a2DXg2vgyLLW4b910XvBvOUQes46tC0AoDuxkvaLVfrTfw DxiQ== X-Gm-Message-State: AOAM532nuhGLJ/+fY5TBECEqiwVyCxv6KXZfwk9uqx/khTgfyzdKrPvp o9a9KWnrDAZ7XsH6GRDv7sxIwbNznQf3viFDSZFMlrvhqykU11PzJvltfvuqdfz9wTJCzdlkGVS e1HogwL7m2XmgJF3mVsDz89CLqTfOoaUCk4F1z+5INwX3deEGO+fZjf0I4E48Yp7rFOL0jjVO X-Google-Smtp-Source: ABdhPJwpbEBQUGWKHa+O6vpBO1hrtY1fDF6PVznxZOO85AbFSulacBKSqnTpL8BHQ34v6DKNrg9Zcg== X-Received: by 2002:a17:906:4f16:: with SMTP id t22mr8076370eju.40.1599736159889; Thu, 10 Sep 2020 04:09:19 -0700 (PDT) Received: from localhost.localdomain (dh207-97-133.xnet.hr. [88.207.97.133]) by smtp.googlemail.com with ESMTPSA id z21sm6499564eja.72.2020.09.10.04.09.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 04:09:19 -0700 (PDT) From: Robert Marko To: u-boot@lists.denx.de Cc: Robert Marko , Luka Perkov Subject: [PATCH v2 3/8] IPQ40xx: Add SMEM support Date: Thu, 10 Sep 2020 13:09:03 +0200 Message-Id: <20200910110908.67881-4-robert.marko@sartura.hr> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200910110908.67881-1-robert.marko@sartura.hr> References: <20200910110908.67881-1-robert.marko@sartura.hr> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean There is already existing driver for SMEM so lets enable it for IPQ40xx as well. Signed-off-by: Robert Marko Cc: Luka Perkov --- arch/arm/Kconfig | 2 ++ arch/arm/dts/qcom-ipq4019.dtsi | 5 +++++ drivers/smem/Kconfig | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 80702c23d3..ee378f03f4 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -767,8 +767,10 @@ config ARCH_IPQ40XX select DM select DM_GPIO select DM_SERIAL + select MSM_SMEM select PINCTRL select CLK + select SMEM select OF_CONTROL imply CMD_DM diff --git a/arch/arm/dts/qcom-ipq4019.dtsi b/arch/arm/dts/qcom-ipq4019.dtsi index 7b3b5e0248..dd69d0a5b2 100644 --- a/arch/arm/dts/qcom-ipq4019.dtsi +++ b/arch/arm/dts/qcom-ipq4019.dtsi @@ -39,6 +39,11 @@ }; }; + smem { + compatible = "qcom,smem"; + memory-region = <&smem_mem>; + }; + soc: soc { #address-cells = <1>; #size-cells = <1>; diff --git a/drivers/smem/Kconfig b/drivers/smem/Kconfig index 7169d0f205..73d51b3a7a 100644 --- a/drivers/smem/Kconfig +++ b/drivers/smem/Kconfig @@ -15,7 +15,7 @@ config SANDBOX_SMEM config MSM_SMEM bool "Qualcomm Shared Memory Manager (SMEM)" depends on DM - depends on ARCH_SNAPDRAGON + depends on ARCH_SNAPDRAGON || ARCH_IPQ40XX help Enable support for the Qualcomm Shared Memory Manager. The driver provides an interface to items in a heap shared among all From patchwork Thu Sep 10 11:09:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 1361525 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=tfD6uRH/; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BnGPn5Q4kz9sSJ for ; Thu, 10 Sep 2020 21:10:05 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9B8428233B; Thu, 10 Sep 2020 13:09:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sartura.hr 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=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.b="tfD6uRH/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D944A8233D; Thu, 10 Sep 2020 13:09: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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) (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 ECFFF82320 for ; Thu, 10 Sep 2020 13:09:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=robert.marko@sartura.hr Received: by mail-ed1-x544.google.com with SMTP id b12so5859275edz.11 for ; Thu, 10 Sep 2020 04:09:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3kruodkdiH6fo3nf5Q7zIvtg1bDLA8fuds3eoVd8oB4=; b=tfD6uRH/uCrz0A+R0i4OuxG9agCqI+opBXUsmXCLAUQKZ0RmxRC3tJsTJOf++Lqj1I QyqI0ixW/W4VdqwPvAy6NcEF8LqKKFhHkSUVIfa211VMqUNWGAqvA6WVSexMfFrn4RIa dvMB40ZXQXaaclfP6ZzYNqWX6Zopk2xz01PSqzWDD3PcjGWBmGzgtDrAOtgwb79Nhe6j mM2uD3vKNOa4QQFqL5qvs2dawLbgLH/J1kek5oqb2lAiF0lJxHVXt6WzDVnX2WvUBgmc icorRMKKM2TJiol35prCcLENXo883BJhUkm6IsX48KERj+LBm+9xktSLtRfNvi6Ft9dK kSNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3kruodkdiH6fo3nf5Q7zIvtg1bDLA8fuds3eoVd8oB4=; b=HLZ6CpA8I6VUsqEGQcYvaDdYO3snVL18exqDMtncFlPY6QnXbEKrerc+m2xMLvYyu3 eBo5nxH+06AQzDo+FcXFpwMBCQZA8bihQxwJMob93czE0CgMlUevkOtdqQhwpnvf5QHe Mp1DmnD3IJMB1+jKNRBZ0O8gzudbCB4t2sw5eROw85sXDEp4PJXBSXGnxdAVf14mxGM8 7Bhc6PavJLa9jvb4OhlMm6GlCqti9/a4W43c1Ghnl0pkgvqCCHIcUVgnM4iU614HTMb/ 3LbunvbxWMdLPndLgMwhJTM4CH6CnTlSUryfurLF992EVMNn2lOLnkAPxNew9dvhCPTx eByw== X-Gm-Message-State: AOAM530RqEB2DCyGl0HGDcTu7S6VfoqF+ll3sAGzh5I30kRWV3RvS9SQ w3NDEXj/7OGCZ81zRJ/M7x7eXj3CqiaqqiS7qozTsvQH6T5qZZ7weonpA4ffsRKzqcAXiqx9+32 AXDTUHN0Vzpimgj0z3cjnxZBC+F6/A4BRrWiuCH0HU2GZ3MQ3ayR+SK2x7Za6UCyC0jsodYcQ X-Google-Smtp-Source: ABdhPJywF9QjZF8htixeDKJXfzwv+gFfFiSrIbfztChWHdxrV8blqJlP6zZjBmhI0+fBoAC3qfP+Ug== X-Received: by 2002:a05:6402:17fc:: with SMTP id t28mr7404154edy.244.1599736161118; Thu, 10 Sep 2020 04:09:21 -0700 (PDT) Received: from localhost.localdomain (dh207-97-133.xnet.hr. [88.207.97.133]) by smtp.googlemail.com with ESMTPSA id z21sm6499564eja.72.2020.09.10.04.09.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 04:09:20 -0700 (PDT) From: Robert Marko To: u-boot@lists.denx.de Cc: Robert Marko , Luka Perkov Subject: [PATCH v2 4/8] reset: Add IPQ40xx reset controller driver Date: Thu, 10 Sep 2020 13:09:04 +0200 Message-Id: <20200910110908.67881-5-robert.marko@sartura.hr> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200910110908.67881-1-robert.marko@sartura.hr> References: <20200910110908.67881-1-robert.marko@sartura.hr> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean On Qualcomm IPQ40xx SoC series, GCC clock IP also handles the resets. So since this will be needed by further drivers, lets add a driver for the reset controller. Signed-off-by: Robert Marko Cc: Luka Perkov --- MAINTAINERS | 2 + drivers/reset/Kconfig | 8 + drivers/reset/Makefile | 1 + drivers/reset/reset-ipq4019.c | 173 ++++++++++++++++++ .../dt-bindings/reset/qcom,ipq4019-reset.h | 92 ++++++++++ 5 files changed, 276 insertions(+) create mode 100644 drivers/reset/reset-ipq4019.c create mode 100644 include/dt-bindings/reset/qcom,ipq4019-reset.h diff --git a/MAINTAINERS b/MAINTAINERS index fa73c4e025..1f00d5fced 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -238,6 +238,8 @@ M: Luka Perkov S: Maintained F: arch/arm/mach-ipq40xx/ F: include/dt-bindings/clock/qcom,ipq4019-gcc.h +F: include/dt-bindings/reset/qcom,ipq4019-reset.h +F: drivers/reset/reset-ipq4019.c ARM MARVELL KIRKWOOD ARMADA-XP ARMADA-38X ARMADA-37XX ARMADA-7K/8K M: Stefan Roese diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index 253902ff57..3fdfe4a6cb 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig @@ -148,6 +148,14 @@ 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 + default y + help + Support for reset controller on Qualcomm + IPQ40xx SoCs. + config RESET_SIFIVE bool "Reset Driver for SiFive SoC's" depends on DM_RESET && CLK_SIFIVE_FU540_PRCI && TARGET_SIFIVE_FU540 diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile index 3c7f066ae3..5176da5885 100644 --- a/drivers/reset/Makefile +++ b/drivers/reset/Makefile @@ -23,6 +23,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_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-ipq4019.c new file mode 100644 index 0000000000..f216db4ce5 --- /dev/null +++ b/drivers/reset/reset-ipq4019.c @@ -0,0 +1,173 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2020 Sartura Ltd. + * + * Author: Robert Marko + * + * Based on Linux driver + */ + +#include +#include +#include +#include +#include +#include +#include + +struct ipq4019_reset_priv { + phys_addr_t base; +}; + +struct qcom_reset_map { + unsigned int reg; + u8 bit; +}; + +static const struct qcom_reset_map gcc_ipq4019_resets[] = { + [WIFI0_CPU_INIT_RESET] = { 0x1f008, 5 }, + [WIFI0_RADIO_SRIF_RESET] = { 0x1f008, 4 }, + [WIFI0_RADIO_WARM_RESET] = { 0x1f008, 3 }, + [WIFI0_RADIO_COLD_RESET] = { 0x1f008, 2 }, + [WIFI0_CORE_WARM_RESET] = { 0x1f008, 1 }, + [WIFI0_CORE_COLD_RESET] = { 0x1f008, 0 }, + [WIFI1_CPU_INIT_RESET] = { 0x20008, 5 }, + [WIFI1_RADIO_SRIF_RESET] = { 0x20008, 4 }, + [WIFI1_RADIO_WARM_RESET] = { 0x20008, 3 }, + [WIFI1_RADIO_COLD_RESET] = { 0x20008, 2 }, + [WIFI1_CORE_WARM_RESET] = { 0x20008, 1 }, + [WIFI1_CORE_COLD_RESET] = { 0x20008, 0 }, + [USB3_UNIPHY_PHY_ARES] = { 0x1e038, 5 }, + [USB3_HSPHY_POR_ARES] = { 0x1e038, 4 }, + [USB3_HSPHY_S_ARES] = { 0x1e038, 2 }, + [USB2_HSPHY_POR_ARES] = { 0x1e01c, 4 }, + [USB2_HSPHY_S_ARES] = { 0x1e01c, 2 }, + [PCIE_PHY_AHB_ARES] = { 0x1d010, 11 }, + [PCIE_AHB_ARES] = { 0x1d010, 10 }, + [PCIE_PWR_ARES] = { 0x1d010, 9 }, + [PCIE_PIPE_STICKY_ARES] = { 0x1d010, 8 }, + [PCIE_AXI_M_STICKY_ARES] = { 0x1d010, 7 }, + [PCIE_PHY_ARES] = { 0x1d010, 6 }, + [PCIE_PARF_XPU_ARES] = { 0x1d010, 5 }, + [PCIE_AXI_S_XPU_ARES] = { 0x1d010, 4 }, + [PCIE_AXI_M_VMIDMT_ARES] = { 0x1d010, 3 }, + [PCIE_PIPE_ARES] = { 0x1d010, 2 }, + [PCIE_AXI_S_ARES] = { 0x1d010, 1 }, + [PCIE_AXI_M_ARES] = { 0x1d010, 0 }, + [ESS_RESET] = { 0x12008, 0}, + [GCC_BLSP1_BCR] = {0x01000, 0}, + [GCC_BLSP1_QUP1_BCR] = {0x02000, 0}, + [GCC_BLSP1_UART1_BCR] = {0x02038, 0}, + [GCC_BLSP1_QUP2_BCR] = {0x03008, 0}, + [GCC_BLSP1_UART2_BCR] = {0x03028, 0}, + [GCC_BIMC_BCR] = {0x04000, 0}, + [GCC_TLMM_BCR] = {0x05000, 0}, + [GCC_IMEM_BCR] = {0x0E000, 0}, + [GCC_ESS_BCR] = {0x12008, 0}, + [GCC_PRNG_BCR] = {0x13000, 0}, + [GCC_BOOT_ROM_BCR] = {0x13008, 0}, + [GCC_CRYPTO_BCR] = {0x16000, 0}, + [GCC_SDCC1_BCR] = {0x18000, 0}, + [GCC_SEC_CTRL_BCR] = {0x1A000, 0}, + [GCC_AUDIO_BCR] = {0x1B008, 0}, + [GCC_QPIC_BCR] = {0x1C000, 0}, + [GCC_PCIE_BCR] = {0x1D000, 0}, + [GCC_USB2_BCR] = {0x1E008, 0}, + [GCC_USB2_PHY_BCR] = {0x1E018, 0}, + [GCC_USB3_BCR] = {0x1E024, 0}, + [GCC_USB3_PHY_BCR] = {0x1E034, 0}, + [GCC_SYSTEM_NOC_BCR] = {0x21000, 0}, + [GCC_PCNOC_BCR] = {0x2102C, 0}, + [GCC_DCD_BCR] = {0x21038, 0}, + [GCC_SNOC_BUS_TIMEOUT0_BCR] = {0x21064, 0}, + [GCC_SNOC_BUS_TIMEOUT1_BCR] = {0x2106C, 0}, + [GCC_SNOC_BUS_TIMEOUT2_BCR] = {0x21074, 0}, + [GCC_SNOC_BUS_TIMEOUT3_BCR] = {0x2107C, 0}, + [GCC_PCNOC_BUS_TIMEOUT0_BCR] = {0x21084, 0}, + [GCC_PCNOC_BUS_TIMEOUT1_BCR] = {0x2108C, 0}, + [GCC_PCNOC_BUS_TIMEOUT2_BCR] = {0x21094, 0}, + [GCC_PCNOC_BUS_TIMEOUT3_BCR] = {0x2109C, 0}, + [GCC_PCNOC_BUS_TIMEOUT4_BCR] = {0x210A4, 0}, + [GCC_PCNOC_BUS_TIMEOUT5_BCR] = {0x210AC, 0}, + [GCC_PCNOC_BUS_TIMEOUT6_BCR] = {0x210B4, 0}, + [GCC_PCNOC_BUS_TIMEOUT7_BCR] = {0x210BC, 0}, + [GCC_PCNOC_BUS_TIMEOUT8_BCR] = {0x210C4, 0}, + [GCC_PCNOC_BUS_TIMEOUT9_BCR] = {0x210CC, 0}, + [GCC_TCSR_BCR] = {0x22000, 0}, + [GCC_MPM_BCR] = {0x24000, 0}, + [GCC_SPDM_BCR] = {0x25000, 0}, +}; + +static int ipq4019_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; + const struct qcom_reset_map *map; + u32 value; + + map = &reset_map[rst->id]; + + value = readl(priv->base + map->reg); + value |= BIT(map->bit); + writel(value, priv->base + map->reg); + + return 0; +} + +static int ipq4019_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; + const struct qcom_reset_map *map; + u32 value; + + map = &reset_map[rst->id]; + + value = readl(priv->base + map->reg); + value &= ~BIT(map->bit); + writel(value, priv->base + map->reg); + + return 0; +} + +static int ipq4019_reset_free(struct reset_ctl *rst) +{ + return 0; +} + +static int ipq4019_reset_request(struct reset_ctl *rst) +{ + return 0; +} + +static const struct reset_ops ipq4019_reset_ops = { + .request = ipq4019_reset_request, + .rfree = ipq4019_reset_free, + .rst_assert = ipq4019_reset_assert, + .rst_deassert = ipq4019_reset_deassert, +}; + +static const struct udevice_id ipq4019_reset_ids[] = { + { .compatible = "qcom,gcc-reset-ipq4019" }, + { } +}; + +static int ipq4019_reset_probe(struct udevice *dev) +{ + struct ipq4019_reset_priv *priv = dev_get_priv(dev); + + priv->base = dev_read_addr(dev); + if (priv->base == FDT_ADDR_T_NONE) + return -EINVAL; + + return 0; +} + +U_BOOT_DRIVER(ipq4019_reset) = { + .name = "ipq4019_reset", + .id = UCLASS_RESET, + .of_match = ipq4019_reset_ids, + .ops = &ipq4019_reset_ops, + .probe = ipq4019_reset_probe, + .priv_auto_alloc_size = sizeof(struct ipq4019_reset_priv), +}; diff --git a/include/dt-bindings/reset/qcom,ipq4019-reset.h b/include/dt-bindings/reset/qcom,ipq4019-reset.h new file mode 100644 index 0000000000..ed047d7402 --- /dev/null +++ b/include/dt-bindings/reset/qcom,ipq4019-reset.h @@ -0,0 +1,92 @@ +/* Copyright (c) 2015 The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +#ifndef __QCOM_RESET_IPQ4019_H__ +#define __QCOM_RESET_IPQ4019_H__ + +#define WIFI0_CPU_INIT_RESET 0 +#define WIFI0_RADIO_SRIF_RESET 1 +#define WIFI0_RADIO_WARM_RESET 2 +#define WIFI0_RADIO_COLD_RESET 3 +#define WIFI0_CORE_WARM_RESET 4 +#define WIFI0_CORE_COLD_RESET 5 +#define WIFI1_CPU_INIT_RESET 6 +#define WIFI1_RADIO_SRIF_RESET 7 +#define WIFI1_RADIO_WARM_RESET 8 +#define WIFI1_RADIO_COLD_RESET 9 +#define WIFI1_CORE_WARM_RESET 10 +#define WIFI1_CORE_COLD_RESET 11 +#define USB3_UNIPHY_PHY_ARES 12 +#define USB3_HSPHY_POR_ARES 13 +#define USB3_HSPHY_S_ARES 14 +#define USB2_HSPHY_POR_ARES 15 +#define USB2_HSPHY_S_ARES 16 +#define PCIE_PHY_AHB_ARES 17 +#define PCIE_AHB_ARES 18 +#define PCIE_PWR_ARES 19 +#define PCIE_PIPE_STICKY_ARES 20 +#define PCIE_AXI_M_STICKY_ARES 21 +#define PCIE_PHY_ARES 22 +#define PCIE_PARF_XPU_ARES 23 +#define PCIE_AXI_S_XPU_ARES 24 +#define PCIE_AXI_M_VMIDMT_ARES 25 +#define PCIE_PIPE_ARES 26 +#define PCIE_AXI_S_ARES 27 +#define PCIE_AXI_M_ARES 28 +#define ESS_RESET 29 +#define GCC_BLSP1_BCR 30 +#define GCC_BLSP1_QUP1_BCR 31 +#define GCC_BLSP1_UART1_BCR 32 +#define GCC_BLSP1_QUP2_BCR 33 +#define GCC_BLSP1_UART2_BCR 34 +#define GCC_BIMC_BCR 35 +#define GCC_TLMM_BCR 36 +#define GCC_IMEM_BCR 37 +#define GCC_ESS_BCR 38 +#define GCC_PRNG_BCR 39 +#define GCC_BOOT_ROM_BCR 40 +#define GCC_CRYPTO_BCR 41 +#define GCC_SDCC1_BCR 42 +#define GCC_SEC_CTRL_BCR 43 +#define GCC_AUDIO_BCR 44 +#define GCC_QPIC_BCR 45 +#define GCC_PCIE_BCR 46 +#define GCC_USB2_BCR 47 +#define GCC_USB2_PHY_BCR 48 +#define GCC_USB3_BCR 49 +#define GCC_USB3_PHY_BCR 50 +#define GCC_SYSTEM_NOC_BCR 51 +#define GCC_PCNOC_BCR 52 +#define GCC_DCD_BCR 53 +#define GCC_SNOC_BUS_TIMEOUT0_BCR 54 +#define GCC_SNOC_BUS_TIMEOUT1_BCR 55 +#define GCC_SNOC_BUS_TIMEOUT2_BCR 56 +#define GCC_SNOC_BUS_TIMEOUT3_BCR 57 +#define GCC_PCNOC_BUS_TIMEOUT0_BCR 58 +#define GCC_PCNOC_BUS_TIMEOUT1_BCR 59 +#define GCC_PCNOC_BUS_TIMEOUT2_BCR 60 +#define GCC_PCNOC_BUS_TIMEOUT3_BCR 61 +#define GCC_PCNOC_BUS_TIMEOUT4_BCR 62 +#define GCC_PCNOC_BUS_TIMEOUT5_BCR 63 +#define GCC_PCNOC_BUS_TIMEOUT6_BCR 64 +#define GCC_PCNOC_BUS_TIMEOUT7_BCR 65 +#define GCC_PCNOC_BUS_TIMEOUT8_BCR 66 +#define GCC_PCNOC_BUS_TIMEOUT9_BCR 67 +#define GCC_TCSR_BCR 68 +#define GCC_QDSS_BCR 69 +#define GCC_MPM_BCR 70 +#define GCC_SPDM_BCR 71 + +#endif From patchwork Thu Sep 10 11:09:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 1361527 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=Vkc2ITrX; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BnGQ12ykBz9sSJ for ; Thu, 10 Sep 2020 21:10:17 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A906B82345; Thu, 10 Sep 2020 13:09:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sartura.hr 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=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.b="Vkc2ITrX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 625F28233E; Thu, 10 Sep 2020 13:09:25 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) (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 10051822FB for ; Thu, 10 Sep 2020 13:09:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=robert.marko@sartura.hr Received: by mail-ed1-x544.google.com with SMTP id g4so5915444edk.0 for ; Thu, 10 Sep 2020 04:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ezax845onFTn9+d1Dy4mgKiesrLxGx3dHJ8DRIo3Ud8=; b=Vkc2ITrXizOBK/wXw6l8YC+5vlM0oy/xrA/C7LJlP7m5spRTSuFm2XbhoQZi/bmUrs XrNd5zUNaMcWeQlVeHpUqoZJ16Mt5K+nbszSh00vgSR0R9EPBWB8mhNHWIuVH6LD/97q qlooCzyFhD/H0T0Cd4XExZrJ8P82LIUOP2mO1Y+6OdQN2Gt+9QRJfB+pLZI9gGuka5ro ZedmnLax+ebCCxndxZ+OLn9/qltgL+CAiwLdeMZBW+akGb59iiLeXzMhPbfJdVpIpEsh R/6s9LvuHw0gblb3gwIEn6DQd+I9yKUroNYRr5ed1np5EzEUt3VkOFbe6ou0Z53XnneU snVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ezax845onFTn9+d1Dy4mgKiesrLxGx3dHJ8DRIo3Ud8=; b=qxH36FkVBU1NmIrqnV1Gt5/+afYRQd0TUwlX6y1Rk3BA279ZoCcv6t284LsU+4rIAA QHROvml0ybLfa2dHoblkqZ7Gj7SgDgRvJtoF647JkrEhD33K3taN1iTqdNH8FLrOkiJF fVAT1kNDLUYYhl9xVfh8fduUS71KG8s5gzKjZeerjtXFhquBl8QTAxZI0sk2S506zeao 8lahxWZgI0bLoKnHL7gxiDk8xvAwMF/OZNL4sohBSNfxiXqQDsiIr+j2zUi8aj63GKBd c1s6+k2GAZCB7ZI2dhIEZtFAaPDUtu7Ir1mR9UoN/8gNvdSKx4GtBIHT1wKuCGrw/wni wvfA== X-Gm-Message-State: AOAM532U6XCPL99lT/77bQ6EbtbjgRD0C87pUNQoTQr15y7DLu1Liuqt vQhKXOL4eI18l2BX8W5iQbh3CMuorAe3TI+63Bcf/vL/4ryts2lxAqQjvPAwUd65mt0Wv+9dS/C XHi7usmCuEfYmmPWzyq7imo1fhI1ofY3RPtO+++Bm1b7+h+EFqLoQjRTd7ogk+XlsZ4dh94jS X-Google-Smtp-Source: ABdhPJzeVqxxnsCLmA9RRIYxjvHUqwBRGdD+sv1znJ7b6IJ3/Nft/nO+NWDZ6M6biFYHCHGQTGzg5g== X-Received: by 2002:aa7:c347:: with SMTP id j7mr9075935edr.185.1599736162486; Thu, 10 Sep 2020 04:09:22 -0700 (PDT) Received: from localhost.localdomain (dh207-97-133.xnet.hr. [88.207.97.133]) by smtp.googlemail.com with ESMTPSA id z21sm6499564eja.72.2020.09.10.04.09.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 04:09:22 -0700 (PDT) From: Robert Marko To: u-boot@lists.denx.de Cc: Robert Marko , Luka Perkov Subject: [PATCH v2 5/8] IPQ40xx: Add reset controller support Date: Thu, 10 Sep 2020 13:09:05 +0200 Message-Id: <20200910110908.67881-6-robert.marko@sartura.hr> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200910110908.67881-1-robert.marko@sartura.hr> References: <20200910110908.67881-1-robert.marko@sartura.hr> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean Since we have a driver for the reset controller, lets add the necessary node. Signed-off-by: Robert Marko Cc: Luka Perkov --- arch/arm/Kconfig | 1 + arch/arm/dts/qcom-ipq4019.dtsi | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ee378f03f4..68d6d1afd6 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -767,6 +767,7 @@ config ARCH_IPQ40XX select DM select DM_GPIO select DM_SERIAL + select DM_RESET select MSM_SMEM select PINCTRL select CLK diff --git a/arch/arm/dts/qcom-ipq4019.dtsi b/arch/arm/dts/qcom-ipq4019.dtsi index dd69d0a5b2..7b15df38d8 100644 --- a/arch/arm/dts/qcom-ipq4019.dtsi +++ b/arch/arm/dts/qcom-ipq4019.dtsi @@ -11,6 +11,7 @@ #include #include #include +#include / { #address-cells = <1>; @@ -58,6 +59,14 @@ u-boot,dm-pre-reloc; }; + reset: gcc-reset@1800000 { + compatible = "qcom,gcc-reset-ipq4019"; + reg = <0x1800000 0x60000>; + #clock-cells = <1>; + #reset-cells = <1>; + u-boot,dm-pre-reloc; + }; + pinctrl: qcom,tlmm@1000000 { compatible = "qcom,tlmm-ipq4019"; reg = <0x1000000 0x300000>; From patchwork Thu Sep 10 11:09:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 1361528 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=GW7RT2VF; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BnGQD0lHNz9sSJ for ; Thu, 10 Sep 2020 21:10:28 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4212A82324; Thu, 10 Sep 2020 13:09:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sartura.hr 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=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.b="GW7RT2VF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BD4B582345; Thu, 10 Sep 2020 13:09:27 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) (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 9852A8233C for ; Thu, 10 Sep 2020 13:09:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=robert.marko@sartura.hr Received: by mail-ej1-x643.google.com with SMTP id i26so8043892ejb.12 for ; Thu, 10 Sep 2020 04:09:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r7qAmLz1HuOf3JACSCz2xfniwIFKfINA7FNwNpXf1QY=; b=GW7RT2VF2H3GVk/24n6BU4Jg42j0RrAEYlxvZnFI8os7sBNy4hU8jNLYd1pEuC0yA3 n5aprs/QGiQwuM9NVsIff+jZ8ABfWdtSjmweCG9Iqnh6piGwOqapjIMc3FcUnT25UGj5 F39i0UrSbVJS2rBEBxYPFc8WuZO8CX89Nh4xb+mmckK6OijWVHchc+G/d2q/r1Fm+qsE o5XY/c3t3Y+fjWxJwdjdvYFBdW338aRDZO89vOHnusQirdUSgdLmu7MEp8fY295FS0DX OYDk8qpvGbJ+PcXLyBYvvP4XTapQDwa7Do96zbiWmyGBE97Kr717Gussp9u2rH0ur7ey +RrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r7qAmLz1HuOf3JACSCz2xfniwIFKfINA7FNwNpXf1QY=; b=esTLlUbC6sL6rtU3f7D62UQwB9v8D52/nCX4t/OmBHDQNUSuLSM/zCWH2TbJ6tOBUy ZD5AWGoNMNAqbUdO0yq6MDW+WfptCn21rfMGCedM8cN7loMtw3TyF5bbhqw7lfwIu4Cf 0Bem3o5DSrVGJVbzwHIxyH3Fb8M26RmNm2pVtwQaRxDkxKQzv3qmJTrLYLhPRy/+3D0h djqTPHX753d51QlP2DbZVZskQv/RqozMmjCfho/E17Nr3g6vQRK6SCdtZtX8sWsa0Now GWQW74fx99vwJHzDgi73RqGkz4f3X1IbFB0dg0fqgi0MTPTlCkO5sOfeQaE+Ld3Y8YgT F9QQ== X-Gm-Message-State: AOAM533lqpskaMFLDDAADXfj4zpgFmY4y6BSn4jZ0bqiKxIHiFh4h4zM VshuMWHjIqYTFLlajbTKn0Rj3QQwjqGtZeddc6bj3qumMBKfTJDre3cZuizreguGKNjKEd7CtTU Woh+qLgRMdp5fVhhj+YNQkaJ7OTyH8ZWWNXAymrMiLNoxsEJUmE5EaRKsjcgTE8jjTiDNzSIA X-Google-Smtp-Source: ABdhPJys4ILu4u1wOUKBh6vwYUJfHJ08u4DwqfAO5oGW530x5n4COCIaXewNiRie6XDYPlbzfSGL1A== X-Received: by 2002:a17:906:1690:: with SMTP id s16mr8075391ejd.122.1599736163878; Thu, 10 Sep 2020 04:09:23 -0700 (PDT) Received: from localhost.localdomain (dh207-97-133.xnet.hr. [88.207.97.133]) by smtp.googlemail.com with ESMTPSA id z21sm6499564eja.72.2020.09.10.04.09.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 04:09:23 -0700 (PDT) From: Robert Marko To: u-boot@lists.denx.de Cc: Robert Marko , Luka Perkov Subject: [PATCH v2 6/8] phy: add driver for Qualcomm IPQ40xx USB PHY Date: Thu, 10 Sep 2020 13:09:06 +0200 Message-Id: <20200910110908.67881-7-robert.marko@sartura.hr> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200910110908.67881-1-robert.marko@sartura.hr> References: <20200910110908.67881-1-robert.marko@sartura.hr> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean Add a driver to setup the USB PHY-s on Qualcomm IPQ40xx series SoCs. The driver sets up HS and SS phys. Signed-off-by: Robert Marko Cc: Luka Perkov --- MAINTAINERS | 1 + drivers/phy/Kconfig | 6 ++ drivers/phy/Makefile | 1 + drivers/phy/phy-qcom-ipq4019-usb.c | 145 +++++++++++++++++++++++++++++ 4 files changed, 153 insertions(+) create mode 100644 drivers/phy/phy-qcom-ipq4019-usb.c diff --git a/MAINTAINERS b/MAINTAINERS index 1f00d5fced..c0e9285124 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -240,6 +240,7 @@ F: arch/arm/mach-ipq40xx/ F: include/dt-bindings/clock/qcom,ipq4019-gcc.h F: include/dt-bindings/reset/qcom,ipq4019-reset.h F: drivers/reset/reset-ipq4019.c +F: drivers/phy/phy-qcom-ipq4019-usb.c ARM MARVELL KIRKWOOD ARMADA-XP ARMADA-38X ARMADA-37XX ARMADA-7K/8K M: Stefan Roese diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index 9c775107e9..8da00a259d 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig @@ -125,6 +125,12 @@ 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 diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile index 74e8d931d3..009f353baf 100644 --- a/drivers/phy/Makefile +++ b/drivers/phy/Makefile @@ -13,6 +13,7 @@ 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 diff --git a/drivers/phy/phy-qcom-ipq4019-usb.c b/drivers/phy/phy-qcom-ipq4019-usb.c new file mode 100644 index 0000000000..465f0d3a01 --- /dev/null +++ b/drivers/phy/phy-qcom-ipq4019-usb.c @@ -0,0 +1,145 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2019 Sartura Ltd. + * + * Author: Robert Marko + * + * Based on Linux driver + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +struct ipq4019_usb_phy { + phys_addr_t base; + struct reset_ctl por_rst; + struct reset_ctl srif_rst; +}; + +static int ipq4019_ss_phy_power_off(struct phy *_phy) +{ + struct ipq4019_usb_phy *phy = dev_get_priv(_phy->dev); + + reset_assert(&phy->por_rst); + mdelay(10); + + return 0; +} + +static int ipq4019_ss_phy_power_on(struct phy *_phy) +{ + struct ipq4019_usb_phy *phy = dev_get_priv(_phy->dev); + + ipq4019_ss_phy_power_off(_phy); + + reset_deassert(&phy->por_rst); + + return 0; +} + +static struct phy_ops ipq4019_usb_ss_phy_ops = { + .power_on = ipq4019_ss_phy_power_on, + .power_off = ipq4019_ss_phy_power_off, +}; + +static int ipq4019_usb_ss_phy_probe(struct udevice *dev) +{ + struct ipq4019_usb_phy *phy = dev_get_priv(dev); + int ret; + + phy->base = dev_read_addr(dev); + if (phy->base == FDT_ADDR_T_NONE) + return -EINVAL; + + ret = reset_get_by_name(dev, "por_rst", &phy->por_rst); + if (ret) + return ret; + + return 0; +} + +static const struct udevice_id ipq4019_usb_ss_phy_ids[] = { + { .compatible = "qcom,usb-ss-ipq4019-phy" }, + { } +}; + +U_BOOT_DRIVER(ipq4019_usb_ss_phy) = { + .name = "ipq4019-usb-ss-phy", + .id = UCLASS_PHY, + .of_match = ipq4019_usb_ss_phy_ids, + .ops = &ipq4019_usb_ss_phy_ops, + .probe = ipq4019_usb_ss_phy_probe, + .priv_auto_alloc_size = sizeof(struct ipq4019_usb_phy), +}; + +static int ipq4019_hs_phy_power_off(struct phy *_phy) +{ + struct ipq4019_usb_phy *phy = dev_get_priv(_phy->dev); + + reset_assert(&phy->por_rst); + mdelay(10); + + reset_assert(&phy->srif_rst); + mdelay(10); + + return 0; +} + +static int ipq4019_hs_phy_power_on(struct phy *_phy) +{ + struct ipq4019_usb_phy *phy = dev_get_priv(_phy->dev); + + ipq4019_hs_phy_power_off(_phy); + + reset_deassert(&phy->srif_rst); + mdelay(10); + + reset_deassert(&phy->por_rst); + + return 0; +} + +static struct phy_ops ipq4019_usb_hs_phy_ops = { + .power_on = ipq4019_hs_phy_power_on, + .power_off = ipq4019_hs_phy_power_off, +}; + +static int ipq4019_usb_hs_phy_probe(struct udevice *dev) +{ + struct ipq4019_usb_phy *phy = dev_get_priv(dev); + int ret; + + phy->base = dev_read_addr(dev); + if (phy->base == FDT_ADDR_T_NONE) + return -EINVAL; + + ret = reset_get_by_name(dev, "por_rst", &phy->por_rst); + if (ret) + return ret; + + ret = reset_get_by_name(dev, "srif_rst", &phy->srif_rst); + if (ret) + return ret; + + return 0; +} + +static const struct udevice_id ipq4019_usb_hs_phy_ids[] = { + { .compatible = "qcom,usb-hs-ipq4019-phy" }, + { } +}; + +U_BOOT_DRIVER(ipq4019_usb_hs_phy) = { + .name = "ipq4019-usb-hs-phy", + .id = UCLASS_PHY, + .of_match = ipq4019_usb_hs_phy_ids, + .ops = &ipq4019_usb_hs_phy_ops, + .probe = ipq4019_usb_hs_phy_probe, + .priv_auto_alloc_size = sizeof(struct ipq4019_usb_phy), +}; From patchwork Thu Sep 10 11:09:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 1361529 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=RZ5DKLzB; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BnGQS2Km7z9sSJ for ; Thu, 10 Sep 2020 21:10:40 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C764882351; Thu, 10 Sep 2020 13:09:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sartura.hr 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=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.b="RZ5DKLzB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3A10982345; Thu, 10 Sep 2020 13:09:28 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) (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 C7392822FB for ; Thu, 10 Sep 2020 13:09:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=robert.marko@sartura.hr Received: by mail-ej1-x643.google.com with SMTP id z23so8036233ejr.13 for ; Thu, 10 Sep 2020 04:09:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=f81Iaihtk7O36AOos9SATvxzQdxuhMOKMyWn8iU1dMw=; b=RZ5DKLzB+f8v60W+AVsxGZfQjJbMa96FMbPdjvNW13vhmLEx55KZbGm3Dm/J61hGEi EncRvfAgR/ESQ+1JWfVwvDDYxE1Ijn76ezCDV+bBJIiWXZPj0C5rxmVsFqOoJZT9HE/l IA0cndBVruks06dy797FYY2gi71fG74IHIBPRrA/0XGO6iN9k9BPf2R067GQdWZtxhJF LE7UuyfeZ+Thyq6VPXyS0Tx5S/EpCzRyNoKFlCCCf7oI8v9o85BSAwMQYl5mMFHAY4py D5ByZmlXIbWw2HMxJb0jCYuqnXNQymdBBDXxZTfpyF+1Twg7skypMVdBIUbz5yQbYGlu 1rnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=f81Iaihtk7O36AOos9SATvxzQdxuhMOKMyWn8iU1dMw=; b=QEqU600Jq//xXOf5jdTCOaTm+Lxv1HlTgd1TStvRcjhwv18HYZdB0luF6AVJLcxwpj T6g30UdNOSVWZbZSISvGnLAEbf6Ux5K+kx/rp6yJJUQ4yIFfSBOnplSQIg8w1jeWJ6I/ +dYedgeWMy9qXgjJdwPtR1zkH3gnkKtTlJ2fija7N2ixahW0PaqCod7GKWSg6WxidsBf rUMNlF2635VThqfse0V0C6sOLIl3TudJtqWQAF6J3ylJYMIH363kZ2Zf1WeHptZ6hBFS lhiShoJgZ4ivV84kRZP9Lhzru3I+xYQhIVvSATC8Ekeomn4p3QAA8EuZuz+NKCQrYnqF YqJA== X-Gm-Message-State: AOAM531aZrYA6Na5WUkxt3q5NeknZIRnWaJ5cvEgDBOmtw4kGQP5x8OJ O701I6oIaHShaHOuplG0XmEIjqwRQyg+52F+N+dOsZfWu5tYkeu1czG2okpQn+BanE/1bFH+CbC FLziW1559k8AvB2MvUcXl5QaKB172K7EokSjocj/vbZCYLZK5C7B70raZyOnqlCaGeYzrF1Hn X-Google-Smtp-Source: ABdhPJx7tN7UUQrDEKPiKCAXgFCCSMn/xUo9jAlYYFwhD8HhxZo7JI5X85v4+/mVIkDep6c0932Yeg== X-Received: by 2002:a17:907:72c2:: with SMTP id du2mr8630118ejc.512.1599736165145; Thu, 10 Sep 2020 04:09:25 -0700 (PDT) Received: from localhost.localdomain (dh207-97-133.xnet.hr. [88.207.97.133]) by smtp.googlemail.com with ESMTPSA id z21sm6499564eja.72.2020.09.10.04.09.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 04:09:24 -0700 (PDT) From: Robert Marko To: u-boot@lists.denx.de Cc: Robert Marko , Luka Perkov Subject: [PATCH v2 7/8] usb: dwc3: Add Qualcomm DWC3 compatible string Date: Thu, 10 Sep 2020 13:09:07 +0200 Message-Id: <20200910110908.67881-8-robert.marko@sartura.hr> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200910110908.67881-1-robert.marko@sartura.hr> References: <20200910110908.67881-1-robert.marko@sartura.hr> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean Lot of Qualcomm SoC-s use DWC3 controller for both USB2.0 and USB3.0 ports. Qualcomm has some custom config registers on top of the generic ones, but for host mode these are not needed. So lets add the neccessary compatible string. Signed-off-by: Robert Marko Cc: Luka Perkov --- drivers/usb/dwc3/dwc3-generic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c index 551f682024..7fbf2502fa 100644 --- a/drivers/usb/dwc3/dwc3-generic.c +++ b/drivers/usb/dwc3/dwc3-generic.c @@ -449,6 +449,7 @@ static const struct udevice_id dwc3_glue_ids[] = { { .compatible = "ti,am654-dwc3" }, { .compatible = "rockchip,rk3328-dwc3" }, { .compatible = "rockchip,rk3399-dwc3" }, + { .compatible = "qcom,dwc3" }, { } }; From patchwork Thu Sep 10 11:09:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 1361530 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=hZa+yLmc; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BnGQg5XnKz9sSJ for ; Thu, 10 Sep 2020 21:10:51 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D499A8235D; Thu, 10 Sep 2020 13:09:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sartura.hr 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=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.b="hZa+yLmc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 467E782339; Thu, 10 Sep 2020 13:09:30 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) (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 9E15582339 for ; Thu, 10 Sep 2020 13:09:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=robert.marko@sartura.hr Received: by mail-ej1-x643.google.com with SMTP id e23so8101779eja.3 for ; Thu, 10 Sep 2020 04:09:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Dx+Xr2GWTIpZyHowtXfbwpTfhUp00duJ0d04+mfD6JQ=; b=hZa+yLmc9NOF41YvKoR9fZbSTHSa+dZVXfLd9HI9abrMba/KjrG30qzebso0SsEc5s D49OX5uKRwiLvBAlTNxO4Xgsul15JTOy5QN+KNj92/6fg/+xcFlvGd9yw4DKZdcVBTth I+TwNyTKkKeOfHC596GpRCs+mQ3jgZK2NbzvAvWzeIYGwNJaxNZKNdKNQy4V8RIlvCDM FeEMwpQaRa31qwqjmPx9FCigHPsEiN4eDXukqhJN4TdA7CNpa/cD/fh3vnGIi+beXIJx p9hAAXnXYdj7ILdyuQtfgCXQ0StYW+Y6Ukd2JDfQ5EwrXUV2NKPc5v/bzmGxN5kCxgR8 dqUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Dx+Xr2GWTIpZyHowtXfbwpTfhUp00duJ0d04+mfD6JQ=; b=Y+bGj/Zc5iW81QjtQdijUe2TCPv/DQoXA21VhmqWQRE+HvP/6zeTXtOz+udmf+dHPA agdbecGg+pYln+ZcwyvUdlIF/QzKu3S62e+OT1jaLifxck/mKk7cq9+/CED1xaPrFdFJ +BI+AIpADS2oAHHDBy2qUAvvTQdGwJ4eg8futEloD+8IBgguZFVCSPGISG4kfhgM/N1q T5S4ONJZrKLIPz3HSy3SUShdWFW7zbWIwVDm9Q39be2Su8iCegNc/zWmism8YOiB60up TjekG4toFvvWLFhGczeo+9XpB305DrXNXlMUfSrg1NI02Q66bPk/CyRZQ8deVzNJza65 LvDg== X-Gm-Message-State: AOAM531HzOyI/YX58ibLd8CE88xkBSbXcSJa7mr6849DlBYbbEuXxz3x AwiM6GZxMoP0OVvBfws6VjE7R0LD6mBqa0pYMpEnQLVjepZh0jRLlw0xspav/z2CnLeu17a0SJ8 zXdd0Y7jYkK2BTQqxKONK2WSrlpYjbQBbAhTozLeoKPqXQWsvdjLp30PtgyNwsNwV8ZY1TRYG X-Google-Smtp-Source: ABdhPJxY9gNakCd1zzFjA4PAIs3fH2mbIG5qlV0IDX1o3LTy/pmQpAz2r1SiPP9yn2lQUAtkiy17Jg== X-Received: by 2002:a17:906:813:: with SMTP id e19mr7990449ejd.101.1599736167022; Thu, 10 Sep 2020 04:09:27 -0700 (PDT) Received: from localhost.localdomain (dh207-97-133.xnet.hr. [88.207.97.133]) by smtp.googlemail.com with ESMTPSA id z21sm6499564eja.72.2020.09.10.04.09.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 04:09:26 -0700 (PDT) From: Robert Marko To: u-boot@lists.denx.de Cc: Robert Marko , Luka Perkov Subject: [PATCH v2 8/8] IPQ40xx: Add USB nodes Date: Thu, 10 Sep 2020 13:09:08 +0200 Message-Id: <20200910110908.67881-9-robert.marko@sartura.hr> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200910110908.67881-1-robert.marko@sartura.hr> References: <20200910110908.67881-1-robert.marko@sartura.hr> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean There are drivers to support built in USB controller and PHY-s now, so lets add the USB nodes to DTSI. Signed-off-by: Robert Marko Cc: Luka Perkov --- arch/arm/dts/qcom-ipq4019.dtsi | 76 ++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/arch/arm/dts/qcom-ipq4019.dtsi b/arch/arm/dts/qcom-ipq4019.dtsi index 7b15df38d8..e0e4188e5d 100644 --- a/arch/arm/dts/qcom-ipq4019.dtsi +++ b/arch/arm/dts/qcom-ipq4019.dtsi @@ -90,5 +90,81 @@ gpio-bank-name="soc"; #gpio-cells = <2>; }; + + usb3_ss_phy: ssphy@9a000 { + compatible = "qcom,usb-ss-ipq4019-phy"; + #phy-cells = <0>; + reg = <0x9a000 0x800>; + reg-names = "phy_base"; + resets = <&reset USB3_UNIPHY_PHY_ARES>; + reset-names = "por_rst"; + status = "disabled"; + }; + + usb3_hs_phy: hsphy@a6000 { + compatible = "qcom,usb-hs-ipq4019-phy"; + #phy-cells = <0>; + reg = <0xa6000 0x40>; + reg-names = "phy_base"; + resets = <&reset USB3_HSPHY_POR_ARES>, <&reset USB3_HSPHY_S_ARES>; + reset-names = "por_rst", "srif_rst"; + status = "disabled"; + }; + + usb3: usb3@8af8800 { + compatible = "qcom,dwc3"; + reg = <0x8af8800 0x100>; + #address-cells = <1>; + #size-cells = <1>; + clocks = <&gcc GCC_USB3_MASTER_CLK>, + <&gcc GCC_USB3_SLEEP_CLK>, + <&gcc GCC_USB3_MOCK_UTMI_CLK>; + clock-names = "master", "sleep", "mock_utmi"; + ranges; + status = "disabled"; + + dwc3@8a00000 { + compatible = "snps,dwc3"; + reg = <0x8a00000 0xf8000>; + phys = <&usb3_hs_phy>, <&usb3_ss_phy>; + phy-names = "usb2-phy", "usb3-phy"; + dr_mode = "host"; + maximum-speed = "super-speed"; + snps,dis_u2_susphy_quirk; + }; + }; + + usb2_hs_phy: hsphy@a8000 { + compatible = "qcom,usb-hs-ipq4019-phy"; + #phy-cells = <0>; + reg = <0xa8000 0x40>; + reg-names = "phy_base"; + resets = <&reset USB2_HSPHY_POR_ARES>, <&reset USB2_HSPHY_S_ARES>; + reset-names = "por_rst", "srif_rst"; + status = "disabled"; + }; + + usb2: usb2@60f8800 { + compatible = "qcom,dwc3"; + reg = <0x60f8800 0x100>; + #address-cells = <1>; + #size-cells = <1>; + clocks = <&gcc GCC_USB2_MASTER_CLK>, + <&gcc GCC_USB2_SLEEP_CLK>, + <&gcc GCC_USB2_MOCK_UTMI_CLK>; + clock-names = "master", "sleep", "mock_utmi"; + ranges; + status = "disabled"; + + dwc3@6000000 { + compatible = "snps,dwc3"; + reg = <0x6000000 0xf8000>; + phys = <&usb2_hs_phy>; + phy-names = "usb2-phy"; + dr_mode = "host"; + maximum-speed = "high-speed"; + snps,dis_u2_susphy_quirk; + }; + }; }; };