From patchwork Thu Jun 4 10:09:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 1303428 X-Patchwork-Delegate: ykai007@gmail.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=sntech.de 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 49d1kz0m2cz9sRR for ; Thu, 4 Jun 2020 20:11:07 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4A84281EA9; Thu, 4 Jun 2020 12:09:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id B1AD581E81; Thu, 4 Jun 2020 12: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,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F2A7281E6F for ; Thu, 4 Jun 2020 12:09:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=heiko@sntech.de Received: from ip5f5aa64a.dynamic.kabel-deutschland.de ([95.90.166.74] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgmoA-0003qi-3S; Thu, 04 Jun 2020 12:09:10 +0200 From: Heiko Stuebner To: u-boot@lists.denx.de Cc: sjg@chromium.org, philipp.tomsich@theobroma-systems.com, christoph.muellner@theobroma-systems.com, kever.yang@rock-chips.com, heiko@sntech.de, Heiko Stuebner Subject: [PATCH v2 1/8] arm64: dts: rk3399-puma: fix gpio levels for gmac reset pin Date: Thu, 4 Jun 2020 12:09:01 +0200 Message-Id: <20200604100908.468659-2-heiko@sntech.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200604100908.468659-1-heiko@sntech.de> References: <20200604100908.468659-1-heiko@sntech.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean From: Heiko Stuebner The gmac reset has opposite values for the gpio declaration and the separate reset-active, bring this in line to make u-boot also find the ethernet-phy. This mimics the upstream Linux commit found on https://lore.kernel.org/r/20200603132836.362519-1-heiko@sntech.de Signed-off-by: Heiko Stuebner Reviewed-by: Philipp Tomsich Reviewed-by: Kever Yang --- arch/arm/dts/rk3399-puma.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/dts/rk3399-puma.dtsi b/arch/arm/dts/rk3399-puma.dtsi index 07694b196f..531520e771 100644 --- a/arch/arm/dts/rk3399-puma.dtsi +++ b/arch/arm/dts/rk3399-puma.dtsi @@ -157,7 +157,7 @@ phy-mode = "rgmii"; pinctrl-names = "default"; pinctrl-0 = <&rgmii_pins>; - snps,reset-gpio = <&gpio3 RK_PC0 GPIO_ACTIVE_HIGH>; + snps,reset-gpio = <&gpio3 RK_PC0 GPIO_ACTIVE_LOW>; snps,reset-active-low; snps,reset-delays-us = <0 10000 50000>; tx_delay = <0x10>; From patchwork Thu Jun 4 10:09:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 1303424 X-Patchwork-Delegate: ykai007@gmail.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=sntech.de 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 49d1jz1pbdz9sSc for ; Thu, 4 Jun 2020 20:10:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B6F9381E8E; Thu, 4 Jun 2020 12:09:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id BF10F81E7D; Thu, 4 Jun 2020 12:09:18 +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,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5137281E67 for ; Thu, 4 Jun 2020 12:09:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=heiko@sntech.de Received: from ip5f5aa64a.dynamic.kabel-deutschland.de ([95.90.166.74] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgmoA-0003qi-C6; Thu, 04 Jun 2020 12:09:10 +0200 From: Heiko Stuebner To: u-boot@lists.denx.de Cc: sjg@chromium.org, philipp.tomsich@theobroma-systems.com, christoph.muellner@theobroma-systems.com, kever.yang@rock-chips.com, heiko@sntech.de, Heiko Stuebner Subject: [PATCH v2 2/8] arm64: dts: rk3399-puma: fix gpio levels for vcc5v0-host regulator Date: Thu, 4 Jun 2020 12:09:02 +0200 Message-Id: <20200604100908.468659-3-heiko@sntech.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200604100908.468659-1-heiko@sntech.de> References: <20200604100908.468659-1-heiko@sntech.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean From: Heiko Stuebner The regulator enable-gpio uses opposite values for the declaration vs. the enable_active_low property, breaking the regulator enablement. Make the usbhost-supply work again by bringing them in sync again. This mimics the upstream Linux change found on: http://lore.kernel.org/r/20200604091239.424318-1-heiko@sntech.de Signed-off-by: Heiko Stuebner Reviewed-by: Kever Yang --- arch/arm/dts/rk3399-puma.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/dts/rk3399-puma.dtsi b/arch/arm/dts/rk3399-puma.dtsi index 531520e771..72c06abd27 100644 --- a/arch/arm/dts/rk3399-puma.dtsi +++ b/arch/arm/dts/rk3399-puma.dtsi @@ -101,7 +101,7 @@ vcc5v0_host: vcc5v0-host-regulator { compatible = "regulator-fixed"; - gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>; + gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_LOW>; enable-active-low; pinctrl-names = "default"; pinctrl-0 = <&vcc5v0_host_en>; From patchwork Thu Jun 4 10:09:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 1303421 X-Patchwork-Delegate: ykai007@gmail.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=sntech.de 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) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49d1jG4Xr0z9sRR for ; Thu, 4 Jun 2020 20:09:38 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9870D81E5A; Thu, 4 Jun 2020 12:09:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 871FC81E7A; Thu, 4 Jun 2020 12:09:15 +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,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DFB4581E43 for ; Thu, 4 Jun 2020 12:09:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=heiko@sntech.de Received: from ip5f5aa64a.dynamic.kabel-deutschland.de ([95.90.166.74] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgmoA-0003qi-Kd; Thu, 04 Jun 2020 12:09:10 +0200 From: Heiko Stuebner To: u-boot@lists.denx.de Cc: sjg@chromium.org, philipp.tomsich@theobroma-systems.com, christoph.muellner@theobroma-systems.com, kever.yang@rock-chips.com, heiko@sntech.de, Heiko Stuebner Subject: [PATCH v2 3/8] rockchip: puma: fix indentation for -u-boot.dtsi Date: Thu, 4 Jun 2020 12:09:03 +0200 Message-Id: <20200604100908.468659-4-heiko@sntech.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200604100908.468659-1-heiko@sntech.de> References: <20200604100908.468659-1-heiko@sntech.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean From: Heiko Stuebner Tabs not spaces, so transform it to the common styling. Signed-off-by: Heiko Stuebner Reviewed-by: Philipp Tomsich Reviewed-by: Kever Yang --- arch/arm/dts/rk3399-puma-u-boot.dtsi | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/arch/arm/dts/rk3399-puma-u-boot.dtsi b/arch/arm/dts/rk3399-puma-u-boot.dtsi index 3ad1139833..ddb5fa6e76 100644 --- a/arch/arm/dts/rk3399-puma-u-boot.dtsi +++ b/arch/arm/dts/rk3399-puma-u-boot.dtsi @@ -2,24 +2,24 @@ #include "rk3399-u-boot.dtsi" / { - config { - u-boot,spl-payload-offset = <0x40000>; /* @ 256KB */ - u-boot,mmc-env-offset = <0x4000>; /* @ 16KB */ - u-boot,efi-partition-entries-offset = <0x200000>; /* 2MB */ - u-boot,boot-led = "module_led"; - sysreset-gpio = <&gpio1 RK_PA6 GPIO_ACTIVE_HIGH>; - }; + config { + u-boot,spl-payload-offset = <0x40000>; /* @ 256KB */ + u-boot,mmc-env-offset = <0x4000>; /* @ 16KB */ + u-boot,efi-partition-entries-offset = <0x200000>; /* 2MB */ + u-boot,boot-led = "module_led"; + sysreset-gpio = <&gpio1 RK_PA6 GPIO_ACTIVE_HIGH>; + }; - chosen { - stdout-path = "serial0:115200n8"; - u-boot,spl-boot-order = \ + chosen { + stdout-path = "serial0:115200n8"; + u-boot,spl-boot-order = \ "same-as-spl", &norflash, &sdhci, &sdmmc; - }; + }; - aliases { - spi0 = &spi1; - spi1 = &spi5; - }; + aliases { + spi0 = &spi1; + spi1 = &spi5; + }; /* * The Qseven BIOS_DISABLE signal on the RK3399-Q7 keeps the on-module From patchwork Thu Jun 4 10:09:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 1303422 X-Patchwork-Delegate: ykai007@gmail.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=sntech.de 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 49d1jT3V7Lz9sRR for ; Thu, 4 Jun 2020 20:09:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 46EA181E73; Thu, 4 Jun 2020 12:09:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 3ACC281E7F; Thu, 4 Jun 2020 12:09:18 +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,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 377E181E73 for ; Thu, 4 Jun 2020 12:09:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=heiko@sntech.de Received: from ip5f5aa64a.dynamic.kabel-deutschland.de ([95.90.166.74] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgmoA-0003qi-TC; Thu, 04 Jun 2020 12:09:10 +0200 From: Heiko Stuebner To: u-boot@lists.denx.de Cc: sjg@chromium.org, philipp.tomsich@theobroma-systems.com, christoph.muellner@theobroma-systems.com, kever.yang@rock-chips.com, heiko@sntech.de, Heiko Stuebner Subject: [PATCH v2 4/8] rockchip: puma: fix indentation of misc_init_r Date: Thu, 4 Jun 2020 12:09:04 +0200 Message-Id: <20200604100908.468659-5-heiko@sntech.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200604100908.468659-1-heiko@sntech.de> References: <20200604100908.468659-1-heiko@sntech.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean From: Heiko Stuebner The commit moving puma to the generic cpuid/macaddr helpers used 7 spaces as indentation, so correct that by moving to the required tabs. Fixes: fa177ff0208b ("board: puma: Use rockchip_* helpers to setup cpuid and macaddr") Signed-off-by: Heiko Stuebner Reviewed-by: Philipp Tomsich Reviewed-by: Kever Yang --- .../puma_rk3399/puma-rk3399.c | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c index f7f08ae617..65bb2ad6f2 100644 --- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c +++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c @@ -114,22 +114,22 @@ static int setup_boottargets(void) int misc_init_r(void) { - const u32 cpuid_offset = 0x7; - const u32 cpuid_length = 0x10; - u8 cpuid[cpuid_length]; - int ret; - - ret = rockchip_cpuid_from_efuse(cpuid_offset, cpuid_length, cpuid); - if (ret) - return ret; - - ret = rockchip_cpuid_set(cpuid, cpuid_length); - if (ret) - return ret; - - ret = rockchip_setup_macaddr(); - if (ret) - return ret; + const u32 cpuid_offset = 0x7; + const u32 cpuid_length = 0x10; + u8 cpuid[cpuid_length]; + int ret; + + ret = rockchip_cpuid_from_efuse(cpuid_offset, cpuid_length, cpuid); + if (ret) + return ret; + + ret = rockchip_cpuid_set(cpuid, cpuid_length); + if (ret) + return ret; + + ret = rockchip_setup_macaddr(); + if (ret) + return ret; setup_iodomain(); setup_boottargets(); From patchwork Thu Jun 4 10:09:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 1303426 X-Patchwork-Delegate: ykai007@gmail.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=sntech.de 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 49d1kV14bKz9sRR for ; Thu, 4 Jun 2020 20:10:42 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0415F81E92; Thu, 4 Jun 2020 12:09:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 8DDD781E7E; Thu, 4 Jun 2020 12:09: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=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2B2E481E5A for ; Thu, 4 Jun 2020 12:09:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=heiko@sntech.de Received: from ip5f5aa64a.dynamic.kabel-deutschland.de ([95.90.166.74] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgmoB-0003qi-5W; Thu, 04 Jun 2020 12:09:11 +0200 From: Heiko Stuebner To: u-boot@lists.denx.de Cc: sjg@chromium.org, philipp.tomsich@theobroma-systems.com, christoph.muellner@theobroma-systems.com, kever.yang@rock-chips.com, heiko@sntech.de, Heiko Stuebner Subject: [PATCH v2 5/8] rockchip: puma: reorganize devicetrees to actually work and match upstream Date: Thu, 4 Jun 2020 12:09:05 +0200 Message-Id: <20200604100908.468659-6-heiko@sntech.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200604100908.468659-1-heiko@sntech.de> References: <20200604100908.468659-1-heiko@sntech.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean From: Heiko Stuebner So far the puma dts files only just included the main puma dtsi without handling the actual baseboard and rk3399-puma.dtsi was very much detached from the variant in the mainline Linux kernel. Recent changes resulted in a strange situation with nonworking puma boards. Commit ab800e5a6f28 ("arm: dts: rockchip: puma: move U-Boot specific bits to u-boot.dtsi") moved the sdram include from rk3399-puma-ddrX.dts to new files rk3399-puma-ddrx-u-boot.dtsi which were never included anywhere though. Commit 167efc2c7a46 ("arm64: dts: rk3399: Sync v5.7-rc1 from Linux") replaced the rk3399-puma.dtsi nearly completely, but in the kernel it definitly depends on a baseboard dts to actually enable peripherals like sd-slot, uarts, etc. So to untagle this and bring the whole thing more in line with mainline Linux, bring the rk3399-puma-haikou.dts over as well, drop the separate DDR-option devicetrees and instead replace them with a puma Kconfig option to select and include the needed DDR variant. Signed-off-by: Heiko Stuebner Reviewed-by: Philipp Tomsich --- arch/arm/dts/Makefile | 4 +- arch/arm/dts/rk3399-puma-ddr1333-u-boot.dtsi | 4 - arch/arm/dts/rk3399-puma-ddr1333.dts | 8 - arch/arm/dts/rk3399-puma-ddr1600-u-boot.dtsi | 4 - arch/arm/dts/rk3399-puma-ddr1600.dts | 9 - arch/arm/dts/rk3399-puma-ddr1866-u-boot.dtsi | 4 - arch/arm/dts/rk3399-puma-ddr1866.dts | 8 - arch/arm/dts/rk3399-puma-haikou.dts | 272 +++++++++++++++++++ arch/arm/dts/rk3399-puma-u-boot.dtsi | 11 + board/theobroma-systems/puma_rk3399/Kconfig | 15 + configs/puma-rk3399_defconfig | 2 +- 11 files changed, 300 insertions(+), 41 deletions(-) delete mode 100644 arch/arm/dts/rk3399-puma-ddr1333-u-boot.dtsi delete mode 100644 arch/arm/dts/rk3399-puma-ddr1333.dts delete mode 100644 arch/arm/dts/rk3399-puma-ddr1600-u-boot.dtsi delete mode 100644 arch/arm/dts/rk3399-puma-ddr1600.dts delete mode 100644 arch/arm/dts/rk3399-puma-ddr1866-u-boot.dtsi delete mode 100644 arch/arm/dts/rk3399-puma-ddr1866.dts create mode 100644 arch/arm/dts/rk3399-puma-haikou.dts diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index c6af87cf5e..a66bdb439d 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -130,9 +130,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \ rk3399-nanopi-neo4.dtb \ rk3399-orangepi.dtb \ rk3399-pinebook-pro.dtb \ - rk3399-puma-ddr1333.dtb \ - rk3399-puma-ddr1600.dtb \ - rk3399-puma-ddr1866.dtb \ + rk3399-puma-haikou.dtb \ rk3399-roc-pc.dtb \ rk3399-roc-pc-mezzanine.dtb \ rk3399-rock-pi-4.dtb \ diff --git a/arch/arm/dts/rk3399-puma-ddr1333-u-boot.dtsi b/arch/arm/dts/rk3399-puma-ddr1333-u-boot.dtsi deleted file mode 100644 index 39d3927f49..0000000000 --- a/arch/arm/dts/rk3399-puma-ddr1333-u-boot.dtsi +++ /dev/null @@ -1,4 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -#include "rk3399-puma-u-boot.dtsi" -#include "rk3399-sdram-ddr3-1333.dtsi" diff --git a/arch/arm/dts/rk3399-puma-ddr1333.dts b/arch/arm/dts/rk3399-puma-ddr1333.dts deleted file mode 100644 index 80f27699f4..0000000000 --- a/arch/arm/dts/rk3399-puma-ddr1333.dts +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ OR X11 -/* - * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH - */ - -/dts-v1/; - -#include "rk3399-puma.dtsi" diff --git a/arch/arm/dts/rk3399-puma-ddr1600-u-boot.dtsi b/arch/arm/dts/rk3399-puma-ddr1600-u-boot.dtsi deleted file mode 100644 index be58311dc4..0000000000 --- a/arch/arm/dts/rk3399-puma-ddr1600-u-boot.dtsi +++ /dev/null @@ -1,4 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -#include "rk3399-puma-u-boot.dtsi" -#include "rk3399-sdram-ddr3-1600.dtsi" diff --git a/arch/arm/dts/rk3399-puma-ddr1600.dts b/arch/arm/dts/rk3399-puma-ddr1600.dts deleted file mode 100644 index cb76b0165c..0000000000 --- a/arch/arm/dts/rk3399-puma-ddr1600.dts +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ OR X11 -/* - * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH - */ - -/dts-v1/; - -#include "rk3399-puma.dtsi" -#include "rk3399-u-boot.dtsi" diff --git a/arch/arm/dts/rk3399-puma-ddr1866-u-boot.dtsi b/arch/arm/dts/rk3399-puma-ddr1866-u-boot.dtsi deleted file mode 100644 index 48da076329..0000000000 --- a/arch/arm/dts/rk3399-puma-ddr1866-u-boot.dtsi +++ /dev/null @@ -1,4 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -#include "rk3399-puma-u-boot.dtsi" -#include "rk3399-sdram-ddr3-1866.dtsi" diff --git a/arch/arm/dts/rk3399-puma-ddr1866.dts b/arch/arm/dts/rk3399-puma-ddr1866.dts deleted file mode 100644 index 80f27699f4..0000000000 --- a/arch/arm/dts/rk3399-puma-ddr1866.dts +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ OR X11 -/* - * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH - */ - -/dts-v1/; - -#include "rk3399-puma.dtsi" diff --git a/arch/arm/dts/rk3399-puma-haikou.dts b/arch/arm/dts/rk3399-puma-haikou.dts new file mode 100644 index 0000000000..f23ec02783 --- /dev/null +++ b/arch/arm/dts/rk3399-puma-haikou.dts @@ -0,0 +1,272 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH + */ + +/dts-v1/; +#include "rk3399-puma.dtsi" +#include "rk3399-puma-u-boot.dtsi" + +/ { + model = "Theobroma Systems RK3399-Q7 SoM"; + compatible = "tsd,rk3399-puma-haikou", "rockchip,rk3399"; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + leds { + pinctrl-0 = <&led_pin_module>, <&led_sd_haikou>; + + sd-card-led { + label = "sd_card_led"; + gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mmc0"; + }; + }; + + i2s0-sound { + compatible = "simple-audio-card"; + simple-audio-card,format = "i2s"; + simple-audio-card,name = "Haikou,I2S-codec"; + simple-audio-card,mclk-fs = <512>; + + simple-audio-card,codec { + clocks = <&sgtl5000_clk>; + sound-dai = <&sgtl5000>; + }; + + simple-audio-card,cpu { + bitclock-master; + frame-master; + sound-dai = <&i2s0>; + }; + }; + + sgtl5000_clk: sgtl5000-oscillator { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24576000>; + }; + + dc_12v: dc-12v { + compatible = "regulator-fixed"; + regulator-name = "dc_12v"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + }; + + vcc3v3_baseboard: vcc3v3-baseboard { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3_baseboard"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&dc_12v>; + }; + + vcc5v0_baseboard: vcc5v0-baseboard { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_baseboard"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&dc_12v>; + }; + + vcc5v0_otg: vcc5v0-otg-regulator { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&otg_vbus_drv>; + regulator-name = "vcc5v0_otg"; + regulator-always-on; + }; + + vdda_codec: vdda-codec { + compatible = "regulator-fixed"; + regulator-name = "vdda_codec"; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vcc5v0_baseboard>; + }; + + vddd_codec: vddd-codec { + compatible = "regulator-fixed"; + regulator-name = "vddd_codec"; + regulator-boot-on; + regulator-min-microvolt = <1600000>; + regulator-max-microvolt = <1600000>; + vin-supply = <&vcc5v0_baseboard>; + }; +}; + +&hdmi { + ddc-i2c-bus = <&i2c3>; + status = "okay"; +}; + +&i2c1 { + status = "okay"; + clock-frequency = <400000>; +}; + +&i2c2 { + status = "okay"; + clock-frequency = <400000>; +}; + +&i2c3 { + i2c-scl-rising-time-ns = <450>; + i2c-scl-falling-time-ns = <15>; + status = "okay"; +}; + +&i2c4 { + status = "okay"; + clock-frequency = <400000>; + + sgtl5000: codec@a { + compatible = "fsl,sgtl5000"; + reg = <0x0a>; + clocks = <&sgtl5000_clk>; + #sound-dai-cells = <0>; + VDDA-supply = <&vdda_codec>; + VDDIO-supply = <&vdda_codec>; + VDDD-supply = <&vddd_codec>; + status = "okay"; + }; +}; + +&i2c6 { + status = "okay"; + clock-frequency = <400000>; +}; + +&pcie_phy { + status = "okay"; +}; + +&pcie0 { + ep-gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>; + num-lanes = <4>; + pinctrl-names = "default"; + pinctrl-0 = <&pcie_clkreqn_cpm>; + status = "okay"; +}; + +&pinctrl { + pinctrl-names = "default"; + pinctrl-0 = <&haikou_pin_hog>; + + hog { + haikou_pin_hog: haikou-pin-hog { + rockchip,pins = + /* LID_BTN */ + <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>, + /* BATLOW# */ + <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>, + /* SLP_BTN# */ + <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_up>, + /* BIOS_DISABLE# */ + <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + leds { + led_sd_haikou: led-sd-gpio { + rockchip,pins = + <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + usb2 { + otg_vbus_drv: otg-vbus-drv { + rockchip,pins = + <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; +}; + +&pwm0 { + status = "okay"; +}; + +&sdmmc { + bus-width = <4>; + cap-mmc-highspeed; + cap-sd-highspeed; + cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>; + disable-wp; + max-frequency = <150000000>; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; + vmmc-supply = <&vcc3v3_baseboard>; + status = "okay"; +}; + +&spi5 { + status = "okay"; +}; + +&tcphy0 { + status = "okay"; +}; + +&u2phy0 { + status = "okay"; +}; + +&usbdrd3_0 { + status = "okay"; +}; + +&usbdrd_dwc3_0 { + dr_mode = "otg"; + status = "okay"; +}; + +&u2phy0_host { + phy-supply = <&vcc5v0_otg>; + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>; + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +&usb_host0_ehci { + status = "okay"; +}; + +&usb_host0_ohci { + status = "okay"; +}; + +&vopb { + status = "okay"; +}; + +&vopb_mmu { + status = "okay"; +}; + +&vopl { + status = "okay"; +}; + +&vopl_mmu { + status = "okay"; +}; diff --git a/arch/arm/dts/rk3399-puma-u-boot.dtsi b/arch/arm/dts/rk3399-puma-u-boot.dtsi index ddb5fa6e76..29846c4b00 100644 --- a/arch/arm/dts/rk3399-puma-u-boot.dtsi +++ b/arch/arm/dts/rk3399-puma-u-boot.dtsi @@ -1,6 +1,17 @@ // SPDX-License-Identifier: GPL-2.0+ #include "rk3399-u-boot.dtsi" + +#ifdef CONFIG_TARGET_PUMA_RK3399_RAM_DDR3_1333 +#include "rk3399-sdram-ddr3-1333.dtsi" +#endif +#ifdef CONFIG_TARGET_PUMA_RK3399_RAM_DDR3_1600 +#include "rk3399-sdram-ddr3-1600.dtsi" +#endif +#ifdef CONFIG_TARGET_PUMA_RK3399_RAM_DDR3_1866 +#include "rk3399-sdram-ddr3-1866.dtsi" +#endif + / { config { u-boot,spl-payload-offset = <0x40000>; /* @ 256KB */ diff --git a/board/theobroma-systems/puma_rk3399/Kconfig b/board/theobroma-systems/puma_rk3399/Kconfig index 9e23252754..e82623a170 100644 --- a/board/theobroma-systems/puma_rk3399/Kconfig +++ b/board/theobroma-systems/puma_rk3399/Kconfig @@ -18,4 +18,19 @@ config ENV_SIZE config ENV_OFFSET default 0x3fc000 if ENV_IS_IN_SPI_FLASH +choice + prompt "Theobroma Systems RK3399-Q7 DDR Option" + default TARGET_PUMA_RK3399_RAM_DDR3_1333 + +config TARGET_PUMA_RK3399_RAM_DDR3_1333 + bool "DDR3-1333MHz" + +config TARGET_PUMA_RK3399_RAM_DDR3_1600 + bool "DDR3-1600MHz" + +config TARGET_PUMA_RK3399_RAM_DDR3_1866 + bool "DDR3-1866MHz" + +endchoice + endif diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig index a148832b83..47a60930b6 100644 --- a/configs/puma-rk3399_defconfig +++ b/configs/puma-rk3399_defconfig @@ -39,7 +39,7 @@ CONFIG_CMD_PMIC=y CONFIG_CMD_REGULATOR=y CONFIG_SPL_OF_CONTROL=y CONFIG_OF_LIVE=y -CONFIG_DEFAULT_DEVICE_TREE="rk3399-puma-ddr1600" +CONFIG_DEFAULT_DEVICE_TREE="rk3399-puma-haikou" CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y From patchwork Thu Jun 4 10:09:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 1303425 X-Patchwork-Delegate: ykai007@gmail.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=sntech.de 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 49d1kD3Qqqz9sRR for ; Thu, 4 Jun 2020 20:10:28 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B4AB981E95; Thu, 4 Jun 2020 12:09:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 2FD9A81E73; Thu, 4 Jun 2020 12:09: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=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8066981E79 for ; Thu, 4 Jun 2020 12:09:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=heiko@sntech.de Received: from ip5f5aa64a.dynamic.kabel-deutschland.de ([95.90.166.74] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgmoB-0003qi-Ei; Thu, 04 Jun 2020 12:09:11 +0200 From: Heiko Stuebner To: u-boot@lists.denx.de Cc: sjg@chromium.org, philipp.tomsich@theobroma-systems.com, christoph.muellner@theobroma-systems.com, kever.yang@rock-chips.com, heiko@sntech.de, Heiko Stuebner Subject: [PATCH v2 6/8] rockchip: puma: remove separate fit generator Date: Thu, 4 Jun 2020 12:09:06 +0200 Message-Id: <20200604100908.468659-7-heiko@sntech.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200604100908.468659-1-heiko@sntech.de> References: <20200604100908.468659-1-heiko@sntech.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean From: Heiko Stuebner The introduction of the puma-specific generator was mainly a way to split the pmu firmware from the ATF binary and not having to distribute that 4GB (sparse) image that was created before moving to the bl31.elf as base. Looking at the publically available repository for that separate pmu firmware https://git.theobroma-systems.com/rk3399-cortex-m0.git/ there is also no activity for 3 years and apart from some build customizations no other changes were done. And even then, if changes need to be made, this can very well also happen in the atf context itself, so there is no real need to diverge from the established build procedure and we can just go back to using the main make_fit_atf.py script. Signed-off-by: Heiko Stuebner Reviewed-by: Philipp Tomsich Reviewed-by: Kever Yang --- .../puma_rk3399/fit_spl_atf.sh | 94 ------------------- configs/puma-rk3399_defconfig | 1 - 2 files changed, 95 deletions(-) delete mode 100755 board/theobroma-systems/puma_rk3399/fit_spl_atf.sh diff --git a/board/theobroma-systems/puma_rk3399/fit_spl_atf.sh b/board/theobroma-systems/puma_rk3399/fit_spl_atf.sh deleted file mode 100755 index c9396577a9..0000000000 --- a/board/theobroma-systems/puma_rk3399/fit_spl_atf.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/sh -# -# SPDX-License-Identifier: GPL-2.0+ -# -# Copyright (C) 2019 Jagan Teki -# -# Based on the board/sunxi/mksunxi_fit_atf.sh -# -# Script to generate FIT image source for 64-bit puma boards with -# U-Boot proper, ATF, PMU firmware and devicetree. -# -# usage: $0 [ [&2 - echo "Please read Building section in doc/README.rockchip" >&2 - BL31=/dev/null -fi - -[ -z "$PMUM0" ] && PMUM0="rk3399m0.bin" - -if [ ! -f $PMUM0 ]; then - echo "WARNING: PMUM0 file $PMUM0 NOT found, resulting binary is non-functional" >&2 - echo "Please read Building section in doc/README.rockchip" >&2 - PMUM0=/dev/null -fi - -cat << __HEADER_EOF -/* SPDX-License-Identifier: GPL-2.0+ OR X11 */ -/* - * Copyright (C) 2017 Theobroma Systems Design und Consulting GmbH - * - * Minimal dts for a SPL FIT image payload. - */ - -/dts-v1/; - -/ { - description = "FIT image with U-Boot proper, ATF bl31, M0 Firmware, DTB"; - #address-cells = <1>; - - images { - uboot { - description = "U-Boot (64-bit)"; - data = /incbin/("u-boot-nodtb.bin"); - type = "standalone"; - arch = "arm64"; - compression = "none"; - load = <0x4a000000>; - }; - atf { - description = "ARM Trusted Firmware"; - data = /incbin/("$BL31"); - type = "firmware"; - arch = "arm64"; - os = "arm-trusted-firmware"; - compression = "none"; - load = <0x1000>; - entry = <0x1000>; - }; - pmu { - description = "Cortex-M0 firmware"; - data = /incbin/("$PMUM0"); - type = "pmu-firmware"; - compression = "none"; - load = <0x180000>; - }; - fdt { - description = "RK3399-Q7 (Puma) flat device-tree"; - data = /incbin/("$1"); - type = "flat_dt"; - compression = "none"; - }; -__HEADER_EOF - -cat << __CONF_HEADER_EOF - }; - - configurations { - default = "conf"; - conf { - description = "Theobroma Systems RK3399-Q7 (Puma) SoM"; - firmware = "atf"; - loadables = "uboot", "pmu"; - fdt = "fdt"; - }; -__CONF_HEADER_EOF - -cat << __ITS_EOF - }; -}; -__ITS_EOF diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig index 47a60930b6..31d4eb3471 100644 --- a/configs/puma-rk3399_defconfig +++ b/configs/puma-rk3399_defconfig @@ -14,7 +14,6 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y CONFIG_SPL_TEXT_BASE=0xff8c2000 CONFIG_DEBUG_UART=y -CONFIG_SPL_FIT_GENERATOR="board/theobroma-systems/puma_rk3399/fit_spl_atf.sh" CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-puma-haikou.dtb" CONFIG_MISC_INIT_R=y CONFIG_DISPLAY_BOARDINFO_LATE=y From patchwork Thu Jun 4 10:09:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 1303427 X-Patchwork-Delegate: ykai007@gmail.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=sntech.de 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 49d1kk4LxBz9sRR for ; Thu, 4 Jun 2020 20:10:54 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0C52B81EA2; Thu, 4 Jun 2020 12:09:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 4D8E981E81; Thu, 4 Jun 2020 12: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,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BD2D981E6E for ; Thu, 4 Jun 2020 12:09:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=heiko@sntech.de Received: from ip5f5aa64a.dynamic.kabel-deutschland.de ([95.90.166.74] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgmoB-0003qi-N5; Thu, 04 Jun 2020 12:09:11 +0200 From: Heiko Stuebner To: u-boot@lists.denx.de Cc: sjg@chromium.org, philipp.tomsich@theobroma-systems.com, christoph.muellner@theobroma-systems.com, kever.yang@rock-chips.com, heiko@sntech.de, Heiko Stuebner Subject: [PATCH v2 7/8] rockchip: puma: drop special handling of usb host regulator Date: Thu, 4 Jun 2020 12:09:07 +0200 Message-Id: <20200604100908.468659-8-heiko@sntech.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200604100908.468659-1-heiko@sntech.de> References: <20200604100908.468659-1-heiko@sntech.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean From: Heiko Stuebner With the current usb stack in u-boot, all host ports on puma work flawlessly without any additional special handling, so drop that usb hub hacking from the puma board. Tested with mass-storage and usb-ethernet on both usb3 and usb2 ports. Signed-off-by: Heiko Stuebner Reviewed-by: Kever Yang --- .../puma_rk3399/puma-rk3399.c | 67 ------------------- 1 file changed, 67 deletions(-) diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c index 65bb2ad6f2..deeba3084a 100644 --- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c +++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c @@ -152,70 +152,3 @@ void get_board_serial(struct tag_serialnr *serialnr) serialnr->low = (u32)(serial & 0xffffffff); } #endif - -/** - * Switch power at an external regulator (for our root hub). - * - * @param ctrl pointer to the xHCI controller - * @param port port number as in the control message (one-based) - * @param enable boolean indicating whether to enable or disable power - * @return returns 0 on success, an error-code on failure - */ -static int board_usb_port_power_set(struct udevice *dev, int port, - bool enable) -{ -#if CONFIG_IS_ENABLED(OF_CONTROL) && CONFIG_IS_ENABLED(DM_REGULATOR) - /* We start counting ports at 0, while USB counts from 1. */ - int index = port - 1; - const char *regname = NULL; - struct udevice *regulator; - const char *prop = "tsd,usb-port-power"; - int ret; - - debug("%s: ctrl '%s' port %d enable %s\n", __func__, - dev_read_name(dev), port, enable ? "true" : "false"); - - ret = dev_read_string_index(dev, prop, index, ®name); - if (ret < 0) { - debug("%s: ctrl '%s' port %d: no entry in '%s'\n", - __func__, dev_read_name(dev), port, prop); - return ret; - } - - ret = regulator_get_by_platname(regname, ®ulator); - if (ret) { - debug("%s: ctrl '%s' port %d: could not get regulator '%s'\n", - __func__, dev_read_name(dev), port, regname); - return ret; - } - - regulator_set_enable(regulator, enable); - return 0; -#else - return -ENOTSUPP; -#endif -} - -void usb_hub_reset_devices(struct usb_hub_device *hub, int port) -{ - struct udevice *dev = hub->pusb_dev->dev; - struct udevice *ctrl; - - /* We are only interested in our root-hubs */ - if (usb_hub_is_root_hub(dev) == false) - return; - - ctrl = usb_get_bus(dev); - if (!ctrl) { - debug("%s: could not retrieve ctrl for hub\n", __func__); - return; - } - - /* - * To work around an incompatibility between the single-threaded - * USB stack in U-Boot and (a strange low-power mode of) the USB - * hub we have on-module, we need to delay powering on the hub - * until the first time the port is probed. - */ - board_usb_port_power_set(ctrl, port, true); -} From patchwork Thu Jun 4 10:09:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 1303420 X-Patchwork-Delegate: ykai007@gmail.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=sntech.de 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) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49d1j80GGTz9sRR for ; Thu, 4 Jun 2020 20:09:29 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8FD9881E43; Thu, 4 Jun 2020 12:09:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 5621A81E77; Thu, 4 Jun 2020 12:09:15 +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,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C17C281E3D for ; Thu, 4 Jun 2020 12:09:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=heiko@sntech.de Received: from ip5f5aa64a.dynamic.kabel-deutschland.de ([95.90.166.74] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgmoB-0003qi-Vz; Thu, 04 Jun 2020 12:09:12 +0200 From: Heiko Stuebner To: u-boot@lists.denx.de Cc: sjg@chromium.org, philipp.tomsich@theobroma-systems.com, christoph.muellner@theobroma-systems.com, kever.yang@rock-chips.com, heiko@sntech.de, Heiko Stuebner Subject: [PATCH v2 8/8] rockchip: puma: enable new usb config options Date: Thu, 4 Jun 2020 12:09:08 +0200 Message-Id: <20200604100908.468659-9-heiko@sntech.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200604100908.468659-1-heiko@sntech.de> References: <20200604100908.468659-1-heiko@sntech.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean From: Heiko Stuebner With recently added changes we get support for usb3 including handling of the phys (type-c and inno-usb2), so enable the necessary config options on puma. Signed-off-by: Heiko Stuebner Reviewed-by: Philipp Tomsich Reviewed-by: Kever Yang --- configs/puma-rk3399_defconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig index 31d4eb3471..6b7d2ee6b8 100644 --- a/configs/puma-rk3399_defconfig +++ b/configs/puma-rk3399_defconfig @@ -59,6 +59,8 @@ CONFIG_PHY_MICREL_KSZ90X1=y CONFIG_DM_ETH=y CONFIG_ETH_DESIGNWARE=y CONFIG_GMAC_ROCKCHIP=y +CONFIG_PHY_ROCKCHIP_INNO_USB2=y +CONFIG_PHY_ROCKCHIP_TYPEC=y CONFIG_DM_PMIC_FAN53555=y CONFIG_PMIC_RK8XX=y CONFIG_SPL_DM_REGULATOR=y @@ -67,6 +69,7 @@ CONFIG_SPL_DM_REGULATOR_FIXED=y CONFIG_DM_REGULATOR_GPIO=y CONFIG_REGULATOR_RK8XX=y CONFIG_PWM_ROCKCHIP=y +CONFIG_DM_RESET=y CONFIG_DM_RTC=y CONFIG_RTC_ISL1208=y CONFIG_DEBUG_UART_SHIFT=2 @@ -77,6 +80,8 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_GENERIC=y +CONFIG_USB_DWC3=y +CONFIG_USB_DWC3_GENERIC=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y CONFIG_USB_ETHER_ASIX88179=y