[U-Boot] [PATCH 00/13] rockchip: clean up rk3288 board related code

This patch set clean source code used in tpl/spl/board files, and migrate u-boot dts change into -u-boot.dtsi for many boards.
Kever Yang (13): rockchip: rk3288: add arch_cpu_init in spl rockchip: rk3288: move configure_l2ctlr back to rk3288 rockchip: rk3288: add default TPL_LDSCRIPT value in Kconfig rockchip: rk3288: enable TPL for evb-rk3288 rockchip: evb-rk3288: add -u-boot.dtsi rockchip: fennec-rk3288: add -u-boot.dtsi rockchip: rk3288: update u-boot raw image size for all boards rockchip: firefly-rk3288: add -u-boot.dtsi rockchip: rk3288-firefly: sync sdmmc pinctrl from mainline rockchip: miqi-rk3288: add -u-boot.dtsi rockchip: popmetal-rk3288: add -u-boot.dtsi rockchip: rk3288: dts: enable spl-boot-order rockchip: board: rk3288: remove board_boot_order()
arch/arm/dts/rk3288-evb-u-boot.dtsi | 46 ++++++++++++++++ arch/arm/dts/rk3288-evb.dts | 25 --------- arch/arm/dts/rk3288-fennec-u-boot.dtsi | 54 +++++++++++++++++++ arch/arm/dts/rk3288-fennec.dts | 25 --------- arch/arm/dts/rk3288-firefly-u-boot.dtsi | 50 +++++++++++++++++ arch/arm/dts/rk3288-firefly.dts | 23 -------- arch/arm/dts/rk3288-firefly.dtsi | 26 ++++++++- arch/arm/dts/rk3288-miqi-u-boot.dtsi | 38 +++++++++++++ arch/arm/dts/rk3288-miqi.dts | 18 ------- arch/arm/dts/rk3288-popmetal-u-boot.dtsi | 46 ++++++++++++++++ arch/arm/dts/rk3288-popmetal.dts | 26 --------- arch/arm/dts/rk3288-u-boot.dtsi | 7 +++ .../arm/include/asm/arch-rockchip/sys_proto.h | 22 -------- arch/arm/mach-rockchip/Makefile | 2 +- arch/arm/mach-rockchip/rk3288-board-spl.c | 7 ++- arch/arm/mach-rockchip/rk3288-board-tpl.c | 2 - arch/arm/mach-rockchip/rk3288/Kconfig | 4 ++ arch/arm/mach-rockchip/rk3288/rk3288.c | 26 +++++++++ board/amarula/vyasa-rk3288/vyasa-rk3288.c | 8 --- .../popmetal_rk3288/popmetal-rk3288.c | 8 --- board/mqmaker/miqi_rk3288/miqi-rk3288.c | 9 ---- board/rockchip/evb_rk3288/evb-rk3288.c | 9 ---- board/rockchip/fennec_rk3288/fennec-rk3288.c | 9 ---- configs/evb-rk3288_defconfig | 9 ++-- configs/tinker-rk3288_defconfig | 1 - include/configs/rk3288_common.h | 2 + include/configs/tinker_rk3288.h | 1 - 27 files changed, 308 insertions(+), 195 deletions(-) create mode 100644 arch/arm/dts/rk3288-evb-u-boot.dtsi create mode 100644 arch/arm/dts/rk3288-fennec-u-boot.dtsi create mode 100644 arch/arm/dts/rk3288-firefly-u-boot.dtsi create mode 100644 arch/arm/dts/rk3288-miqi-u-boot.dtsi create mode 100644 arch/arm/dts/rk3288-popmetal-u-boot.dtsi

