[U-Boot] [PATCH 1/6] rockchip: dts: rk3399-puma: fix the modelling of BIOS_DISABLE

The fixed regulator for overriding BIOS_DISABLE had been modelling backwards (i.e. the GPIO polarity and the enable-active-low/high property had both been inverted), causing the 'regulator' command to always print/expect 'disabled'/'enabled' backwards.
This fixes the mix-up and models it correctly: * the GPIO is low-active * the regulator should be enabled (enable-active-high) during boot-on initialisation
Signed-off-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com ---
arch/arm/dts/rk3399-puma.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/rk3399-puma.dtsi b/arch/arm/dts/rk3399-puma.dtsi index 4c22279..19d0717 100644 --- a/arch/arm/dts/rk3399-puma.dtsi +++ b/arch/arm/dts/rk3399-puma.dtsi @@ -112,8 +112,8 @@ compatible = "regulator-fixed"; u-boot,dm-pre-reloc; regulator-name = "bios_enable"; - enable-active-low; - gpio = <&gpio3 29 GPIO_ACTIVE_HIGH>; + enable-active-high; + gpio = <&gpio3 29 GPIO_ACTIVE_LOW>; regulator-always-on; regulator-boot-on; regulator-min-microvolt = <1800000>;

To correctly model the usbhub_enable regulator for U-Boot, we need to change the settings to: * the GPIO polarity is GPIO_ACTIVE_LOW * should be set to inactive (enable-active-low) when boot-on settings are applied * it can be changed at runtime (i.e. remove the always-on)
Signed-off-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com ---
arch/arm/dts/rk3399-puma.dtsi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/arm/dts/rk3399-puma.dtsi b/arch/arm/dts/rk3399-puma.dtsi index 19d0717..7fd4706 100644 --- a/arch/arm/dts/rk3399-puma.dtsi +++ b/arch/arm/dts/rk3399-puma.dtsi @@ -95,8 +95,7 @@ compatible = "regulator-fixed"; regulator-name = "usbhub_enable"; enable-active-low; - gpio = <&gpio4 3 GPIO_ACTIVE_HIGH>; - regulator-always-on; + gpio = <&gpio4 3 GPIO_ACTIVE_LOW>; regulator-boot-on; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>;

To correctly model the usbhub_enable regulator for U-Boot, we need to change the settings to:
- the GPIO polarity is GPIO_ACTIVE_LOW
- should be set to inactive (enable-active-low) when boot-on settings are applied
- it can be changed at runtime (i.e. remove the always-on)
Signed-off-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
arch/arm/dts/rk3399-puma.dtsi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Applied to u-boot-rockchip, thanks!