Add arch_cpu_init() in SPL for soc related init, and move configure_l2ctlr() into it. The arch_cpu_init() only need to run once, so no need to run in TPL.
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
arch/arm/mach-rockchip/rk3288-board-spl.c | 7 ++++++- arch/arm/mach-rockchip/rk3288-board-tpl.c | 2 -- arch/arm/mach-rockchip/rk3288/rk3288.c | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c index b7fab63acf..3869de9119 100644 --- a/arch/arm/mach-rockchip/rk3288-board-spl.c +++ b/arch/arm/mach-rockchip/rk3288-board-spl.c @@ -103,6 +103,11 @@ static int phycore_init(void) } #endif
+__weak int arch_cpu_init(void) +{ + return 0; +} + void board_init_f(ulong dummy) { struct udevice *dev; @@ -127,7 +132,7 @@ void board_init_f(ulong dummy) }
rockchip_timer_init(); - configure_l2ctlr(); + arch_cpu_init();
ret = rockchip_get_clk(&dev); if (ret) { diff --git a/arch/arm/mach-rockchip/rk3288-board-tpl.c b/arch/arm/mach-rockchip/rk3288-board-tpl.c index 787129bbae..5adbe92185 100644 --- a/arch/arm/mach-rockchip/rk3288-board-tpl.c +++ b/arch/arm/mach-rockchip/rk3288-board-tpl.c @@ -12,7 +12,6 @@ #include <asm/io.h> #include <asm/arch-rockchip/bootrom.h> #include <asm/arch-rockchip/clock.h> -#include <asm/arch-rockchip/sys_proto.h> #include <asm/arch-rockchip/timer.h>
void board_init_f(ulong dummy) @@ -38,7 +37,6 @@ void board_init_f(ulong dummy) }
rockchip_timer_init(); - configure_l2ctlr();
ret = rockchip_get_clk(&dev); if (ret) { diff --git a/arch/arm/mach-rockchip/rk3288/rk3288.c b/arch/arm/mach-rockchip/rk3288/rk3288.c index 7941ca68a6..5300650e19 100644 --- a/arch/arm/mach-rockchip/rk3288/rk3288.c +++ b/arch/arm/mach-rockchip/rk3288/rk3288.c @@ -10,11 +10,15 @@
int arch_cpu_init(void) { +#ifdef CONFIG_SPL_BUILD + configure_l2ctlr(); +#else /* We do some SoC one time setting here. */ struct rk3288_grf * const grf = (void *)GRF_BASE;
/* Use rkpwm by default */ rk_setreg(&grf->soc_con2, 1 << 0); +#endif
return 0; }

The configure_l2ctlr() is used only by rk3288, do not need to locate in sys_proto.h
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
.../arm/include/asm/arch-rockchip/sys_proto.h | 22 ------------------- arch/arm/mach-rockchip/rk3288/rk3288.c | 22 +++++++++++++++++++ 2 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/arch/arm/include/asm/arch-rockchip/sys_proto.h b/arch/arm/include/asm/arch-rockchip/sys_proto.h index 928e4f258b..905c774c15 100644 --- a/arch/arm/include/asm/arch-rockchip/sys_proto.h +++ b/arch/arm/include/asm/arch-rockchip/sys_proto.h @@ -6,28 +6,6 @@ #ifndef _ASM_ARCH_SYS_PROTO_H #define _ASM_ARCH_SYS_PROTO_H
-#ifdef CONFIG_ROCKCHIP_RK3288 -#include <asm/armv7.h> - -static void configure_l2ctlr(void) -{ - uint32_t l2ctlr; - - l2ctlr = read_l2ctlr(); - l2ctlr &= 0xfffc0000; /* clear bit0~bit17 */ - - /* - * Data RAM write latency: 2 cycles - * Data RAM read latency: 2 cycles - * Data RAM setup latency: 1 cycle - * Tag RAM write latency: 1 cycle - * Tag RAM read latency: 1 cycle - * Tag RAM setup latency: 1 cycle - */ - l2ctlr |= (1 << 3 | 1 << 0); - write_l2ctlr(l2ctlr); -} -#endif /* CONFIG_ROCKCHIP_RK3288 */
/* provided to defeat compiler optimisation in board_init_f() */ void gru_dummy_function(int i); diff --git a/arch/arm/mach-rockchip/rk3288/rk3288.c b/arch/arm/mach-rockchip/rk3288/rk3288.c index 5300650e19..7552472fbc 100644 --- a/arch/arm/mach-rockchip/rk3288/rk3288.c +++ b/arch/arm/mach-rockchip/rk3288/rk3288.c @@ -2,12 +2,34 @@ /* * Copyright (c) 2016 Rockchip Electronics Co., Ltd */ +#include <asm/armv7.h> #include <asm/io.h> #include <asm/arch-rockchip/hardware.h> #include <asm/arch-rockchip/grf_rk3288.h>
#define GRF_BASE 0xff770000
+#ifdef CONFIG_SPL_BUILD +static void configure_l2ctlr(void) +{ + u32 l2ctlr; + + l2ctlr = read_l2ctlr(); + l2ctlr &= 0xfffc0000; /* clear bit0~bit17 */ + + /* + * Data RAM write latency: 2 cycles + * Data RAM read latency: 2 cycles + * Data RAM setup latency: 1 cycle + * Tag RAM write latency: 1 cycle + * Tag RAM read latency: 1 cycle + * Tag RAM setup latency: 1 cycle + */ + l2ctlr |= (1 << 3 | 1 << 0); + write_l2ctlr(l2ctlr); +} +#endif + int arch_cpu_init(void) { #ifdef CONFIG_SPL_BUILD

We share the same TPL_LDSCRIPT for all rk3288 board, add default value in Kconfig.
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
arch/arm/mach-rockchip/rk3288/Kconfig | 3 +++ configs/tinker-rk3288_defconfig | 1 - 2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-rockchip/rk3288/Kconfig b/arch/arm/mach-rockchip/rk3288/Kconfig index 9a4c130386..57b7962a37 100644 --- a/arch/arm/mach-rockchip/rk3288/Kconfig +++ b/arch/arm/mach-rockchip/rk3288/Kconfig @@ -160,6 +160,9 @@ config SPL_LIBGENERIC_SUPPORT config SPL_SERIAL_SUPPORT default y
+config TPL_LDSCRIPT + default "arch/arm/mach-rockchip/u-boot-tpl.lds" + config TPL_MAX_SIZE default 32768
diff --git a/configs/tinker-rk3288_defconfig b/configs/tinker-rk3288_defconfig index 7695652e52..b234539a53 100644 --- a/configs/tinker-rk3288_defconfig +++ b/configs/tinker-rk3288_defconfig @@ -2,7 +2,6 @@ CONFIG_ARM=y CONFIG_ARCH_ROCKCHIP=y CONFIG_SYS_TEXT_BASE=0x01000000 CONFIG_ROCKCHIP_RK3288=y -CONFIG_TPL_LDSCRIPT="arch/arm/mach-rockchip/u-boot-tpl.lds" CONFIG_TARGET_TINKER_RK3288=y CONFIG_NR_DRAM_BANKS=1 CONFIG_SPL_SIZE_LIMIT=307200

Enable TPL for evb-rk3288 so that we can have a free size limited SPL.
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
arch/arm/mach-rockchip/rk3288/Kconfig | 1 + configs/evb-rk3288_defconfig | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-rockchip/rk3288/Kconfig b/arch/arm/mach-rockchip/rk3288/Kconfig index 57b7962a37..de8d9c24f1 100644 --- a/arch/arm/mach-rockchip/rk3288/Kconfig +++ b/arch/arm/mach-rockchip/rk3288/Kconfig @@ -47,6 +47,7 @@ config TARGET_CHROMEBOOK_SPEEDY config TARGET_EVB_RK3288 bool "Evb-RK3288" select BOARD_LATE_INIT + select TPL help EVB-RK3288 is a RK3288-based development board with 2 USB ports, HDMI, VGA, micro-SD card, audio, WiFi and Gigabit Ethernet, It diff --git a/configs/evb-rk3288_defconfig b/configs/evb-rk3288_defconfig index 2468aa2101..a6df143276 100644 --- a/configs/evb-rk3288_defconfig +++ b/configs/evb-rk3288_defconfig @@ -1,11 +1,10 @@ CONFIG_ARM=y CONFIG_ARCH_ROCKCHIP=y -CONFIG_SYS_TEXT_BASE=0x00000000 +CONFIG_SYS_TEXT_BASE=0x01000000 CONFIG_ROCKCHIP_RK3288=y -CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y CONFIG_TARGET_EVB_RK3288=y CONFIG_NR_DRAM_BANKS=1 -CONFIG_SPL_STACK_R_ADDR=0x80000 +CONFIG_SPL_SIZE_LIMIT=307200 CONFIG_DEBUG_UART_BASE=0xff690000 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_DEBUG_UART=y @@ -14,9 +13,7 @@ CONFIG_SILENT_CONSOLE=y CONFIG_DEFAULT_FDT_FILE="rk3288-evb-rk808.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_SPL_TEXT_BASE=0xff704000 -CONFIG_SPL_STACK_R=y -CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000 +CONFIG_SPL_TEXT_BASE=0 CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y

Move U-Boot relate dts node/property into -u-boot.dtsi
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
arch/arm/dts/rk3288-evb-u-boot.dtsi | 46 +++++++++++++++++++++++++++++ arch/arm/dts/rk3288-evb.dts | 25 ---------------- 2 files changed, 46 insertions(+), 25 deletions(-) create mode 100644 arch/arm/dts/rk3288-evb-u-boot.dtsi
diff --git a/arch/arm/dts/rk3288-evb-u-boot.dtsi b/arch/arm/dts/rk3288-evb-u-boot.dtsi new file mode 100644 index 0000000000..8ac7840f8f --- /dev/null +++ b/arch/arm/dts/rk3288-evb-u-boot.dtsi @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Rockchip Electronics Co., Ltd + */ + +#include "rk3288-u-boot.dtsi" + +&pinctrl { + u-boot,dm-pre-reloc; +}; + +&uart2 { + u-boot,dm-pre-reloc; +}; + +&sdmmc { + u-boot,dm-pre-reloc; +}; + +&emmc { + u-boot,dm-pre-reloc; +}; + +&gpio3 { + u-boot,dm-pre-reloc; +}; + +&gpio8 { + u-boot,dm-pre-reloc; +}; + +&sdmmc_bus4 { + u-boot,dm-spl; +}; + +&sdmmc_clk { + u-boot,dm-spl; +}; + +&sdmmc_cmd { + u-boot,dm-spl; +}; + +&sdmmc_pwr { + u-boot,dm-spl; +}; diff --git a/arch/arm/dts/rk3288-evb.dts b/arch/arm/dts/rk3288-evb.dts index 575de44c05..eac91a873f 100644 --- a/arch/arm/dts/rk3288-evb.dts +++ b/arch/arm/dts/rk3288-evb.dts @@ -26,31 +26,6 @@ rockchip,sdram-params = <0x20d266a4 0x5b6 2 533000000 6 9 0>; };
-&pinctrl { - u-boot,dm-pre-reloc; -}; - &pwm1 { status = "okay"; }; - -&uart2 { - u-boot,dm-pre-reloc; - reg-shift = <2>; -}; - -&sdmmc { - u-boot,dm-pre-reloc; -}; - -&emmc { - u-boot,dm-pre-reloc; -}; - -&gpio3 { - u-boot,dm-pre-reloc; -}; - -&gpio8 { - u-boot,dm-pre-reloc; -};

Move U-Boot relate dts node/property into -u-boot.dtsi
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
arch/arm/dts/rk3288-fennec-u-boot.dtsi | 54 ++++++++++++++++++++++++++ arch/arm/dts/rk3288-fennec.dts | 25 ------------ 2 files changed, 54 insertions(+), 25 deletions(-) create mode 100644 arch/arm/dts/rk3288-fennec-u-boot.dtsi
diff --git a/arch/arm/dts/rk3288-fennec-u-boot.dtsi b/arch/arm/dts/rk3288-fennec-u-boot.dtsi new file mode 100644 index 0000000000..2efb309d6b --- /dev/null +++ b/arch/arm/dts/rk3288-fennec-u-boot.dtsi @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Rockchip Electronics Co., Ltd + */ + +#include "rk3288-u-boot.dtsi" + +&pinctrl { + u-boot,dm-pre-reloc; +}; + +&uart2 { + u-boot,dm-pre-reloc; +}; + +&sdmmc { + u-boot,dm-pre-reloc; +}; + +&emmc { + u-boot,dm-pre-reloc; +}; + +&gpio3 { + u-boot,dm-pre-reloc; +}; + +&gpio8 { + u-boot,dm-pre-reloc; +}; + +&pcfg_pull_none_drv_8ma { + u-boot,dm-spl; +}; + +&pcfg_pull_up_drv_8ma { + u-boot,dm-spl; +}; + +&sdmmc_bus4 { + u-boot,dm-spl; +}; + +&sdmmc_clk { + u-boot,dm-spl; +}; + +&sdmmc_cmd { + u-boot,dm-spl; +}; + +&sdmmc_pwr { + u-boot,dm-spl; +}; diff --git a/arch/arm/dts/rk3288-fennec.dts b/arch/arm/dts/rk3288-fennec.dts index b569307168..e1d55e3104 100644 --- a/arch/arm/dts/rk3288-fennec.dts +++ b/arch/arm/dts/rk3288-fennec.dts @@ -26,31 +26,6 @@ rockchip,sdram-params = <0x20d266a4 0x5b6 2 533000000 6 9 0>; };
-&pinctrl { - u-boot,dm-pre-reloc; -}; - &pwm1 { status = "okay"; }; - -&uart2 { - u-boot,dm-pre-reloc; - reg-shift = <2>; -}; - -&sdmmc { - u-boot,dm-pre-reloc; -}; - -&emmc { - u-boot,dm-pre-reloc; -}; - -&gpio3 { - u-boot,dm-pre-reloc; -}; - -&gpio8 { - u-boot,dm-pre-reloc; -};

Some rk3288 boards are using raw image of u-boot.bin, and now it's much bigger than default 200KB, update CONFIG_SYS_MONITOR_LEN to 600KB.
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
include/configs/rk3288_common.h | 2 ++ include/configs/tinker_rk3288.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h index 7c79ed6138..06073cbb61 100644 --- a/include/configs/rk3288_common.h +++ b/include/configs/rk3288_common.h @@ -35,6 +35,8 @@ #define SDRAM_BANK_SIZE (2UL << 30) #define SDRAM_MAX_SIZE 0xfe000000
+#define CONFIG_SYS_MONITOR_LEN (600 * 1024) + #ifndef CONFIG_SPL_BUILD /* usb otg */
diff --git a/include/configs/tinker_rk3288.h b/include/configs/tinker_rk3288.h index 32057b3dbb..5adae68c91 100644 --- a/include/configs/tinker_rk3288.h +++ b/include/configs/tinker_rk3288.h @@ -18,6 +18,5 @@ func(DHCP, dchp, na)
#define CONFIG_SYS_MMC_ENV_DEV 1 -#define CONFIG_SYS_MONITOR_LEN (600 * 1024)
#endif

Move U-Boot relate dts node/property into -u-boot.dtsi
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
arch/arm/dts/rk3288-firefly-u-boot.dtsi | 54 +++++++++++++++++++++++++ arch/arm/dts/rk3288-firefly.dts | 23 ----------- 2 files changed, 54 insertions(+), 23 deletions(-) create mode 100644 arch/arm/dts/rk3288-firefly-u-boot.dtsi
diff --git a/arch/arm/dts/rk3288-firefly-u-boot.dtsi b/arch/arm/dts/rk3288-firefly-u-boot.dtsi new file mode 100644 index 0000000000..2efb309d6b --- /dev/null +++ b/arch/arm/dts/rk3288-firefly-u-boot.dtsi @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Rockchip Electronics Co., Ltd + */ + +#include "rk3288-u-boot.dtsi" + +&pinctrl { + u-boot,dm-pre-reloc; +}; + +&uart2 { + u-boot,dm-pre-reloc; +}; + +&sdmmc { + u-boot,dm-pre-reloc; +}; + +&emmc { + u-boot,dm-pre-reloc; +}; + +&gpio3 { + u-boot,dm-pre-reloc; +}; + +&gpio8 { + u-boot,dm-pre-reloc; +}; + +&pcfg_pull_none_drv_8ma { + u-boot,dm-spl; +}; + +&pcfg_pull_up_drv_8ma { + u-boot,dm-spl; +}; + +&sdmmc_bus4 { + u-boot,dm-spl; +}; + +&sdmmc_clk { + u-boot,dm-spl; +}; + +&sdmmc_cmd { + u-boot,dm-spl; +}; + +&sdmmc_pwr { + u-boot,dm-spl; +}; diff --git a/arch/arm/dts/rk3288-firefly.dts b/arch/arm/dts/rk3288-firefly.dts index 2e075406f4..1cff04e7c7 100644 --- a/arch/arm/dts/rk3288-firefly.dts +++ b/arch/arm/dts/rk3288-firefly.dts @@ -37,7 +37,6 @@ };
&pinctrl { - u-boot,dm-pre-reloc; act8846 { pmic_vsel: pmic-vsel { rockchip,pins = <7 14 RK_FUNC_GPIO &pcfg_output_low>; @@ -59,25 +58,3 @@ &pwm1 { status = "okay"; }; - -&uart2 { - u-boot,dm-pre-reloc; - reg-shift = <2>; -}; - -&usb_host1 { - vbus-supply = <&vcc_host_5v>; - status = "okay"; -}; - -&sdmmc { - u-boot,dm-pre-reloc; -}; - -&gpio3 { - u-boot,dm-pre-reloc; -}; - -&gpio8 { - u-boot,dm-pre-reloc; -};

The rk3288-firefly board have different setting for sdmmc io, sync then from kernel mainline: 6fbc7275c7a9 Linux 5.2-rc7
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
arch/arm/dts/rk3288-firefly-u-boot.dtsi | 6 +----- arch/arm/dts/rk3288-firefly.dtsi | 26 ++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/arch/arm/dts/rk3288-firefly-u-boot.dtsi b/arch/arm/dts/rk3288-firefly-u-boot.dtsi index 2efb309d6b..8b9c38310f 100644 --- a/arch/arm/dts/rk3288-firefly-u-boot.dtsi +++ b/arch/arm/dts/rk3288-firefly-u-boot.dtsi @@ -29,11 +29,7 @@ u-boot,dm-pre-reloc; };
-&pcfg_pull_none_drv_8ma { - u-boot,dm-spl; -}; - -&pcfg_pull_up_drv_8ma { +&pcfg_pull_up_drv_12ma { u-boot,dm-spl; };
diff --git a/arch/arm/dts/rk3288-firefly.dtsi b/arch/arm/dts/rk3288-firefly.dtsi index 2239ab9f59..b7f279f706 100644 --- a/arch/arm/dts/rk3288-firefly.dtsi +++ b/arch/arm/dts/rk3288-firefly.dtsi @@ -320,6 +320,11 @@ output-low; };
+ pcfg_pull_up_drv_12ma: pcfg-pull-up-drv-12ma { + bias-pull-up; + drive-strength = <12>; + }; + act8846 { pwr_hold: pwr-hold { rockchip,pins = <0 1 RK_FUNC_GPIO &pcfg_output_high>; @@ -363,8 +368,27 @@ };
sdmmc { + /* + * Default drive strength isn't enough to achieve even + * high-speed mode on firefly board so bump up to 12ma. + */ + sdmmc_bus4: sdmmc-bus4 { + rockchip,pins = <6 RK_PC0 1 &pcfg_pull_up_drv_12ma>, + <6 RK_PC1 1 &pcfg_pull_up_drv_12ma>, + <6 RK_PC2 1 &pcfg_pull_up_drv_12ma>, + <6 RK_PC3 1 &pcfg_pull_up_drv_12ma>; + }; + + sdmmc_clk: sdmmc-clk { + rockchip,pins = <6 RK_PC4 1 &pcfg_pull_none_12ma>; + }; + + sdmmc_cmd: sdmmc-cmd { + rockchip,pins = <6 RK_PC5 1 &pcfg_pull_up_drv_12ma>; + }; + sdmmc_pwr: sdmmc-pwr { - rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = <7 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>; }; };

Move U-Boot relate dts node/property into -u-boot.dtsi
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
arch/arm/dts/rk3288-miqi-u-boot.dtsi | 38 ++++++++++++++++++++++++++++ arch/arm/dts/rk3288-miqi.dts | 18 ------------- 2 files changed, 38 insertions(+), 18 deletions(-) create mode 100644 arch/arm/dts/rk3288-miqi-u-boot.dtsi
diff --git a/arch/arm/dts/rk3288-miqi-u-boot.dtsi b/arch/arm/dts/rk3288-miqi-u-boot.dtsi new file mode 100644 index 0000000000..4f63fc9f13 --- /dev/null +++ b/arch/arm/dts/rk3288-miqi-u-boot.dtsi @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Rockchip Electronics Co., Ltd + */ + +#include "rk3288-u-boot.dtsi" + +&pinctrl { + u-boot,dm-pre-reloc; +}; + +&uart2 { + u-boot,dm-pre-reloc; +}; + +&sdmmc { + u-boot,dm-pre-reloc; +}; + +&emmc { + u-boot,dm-pre-reloc; +}; + +&sdmmc_bus4 { + u-boot,dm-spl; +}; + +&sdmmc_clk { + u-boot,dm-spl; +}; + +&sdmmc_cmd { + u-boot,dm-spl; +}; + +&sdmmc_pwr { + u-boot,dm-spl; +}; diff --git a/arch/arm/dts/rk3288-miqi.dts b/arch/arm/dts/rk3288-miqi.dts index 29e60dd125..e47170c653 100644 --- a/arch/arm/dts/rk3288-miqi.dts +++ b/arch/arm/dts/rk3288-miqi.dts @@ -25,21 +25,3 @@ 0xa60 0x40 0x10 0x0>; rockchip,sdram-params = <0x30B25564 0x627 3 666000000 3 9 1>; }; - - -&pinctrl { - u-boot,dm-pre-reloc; -}; - -&uart2 { - u-boot,dm-pre-reloc; - reg-shift = <2>; -}; - -&sdmmc { - u-boot,dm-pre-reloc; -}; - -&emmc { - u-boot,dm-pre-reloc; -};

Move U-Boot relate dts node/property into -u-boot.dtsi
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
arch/arm/dts/rk3288-popmetal-u-boot.dtsi | 46 ++++++++++++++++++++++++ arch/arm/dts/rk3288-popmetal.dts | 26 -------------- 2 files changed, 46 insertions(+), 26 deletions(-) create mode 100644 arch/arm/dts/rk3288-popmetal-u-boot.dtsi
diff --git a/arch/arm/dts/rk3288-popmetal-u-boot.dtsi b/arch/arm/dts/rk3288-popmetal-u-boot.dtsi new file mode 100644 index 0000000000..8ac7840f8f --- /dev/null +++ b/arch/arm/dts/rk3288-popmetal-u-boot.dtsi @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Rockchip Electronics Co., Ltd + */ + +#include "rk3288-u-boot.dtsi" + +&pinctrl { + u-boot,dm-pre-reloc; +}; + +&uart2 { + u-boot,dm-pre-reloc; +}; + +&sdmmc { + u-boot,dm-pre-reloc; +}; + +&emmc { + u-boot,dm-pre-reloc; +}; + +&gpio3 { + u-boot,dm-pre-reloc; +}; + +&gpio8 { + u-boot,dm-pre-reloc; +}; + +&sdmmc_bus4 { + u-boot,dm-spl; +}; + +&sdmmc_clk { + u-boot,dm-spl; +}; + +&sdmmc_cmd { + u-boot,dm-spl; +}; + +&sdmmc_pwr { + u-boot,dm-spl; +}; diff --git a/arch/arm/dts/rk3288-popmetal.dts b/arch/arm/dts/rk3288-popmetal.dts index d1e1cd5112..5c6d06f2fd 100644 --- a/arch/arm/dts/rk3288-popmetal.dts +++ b/arch/arm/dts/rk3288-popmetal.dts @@ -26,32 +26,6 @@ rockchip,sdram-params = <0x30B25564 0x627 3 666000000 3 9 1>; };
- -&pinctrl { - u-boot,dm-pre-reloc; -}; - &pwm1 { status = "okay"; }; - -&uart2 { - u-boot,dm-pre-reloc; - reg-shift = <2>; -}; - -&sdmmc { - u-boot,dm-pre-reloc; -}; - -&emmc { - u-boot,dm-pre-reloc; -}; - -&gpio3 { - u-boot,dm-pre-reloc; -}; - -&gpio8 { - u-boot,dm-pre-reloc; -};

We share the same default SPL boot order for all rk3288 boards, use dts instead of hard code in board file.
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
arch/arm/dts/rk3288-u-boot.dtsi | 7 +++++++ arch/arm/mach-rockchip/Makefile | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi index 4cf75c7504..3f00a3b6d3 100644 --- a/arch/arm/dts/rk3288-u-boot.dtsi +++ b/arch/arm/dts/rk3288-u-boot.dtsi @@ -3,6 +3,13 @@ * Copyright (C) 2019 Rockchip Electronics Co., Ltd */
+/ { + chosen { + u-boot,spl-boot-order = \ + "same-as-spl", &emmc, &sdmmc; + }; +}; + &dmc { u-boot,dm-pre-reloc; }; diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile index 23760a959a..0c169e9234 100644 --- a/arch/arm/mach-rockchip/Makefile +++ b/arch/arm/mach-rockchip/Makefile @@ -17,7 +17,7 @@ obj-tpl-$(CONFIG_ROCKCHIP_RK3399) += rk3399-board-tpl.o obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o obj-spl-$(CONFIG_ROCKCHIP_RK3188) += rk3188-board-spl.o obj-spl-$(CONFIG_ROCKCHIP_RK322X) += rk322x-board-spl.o spl-boot-order.o -obj-spl-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board-spl.o +obj-spl-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board-spl.o spl-boot-order.o obj-spl-$(CONFIG_ROCKCHIP_RK3328) += rk3328-board-spl.o obj-spl-$(CONFIG_ROCKCHIP_RK3368) += rk3368-board-spl.o spl-boot-order.o obj-spl-$(CONFIG_ROCKCHIP_RK3399) += rk3399-board-spl.o spl-boot-order.o

Prefer to use dts config instead, remove all board_boot_order() for rk3288 boards.
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
board/amarula/vyasa-rk3288/vyasa-rk3288.c | 8 -------- board/chipspark/popmetal_rk3288/popmetal-rk3288.c | 8 -------- board/mqmaker/miqi_rk3288/miqi-rk3288.c | 9 --------- board/rockchip/evb_rk3288/evb-rk3288.c | 9 --------- board/rockchip/fennec_rk3288/fennec-rk3288.c | 9 --------- 5 files changed, 43 deletions(-)
diff --git a/board/amarula/vyasa-rk3288/vyasa-rk3288.c b/board/amarula/vyasa-rk3288/vyasa-rk3288.c index 2b509f529f..baf197c485 100644 --- a/board/amarula/vyasa-rk3288/vyasa-rk3288.c +++ b/board/amarula/vyasa-rk3288/vyasa-rk3288.c @@ -6,14 +6,6 @@ #include <common.h>
#ifndef CONFIG_TPL_BUILD -#include <spl.h> - -void board_boot_order(u32 *spl_boot_list) -{ - /* eMMC prior to sdcard. */ - spl_boot_list[0] = BOOT_DEVICE_MMC2; - spl_boot_list[1] = BOOT_DEVICE_MMC1; -}
int spl_start_uboot(void) { diff --git a/board/chipspark/popmetal_rk3288/popmetal-rk3288.c b/board/chipspark/popmetal_rk3288/popmetal-rk3288.c index 355c78b7b7..9ba1fbd0e2 100644 --- a/board/chipspark/popmetal_rk3288/popmetal-rk3288.c +++ b/board/chipspark/popmetal_rk3288/popmetal-rk3288.c @@ -4,16 +4,8 @@ */
#include <common.h> -#include <spl.h> #include <asm/gpio.h>
-void board_boot_order(u32 *spl_boot_list) -{ - /* eMMC prior to sdcard */ - spl_boot_list[0] = BOOT_DEVICE_MMC2; - spl_boot_list[1] = BOOT_DEVICE_MMC1; -} - #define GPIO7A3_HUB_RST 227
int rk_board_late_init(void) diff --git a/board/mqmaker/miqi_rk3288/miqi-rk3288.c b/board/mqmaker/miqi_rk3288/miqi-rk3288.c index d6992a26ca..779bc646b2 100644 --- a/board/mqmaker/miqi_rk3288/miqi-rk3288.c +++ b/board/mqmaker/miqi_rk3288/miqi-rk3288.c @@ -3,12 +3,3 @@ * (C) Copyright 2016 Rockchip Electronics Co., Ltd */
-#include <common.h> -#include <spl.h> - -void board_boot_order(u32 *spl_boot_list) -{ - /* eMMC prior to sdcard. */ - spl_boot_list[0] = BOOT_DEVICE_MMC2; - spl_boot_list[1] = BOOT_DEVICE_MMC1; -} diff --git a/board/rockchip/evb_rk3288/evb-rk3288.c b/board/rockchip/evb_rk3288/evb-rk3288.c index d6992a26ca..779bc646b2 100644 --- a/board/rockchip/evb_rk3288/evb-rk3288.c +++ b/board/rockchip/evb_rk3288/evb-rk3288.c @@ -3,12 +3,3 @@ * (C) Copyright 2016 Rockchip Electronics Co., Ltd */
-#include <common.h> -#include <spl.h> - -void board_boot_order(u32 *spl_boot_list) -{ - /* eMMC prior to sdcard. */ - spl_boot_list[0] = BOOT_DEVICE_MMC2; - spl_boot_list[1] = BOOT_DEVICE_MMC1; -} diff --git a/board/rockchip/fennec_rk3288/fennec-rk3288.c b/board/rockchip/fennec_rk3288/fennec-rk3288.c index ce455449dd..779bc646b2 100644 --- a/board/rockchip/fennec_rk3288/fennec-rk3288.c +++ b/board/rockchip/fennec_rk3288/fennec-rk3288.c @@ -3,12 +3,3 @@ * (C) Copyright 2016 Rockchip Electronics Co., Ltd */
-#include <common.h> -#include <spl.h> - -void board_boot_order(u32 *spl_boot_list) -{ - /* eMMC prior to sdcard */ - spl_boot_list[0] = BOOT_DEVICE_MMC2; - spl_boot_list[1] = BOOT_DEVICE_MMC1; -}
participants (1)
-
Kever Yang