This change updates the USB configuration for the RK3399-Q7 in the DTS: * fixes the OTG board configuration by enabling it ('okay') * improves the speed of 'usb start' by disabling the unused EHCI/OHCI controllers
Signed-off-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com ---
arch/arm/dts/rk3399-puma.dtsi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/arm/dts/rk3399-puma.dtsi b/arch/arm/dts/rk3399-puma.dtsi index 7fd4706..f7c70d96 100644 --- a/arch/arm/dts/rk3399-puma.dtsi +++ b/arch/arm/dts/rk3399-puma.dtsi @@ -524,23 +524,23 @@ };
&usb_host0_ehci { - status = "okay"; + status = "disabled"; };
&usb_host0_ohci { - status = "okay"; + status = "disabled"; };
&dwc3_typec0 { - status = "disabled"; + status = "okay"; };
&usb_host1_ehci { - status = "okay"; + status = "disabled"; };
&usb_host1_ohci { - status = "okay"; + status = "disabled"; };
&dwc3_typec1 {

This change updates the USB configuration for the RK3399-Q7 in the DTS:
- fixes the OTG board configuration by enabling it ('okay')
- improves the speed of 'usb start' by disabling the unused EHCI/OHCI controllers
Signed-off-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
arch/arm/dts/rk3399-puma.dtsi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Applied to u-boot-rockchip, thanks!

From: Klaus Goger klaus.goger@theobroma-systems.com
pinctrl/rockchip.h provides defines that map pin numbers to pin names. Use them to make the dts more human readable.
Signed-off-by: Klaus Goger klaus.goger@theobroma-systems.com Signed-off-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com ---
arch/arm/dts/rk3368-lion.dts | 2 +- arch/arm/dts/rk3399-puma.dtsi | 47 ++++++++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/arch/arm/dts/rk3368-lion.dts b/arch/arm/dts/rk3368-lion.dts index 850db50..f018b8b 100644 --- a/arch/arm/dts/rk3368-lion.dts +++ b/arch/arm/dts/rk3368-lion.dts @@ -68,7 +68,7 @@ phy-supply = <&vcc33_io>; phy-mode = "rgmii"; clock_in_out = "input"; - snps,reset-gpio = <&gpio3 11 GPIO_ACTIVE_LOW>; + snps,reset-gpio = <&gpio3 RK_PB3 GPIO_ACTIVE_LOW>; snps,reset-active-low; snps,reset-delays-us = <2 10000 50000>; assigned-clocks = <&cru SCLK_MAC>; diff --git a/arch/arm/dts/rk3399-puma.dtsi b/arch/arm/dts/rk3399-puma.dtsi index f7c70d96..b801de2 100644 --- a/arch/arm/dts/rk3399-puma.dtsi +++ b/arch/arm/dts/rk3399-puma.dtsi @@ -37,13 +37,13 @@
module_led { label = "module_led"; - gpios = <&gpio2 25 GPIO_ACTIVE_HIGH>; + gpios = <&gpio2 RK_PD1 GPIO_ACTIVE_HIGH>; linux,default-trigger = "heartbeat"; };
sd_card_led { label = "sd_card_led"; - gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; + gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>; linux,default-trigger = "mmc0"; }; }; @@ -95,7 +95,7 @@ compatible = "regulator-fixed"; regulator-name = "usbhub_enable"; enable-active-low; - gpio = <&gpio4 3 GPIO_ACTIVE_LOW>; + gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_LOW>; regulator-boot-on; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; @@ -112,7 +112,7 @@ u-boot,dm-pre-reloc; regulator-name = "bios_enable"; enable-active-high; - gpio = <&gpio3 29 GPIO_ACTIVE_LOW>; + gpio = <&gpio3 RK_PD5 GPIO_ACTIVE_LOW>; regulator-always-on; regulator-boot-on; regulator-min-microvolt = <1800000>; @@ -140,7 +140,7 @@ vcc5v0_otg: vcc5v0-otg-regulator { compatible = "regulator-fixed"; enable-active-high; - gpio = <&gpio0 2 GPIO_ACTIVE_HIGH>; + gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&otg_vbus_drv>; regulator-name = "vcc5v0_otg"; @@ -150,7 +150,7 @@ vcc5v0_host: vcc5v0-host-regulator { compatible = "regulator-fixed"; enable-active-low; - gpio = <&gpio4 3 GPIO_ACTIVE_HIGH>; + gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&host_vbus_drv>; regulator-name = "vcc5v0_host"; @@ -196,7 +196,7 @@ phy-supply = <&vcc_phy>; phy-mode = "rgmii"; clock_in_out = "input"; - snps,reset-gpio = <&gpio3 16 GPIO_ACTIVE_LOW>; + snps,reset-gpio = <&gpio3 RK_PC0 GPIO_ACTIVE_LOW>; snps,reset-active-low; snps,reset-delays-us = <2 10000 50000>; assigned-clocks = <&cru SCLK_RMII_SRC>; @@ -224,7 +224,7 @@ vdd_gpu: fan535555@60 { compatible = "fcs,fan53555"; reg = <0x60>; - vsel-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; + vsel-gpios = <&gpio1 RK_PB6 GPIO_ACTIVE_HIGH>; vin-supply = <&vcc5v0_sys>; regulator-compatible = "fan53555-reg"; regulator-name = "vdd_gpu"; @@ -426,7 +426,7 @@ vdd_cpu_b: fan53555@60 { compatible = "fcs,fan53555"; reg = <0x60>; - vsel-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; + vsel-gpios = <&gpio1 RK_PA4 GPIO_ACTIVE_HIGH>; vin-supply = <&vcc5v0_sys>; regulator-compatible = "fan53555-reg"; regulator-name = "vdd_cpu_b"; @@ -469,7 +469,7 @@ assigned-clocks = <&cru SCLK_PCIEPHY_REF>; assigned-clock-parents = <&cru SCLK_PCIEPHY_REF100M>; assigned-clock-rates = <100000000>; - ep-gpios = <&gpio4 22 GPIO_ACTIVE_HIGH>; + ep-gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>; num-lanes = <4>; pinctrl-names = "default"; pinctrl-0 = <&pcie_clkreqn>; @@ -564,42 +564,43 @@ puma_pin_hog: puma_pin_hog { rockchip,pins = /* We need pull-ups on Q7 buttons */ - <0 4 RK_FUNC_GPIO &pcfg_pull_up>, /* LID_BTN# */ - <0 10 RK_FUNC_GPIO &pcfg_pull_up>, /* BATLOW# */ - <0 11 RK_FUNC_GPIO &pcfg_pull_up>, /* SLP_BTN# */ - <0 9 RK_FUNC_GPIO &pcfg_pull_up>; /* BIOS_DISABLE# */ + <RK_GPIO0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>, /* LID_BTN# */ + <RK_GPIO0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>, /* BATLOW# */ + <RK_GPIO0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_up>, /* SLP_BTN# */ + <RK_GPIO0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>; /* BIOS_DISABLE# */ }; };
pmic { pmic_int_l: pmic-int-l { rockchip,pins = - <1 22 RK_FUNC_GPIO &pcfg_pull_up>; + <RK_GPIO1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>; }; };
leds_pins_puma: led_pins@0 { rockchip,pins = - <2 25 RK_FUNC_GPIO &pcfg_pull_none>, - <1 2 RK_FUNC_GPIO &pcfg_pull_none>; + <RK_GPIO2 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>, + <RK_GPIO1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; };
usb2 { otg_vbus_drv: otg-vbus-drv { rockchip,pins = - <0 2 RK_FUNC_GPIO &pcfg_pull_none>; + <RK_GPIO0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; };
host_vbus_drv: host-vbus-drv { rockchip,pins = - <0 2 RK_FUNC_GPIO &pcfg_pull_none>; + <RK_GPIO4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>; }; };
i2c8 { i2c8_xfer_a: i2c8-xfer { - rockchip,pins = <1 21 RK_FUNC_1 &pcfg_pull_up>, - <1 20 RK_FUNC_1 &pcfg_pull_up>; + rockchip,pins = + <RK_GPIO1 RK_PC5 RK_FUNC_1 &pcfg_pull_up>, + <RK_GPIO1 RK_PC4 RK_FUNC_1 &pcfg_pull_up>; }; }; }; @@ -624,8 +625,8 @@ &i2c6_xfer { /* Enable pull-ups, the pins would float otherwise. */ rockchip,pins = - <2 10 RK_FUNC_2 &pcfg_pull_up>, - <2 9 RK_FUNC_2 &pcfg_pull_up>; + <RK_GPIO2 RK_PB2 RK_FUNC_2 &pcfg_pull_up>, + <RK_GPIO2 RK_PB1 RK_FUNC_2 &pcfg_pull_up>; };
&i2c7 {

From: Klaus Goger klaus.goger@theobroma-systems.com
pinctrl/rockchip.h provides defines that map pin numbers to pin names. Use them to make the dts more human readable.
Signed-off-by: Klaus Goger klaus.goger@theobroma-systems.com Signed-off-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
arch/arm/dts/rk3368-lion.dts | 2 +- arch/arm/dts/rk3399-puma.dtsi | 47 ++++++++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 24 deletions(-)
Applied to u-boot-rockchip, thanks!

From: Klaus Goger klaus.goger@theobroma-systems.com
The VCC_SD and VCC_SDIO rail should only be powered up to 3.0V on RK3399 platforms.
Signed-off-by: Klaus Goger klaus.goger@theobroma-systems.com Signed-off-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com ---
arch/arm/dts/rk3399-firefly.dts | 4 ++-- arch/arm/dts/rk3399-puma.dtsi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/dts/rk3399-firefly.dts b/arch/arm/dts/rk3399-firefly.dts index 31e3ba8..f134c00 100644 --- a/arch/arm/dts/rk3399-firefly.dts +++ b/arch/arm/dts/rk3399-firefly.dts @@ -332,10 +332,10 @@ regulator-always-on; regulator-boot-on; regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3300000>; + regulator-max-microvolt = <3000000>; regulator-state-mem { regulator-on-in-suspend; - regulator-suspend-microvolt = <3300000>; + regulator-suspend-microvolt = <3000000>; }; };
diff --git a/arch/arm/dts/rk3399-puma.dtsi b/arch/arm/dts/rk3399-puma.dtsi index b801de2..45400fd 100644 --- a/arch/arm/dts/rk3399-puma.dtsi +++ b/arch/arm/dts/rk3399-puma.dtsi @@ -348,11 +348,11 @@ regulator-always-on; regulator-boot-on; regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3300000>; + regulator-max-microvolt = <3000000>; regulator-name = "vcc_sd"; regulator-state-mem { regulator-on-in-suspend; - regulator-suspend-microvolt = <3300000>; + regulator-suspend-microvolt = <3000000>; }; };

From: Klaus Goger klaus.goger@theobroma-systems.com
The VCC_SD and VCC_SDIO rail should only be powered up to 3.0V on RK3399 platforms.
Signed-off-by: Klaus Goger klaus.goger@theobroma-systems.com Signed-off-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
arch/arm/dts/rk3399-firefly.dts | 4 ++-- arch/arm/dts/rk3399-puma.dtsi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
Applied to u-boot-rockchip, thanks!

From: Klaus Goger klaus.goger@theobroma-systems.com
The environment storage location is selectable via Kconfig. We support eMMC, SD and SPI-NOR as location for U-Boot. This adds support to store the environment in the SPI-NOR additional to the default eMMC location.
Signed-off-by: Klaus Goger klaus.goger@theobroma-systems.com Signed-off-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com ---
include/configs/puma_rk3399.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/include/configs/puma_rk3399.h b/include/configs/puma_rk3399.h index e481a28..39d0786 100644 --- a/include/configs/puma_rk3399.h +++ b/include/configs/puma_rk3399.h @@ -17,7 +17,15 @@ #undef CONFIG_ENV_OFFSET #define CONFIG_ENV_OFFSET (240 * 1024)
+#if defined(CONFIG_ENV_IS_IN_MMC) #define CONFIG_SYS_MMC_ENV_DEV 1 +#elif defined(CONFIG_ENV_IS_IN_SPI_FLASH) +#define CONFIG_ENV_SECT_SIZE (8 * 1024) +#define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS +#define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS +#define CONFIG_ENV_SPI_MODE CONFIG_SF_DEFAULT_MODE +#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED +#endif
#define SDRAM_BANK_SIZE (2UL << 30)

From: Klaus Goger klaus.goger@theobroma-systems.com
The environment storage location is selectable via Kconfig. We support eMMC, SD and SPI-NOR as location for U-Boot. This adds support to store the environment in the SPI-NOR additional to the default eMMC location.
Signed-off-by: Klaus Goger klaus.goger@theobroma-systems.com Signed-off-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
include/configs/puma_rk3399.h | 8 ++++++++ 1 file changed, 8 insertions(+)
Applied to u-boot-rockchip, thanks!

The fixed regulator for overriding BIOS_DISABLE had been modelling backwards (i.e. the GPIO polarity and the enable-active-low/high property had both been inverted), causing the 'regulator' command to always print/expect 'disabled'/'enabled' backwards.
This fixes the mix-up and models it correctly:
- the GPIO is low-active
- the regulator should be enabled (enable-active-high) during boot-on initialisation
Signed-off-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
arch/arm/dts/rk3399-puma.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Applied to u-boot-rockchip, thanks!
participants (1)
-
Philipp Tomsich