public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file
@ 2019-07-22 11:59 Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 01/35] rockchip: remove redundant CONFIG_SYS_NS16550_MEM32 Kever Yang
                   ` (34 more replies)
  0 siblings, 35 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot


Rockchip SoCs have similar boot process, we can re-use
the same SPL board file for all SoCs, and avoid too much
copy-paste overhead.



Kever Yang (35):
  rockchip: remove redundant CONFIG_SYS_NS16550_MEM32
  rockchip: add CONFIG_IRAM_BASE for all SoCs
  rockchip: intruduce common BROM_BOOTSOURCE_ID_ADDR
  rockchip: declear boot_devices in bootrom.h
  rockchip: add common spl board file
  rockchip: rk3188: init CPU freq in clock driver
  rockchip: rk3188: move usb uart init into arch_cpu_init()
  rockchip: Migrate to use BOOTROM_SUPPORT driver
  rockchip: rk3188: move spl_board_init() into rk3188.c
  rockchip: rk3188: add boot_devices mapping to support 'same-as-spl'
  rockchip: rk3188: migrate to use common spl board file
  rockchip: rk322x: introduce arch_cpu_init() for SoC setting init
  rockchip: rk322x: migrate to use common spl board file
  rockchip: rk322x: add boot_devices mapping to support 'same-as-spl'
  rockchip: fit_spl_optee: rockchip: fix warning unit_address_vs_reg
  rockchip: rk3288: show SPL BANNER earlier in board_init_f()
  rockchip: rk3288: move setup_led() to firefly-rk3288
  rockchip: rk3288-phycore: move phycore_init() to its own board file
  rockchip: rk3288: move dram_init_banksize() into soc file
  rockchip: rk3288: Migrate to use common spl board file
  rockchip: phycore: remove no use "u-boot,boot0" in dts
  rockchip: rk3288-veyron: Migrate "u-boot,boot0" to
    "u-boot,spl-boot-order"
  rockchip: rk3288: add boot_devices mapping to support 'same-as-spl'
  rockchip: rk3328: add STIMER_BASE definition
  rockchip: rk3328: migrate to use common spl board file
  rockchip: rk3328: add boot_devices mapping to support 'same-as-spl'
  rockchip: rk3368: migrate to use common spl board file
  rockchip: rk3368: add boot_devices mapping to support 'same-as-spl'
  rockchip: rk3399: move spl_perform_fixups() into soc file
  rockchip: rk3399: show SPL BANNER earlier in board_init_f()
  rockchip: rk3399: move SoC setting into arch_cpu_init()
  rockchip: rk3399; move spl_board_init() into soc file
  rockchip: rk3399: move boot_devices into soc file
  rockchip: rk3399: move chromebook bob specific flow to its board file
  rockchip: rk3399: Migrate to use common spl board file

 arch/arm/dts/rk3288-phycore-rdk.dts           |   5 -
 arch/arm/dts/rk3288-veyron.dtsi               |   6 +-
 arch/arm/include/asm/arch-rockchip/bootrom.h  |   4 +-
 .../arm/include/asm/arch-rockchip/sys_proto.h |   4 -
 arch/arm/mach-rockchip/Kconfig                |  24 +-
 arch/arm/mach-rockchip/Makefile               |   7 +-
 arch/arm/mach-rockchip/fit_spl_optee.its      |  16 +-
 arch/arm/mach-rockchip/rk3188-board-spl.c     | 193 --------------
 arch/arm/mach-rockchip/rk3188/rk3188.c        |  70 ++++-
 arch/arm/mach-rockchip/rk322x-board-spl.c     |  76 ------
 arch/arm/mach-rockchip/rk322x/rk322x.c        |  18 ++
 arch/arm/mach-rockchip/rk3288-board-spl.c     | 249 -----------------
 arch/arm/mach-rockchip/rk3288/Kconfig         |   2 +
 arch/arm/mach-rockchip/rk3288/rk3288.c        |  21 ++
 arch/arm/mach-rockchip/rk3328-board-spl.c     |  58 ----
 arch/arm/mach-rockchip/rk3328/rk3328.c        |   6 +
 arch/arm/mach-rockchip/rk3368-board-spl.c     |  80 ------
 arch/arm/mach-rockchip/rk3368/rk3368.c        |   6 +
 arch/arm/mach-rockchip/rk3399-board-spl.c     | 251 ------------------
 arch/arm/mach-rockchip/rk3399/rk3399.c        | 144 +++++++++-
 arch/arm/mach-rockchip/spl.c                  | 154 +++++++++++
 board/firefly/firefly-rk3288/firefly-rk3288.c |  36 +++
 board/google/gru/gru.c                        |  21 ++
 board/phytec/phycore_rk3288/phycore-rk3288.c  |  47 ++++
 drivers/clk/rockchip/clk_rk3188.c             |   3 +
 include/configs/rk3128_common.h               |   2 +
 include/configs/rk3188_common.h               |   3 +-
 include/configs/rk322x_common.h               |   1 +
 include/configs/rk3288_common.h               |   2 +
 include/configs/rk3328_common.h               |   6 +-
 include/configs/rk3368_common.h               |   2 +-
 include/configs/rk3399_common.h               |   2 +-
 include/configs/rv1108_common.h               |   2 +
 33 files changed, 568 insertions(+), 953 deletions(-)
 delete mode 100644 arch/arm/mach-rockchip/rk3188-board-spl.c
 delete mode 100644 arch/arm/mach-rockchip/rk322x-board-spl.c
 delete mode 100644 arch/arm/mach-rockchip/rk3288-board-spl.c
 delete mode 100644 arch/arm/mach-rockchip/rk3328-board-spl.c
 delete mode 100644 arch/arm/mach-rockchip/rk3368-board-spl.c
 delete mode 100644 arch/arm/mach-rockchip/rk3399-board-spl.c
 create mode 100644 arch/arm/mach-rockchip/spl.c

-- 
2.17.1

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 01/35] rockchip: remove redundant CONFIG_SYS_NS16550_MEM32
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 02/35] rockchip: add CONFIG_IRAM_BASE for all SoCs Kever Yang
                   ` (33 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

The CONFIG_SYS_NS16550_MEM32 already defined in
rockchip_common.h, no need to define again in soc
level header.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 include/configs/rk3188_common.h | 2 --
 include/configs/rk3328_common.h | 2 --
 include/configs/rk3368_common.h | 2 --
 include/configs/rk3399_common.h | 2 --
 4 files changed, 8 deletions(-)

diff --git a/include/configs/rk3188_common.h b/include/configs/rk3188_common.h
index 1d41702846..ec90088309 100644
--- a/include/configs/rk3188_common.h
+++ b/include/configs/rk3188_common.h
@@ -15,8 +15,6 @@
 #define CONFIG_SYS_MALLOC_LEN		(32 << 20)
 #define CONFIG_SYS_CBSIZE		1024
 
-#define CONFIG_SYS_NS16550_MEM32
-
 #ifdef CONFIG_SPL_ROCKCHIP_BACK_TO_BROM
 /* Bootrom will load u-boot binary to 0x60000000 once return from SPL */
 #endif
diff --git a/include/configs/rk3328_common.h b/include/configs/rk3328_common.h
index 2a81c803b6..3a8e37ef98 100644
--- a/include/configs/rk3328_common.h
+++ b/include/configs/rk3328_common.h
@@ -12,8 +12,6 @@
 #define CONFIG_SYS_CBSIZE		1024
 #define CONFIG_SKIP_LOWLEVEL_INIT
 
-#define CONFIG_SYS_NS16550_MEM32
-
 #define CONFIG_SYS_INIT_SP_ADDR		0x00300000
 #define CONFIG_SYS_LOAD_ADDR		0x00800800
 #define CONFIG_SPL_STACK		0x00400000
diff --git a/include/configs/rk3368_common.h b/include/configs/rk3368_common.h
index 8a1e3118ae..1a859a7e43 100644
--- a/include/configs/rk3368_common.h
+++ b/include/configs/rk3368_common.h
@@ -23,8 +23,6 @@
 #define CONFIG_ROCKCHIP_STIMER_BASE	0xff830020
 #define COUNTER_FREQUENCY		24000000
 
-#define CONFIG_SYS_NS16550_MEM32
-
 #define CONFIG_SYS_INIT_SP_ADDR		0x00300000
 #define CONFIG_SYS_LOAD_ADDR		0x00280000
 
diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h
index 8df0180284..63eac19a4e 100644
--- a/include/configs/rk3399_common.h
+++ b/include/configs/rk3399_common.h
@@ -15,8 +15,6 @@
 #define COUNTER_FREQUENCY               24000000
 #define CONFIG_ROCKCHIP_STIMER_BASE	0xff8680a0
 
-#define CONFIG_SYS_NS16550_MEM32
-
 #define CONFIG_SYS_INIT_SP_ADDR		0x00300000
 #define CONFIG_SYS_LOAD_ADDR		0x00800800
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 02/35] rockchip: add CONFIG_IRAM_BASE for all SoCs
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 01/35] rockchip: remove redundant CONFIG_SYS_NS16550_MEM32 Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 03/35] rockchip: intruduce common BROM_BOOTSOURCE_ID_ADDR Kever Yang
                   ` (32 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

Rockchip SoCs have internal sram for bootrom data area and for
sdram init program space. Introduce the base address in case
we need to use it.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 include/configs/rk3128_common.h | 2 ++
 include/configs/rk3188_common.h | 1 +
 include/configs/rk322x_common.h | 1 +
 include/configs/rk3288_common.h | 2 ++
 include/configs/rk3328_common.h | 2 ++
 include/configs/rk3368_common.h | 2 ++
 include/configs/rk3399_common.h | 2 ++
 include/configs/rv1108_common.h | 2 ++
 8 files changed, 14 insertions(+)

diff --git a/include/configs/rk3128_common.h b/include/configs/rk3128_common.h
index 20d62439fb..d12696d6b3 100644
--- a/include/configs/rk3128_common.h
+++ b/include/configs/rk3128_common.h
@@ -19,6 +19,8 @@
 #define CONFIG_SYS_ARCH_TIMER
 #define CONFIG_SYS_HZ_CLOCK		24000000
 
+#define CONFIG_IRAM_BASE		0x10080000
+
 #define CONFIG_SYS_INIT_SP_ADDR		0x60100000
 #define CONFIG_SYS_LOAD_ADDR		0x60800800
 
diff --git a/include/configs/rk3188_common.h b/include/configs/rk3188_common.h
index ec90088309..92524b06ad 100644
--- a/include/configs/rk3188_common.h
+++ b/include/configs/rk3188_common.h
@@ -23,6 +23,7 @@
 
 #define CONFIG_ROCKCHIP_MAX_INIT_SIZE	(0x8000 - 0x800)
 #define CONFIG_ROCKCHIP_CHIP_TAG	"RK31"
+#define CONFIG_IRAM_BASE	0x10080000
 
 /* spl size 32kb sram - 2kb bootrom */
 #define CONFIG_SPL_MAX_SIZE		(0x8000 - 0x800)
diff --git a/include/configs/rk322x_common.h b/include/configs/rk322x_common.h
index cc08699944..9582cdfb64 100644
--- a/include/configs/rk322x_common.h
+++ b/include/configs/rk322x_common.h
@@ -24,6 +24,7 @@
 
 #define CONFIG_ROCKCHIP_MAX_INIT_SIZE	(28 << 10)
 #define CONFIG_ROCKCHIP_CHIP_TAG	"RK32"
+#define CONFIG_IRAM_BASE		0x10080000
 
 #define CONFIG_SYS_SDRAM_BASE		0x60000000
 #define SDRAM_BANK_SIZE			(512UL << 20UL)
diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h
index 5472a90633..7c7d9f8fb8 100644
--- a/include/configs/rk3288_common.h
+++ b/include/configs/rk3288_common.h
@@ -25,6 +25,8 @@
 #define CONFIG_SYS_LOAD_ADDR		0x00800800
 #define CONFIG_SPL_STACK		0xff718000
 
+#define CONFIG_IRAM_BASE		0xff700000
+
 /* RAW SD card / eMMC locations. */
 #define CONFIG_SYS_SPI_U_BOOT_OFFS	(128 << 10)
 
diff --git a/include/configs/rk3328_common.h b/include/configs/rk3328_common.h
index 3a8e37ef98..1cf45bbb3e 100644
--- a/include/configs/rk3328_common.h
+++ b/include/configs/rk3328_common.h
@@ -8,6 +8,8 @@
 
 #include "rockchip-common.h"
 
+#define CONFIG_IRAM_BASE		0xff090000
+
 #define CONFIG_SYS_MALLOC_LEN		(32 << 20)
 #define CONFIG_SYS_CBSIZE		1024
 #define CONFIG_SKIP_LOWLEVEL_INIT
diff --git a/include/configs/rk3368_common.h b/include/configs/rk3368_common.h
index 1a859a7e43..340413dbba 100644
--- a/include/configs/rk3368_common.h
+++ b/include/configs/rk3368_common.h
@@ -23,6 +23,8 @@
 #define CONFIG_ROCKCHIP_STIMER_BASE	0xff830020
 #define COUNTER_FREQUENCY		24000000
 
+#define CONFIG_IRAM_BASE		0xff8c0000
+
 #define CONFIG_SYS_INIT_SP_ADDR		0x00300000
 #define CONFIG_SYS_LOAD_ADDR		0x00280000
 
diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h
index 63eac19a4e..12ad60d443 100644
--- a/include/configs/rk3399_common.h
+++ b/include/configs/rk3399_common.h
@@ -15,6 +15,8 @@
 #define COUNTER_FREQUENCY               24000000
 #define CONFIG_ROCKCHIP_STIMER_BASE	0xff8680a0
 
+#define CONFIG_IRAM_BASE		0xff8c0000
+
 #define CONFIG_SYS_INIT_SP_ADDR		0x00300000
 #define CONFIG_SYS_LOAD_ADDR		0x00800800
 
diff --git a/include/configs/rv1108_common.h b/include/configs/rv1108_common.h
index 6f61f01538..691aa51e98 100644
--- a/include/configs/rv1108_common.h
+++ b/include/configs/rv1108_common.h
@@ -8,6 +8,8 @@
 #include <asm/arch-rockchip/hardware.h>
 #include "rockchip-common.h"
 
+#define CONFIG_IRAM_BASE		0x10080000
+
 #define CONFIG_SYS_MALLOC_LEN		(32 << 20)
 #define CONFIG_SYS_CBSIZE		1024
 #define CONFIG_SKIP_LOWLEVEL_INIT
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 03/35] rockchip: intruduce common BROM_BOOTSOURCE_ID_ADDR
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 01/35] rockchip: remove redundant CONFIG_SYS_NS16550_MEM32 Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 02/35] rockchip: add CONFIG_IRAM_BASE for all SoCs Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 04/35] rockchip: declear boot_devices in bootrom.h Kever Yang
                   ` (31 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

The boot source from BootRom is store at a fix offset of IRAM,
update to use the common macro instead of rk3399 specific one.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/include/asm/arch-rockchip/bootrom.h | 2 +-
 arch/arm/mach-rockchip/rk3399-board-spl.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/arch-rockchip/bootrom.h b/arch/arm/include/asm/arch-rockchip/bootrom.h
index d67f43f09c..3499227e29 100644
--- a/arch/arm/include/asm/arch-rockchip/bootrom.h
+++ b/arch/arm/include/asm/arch-rockchip/bootrom.h
@@ -55,6 +55,6 @@ enum {
 /**
  * Locations of the boot-device identifier in SRAM
  */
-#define RK3399_BROM_BOOTSOURCE_ID_ADDR   0xff8c0010
+#define BROM_BOOTSOURCE_ID_ADDR   (CONFIG_IRAM_BASE + 0x10)
 
 #endif
diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
index 7154d8e5d0..3624c8ea65 100644
--- a/arch/arm/mach-rockchip/rk3399-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
@@ -35,7 +35,7 @@ static const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
 
 const char *board_spl_was_booted_from(void)
 {
-	u32  bootdevice_brom_id = readl(RK3399_BROM_BOOTSOURCE_ID_ADDR);
+	u32  bootdevice_brom_id = readl(BROM_BOOTSOURCE_ID_ADDR);
 	const char *bootdevice_ofpath = NULL;
 
 	if (bootdevice_brom_id < ARRAY_SIZE(boot_devices))
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 04/35] rockchip: declear boot_devices in bootrom.h
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (2 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 03/35] rockchip: intruduce common BROM_BOOTSOURCE_ID_ADDR Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 05/35] rockchip: add common spl board file Kever Yang
                   ` (30 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

boot_devices may defined in soc file, and used in board file,
we need to delear it in header file.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/include/asm/arch-rockchip/bootrom.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/include/asm/arch-rockchip/bootrom.h b/arch/arm/include/asm/arch-rockchip/bootrom.h
index 3499227e29..0da78f30b6 100644
--- a/arch/arm/include/asm/arch-rockchip/bootrom.h
+++ b/arch/arm/include/asm/arch-rockchip/bootrom.h
@@ -52,6 +52,8 @@ enum {
 	BROM_LAST_BOOTSOURCE = BROM_BOOTSOURCE_USB
 };
 
+extern const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1];
+
 /**
  * Locations of the boot-device identifier in SRAM
  */
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 05/35] rockchip: add common spl board file
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (3 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 04/35] rockchip: declear boot_devices in bootrom.h Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 06/35] rockchip: rk3188: init CPU freq in clock driver Kever Yang
                   ` (29 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

The common spl board file handles board_init_f() in SPL,
and with board_early_init_f() and arch_cpu_init() callback,
other operateion after board_init_f() should go to board specific
spl_board_init().

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/Kconfig  |   8 ++
 arch/arm/mach-rockchip/Makefile |   1 +
 arch/arm/mach-rockchip/spl.c    | 154 ++++++++++++++++++++++++++++++++
 3 files changed, 163 insertions(+)
 create mode 100644 arch/arm/mach-rockchip/spl.c

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 17f31e89f3..ac86532c88 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -227,6 +227,14 @@ config TPL_ROCKCHIP_BACK_TO_BROM
           SPL will return to the boot rom, which will then load the U-Boot
           binary to keep going on.
 
+config SPL_ROCKCHIP_COMMON_BOARD
+	bool "Rockchip SPL common board file"
+	depends on SPL
+	help
+	  Rockchip SoCs have similar boot process, SPL is mainly in charge of
+	  load and boot Trust ATF/U-Boot firmware, and DRAM init if there is
+	  no TPL for the board.
+
 config TPL_ROCKCHIP_COMMON_BOARD
 	bool ""
 	depends on TPL
diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
index a12b8d4434..b831ec6f2b 100644
--- a/arch/arm/mach-rockchip/Makefile
+++ b/arch/arm/mach-rockchip/Makefile
@@ -7,6 +7,7 @@
 # inaccessible/protected memory (and the bootrom-helper assumes that
 # the stack-pointer is valid before switching to the U-Boot stack).
 obj-spl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
+obj-spl-$(CONFIG_SPL_ROCKCHIP_COMMON_BOARD) += spl.o spl-boot-order.o
 obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
 obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o
 
diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c
new file mode 100644
index 0000000000..e00b2f11dc
--- /dev/null
+++ b/arch/arm/mach-rockchip/spl.c
@@ -0,0 +1,154 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2019 Rockchip Electronics Co., Ltd
+ */
+
+#include <common.h>
+#include <debug_uart.h>
+#include <dm.h>
+#include <ram.h>
+#include <spl.h>
+#include <asm/arch-rockchip/bootrom.h>
+#include <asm/arch-rockchip/sdram.h>
+#include <asm/io.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void board_return_to_bootrom(void)
+{
+	back_to_bootrom(BROM_BOOT_NEXTSTAGE);
+}
+
+__weak const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
+};
+
+const char *board_spl_was_booted_from(void)
+{
+	u32  bootdevice_brom_id = readl(BROM_BOOTSOURCE_ID_ADDR);
+	const char *bootdevice_ofpath = NULL;
+
+	if (bootdevice_brom_id < ARRAY_SIZE(boot_devices))
+		bootdevice_ofpath = boot_devices[bootdevice_brom_id];
+
+	if (bootdevice_ofpath)
+		debug("%s: brom_bootdevice_id %x maps to '%s'\n",
+		      __func__, bootdevice_brom_id, bootdevice_ofpath);
+	else
+		debug("%s: failed to resolve brom_bootdevice_id %x\n",
+		      __func__, bootdevice_brom_id);
+
+	return bootdevice_ofpath;
+}
+
+u32 spl_boot_device(void)
+{
+	u32 boot_device = BOOT_DEVICE_MMC1;
+
+#if defined(CONFIG_TARGET_CHROMEBOOK_JERRY) || \
+		defined(CONFIG_TARGET_CHROMEBIT_MICKEY) || \
+		defined(CONFIG_TARGET_CHROMEBOOK_MINNIE)
+	return BOOT_DEVICE_SPI;
+#endif
+	if (CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM))
+		return BOOT_DEVICE_BOOTROM;
+
+	return boot_device;
+}
+
+u32 spl_boot_mode(const u32 boot_device)
+{
+	return MMCSD_MODE_RAW;
+}
+
+#if !defined(CONFIG_SUPPORT_TPL) && !defined(CONFIG_ROCKCHIP_RK3188)
+#define TIMER_LOAD_COUNT_L	0x00
+#define TIMER_LOAD_COUNT_H	0x04
+#define TIMER_CONTROL_REG	0x10
+#define TIMER_EN	0x1
+#define	TIMER_FMODE	BIT(0)
+#define	TIMER_RMODE	BIT(1)
+
+__weak void rockchip_stimer_init(void)
+{
+	/* If Timer already enabled, don't re-init it */
+	u32 reg = readl(CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG);
+
+	if (reg & TIMER_EN)
+		return;
+#ifndef CONFIG_ARM64
+	asm volatile("mcr p15, 0, %0, c14, c0, 0"
+		     : : "r"(COUNTER_FREQUENCY));
+#endif
+	writel(0, CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG);
+	writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE);
+	writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + 4);
+	writel(TIMER_EN | TIMER_FMODE, CONFIG_ROCKCHIP_STIMER_BASE +
+	       TIMER_CONTROL_REG);
+}
+#endif
+
+__weak int board_early_init_f(void)
+{
+	return 0;
+}
+
+__weak int arch_cpu_init(void)
+{
+	return 0;
+}
+
+void board_init_f(ulong dummy)
+{
+	int ret;
+#if !defined(CONFIG_SUPPORT_TPL)
+	struct udevice *dev;
+#endif
+
+#ifdef CONFIG_DEBUG_UART
+	/*
+	 * Debug UART can be used from here if required:
+	 *
+	 * debug_uart_init();
+	 * printch('a');
+	 * printhex8(0x1234);
+	 * printascii("string");
+	 */
+	debug_uart_init();
+	debug("\nspl:debug uart enabled in %s\n", __func__);
+#endif
+
+	board_early_init_f();
+
+	ret = spl_early_init();
+	if (ret) {
+		printf("spl_early_init() failed: %d\n", ret);
+		hang();
+	}
+	arch_cpu_init();
+#if !defined(CONFIG_SUPPORT_TPL)
+	debug("\nspl:init dram\n");
+	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
+	if (ret) {
+		printf("DRAM init failed: %d\n", ret);
+		return;
+	}
+#ifndef CONFIG_ROCKCHIP_RK3188
+	rockchip_stimer_init();
+#endif
+#endif
+#ifdef CONFIG_SYS_ARCH_TIMER
+	/* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */
+	timer_init();
+#endif
+	preloader_console_init();
+}
+
+#ifdef CONFIG_SPL_LOAD_FIT
+int board_fit_config_name_match(const char *name)
+{
+	/* Just empty function now - can't decide what to choose */
+	debug("%s: %s\n", __func__, name);
+
+	return 0;
+}
+#endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 06/35] rockchip: rk3188: init CPU freq in clock driver
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (4 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 05/35] rockchip: add common spl board file Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 07/35] rockchip: rk3188: move usb uart init into arch_cpu_init() Kever Yang
                   ` (28 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

Init CPU frquency in clock driver instead of in SPL board file,
this will help for use common board file later.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/rk3188-board-spl.c | 22 ----------------------
 drivers/clk/rockchip/clk_rk3188.c         |  3 +++
 2 files changed, 3 insertions(+), 22 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3188-board-spl.c b/arch/arm/mach-rockchip/rk3188-board-spl.c
index c3efe0d7a9..017bc6e805 100644
--- a/arch/arm/mach-rockchip/rk3188-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3188-board-spl.c
@@ -70,27 +70,6 @@ fallback:
 	return BOOT_DEVICE_MMC1;
 }
 
-static int setup_arm_clock(void)
-{
-	struct udevice *dev;
-	struct clk clk;
-	int ret;
-
-	ret = rockchip_get_clk(&dev);
-	if (ret)
-		return ret;
-
-	clk.id = CLK_ARM;
-	ret = clk_request(dev, &clk);
-	if (ret < 0)
-		return ret;
-
-	ret = clk_set_rate(&clk, 600000000);
-
-	clk_free(&clk);
-	return ret;
-}
-
 void board_init_f(ulong dummy)
 {
 	struct udevice *dev;
@@ -146,7 +125,6 @@ void board_init_f(ulong dummy)
 		return;
 	}
 
-	setup_arm_clock();
 #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)
 	back_to_bootrom(BROM_BOOT_NEXTSTAGE);
 #endif
diff --git a/drivers/clk/rockchip/clk_rk3188.c b/drivers/clk/rockchip/clk_rk3188.c
index 9bb9959c9d..dda686cfb3 100644
--- a/drivers/clk/rockchip/clk_rk3188.c
+++ b/drivers/clk/rockchip/clk_rk3188.c
@@ -562,6 +562,9 @@ static int rk3188_clk_probe(struct udevice *dev)
 #endif
 
 	rkclk_init(priv->cru, priv->grf, priv->has_bwadj);
+
+	/* Init CPU frequency */
+	rkclk_configure_cpu(priv->cru, priv->grf, APLL_HZ, priv->has_bwadj);
 #endif
 
 	return 0;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 07/35] rockchip: rk3188: move usb uart init into arch_cpu_init()
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (5 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 06/35] rockchip: rk3188: init CPU freq in clock driver Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 08/35] rockchip: Migrate to use BOOTROM_SUPPORT driver Kever Yang
                   ` (27 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

The SoC feature init will be better to use arch_cpu_init() and
goes to soc file.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/rk3188-board-spl.c | 27 +++++-----------------
 arch/arm/mach-rockchip/rk3188/rk3188.c    | 28 ++++++++++++++++++++++-
 2 files changed, 33 insertions(+), 22 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3188-board-spl.c b/arch/arm/mach-rockchip/rk3188-board-spl.c
index 017bc6e805..05ae3eca98 100644
--- a/arch/arm/mach-rockchip/rk3188-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3188-board-spl.c
@@ -17,10 +17,7 @@
 #include <asm/io.h>
 #include <asm/arch-rockchip/bootrom.h>
 #include <asm/arch-rockchip/clock.h>
-#include <asm/arch-rockchip/grf_rk3188.h>
-#include <asm/arch-rockchip/hardware.h>
 #include <asm/arch-rockchip/periph.h>
-#include <asm/arch-rockchip/pmu_rk3188.h>
 #include <asm/arch-rockchip/sdram.h>
 #include <dm/root.h>
 #include <dm/test.h>
@@ -70,6 +67,11 @@ fallback:
 	return BOOT_DEVICE_MMC1;
 }
 
+__weak int arch_cpu_init(void)
+{
+	return 0;
+}
+
 void board_init_f(ulong dummy)
 {
 	struct udevice *dev;
@@ -88,24 +90,7 @@ void board_init_f(ulong dummy)
 	printascii("U-Boot SPL board init");
 #endif
 
-#ifdef CONFIG_ROCKCHIP_USB_UART
-	rk_clrsetreg(&grf->uoc0_con[0],
-		     SIDDQ_MASK | UOC_DISABLE_MASK | COMMON_ON_N_MASK,
-		     1 << SIDDQ_SHIFT | 1 << UOC_DISABLE_SHIFT |
-		     1 << COMMON_ON_N_SHIFT);
-	rk_clrsetreg(&grf->uoc0_con[2],
-		     SOFT_CON_SEL_MASK, 1 << SOFT_CON_SEL_SHIFT);
-	rk_clrsetreg(&grf->uoc0_con[3],
-		     OPMODE_MASK | XCVRSELECT_MASK |
-		     TERMSEL_FULLSPEED_MASK | SUSPENDN_MASK,
-		     OPMODE_NODRIVING << OPMODE_SHIFT |
-		     XCVRSELECT_FSTRANSC << XCVRSELECT_SHIFT |
-		     1 << TERMSEL_FULLSPEED_SHIFT |
-		     1 << SUSPENDN_SHIFT);
-	rk_clrsetreg(&grf->uoc0_con[0],
-		     BYPASSSEL_MASK | BYPASSDMEN_MASK,
-		     1 << BYPASSSEL_SHIFT | 1 << BYPASSDMEN_SHIFT);
-#endif
+	arch_cpu_init();
 
 	ret = spl_early_init();
 	if (ret) {
diff --git a/arch/arm/mach-rockchip/rk3188/rk3188.c b/arch/arm/mach-rockchip/rk3188/rk3188.c
index 933484e0df..f7e12a95b2 100644
--- a/arch/arm/mach-rockchip/rk3188/rk3188.c
+++ b/arch/arm/mach-rockchip/rk3188/rk3188.c
@@ -7,11 +7,12 @@
 #include <asm/arch-rockchip/grf_rk3188.h>
 #include <asm/arch-rockchip/hardware.h>
 
+#define GRF_BASE	0x20008000
+
 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
 void board_debug_uart_init(void)
 {
 	/* Enable early UART on the RK3188 */
-#define GRF_BASE	0x20008000
 	struct rk3188_grf * const grf = (void *)GRF_BASE;
 	enum {
 		GPIO1B1_SHIFT		= 2,
@@ -34,3 +35,28 @@ void board_debug_uart_init(void)
 		     GPIO1B0_UART2_SIN << GPIO1B0_SHIFT);
 }
 #endif
+
+int arch_cpu_init(void)
+{
+#ifdef CONFIG_ROCKCHIP_USB_UART
+	struct rk3188_grf * const grf = (void *)GRF_BASE;
+
+	rk_clrsetreg(&grf->uoc0_con[0],
+		     SIDDQ_MASK | UOC_DISABLE_MASK | COMMON_ON_N_MASK,
+		     1 << SIDDQ_SHIFT | 1 << UOC_DISABLE_SHIFT |
+		     1 << COMMON_ON_N_SHIFT);
+	rk_clrsetreg(&grf->uoc0_con[2],
+		     SOFT_CON_SEL_MASK, 1 << SOFT_CON_SEL_SHIFT);
+	rk_clrsetreg(&grf->uoc0_con[3],
+		     OPMODE_MASK | XCVRSELECT_MASK |
+		     TERMSEL_FULLSPEED_MASK | SUSPENDN_MASK,
+		     OPMODE_NODRIVING << OPMODE_SHIFT |
+		     XCVRSELECT_FSTRANSC << XCVRSELECT_SHIFT |
+		     1 << TERMSEL_FULLSPEED_SHIFT |
+		     1 << SUSPENDN_SHIFT);
+	rk_clrsetreg(&grf->uoc0_con[0],
+		     BYPASSSEL_MASK | BYPASSDMEN_MASK,
+		     1 << BYPASSSEL_SHIFT | 1 << BYPASSDMEN_SHIFT);
+#endif
+	return 0;
+}
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 08/35] rockchip: Migrate to use BOOTROM_SUPPORT driver
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (6 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 07/35] rockchip: rk3188: move usb uart init into arch_cpu_init() Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 09/35] rockchip: rk3188: move spl_board_init() into rk3188.c Kever Yang
                   ` (26 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

SPL bootrom support is a boot device just like mmc and etc,
use formal boot device instead of jump to bootrom directly.
Enable the Kconfig by default if ROCKCHIP_BACK_TO_BROM is enabled.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/Kconfig            |  9 +++------
 arch/arm/mach-rockchip/rk3188-board-spl.c | 13 ++++++-------
 arch/arm/mach-rockchip/rk3288-board-spl.c | 13 ++++++-------
 3 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index ac86532c88..2b4e3c7ce4 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -34,8 +34,8 @@ config ROCKCHIP_RK3188
 	select SPL_RAM
 	select SPL_DRIVERS_MISC_SUPPORT
 	select SPL_ROCKCHIP_EARLYRETURN_TO_BROM
+	select SPL_ROCKCHIP_BACK_TO_BROM
 	select BOARD_LATE_INIT
-	select ROCKCHIP_BROM_HELPER
 	help
 	  The Rockchip RK3188 is a ARM-based SoC with a quad-core Cortex-A9
 	  including NEON and GPU, 512KB L2 cache, Mali-400 graphics, two
@@ -59,9 +59,7 @@ config ROCKCHIP_RK322X
 	select SPL_DRIVERS_MISC_SUPPORT
 	imply SPL_SERIAL_SUPPORT
 	imply TPL_SERIAL_SUPPORT
-	imply TPL_BOOTROM_SUPPORT
 	imply TPL_ROCKCHIP_COMMON_BOARD
-	select ROCKCHIP_BROM_HELPER
 	select TPL_LIBCOMMON_SUPPORT
 	select TPL_LIBGENERIC_SUPPORT
 	help
@@ -77,7 +75,6 @@ config ROCKCHIP_RK3288
 	select SUPPORT_SPL
 	select SPL
 	select SUPPORT_TPL
-	imply TPL_BOOTROM_SUPPORT
 	imply TPL_CLK
 	imply TPL_DM
 	imply TPL_DRIVERS_MISC_SUPPORT
@@ -169,12 +166,10 @@ config ROCKCHIP_RK3399
 	select DM_PMIC
 	select DM_REGULATOR_FIXED
 	select BOARD_LATE_INIT
-	select ROCKCHIP_BROM_HELPER
 	imply TPL_SERIAL_SUPPORT
 	imply TPL_LIBCOMMON_SUPPORT
 	imply TPL_LIBGENERIC_SUPPORT
 	imply TPL_SYS_MALLOC_SIMPLE
-	imply TPL_BOOTROM_SUPPORT
 	imply TPL_DRIVERS_MISC_SUPPORT
 	imply TPL_OF_CONTROL
 	imply TPL_DM
@@ -211,6 +206,7 @@ config SPL_ROCKCHIP_BACK_TO_BROM
 	bool "SPL returns to bootrom"
 	default y if ROCKCHIP_RK3036
 	select ROCKCHIP_BROM_HELPER
+	select SPL_BOOTROM_SUPPORT
 	depends on SPL
 	help
 	  Rockchip SoCs have ability to load SPL & U-Boot binary. If enabled,
@@ -221,6 +217,7 @@ config TPL_ROCKCHIP_BACK_TO_BROM
 	bool "TPL returns to bootrom"
 	default y
 	select ROCKCHIP_BROM_HELPER
+	select TPL_BOOTROM_SUPPORT
 	depends on TPL
 	help
 	  Rockchip SoCs have ability to load SPL & U-Boot binary. If enabled,
diff --git a/arch/arm/mach-rockchip/rk3188-board-spl.c b/arch/arm/mach-rockchip/rk3188-board-spl.c
index 05ae3eca98..33fa7d0bb7 100644
--- a/arch/arm/mach-rockchip/rk3188-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3188-board-spl.c
@@ -26,6 +26,11 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+void board_return_to_bootrom(void)
+{
+	back_to_bootrom(BROM_BOOT_NEXTSTAGE);
+}
+
 u32 spl_boot_device(void)
 {
 #if !CONFIG_IS_ENABLED(OF_PLATDATA)
@@ -109,10 +114,6 @@ void board_init_f(ulong dummy)
 		debug("DRAM init failed: %d\n", ret);
 		return;
 	}
-
-#if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)
-	back_to_bootrom(BROM_BOOT_NEXTSTAGE);
-#endif
 }
 
 static int setup_led(void)
@@ -149,8 +150,6 @@ void spl_board_init(void)
 	}
 
 	preloader_console_init();
-#if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)
-	back_to_bootrom(BROM_BOOT_NEXTSTAGE);
-#endif
+
 	return;
 }
diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c
index c2e168192c..9efba47aff 100644
--- a/arch/arm/mach-rockchip/rk3288-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
@@ -30,6 +30,11 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+void board_return_to_bootrom(void)
+{
+	back_to_bootrom(BROM_BOOT_NEXTSTAGE);
+}
+
 u32 spl_boot_device(void)
 {
 #if !CONFIG_IS_ENABLED(OF_PLATDATA)
@@ -187,10 +192,6 @@ void board_init_f(ulong dummy)
 		return;
 	}
 #endif
-
-#if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)
-	back_to_bootrom(BROM_BOOT_NEXTSTAGE);
-#endif
 }
 
 static int setup_led(void)
@@ -227,9 +228,7 @@ void spl_board_init(void)
 	}
 
 	preloader_console_init();
-#if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)
-	back_to_bootrom(BROM_BOOT_NEXTSTAGE);
-#endif
+
 	return;
 }
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 09/35] rockchip: rk3188: move spl_board_init() into rk3188.c
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (7 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 08/35] rockchip: Migrate to use BOOTROM_SUPPORT driver Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 10/35] rockchip: rk3188: add boot_devices mapping to support 'same-as-spl' Kever Yang
                   ` (25 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

Clean up the rk3188.c so that we can re-use the common spl board file.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/rk3188-board-spl.c | 36 -----------------------
 arch/arm/mach-rockchip/rk3188/rk3188.c    | 36 +++++++++++++++++++++++
 2 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3188-board-spl.c b/arch/arm/mach-rockchip/rk3188-board-spl.c
index 33fa7d0bb7..6370d3837e 100644
--- a/arch/arm/mach-rockchip/rk3188-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3188-board-spl.c
@@ -114,42 +114,6 @@ void board_init_f(ulong dummy)
 		debug("DRAM init failed: %d\n", ret);
 		return;
 	}
-}
-
-static int setup_led(void)
-{
-#ifdef CONFIG_SPL_LED
-	struct udevice *dev;
-	char *led_name;
-	int ret;
-
-	led_name = fdtdec_get_config_string(gd->fdt_blob, "u-boot,boot-led");
-	if (!led_name)
-		return 0;
-	ret = led_get_by_label(led_name, &dev);
-	if (ret) {
-		debug("%s: get=%d\n", __func__, ret);
-		return ret;
-	}
-	ret = led_set_on(dev, 1);
-	if (ret)
-		return ret;
-#endif
-
-	return 0;
-}
-
-void spl_board_init(void)
-{
-	int ret;
-
-	ret = setup_led();
-	if (ret) {
-		debug("LED ret=%d\n", ret);
-		hang();
-	}
 
 	preloader_console_init();
-
-	return;
 }
diff --git a/arch/arm/mach-rockchip/rk3188/rk3188.c b/arch/arm/mach-rockchip/rk3188/rk3188.c
index f7e12a95b2..7a0b10a27d 100644
--- a/arch/arm/mach-rockchip/rk3188/rk3188.c
+++ b/arch/arm/mach-rockchip/rk3188/rk3188.c
@@ -60,3 +60,39 @@ int arch_cpu_init(void)
 #endif
 	return 0;
 }
+
+#ifdef CONFIG_SPL_BUILD
+static int setup_led(void)
+{
+#ifdef CONFIG_SPL_LED
+	struct udevice *dev;
+	char *led_name;
+	int ret;
+
+	led_name = fdtdec_get_config_string(gd->fdt_blob, "u-boot,boot-led");
+	if (!led_name)
+		return 0;
+	ret = led_get_by_label(led_name, &dev);
+	if (ret) {
+		debug("%s: get=%d\n", __func__, ret);
+		return ret;
+	}
+	ret = led_set_on(dev, 1);
+	if (ret)
+		return ret;
+#endif
+
+	return 0;
+}
+
+void spl_board_init(void)
+{
+	int ret;
+
+	ret = setup_led();
+	if (ret) {
+		debug("LED ret=%d\n", ret);
+		hang();
+	}
+}
+#endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 10/35] rockchip: rk3188: add boot_devices mapping to support 'same-as-spl'
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (8 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 09/35] rockchip: rk3188: move spl_board_init() into rk3188.c Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 11/35] rockchip: rk3188: migrate to use common spl board file Kever Yang
                   ` (24 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

The driver need a mapping to get the dts node by boot srouce ID.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/rk3188/rk3188.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/mach-rockchip/rk3188/rk3188.c b/arch/arm/mach-rockchip/rk3188/rk3188.c
index 7a0b10a27d..08792f1674 100644
--- a/arch/arm/mach-rockchip/rk3188/rk3188.c
+++ b/arch/arm/mach-rockchip/rk3188/rk3188.c
@@ -4,11 +4,17 @@
  */
 #include <common.h>
 #include <asm/io.h>
+#include <asm/arch-rockchip/bootrom.h>
 #include <asm/arch-rockchip/grf_rk3188.h>
 #include <asm/arch-rockchip/hardware.h>
 
 #define GRF_BASE	0x20008000
 
+const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
+	[BROM_BOOTSOURCE_EMMC] = "dwmmc at 1021c000",
+	[BROM_BOOTSOURCE_SD] = "dwmmc at 10214000",
+};
+
 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
 void board_debug_uart_init(void)
 {
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 11/35] rockchip: rk3188: migrate to use common spl board file
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (9 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 10/35] rockchip: rk3188: add boot_devices mapping to support 'same-as-spl' Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 12/35] rockchip: rk322x: introduce arch_cpu_init() for SoC setting init Kever Yang
                   ` (23 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

rk3188 has similar boot flow in SPL with other Rockchip SoCs,
migrate to use common spl board file.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/Kconfig            |   1 +
 arch/arm/mach-rockchip/Makefile           |   1 -
 arch/arm/mach-rockchip/rk3188-board-spl.c | 119 ----------------------
 3 files changed, 1 insertion(+), 120 deletions(-)
 delete mode 100644 arch/arm/mach-rockchip/rk3188-board-spl.c

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 2b4e3c7ce4..66d07f672e 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -36,6 +36,7 @@ config ROCKCHIP_RK3188
 	select SPL_ROCKCHIP_EARLYRETURN_TO_BROM
 	select SPL_ROCKCHIP_BACK_TO_BROM
 	select BOARD_LATE_INIT
+	imply SPL_ROCKCHIP_COMMON_BOARD
 	help
 	  The Rockchip RK3188 is a ARM-based SoC with a quad-core Cortex-A9
 	  including NEON and GPU, 512KB L2 cache, Mali-400 graphics, two
diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
index b831ec6f2b..b4797b4e0f 100644
--- a/arch/arm/mach-rockchip/Makefile
+++ b/arch/arm/mach-rockchip/Makefile
@@ -12,7 +12,6 @@ obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
 obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_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 spl-boot-order.o
 obj-spl-$(CONFIG_ROCKCHIP_RK3328) += rk3328-board-spl.o
diff --git a/arch/arm/mach-rockchip/rk3188-board-spl.c b/arch/arm/mach-rockchip/rk3188-board-spl.c
deleted file mode 100644
index 6370d3837e..0000000000
--- a/arch/arm/mach-rockchip/rk3188-board-spl.c
+++ /dev/null
@@ -1,119 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2015 Google, Inc
- */
-
-#include <clk.h>
-#include <common.h>
-#include <debug_uart.h>
-#include <dm.h>
-#include <fdtdec.h>
-#include <led.h>
-#include <malloc.h>
-#include <ram.h>
-#include <spl.h>
-#include <syscon.h>
-#include <asm/gpio.h>
-#include <asm/io.h>
-#include <asm/arch-rockchip/bootrom.h>
-#include <asm/arch-rockchip/clock.h>
-#include <asm/arch-rockchip/periph.h>
-#include <asm/arch-rockchip/sdram.h>
-#include <dm/root.h>
-#include <dm/test.h>
-#include <dm/util.h>
-#include <power/regulator.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-void board_return_to_bootrom(void)
-{
-	back_to_bootrom(BROM_BOOT_NEXTSTAGE);
-}
-
-u32 spl_boot_device(void)
-{
-#if !CONFIG_IS_ENABLED(OF_PLATDATA)
-	const void *blob = gd->fdt_blob;
-	struct udevice *dev;
-	const char *bootdev;
-	int node;
-	int ret;
-
-	bootdev = fdtdec_get_config_string(blob, "u-boot,boot0");
-	debug("Boot device %s\n", bootdev);
-	if (!bootdev)
-		goto fallback;
-
-	node = fdt_path_offset(blob, bootdev);
-	if (node < 0) {
-		debug("node=%d\n", node);
-		goto fallback;
-	}
-	ret = device_get_global_by_ofnode(offset_to_ofnode(node), &dev);
-	if (ret) {
-		debug("device@node %s/%d not found: %d\n", bootdev, node,
-		      ret);
-		goto fallback;
-	}
-	debug("Found device %s\n", dev->name);
-	switch (device_get_uclass_id(dev)) {
-	case UCLASS_SPI_FLASH:
-		return BOOT_DEVICE_SPI;
-	case UCLASS_MMC:
-		return BOOT_DEVICE_MMC1;
-	default:
-		debug("Booting from device uclass '%s' not supported\n",
-		      dev_get_uclass_name(dev));
-	}
-
-fallback:
-#endif
-	return BOOT_DEVICE_MMC1;
-}
-
-__weak int arch_cpu_init(void)
-{
-	return 0;
-}
-
-void board_init_f(ulong dummy)
-{
-	struct udevice *dev;
-	int ret;
-
-#ifdef CONFIG_DEBUG_UART
-	/*
-	 * Debug UART can be used from here if required:
-	 *
-	 * debug_uart_init();
-	 * printch('a');
-	 * printhex8(0x1234);
-	 * printascii("string");
-	 */
-	debug_uart_init();
-	printascii("U-Boot SPL board init");
-#endif
-
-	arch_cpu_init();
-
-	ret = spl_early_init();
-	if (ret) {
-		debug("spl_early_init() failed: %d\n", ret);
-		hang();
-	}
-
-	ret = rockchip_get_clk(&dev);
-	if (ret) {
-		debug("CLK init failed: %d\n", ret);
-		return;
-	}
-
-	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
-	if (ret) {
-		debug("DRAM init failed: %d\n", ret);
-		return;
-	}
-
-	preloader_console_init();
-}
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 12/35] rockchip: rk322x: introduce arch_cpu_init() for SoC setting init
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (10 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 11/35] rockchip: rk3188: migrate to use common spl board file Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 13/35] rockchip: rk322x: migrate to use common spl board file Kever Yang
                   ` (22 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

Use arch_cpu_init() to init SoC secure region and move it to
rk322x.c

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/rk322x-board-spl.c | 10 ++++++----
 arch/arm/mach-rockchip/rk322x/rk322x.c    | 12 ++++++++++++
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk322x-board-spl.c b/arch/arm/mach-rockchip/rk322x-board-spl.c
index c825e31c02..6bf9e444ce 100644
--- a/arch/arm/mach-rockchip/rk322x-board-spl.c
+++ b/arch/arm/mach-rockchip/rk322x-board-spl.c
@@ -44,7 +44,11 @@ void rockchip_stimer_init(void)
 	       TIMER_CONTROL_REG);
 }
 
-#define SGRF_DDR_CON0 0x10150000
+__weak int arch_cpu_init(void)
+{
+	return 0;
+}
+
 void board_init_f(ulong dummy)
 {
 	int ret;
@@ -60,9 +64,7 @@ void board_init_f(ulong dummy)
 	rockchip_stimer_init();
 	/* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */
 	timer_init();
-
-	/* Disable the ddr secure region setting to make it non-secure */
-	rk_clrreg(SGRF_DDR_CON0, 0x4000);
+	arch_cpu_init();
 }
 
 #ifdef CONFIG_SPL_LOAD_FIT
diff --git a/arch/arm/mach-rockchip/rk322x/rk322x.c b/arch/arm/mach-rockchip/rk322x/rk322x.c
index e5250bc784..c8c656ab4b 100644
--- a/arch/arm/mach-rockchip/rk322x/rk322x.c
+++ b/arch/arm/mach-rockchip/rk322x/rk322x.c
@@ -42,3 +42,15 @@ void board_debug_uart_init(void)
 		     CON_IOMUX_UART2SEL_21 << CON_IOMUX_UART2SEL_SHIFT);
 }
 #endif
+
+int arch_cpu_init(void)
+{
+#ifdef CONFIG_SPL_BUILD
+#define SGRF_BASE	0x10150000
+	static struct rk322x_sgrf * const sgrf = (void *)SGRF_BASE;
+
+	/* Disable the ddr secure region setting to make it non-secure */
+	rk_clrreg(&sgrf->soc_con[0], 0x4000);
+#endif
+	return 0;
+}
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 13/35] rockchip: rk322x: migrate to use common spl board file
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (11 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 12/35] rockchip: rk322x: introduce arch_cpu_init() for SoC setting init Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 14/35] rockchip: rk322x: add boot_devices mapping to support 'same-as-spl' Kever Yang
                   ` (21 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

rk322x has similar boot flow in SPL with other Rockchip SoCs,
migrate to use common spl board file.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/Kconfig            |  1 +
 arch/arm/mach-rockchip/Makefile           |  1 -
 arch/arm/mach-rockchip/rk322x-board-spl.c | 78 -----------------------
 3 files changed, 1 insertion(+), 79 deletions(-)
 delete mode 100644 arch/arm/mach-rockchip/rk322x-board-spl.c

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 66d07f672e..1904322091 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -59,6 +59,7 @@ config ROCKCHIP_RK322X
 	select TPL_NEEDS_SEPARATE_STACK if TPL
 	select SPL_DRIVERS_MISC_SUPPORT
 	imply SPL_SERIAL_SUPPORT
+	imply SPL_ROCKCHIP_COMMON_BOARD
 	imply TPL_SERIAL_SUPPORT
 	imply TPL_ROCKCHIP_COMMON_BOARD
 	select TPL_LIBCOMMON_SUPPORT
diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
index b4797b4e0f..e58da5c899 100644
--- a/arch/arm/mach-rockchip/Makefile
+++ b/arch/arm/mach-rockchip/Makefile
@@ -12,7 +12,6 @@ obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
 obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o
 
 obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-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 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
diff --git a/arch/arm/mach-rockchip/rk322x-board-spl.c b/arch/arm/mach-rockchip/rk322x-board-spl.c
deleted file mode 100644
index 6bf9e444ce..0000000000
--- a/arch/arm/mach-rockchip/rk322x-board-spl.c
+++ /dev/null
@@ -1,78 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2017 Rockchip Electronics Co., Ltd
- */
-
-#include <common.h>
-#include <dm.h>
-#include <spl.h>
-#include <asm/io.h>
-#include <asm/arch-rockchip/hardware.h>
-
-u32 spl_boot_device(void)
-{
-	return BOOT_DEVICE_MMC1;
-}
-
-u32 spl_boot_mode(const u32 boot_device)
-{
-	return MMCSD_MODE_RAW;
-}
-
-#define TIMER_LOAD_COUNT_L	0x00
-#define TIMER_LOAD_COUNT_H	0x04
-#define TIMER_CONTROL_REG	0x10
-#define TIMER_EN	0x1
-#define	TIMER_FMODE	BIT(0)
-#define	TIMER_RMODE	BIT(1)
-
-void rockchip_stimer_init(void)
-{
-	/* If Timer already enabled, don't re-init it */
-	u32 reg = readl(CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG);
-
-	if (reg & TIMER_EN)
-		return;
-
-	asm volatile("mcr p15, 0, %0, c14, c0, 0"
-		     : : "r"(COUNTER_FREQUENCY));
-
-	writel(0, CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG);
-	writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE);
-	writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + 4);
-	writel(TIMER_EN | TIMER_FMODE, CONFIG_ROCKCHIP_STIMER_BASE +
-	       TIMER_CONTROL_REG);
-}
-
-__weak int arch_cpu_init(void)
-{
-	return 0;
-}
-
-void board_init_f(ulong dummy)
-{
-	int ret;
-
-	ret = spl_early_init();
-	if (ret) {
-		printf("spl_early_init() failed: %d\n", ret);
-		hang();
-	}
-	preloader_console_init();
-
-	/* Init secure timer */
-	rockchip_stimer_init();
-	/* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */
-	timer_init();
-	arch_cpu_init();
-}
-
-#ifdef CONFIG_SPL_LOAD_FIT
-int board_fit_config_name_match(const char *name)
-{
-	/* Just empty function now - can't decide what to choose */
-	debug("%s: %s\n", __func__, name);
-
-	return 0;
-}
-#endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 14/35] rockchip: rk322x: add boot_devices mapping to support 'same-as-spl'
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (12 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 13/35] rockchip: rk322x: migrate to use common spl board file Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 15/35] rockchip: fit_spl_optee: rockchip: fix warning unit_address_vs_reg Kever Yang
                   ` (20 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

The driver need a mapping to get the dts node by boot srouce ID.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/rk322x/rk322x.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/mach-rockchip/rk322x/rk322x.c b/arch/arm/mach-rockchip/rk322x/rk322x.c
index c8c656ab4b..a8677b9783 100644
--- a/arch/arm/mach-rockchip/rk322x/rk322x.c
+++ b/arch/arm/mach-rockchip/rk322x/rk322x.c
@@ -3,9 +3,15 @@
  * (C) Copyright 2019 Rockchip Electronics Co., Ltd
  */
 #include <asm/io.h>
+#include <asm/arch-rockchip/bootrom.h>
 #include <asm/arch-rockchip/grf_rk322x.h>
 #include <asm/arch-rockchip/hardware.h>
 
+const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
+	[BROM_BOOTSOURCE_EMMC] = "dwmmc at 30020000",
+	[BROM_BOOTSOURCE_SD] = "dwmmc at 30000000",
+};
+
 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
 void board_debug_uart_init(void)
 {
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 15/35] rockchip: fit_spl_optee: rockchip: fix warning unit_address_vs_reg
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (13 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 14/35] rockchip: rk322x: add boot_devices mapping to support 'same-as-spl' Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 16/35] rockchip: rk3288: show SPL BANNER earlier in board_init_f() Kever Yang
                   ` (19 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

Update to fix warning:
u-boot.itb.tmp: Warning (unit_address_vs_reg): Node /images/uboot at 1
has a unit name, but no reg property
u-boot.itb.tmp: Warning (unit_address_vs_reg): Node /images/optee at 1
has a unit name, but no reg property
u-boot.itb.tmp: Warning (unit_address_vs_reg): Node /images/fdt at 1
has a unit name, but no reg property
u-boot.itb.tmp: Warning (unit_address_vs_reg): Node /configurations/conf at 1
has a unit name, but no reg property

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/fit_spl_optee.its | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-rockchip/fit_spl_optee.its b/arch/arm/mach-rockchip/fit_spl_optee.its
index 9be4b3c8d2..6ed5d486f2 100644
--- a/arch/arm/mach-rockchip/fit_spl_optee.its
+++ b/arch/arm/mach-rockchip/fit_spl_optee.its
@@ -11,7 +11,7 @@
 	#address-cells = <1>;
 
 	images {
-		uboot at 1 {
+		uboot {
 			description = "U-Boot";
 			data = /incbin/("../../../u-boot-nodtb.bin");
 			type = "standalone";
@@ -20,7 +20,7 @@
 			compression = "none";
 			load = <0x61000000>;
 		};
-		optee at 1 {
+		optee {
 			description = "OP-TEE";
 			data = /incbin/("../../../tee.bin");
 			type = "firmware";
@@ -30,7 +30,7 @@
 			load = <0x68400000>;
 			entry = <0x68400000>;
 		};
-		fdt at 1 {
+		fdt {
 			description = "dtb";
 			data = /incbin/("../../../u-boot.dtb");
 			type = "flat_dt";
@@ -39,12 +39,12 @@
 	};
 
 	configurations {
-		default = "conf at 1";
-		conf at 1 {
+		default = "conf";
+		conf {
 			description = "Rockchip armv7 with OP-TEE";
-			firmware = "optee at 1";
-			loadables = "uboot at 1";
-			fdt = "fdt at 1";
+			firmware = "optee";
+			loadables = "uboot";
+			fdt = "fdt";
 		};
 	};
 };
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 16/35] rockchip: rk3288: show SPL BANNER earlier in board_init_f()
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (14 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 15/35] rockchip: fit_spl_optee: rockchip: fix warning unit_address_vs_reg Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 17/35] rockchip: rk3288: move setup_led() to firefly-rk3288 Kever Yang
                   ` (18 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

Show the SPL BANNER earlier so that we know already get into SPL.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/rk3288-board-spl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c
index 9efba47aff..6fbb22075c 100644
--- a/arch/arm/mach-rockchip/rk3288-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
@@ -167,6 +167,8 @@ void board_init_f(ulong dummy)
 
 	arch_cpu_init();
 
+	preloader_console_init();
+
 	ret = rockchip_get_clk(&dev);
 	if (ret) {
 		debug("CLK init failed: %d\n", ret);
@@ -227,8 +229,6 @@ void spl_board_init(void)
 		hang();
 	}
 
-	preloader_console_init();
-
 	return;
 }
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 17/35] rockchip: rk3288: move setup_led() to firefly-rk3288
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (15 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 16/35] rockchip: rk3288: show SPL BANNER earlier in board_init_f() Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 18/35] rockchip: rk3288-phycore: move phycore_init() to its own board file Kever Yang
                   ` (17 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

Only firefly-rk3288 has the dts node "u-boot,boot-led",
while CONFIG_SPL_LED is not enable, move code to firefly-rk3288
now in case someone need this code.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/Kconfig                |  1 -
 arch/arm/mach-rockchip/rk3288-board-spl.c     | 36 -------------------
 arch/arm/mach-rockchip/rk3288/Kconfig         |  1 +
 board/firefly/firefly-rk3288/firefly-rk3288.c | 36 +++++++++++++++++++
 4 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 1904322091..ef9d6e1fac 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -73,7 +73,6 @@ config ROCKCHIP_RK322X
 config ROCKCHIP_RK3288
 	bool "Support Rockchip RK3288"
 	select CPU_V7A
-	select SPL_BOARD_INIT if SPL
 	select SUPPORT_SPL
 	select SPL
 	select SUPPORT_TPL
diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c
index 6fbb22075c..6db5369a10 100644
--- a/arch/arm/mach-rockchip/rk3288-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
@@ -196,42 +196,6 @@ void board_init_f(ulong dummy)
 #endif
 }
 
-static int setup_led(void)
-{
-#ifdef CONFIG_SPL_LED
-	struct udevice *dev;
-	char *led_name;
-	int ret;
-
-	led_name = fdtdec_get_config_string(gd->fdt_blob, "u-boot,boot-led");
-	if (!led_name)
-		return 0;
-	ret = led_get_by_label(led_name, &dev);
-	if (ret) {
-		debug("%s: get=%d\n", __func__, ret);
-		return ret;
-	}
-	ret = led_set_on(dev, 1);
-	if (ret)
-		return ret;
-#endif
-
-	return 0;
-}
-
-void spl_board_init(void)
-{
-	int ret;
-
-	ret = setup_led();
-	if (ret) {
-		debug("LED ret=%d\n", ret);
-		hang();
-	}
-
-	return;
-}
-
 #ifdef CONFIG_SPL_OS_BOOT
 
 #define PMU_BASE		0xff730000
diff --git a/arch/arm/mach-rockchip/rk3288/Kconfig b/arch/arm/mach-rockchip/rk3288/Kconfig
index de8d9c24f1..6e3ab1d06b 100644
--- a/arch/arm/mach-rockchip/rk3288/Kconfig
+++ b/arch/arm/mach-rockchip/rk3288/Kconfig
@@ -66,6 +66,7 @@ config TARGET_FENNEC_RK3288
 config TARGET_FIREFLY_RK3288
 	bool "Firefly-RK3288"
 	select BOARD_LATE_INIT
+	select SPL_BOARD_INIT if SPL
 	help
 	  Firefly is a RK3288-based development board with 2 USB ports,
 	  HDMI, VGA, micro-SD card, audio, WiFi  and Gigabit Ethernet, It
diff --git a/board/firefly/firefly-rk3288/firefly-rk3288.c b/board/firefly/firefly-rk3288/firefly-rk3288.c
index bdc02a6a79..a3f784f0a3 100644
--- a/board/firefly/firefly-rk3288/firefly-rk3288.c
+++ b/board/firefly/firefly-rk3288/firefly-rk3288.c
@@ -4,3 +4,39 @@
  */
 
 #include <common.h>
+
+#ifdef CONFIG_SPL_BUILD
+static int setup_led(void)
+{
+#ifdef CONFIG_SPL_LED
+	struct udevice *dev;
+	char *led_name;
+	int ret;
+
+	led_name = fdtdec_get_config_string(gd->fdt_blob, "u-boot,boot-led");
+	if (!led_name)
+		return 0;
+	ret = led_get_by_label(led_name, &dev);
+	if (ret) {
+		debug("%s: get=%d\n", __func__, ret);
+		return ret;
+	}
+	ret = led_set_on(dev, 1);
+	if (ret)
+		return ret;
+#endif
+
+	return 0;
+}
+
+void spl_board_init(void)
+{
+	int ret;
+
+	ret = setup_led();
+	if (ret) {
+		debug("LED ret=%d\n", ret);
+		hang();
+	}
+}
+#endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 18/35] rockchip: rk3288-phycore: move phycore_init() to its own board file
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (16 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 17/35] rockchip: rk3288: move setup_led() to firefly-rk3288 Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-23 10:36   ` Wadim Egorov
  2019-07-22 11:59 ` [U-Boot] [PATCH 19/35] rockchip: rk3288: move dram_init_banksize() into soc file Kever Yang
                   ` (16 subsequent siblings)
  34 siblings, 1 reply; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

phycore_init() is use for phycore board only, it should be move back
to phycore-rk3288.c

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/rk3288-board-spl.c    | 39 ----------------
 arch/arm/mach-rockchip/rk3288/Kconfig        |  1 +
 board/phytec/phycore_rk3288/phycore-rk3288.c | 47 ++++++++++++++++++++
 3 files changed, 48 insertions(+), 39 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c
index 6db5369a10..13cd86079b 100644
--- a/arch/arm/mach-rockchip/rk3288-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
@@ -25,8 +25,6 @@
 #include <dm/root.h>
 #include <dm/test.h>
 #include <dm/util.h>
-#include <power/regulator.h>
-#include <power/rk8xx_pmic.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -81,32 +79,6 @@ fallback:
 	return BOOT_DEVICE_MMC1;
 }
 
-#if !defined(CONFIG_SPL_OF_PLATDATA)
-static int phycore_init(void)
-{
-	struct udevice *pmic;
-	int ret;
-
-	ret = uclass_first_device_err(UCLASS_PMIC, &pmic);
-	if (ret)
-		return ret;
-
-#if defined(CONFIG_SPL_POWER_SUPPORT)
-	/* Increase USB input current to 2A */
-	ret = rk818_spl_configure_usb_input_current(pmic, 2000);
-	if (ret)
-		return ret;
-
-	/* Close charger when USB lower then 3.26V */
-	ret = rk818_spl_configure_usb_chrg_shutdown(pmic, 3260000);
-	if (ret)
-		return ret;
-#endif
-
-	return 0;
-}
-#endif
-
 __weak int arch_cpu_init(void)
 {
 	return 0;
@@ -175,17 +147,6 @@ void board_init_f(ulong dummy)
 		return;
 	}
 
-#if !defined(CONFIG_SPL_OF_PLATDATA)
-	if (of_machine_is_compatible("phytec,rk3288-phycore-som")) {
-		ret = phycore_init();
-		if (ret) {
-			debug("Failed to set up phycore power settings: %d\n",
-			      ret);
-			return;
-		}
-	}
-#endif
-
 #if !defined(CONFIG_SUPPORT_TPL)
 	debug("\nspl:init dram\n");
 	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
diff --git a/arch/arm/mach-rockchip/rk3288/Kconfig b/arch/arm/mach-rockchip/rk3288/Kconfig
index 6e3ab1d06b..87d0786ba8 100644
--- a/arch/arm/mach-rockchip/rk3288/Kconfig
+++ b/arch/arm/mach-rockchip/rk3288/Kconfig
@@ -85,6 +85,7 @@ config TARGET_MIQI_RK3288
 config TARGET_PHYCORE_RK3288
 	bool "phyCORE-RK3288"
         select BOARD_LATE_INIT
+	select SPL_BOARD_INIT if SPL
 	help
 	  Add basic support for the PCM-947 carrier board, a RK3288 based
 	  development board made by PHYTEC. This board works in a combination
diff --git a/board/phytec/phycore_rk3288/phycore-rk3288.c b/board/phytec/phycore_rk3288/phycore-rk3288.c
index ffe1833b06..fbf1511978 100644
--- a/board/phytec/phycore_rk3288/phycore-rk3288.c
+++ b/board/phytec/phycore_rk3288/phycore-rk3288.c
@@ -8,10 +8,13 @@
 #include <common.h>
 #include <dm.h>
 #include <environment.h>
+#include <fdtdec.h>
 #include <i2c.h>
 #include <i2c_eeprom.h>
 #include <netdev.h>
 #include "som.h"
+#include <power/regulator.h>
+#include <power/rk8xx_pmic.h>
 
 static int valid_rk3288_som(struct rk3288_som *som)
 {
@@ -68,3 +71,47 @@ int rk_board_late_init(void)
 
 	return 0;
 }
+
+#ifdef CONFIG_SPL_BUILD
+#if !defined(CONFIG_SPL_OF_PLATDATA)
+static int phycore_init(void)
+{
+	struct udevice *pmic;
+	int ret;
+
+	ret = uclass_first_device_err(UCLASS_PMIC, &pmic);
+	if (ret)
+		return ret;
+
+#if defined(CONFIG_SPL_POWER_SUPPORT)
+	/* Increase USB input current to 2A */
+	ret = rk818_spl_configure_usb_input_current(pmic, 2000);
+	if (ret)
+		return ret;
+
+	/* Close charger when USB lower then 3.26V */
+	ret = rk818_spl_configure_usb_chrg_shutdown(pmic, 3260000);
+	if (ret)
+		return ret;
+#endif
+
+	return 0;
+}
+#endif
+
+void spl_board_init(void)
+{
+#if !defined(CONFIG_SPL_OF_PLATDATA)
+	int ret;
+
+	if (of_machine_is_compatible("phytec,rk3288-phycore-som")) {
+		ret = phycore_init();
+		if (ret) {
+			debug("Failed to set up phycore power settings: %d\n",
+			      ret);
+			return;
+		}
+	}
+#endif
+}
+#endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 19/35] rockchip: rk3288: move dram_init_banksize() into soc file
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (17 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 18/35] rockchip: rk3288-phycore: move phycore_init() to its own board file Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 20/35] rockchip: rk3288: Migrate to use common spl board file Kever Yang
                   ` (15 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

Mov edram_init_banksize() into rk3288.c so that we can re-use
the common SPL board file later.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/rk3288-board-spl.c | 15 ---------------
 arch/arm/mach-rockchip/rk3288/rk3288.c    | 15 +++++++++++++++
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c
index 13cd86079b..97853ccdc7 100644
--- a/arch/arm/mach-rockchip/rk3288-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
@@ -156,18 +156,3 @@ void board_init_f(ulong dummy)
 	}
 #endif
 }
-
-#ifdef CONFIG_SPL_OS_BOOT
-
-#define PMU_BASE		0xff730000
-int dram_init_banksize(void)
-{
-	struct rk3288_pmu *const pmu = (void *)PMU_BASE;
-	size_t size = rockchip_sdram_size((phys_addr_t)&pmu->sys_reg[2]);
-
-	gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
-	gd->bd->bi_dram[0].size = size;
-
-	return 0;
-}
-#endif
diff --git a/arch/arm/mach-rockchip/rk3288/rk3288.c b/arch/arm/mach-rockchip/rk3288/rk3288.c
index 7552472fbc..2526c04c58 100644
--- a/arch/arm/mach-rockchip/rk3288/rk3288.c
+++ b/arch/arm/mach-rockchip/rk3288/rk3288.c
@@ -57,3 +57,18 @@ void board_debug_uart_init(void)
 		     GPIO7C6_UART2DBG_SIN << GPIO7C6_SHIFT);
 }
 #endif
+
+#ifdef CONFIG_SPL_OS_BOOT
+
+#define PMU_BASE		0xff730000
+int dram_init_banksize(void)
+{
+	struct rk3288_pmu *const pmu = (void *)PMU_BASE;
+	size_t size = rockchip_sdram_size((phys_addr_t)&pmu->sys_reg[2]);
+
+	gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
+	gd->bd->bi_dram[0].size = size;
+
+	return 0;
+}
+#endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 20/35] rockchip: rk3288: Migrate to use common spl board file
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (18 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 19/35] rockchip: rk3288: move dram_init_banksize() into soc file Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 21/35] rockchip: phycore: remove no use "u-boot, boot0" in dts Kever Yang
                   ` (14 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

rk3288 has similar boot flow in SPL with other Rockchip SoCs,
migrate to use common spl board file.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/Kconfig            |   1 +
 arch/arm/mach-rockchip/Makefile           |   1 -
 arch/arm/mach-rockchip/rk3288-board-spl.c | 158 ----------------------
 3 files changed, 1 insertion(+), 159 deletions(-)
 delete mode 100644 arch/arm/mach-rockchip/rk3288-board-spl.c

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index ef9d6e1fac..34979206d2 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -76,6 +76,7 @@ config ROCKCHIP_RK3288
 	select SUPPORT_SPL
 	select SPL
 	select SUPPORT_TPL
+	imply SPL_ROCKCHIP_COMMON_BOARD
 	imply TPL_CLK
 	imply TPL_DM
 	imply TPL_DRIVERS_MISC_SUPPORT
diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
index e58da5c899..808ca43ca0 100644
--- a/arch/arm/mach-rockchip/Makefile
+++ b/arch/arm/mach-rockchip/Makefile
@@ -12,7 +12,6 @@ obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
 obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o
 
 obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-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
diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c
deleted file mode 100644
index 97853ccdc7..0000000000
--- a/arch/arm/mach-rockchip/rk3288-board-spl.c
+++ /dev/null
@@ -1,158 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2015 Google, Inc
- */
-
-#include <common.h>
-#include <debug_uart.h>
-#include <dm.h>
-#include <fdtdec.h>
-#include <i2c.h>
-#include <led.h>
-#include <malloc.h>
-#include <ram.h>
-#include <spl.h>
-#include <asm/gpio.h>
-#include <asm/io.h>
-#include <asm/arch-rockchip/bootrom.h>
-#include <asm/arch-rockchip/clock.h>
-#include <asm/arch-rockchip/hardware.h>
-#include <asm/arch-rockchip/periph.h>
-#include <asm/arch-rockchip/pmu_rk3288.h>
-#include <asm/arch-rockchip/sdram.h>
-#include <asm/arch-rockchip/sdram_common.h>
-#include <asm/arch-rockchip/sys_proto.h>
-#include <dm/root.h>
-#include <dm/test.h>
-#include <dm/util.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-void board_return_to_bootrom(void)
-{
-	back_to_bootrom(BROM_BOOT_NEXTSTAGE);
-}
-
-u32 spl_boot_device(void)
-{
-#if !CONFIG_IS_ENABLED(OF_PLATDATA)
-	const void *blob = gd->fdt_blob;
-	struct udevice *dev;
-	const char *bootdev;
-	int node;
-	int ret;
-
-	bootdev = fdtdec_get_config_string(blob, "u-boot,boot0");
-	debug("Boot device %s\n", bootdev);
-	if (!bootdev)
-		goto fallback;
-
-	node = fdt_path_offset(blob, bootdev);
-	if (node < 0) {
-		debug("node=%d\n", node);
-		goto fallback;
-	}
-	ret = device_get_global_by_ofnode(offset_to_ofnode(node), &dev);
-	if (ret) {
-		debug("device@node %s/%d not found: %d\n", bootdev, node,
-		      ret);
-		goto fallback;
-	}
-	debug("Found device %s\n", dev->name);
-	switch (device_get_uclass_id(dev)) {
-	case UCLASS_SPI_FLASH:
-		return BOOT_DEVICE_SPI;
-	case UCLASS_MMC:
-		return BOOT_DEVICE_MMC1;
-	default:
-		debug("Booting from device uclass '%s' not supported\n",
-		      dev_get_uclass_name(dev));
-	}
-
-fallback:
-#elif defined(CONFIG_TARGET_CHROMEBOOK_JERRY) || \
-		defined(CONFIG_TARGET_CHROMEBIT_MICKEY) || \
-		defined(CONFIG_TARGET_CHROMEBOOK_MINNIE) || \
-		defined(CONFIG_TARGET_CHROMEBOOK_SPEEDY)
-	return BOOT_DEVICE_SPI;
-#endif
-	return BOOT_DEVICE_MMC1;
-}
-
-__weak int arch_cpu_init(void)
-{
-	return 0;
-}
-
-#define TIMER_LOAD_COUNT_L	0x00
-#define TIMER_LOAD_COUNT_H	0x04
-#define TIMER_CONTROL_REG	0x10
-#define TIMER_EN	0x1
-#define	TIMER_FMODE	BIT(0)
-#define	TIMER_RMODE	BIT(1)
-
-void rockchip_stimer_init(void)
-{
-	/* If Timer already enabled, don't re-init it */
-	u32 reg = readl(CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG);
-
-	if (reg & TIMER_EN)
-		return;
-
-	asm volatile("mcr p15, 0, %0, c14, c0, 0"
-		     : : "r"(COUNTER_FREQUENCY));
-
-	writel(0, CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG);
-	writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE);
-	writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + 4);
-	writel(TIMER_EN | TIMER_FMODE, CONFIG_ROCKCHIP_STIMER_BASE +
-	       TIMER_CONTROL_REG);
-}
-
-void board_init_f(ulong dummy)
-{
-	struct udevice *dev;
-	int ret;
-
-#ifdef CONFIG_DEBUG_UART
-	/*
-	 * Debug UART can be used from here if required:
-	 *
-	 * debug_uart_init();
-	 * printch('a');
-	 * printhex8(0x1234);
-	 * printascii("string");
-	 */
-	debug_uart_init();
-	debug("\nspl:debug uart enabled in %s\n", __func__);
-#endif
-	ret = spl_early_init();
-	if (ret) {
-		debug("spl_early_init() failed: %d\n", ret);
-		hang();
-	}
-
-	/* Init secure timer */
-	rockchip_stimer_init();
-	/* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */
-	timer_init();
-
-	arch_cpu_init();
-
-	preloader_console_init();
-
-	ret = rockchip_get_clk(&dev);
-	if (ret) {
-		debug("CLK init failed: %d\n", ret);
-		return;
-	}
-
-#if !defined(CONFIG_SUPPORT_TPL)
-	debug("\nspl:init dram\n");
-	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
-	if (ret) {
-		debug("DRAM init failed: %d\n", ret);
-		return;
-	}
-#endif
-}
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 21/35] rockchip: phycore: remove no use "u-boot, boot0" in dts
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (19 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 20/35] rockchip: rk3288: Migrate to use common spl board file Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 22/35] rockchip: rk3288-veyron: Migrate "u-boot, boot0" to "u-boot, spl-boot-order" Kever Yang
                   ` (13 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

We are using "u-boot,spl-boot-order" now and re-use the
definition from rk3288-u-boot.dtsi, so remove it directly here.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/dts/rk3288-phycore-rdk.dts | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/arm/dts/rk3288-phycore-rdk.dts b/arch/arm/dts/rk3288-phycore-rdk.dts
index f2bb7b5f11..cc3921095c 100644
--- a/arch/arm/dts/rk3288-phycore-rdk.dts
+++ b/arch/arm/dts/rk3288-phycore-rdk.dts
@@ -55,11 +55,6 @@
 		stdout-path = &uart2;
 	};
 
-	config {
-		u-boot,dm-pre-reloc;
-		u-boot,boot0 = &emmc;
-	};
-
 	user_buttons: user-buttons {
 		compatible = "gpio-keys";
 		pinctrl-names = "default";
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 22/35] rockchip: rk3288-veyron: Migrate "u-boot, boot0" to "u-boot, spl-boot-order"
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (20 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 21/35] rockchip: phycore: remove no use "u-boot, boot0" in dts Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 23/35] rockchip: rk3288: add boot_devices mapping to support 'same-as-spl' Kever Yang
                   ` (12 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

"u-boot,spl-boot-order" is more flexible and other rockchip SoCs
has convert to use it, migrate to use the new dts property.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/dts/rk3288-veyron.dtsi | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/arm/dts/rk3288-veyron.dtsi b/arch/arm/dts/rk3288-veyron.dtsi
index 916dd486de..8754043b9b 100644
--- a/arch/arm/dts/rk3288-veyron.dtsi
+++ b/arch/arm/dts/rk3288-veyron.dtsi
@@ -16,11 +16,7 @@
 
 	chosen {
 		stdout-path = &uart2;
-	};
-
-	config {
-		u-boot,dm-pre-reloc;
-		u-boot,boot0 = &spi_flash;
+		u-boot,spl-boot-order = &spi_flash;
 	};
 
 	firmware {
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 23/35] rockchip: rk3288: add boot_devices mapping to support 'same-as-spl'
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (21 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 22/35] rockchip: rk3288-veyron: Migrate "u-boot, boot0" to "u-boot, spl-boot-order" Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 24/35] rockchip: rk3328: add STIMER_BASE definition Kever Yang
                   ` (11 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

The driver need a mapping to get the dts node by boot srouce ID.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/rk3288/rk3288.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/mach-rockchip/rk3288/rk3288.c b/arch/arm/mach-rockchip/rk3288/rk3288.c
index 2526c04c58..de9e396288 100644
--- a/arch/arm/mach-rockchip/rk3288/rk3288.c
+++ b/arch/arm/mach-rockchip/rk3288/rk3288.c
@@ -4,11 +4,17 @@
  */
 #include <asm/armv7.h>
 #include <asm/io.h>
+#include <asm/arch-rockchip/bootrom.h>
 #include <asm/arch-rockchip/hardware.h>
 #include <asm/arch-rockchip/grf_rk3288.h>
 
 #define GRF_BASE	0xff770000
 
+const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
+	[BROM_BOOTSOURCE_EMMC] = "dwmmc at ff0f0000",
+	[BROM_BOOTSOURCE_SD] = "dwmmc at ff0c0000",
+};
+
 #ifdef CONFIG_SPL_BUILD
 static void configure_l2ctlr(void)
 {
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 24/35] rockchip: rk3328: add STIMER_BASE definition
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (22 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 23/35] rockchip: rk3288: add boot_devices mapping to support 'same-as-spl' Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 25/35] rockchip: rk3328: migrate to use common spl board file Kever Yang
                   ` (10 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

Add the CONFIG_ROCKCHIP_STIMER_BASE so that we can use the stimer
init function in tpl.c and spl.c

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 include/configs/rk3328_common.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/rk3328_common.h b/include/configs/rk3328_common.h
index 1cf45bbb3e..6ed7525304 100644
--- a/include/configs/rk3328_common.h
+++ b/include/configs/rk3328_common.h
@@ -10,6 +10,8 @@
 
 #define CONFIG_IRAM_BASE		0xff090000
 
+#define CONFIG_ROCKCHIP_STIMER_BASE    0xff1d0020
+
 #define CONFIG_SYS_MALLOC_LEN		(32 << 20)
 #define CONFIG_SYS_CBSIZE		1024
 #define CONFIG_SKIP_LOWLEVEL_INIT
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 25/35] rockchip: rk3328: migrate to use common spl board file
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (23 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 24/35] rockchip: rk3328: add STIMER_BASE definition Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 26/35] rockchip: rk3328: add boot_devices mapping to support 'same-as-spl' Kever Yang
                   ` (9 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

rk3328 has similar boot flow in SPL with other Rockchip SoCs,
migrate to use common spl board file.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/Kconfig            |  1 +
 arch/arm/mach-rockchip/Makefile           |  1 -
 arch/arm/mach-rockchip/rk3328-board-spl.c | 58 -----------------------
 3 files changed, 1 insertion(+), 59 deletions(-)
 delete mode 100644 arch/arm/mach-rockchip/rk3328-board-spl.c

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 34979206d2..05d207dd7a 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -105,6 +105,7 @@ config ROCKCHIP_RK3328
 	select ARM64
 	select SUPPORT_SPL
 	select SPL
+	imply SPL_ROCKCHIP_COMMON_BOARD
 	imply SPL_SERIAL_SUPPORT
 	imply SPL_SEPARATE_BSS
 	select ENABLE_ARM_SOC_BOOT0_HOOK
diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
index 808ca43ca0..579a2ce8ca 100644
--- a/arch/arm/mach-rockchip/Makefile
+++ b/arch/arm/mach-rockchip/Makefile
@@ -12,7 +12,6 @@ obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
 obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o
 
 obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.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
 
diff --git a/arch/arm/mach-rockchip/rk3328-board-spl.c b/arch/arm/mach-rockchip/rk3328-board-spl.c
deleted file mode 100644
index f24fd89e3f..0000000000
--- a/arch/arm/mach-rockchip/rk3328-board-spl.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * (C) Copyright 2016 Rockchip Electronics Co., Ltd
- *
- * SPDX-License-Identifier:     GPL-2.0+
- */
-
-#include <common.h>
-#include <debug_uart.h>
-#include <dm.h>
-#include <ram.h>
-#include <spl.h>
-#include <asm/io.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-void board_debug_uart_init(void)
-{
-}
-
-void board_init_f(ulong dummy)
-{
-	struct udevice *dev;
-	int ret;
-
-	ret = spl_early_init();
-	if (ret) {
-		debug("spl_early_init() failed: %d\n", ret);
-		hang();
-	}
-
-	preloader_console_init();
-
-	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
-	if (ret) {
-		debug("DRAM init failed: %d\n", ret);
-		return;
-	}
-}
-
-u32 spl_boot_mode(const u32 boot_device)
-{
-	return MMCSD_MODE_RAW;
-}
-
-u32 spl_boot_device(void)
-{
-	return BOOT_DEVICE_MMC1;
-}
-
-#ifdef CONFIG_SPL_LOAD_FIT
-int board_fit_config_name_match(const char *name)
-{
-	/* Just empty function now - can't decide what to choose */
-	debug("%s: %s\n", __func__, name);
-
-	return 0;
-}
-#endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 26/35] rockchip: rk3328: add boot_devices mapping to support 'same-as-spl'
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (24 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 25/35] rockchip: rk3328: migrate to use common spl board file Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 27/35] rockchip: rk3368: migrate to use common spl board file Kever Yang
                   ` (8 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

The driver need a mapping to get the dts node by boot srouce ID.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/rk3328/rk3328.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/mach-rockchip/rk3328/rk3328.c b/arch/arm/mach-rockchip/rk3328/rk3328.c
index 1cf829dc34..222a8d36d3 100644
--- a/arch/arm/mach-rockchip/rk3328/rk3328.c
+++ b/arch/arm/mach-rockchip/rk3328/rk3328.c
@@ -4,12 +4,18 @@
  */
 
 #include <common.h>
+#include <asm/arch-rockchip/bootrom.h>
 #include <asm/arch-rockchip/hardware.h>
 #include <asm/armv8/mmu.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
+	[BROM_BOOTSOURCE_EMMC] = "rksdmmc at ff520000",
+	[BROM_BOOTSOURCE_SD] = "rksdmmc at ff500000",
+};
+
 static struct mm_region rk3328_mem_map[] = {
 	{
 		.virt = 0x0UL,
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 27/35] rockchip: rk3368: migrate to use common spl board file
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (25 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 26/35] rockchip: rk3328: add boot_devices mapping to support 'same-as-spl' Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 28/35] rockchip: rk3368: add boot_devices mapping to support 'same-as-spl' Kever Yang
                   ` (7 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

rk3368 has similar boot flow in SPL with other Rockchip SoCs,
migrate to use common spl board file.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/Kconfig            |  1 +
 arch/arm/mach-rockchip/Makefile           |  1 -
 arch/arm/mach-rockchip/rk3368-board-spl.c | 80 -----------------------
 3 files changed, 1 insertion(+), 81 deletions(-)
 delete mode 100644 arch/arm/mach-rockchip/rk3368-board-spl.c

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 05d207dd7a..25214bca9c 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -125,6 +125,7 @@ config ROCKCHIP_RK3368
 	select SUPPORT_TPL
 	select TPL_NEEDS_SEPARATE_TEXT_BASE if SPL
 	select TPL_NEEDS_SEPARATE_STACK if TPL
+	imply SPL_ROCKCHIP_COMMON_BOARD
 	imply SPL_SEPARATE_BSS
 	imply SPL_SERIAL_SUPPORT
 	imply TPL_SERIAL_SUPPORT
diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
index 579a2ce8ca..c7ab72c13b 100644
--- a/arch/arm/mach-rockchip/Makefile
+++ b/arch/arm/mach-rockchip/Makefile
@@ -12,7 +12,6 @@ obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
 obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o
 
 obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-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
 
 ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
diff --git a/arch/arm/mach-rockchip/rk3368-board-spl.c b/arch/arm/mach-rockchip/rk3368-board-spl.c
deleted file mode 100644
index 6ba106c63b..0000000000
--- a/arch/arm/mach-rockchip/rk3368-board-spl.c
+++ /dev/null
@@ -1,80 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
- */
-
-#include <common.h>
-#include <debug_uart.h>
-#include <dm.h>
-#include <ram.h>
-#include <spl.h>
-#include <asm/io.h>
-#include <asm/arch-rockchip/periph.h>
-
-__weak int arch_cpu_init(void)
-{
-	return 0;
-}
-
-#define TIMER_LOAD_COUNT_L	0x00
-#define TIMER_LOAD_COUNT_H	0x04
-#define TIMER_CONTROL_REG	0x10
-#define TIMER_EN	0x1
-#define	TIMER_FMODE	BIT(0)
-#define	TIMER_RMODE	BIT(1)
-
-void rockchip_stimer_init(void)
-{
-	/* If Timer already enabled, don't re-init it */
-	u32 reg = readl(CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG);
-
-	if (reg & TIMER_EN)
-		return;
-
-	writel(0, CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG);
-	writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE);
-	writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + 4);
-	writel(TIMER_EN | TIMER_FMODE, CONFIG_ROCKCHIP_STIMER_BASE +
-	       TIMER_CONTROL_REG);
-}
-
-void board_init_f(ulong dummy)
-{
-	struct udevice *dev;
-	int ret;
-
-	ret = spl_early_init();
-	if (ret) {
-		debug("spl_early_init() failed: %d\n", ret);
-		hang();
-	}
-
-	/* Init secure timer */
-	rockchip_stimer_init();
-	/* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */
-	timer_init();
-
-	arch_cpu_init();
-	preloader_console_init();
-
-	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
-	if (ret) {
-		debug("DRAM init failed: %d\n", ret);
-		return;
-	}
-}
-
-u32 spl_boot_device(void)
-{
-	return BOOT_DEVICE_MMC1;
-}
-
-#ifdef CONFIG_SPL_LOAD_FIT
-int board_fit_config_name_match(const char *name)
-{
-	/* Just empty function now - can't decide what to choose */
-	debug("%s: %s\n", __func__, name);
-
-	return 0;
-}
-#endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 28/35] rockchip: rk3368: add boot_devices mapping to support 'same-as-spl'
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (26 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 27/35] rockchip: rk3368: migrate to use common spl board file Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 29/35] rockchip: rk3399: move spl_perform_fixups() into soc file Kever Yang
                   ` (6 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

The driver need a mapping to get the dts node by boot srouce ID.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/rk3368/rk3368.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/mach-rockchip/rk3368/rk3368.c b/arch/arm/mach-rockchip/rk3368/rk3368.c
index 47786f52ee..c75a5cd0c4 100644
--- a/arch/arm/mach-rockchip/rk3368/rk3368.c
+++ b/arch/arm/mach-rockchip/rk3368/rk3368.c
@@ -8,6 +8,7 @@
 #include <syscon.h>
 #include <asm/armv8/mmu.h>
 #include <asm/io.h>
+#include <asm/arch-rockchip/bootrom.h>
 #include <asm/arch-rockchip/clock.h>
 #include <asm/arch-rockchip/cru_rk3368.h>
 #include <asm/arch-rockchip/grf_rk3368.h>
@@ -52,6 +53,11 @@ static struct mm_region rk3368_mem_map[] = {
 
 struct mm_region *mem_map = rk3368_mem_map;
 
+const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
+	[BROM_BOOTSOURCE_EMMC] = "dwmmc at ff0f0000",
+	[BROM_BOOTSOURCE_SD] = "dwmmc at ff0c0000",
+};
+
 int dram_init_banksize(void)
 {
 	size_t max_size = min((unsigned long)gd->ram_size, gd->ram_top);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 29/35] rockchip: rk3399: move spl_perform_fixups() into soc file
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (27 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 28/35] rockchip: rk3368: add boot_devices mapping to support 'same-as-spl' Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 30/35] rockchip: rk3399: show SPL BANNER earlier in board_init_f() Kever Yang
                   ` (5 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

Move the spl_perform_fixups() into rk3399.c so that we can
use common spl board file later.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/rk3399-board-spl.c | 48 ----------------------
 arch/arm/mach-rockchip/rk3399/rk3399.c    | 50 +++++++++++++++++++++++
 2 files changed, 50 insertions(+), 48 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
index 3624c8ea65..826ca443ce 100644
--- a/arch/arm/mach-rockchip/rk3399-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
@@ -61,54 +61,6 @@ u32 spl_boot_device(void)
 	return boot_device;
 }
 
-const char *spl_decode_boot_device(u32 boot_device)
-{
-	int i;
-	static const struct {
-		u32 boot_device;
-		const char *ofpath;
-	} spl_boot_devices_tbl[] = {
-		{ BOOT_DEVICE_MMC1, "/dwmmc at fe320000" },
-		{ BOOT_DEVICE_MMC2, "/sdhci at fe330000" },
-		{ BOOT_DEVICE_SPI, "/spi at ff1d0000" },
-	};
-
-	for (i = 0; i < ARRAY_SIZE(spl_boot_devices_tbl); ++i)
-		if (spl_boot_devices_tbl[i].boot_device == boot_device)
-			return spl_boot_devices_tbl[i].ofpath;
-
-	return NULL;
-}
-
-void spl_perform_fixups(struct spl_image_info *spl_image)
-{
-	void *blob = spl_image->fdt_addr;
-	const char *boot_ofpath;
-	int chosen;
-
-	/*
-	 * Inject the ofpath of the device the full U-Boot (or Linux in
-	 * Falcon-mode) was booted from into the FDT, if a FDT has been
-	 * loaded at the same time.
-	 */
-	if (!blob)
-		return;
-
-	boot_ofpath = spl_decode_boot_device(spl_image->boot_device);
-	if (!boot_ofpath) {
-		pr_err("%s: could not map boot_device to ofpath\n", __func__);
-		return;
-	}
-
-	chosen = fdt_find_or_add_subnode(blob, 0, "chosen");
-	if (chosen < 0) {
-		pr_err("%s: could not find/create '/chosen'\n", __func__);
-		return;
-	}
-	fdt_setprop_string(blob, chosen,
-			   "u-boot,spl-boot-device", boot_ofpath);
-}
-
 __weak void rockchip_stimer_init(void)
 {
 }
diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c
index 0f09ea5c49..dacbcf8fdf 100644
--- a/arch/arm/mach-rockchip/rk3399/rk3399.c
+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
@@ -146,3 +146,53 @@ void board_debug_uart_init(void)
 #endif
 }
 #endif
+
+#ifdef CONFIG_SPL_BUILD
+const char *spl_decode_boot_device(u32 boot_device)
+{
+	int i;
+	static const struct {
+		u32 boot_device;
+		const char *ofpath;
+	} spl_boot_devices_tbl[] = {
+		{ BOOT_DEVICE_MMC1, "/dwmmc at fe320000" },
+		{ BOOT_DEVICE_MMC2, "/sdhci at fe330000" },
+		{ BOOT_DEVICE_SPI, "/spi@ff1d0000" },
+	};
+
+	for (i = 0; i < ARRAY_SIZE(spl_boot_devices_tbl); ++i)
+		if (spl_boot_devices_tbl[i].boot_device == boot_device)
+			return spl_boot_devices_tbl[i].ofpath;
+
+	return NULL;
+}
+
+void spl_perform_fixups(struct spl_image_info *spl_image)
+{
+	void *blob = spl_image->fdt_addr;
+	const char *boot_ofpath;
+	int chosen;
+
+	/*
+	 * Inject the ofpath of the device the full U-Boot (or Linux in
+	 * Falcon-mode) was booted from into the FDT, if a FDT has been
+	 * loaded at the same time.
+	 */
+	if (!blob)
+		return;
+
+	boot_ofpath = spl_decode_boot_device(spl_image->boot_device);
+	if (!boot_ofpath) {
+		pr_err("%s: could not map boot_device to ofpath\n", __func__);
+		return;
+	}
+
+	chosen = fdt_find_or_add_subnode(blob, 0, "chosen");
+	if (chosen < 0) {
+		pr_err("%s: could not find/create '/chosen'\n", __func__);
+		return;
+	}
+	fdt_setprop_string(blob, chosen,
+			   "u-boot,spl-boot-device", boot_ofpath);
+}
+#endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 30/35] rockchip: rk3399: show SPL BANNER earlier in board_init_f()
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (28 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 29/35] rockchip: rk3399: move spl_perform_fixups() into soc file Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 31/35] rockchip: rk3399: move SoC setting into arch_cpu_init() Kever Yang
                   ` (4 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

Show the SPL BANNER earlier so that we know already get into SPL.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/rk3399-board-spl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
index 826ca443ce..b790ad909c 100644
--- a/arch/arm/mach-rockchip/rk3399-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
@@ -130,6 +130,8 @@ void board_init_f(ulong dummy)
 		pr_err("DRAM init failed: %d\n", ret);
 		return;
 	}
+
+	preloader_console_init();
 }
 
 #if defined(SPL_GPIO_SUPPORT)
@@ -188,8 +190,6 @@ void spl_board_init(void)
 	if (regulators_enable_boot_on(false))
 		debug("%s: Cannot enable boot on regulator\n", __func__);
 #endif
-
-	preloader_console_init();
 }
 
 #ifdef CONFIG_SPL_LOAD_FIT
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 31/35] rockchip: rk3399: move SoC setting into arch_cpu_init()
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (29 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 30/35] rockchip: rk3399: show SPL BANNER earlier in board_init_f() Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 32/35] rockchip: rk3399; move spl_board_init() into soc file Kever Yang
                   ` (3 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

SoC setting like DDR secure region and EMMC clock setting
should go to arch_cpu_init().

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/rk3399-board-spl.c | 27 ++++++-----------------
 arch/arm/mach-rockchip/rk3399/rk3399.c    | 25 ++++++++++++++++++---
 2 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
index b790ad909c..2757c27da0 100644
--- a/arch/arm/mach-rockchip/rk3399-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
@@ -16,7 +16,6 @@
 #include <asm/arch-rockchip/bootrom.h>
 #include <asm/arch-rockchip/clock.h>
 #include <asm/arch-rockchip/cru_rk3399.h>
-#include <asm/arch-rockchip/grf_rk3399.h>
 #include <asm/arch-rockchip/hardware.h>
 #include <asm/arch-rockchip/periph.h>
 #include <asm/arch-rockchip/sys_proto.h>
@@ -65,11 +64,14 @@ __weak void rockchip_stimer_init(void)
 {
 }
 
+__weak int arch_cpu_init(void)
+{
+	return 0;
+}
+
 void board_init_f(ulong dummy)
 {
 	struct udevice *dev;
-	struct rk3399_pmusgrf_regs *sgrf;
-	struct rk3399_grf_regs *grf;
 	int ret;
 
 #ifdef CONFIG_DEBUG_UART
@@ -100,29 +102,14 @@ void board_init_f(ulong dummy)
 	debug("U-Boot SPL board init\n");
 #endif
 
+	arch_cpu_init();
+
 	ret = spl_early_init();
 	if (ret) {
 		debug("spl_early_init() failed: %d\n", ret);
 		hang();
 	}
 
-	/*
-	 * Disable DDR and SRAM security regions.
-	 *
-	 * As we are entered from the BootROM, the region from
-	 * 0x0 through 0xfffff (i.e. the first MB of memory) will
-	 * be protected. This will cause issues with the DW_MMC
-	 * driver, which tries to DMA from/to the stack (likely)
-	 * located in this range.
-	 */
-	sgrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUSGRF);
-	rk_clrsetreg(&sgrf->ddr_rgn_con[16], 0x1ff, 0);
-	rk_clrreg(&sgrf->slv_secure_con4, 0x2000);
-
-	/*  eMMC clock generator: disable the clock multipilier */
-	grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
-	rk_clrreg(&grf->emmccore_con[11], 0x0ff);
-
 	rockchip_stimer_init();
 
 	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c
index dacbcf8fdf..6c8fdc195a 100644
--- a/arch/arm/mach-rockchip/rk3399/rk3399.c
+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
@@ -80,11 +80,30 @@ int dram_init_banksize(void)
 
 int arch_cpu_init(void)
 {
-	/* We do some SoC one time setting here. */
-	struct rk3399_grf_regs * const grf = (void *)GRF_BASE;
 
-	/* Emmc clock generator: disable the clock multipilier */
+#ifdef CONFIG_SPL_BUILD
+	struct rk3399_pmusgrf_regs *sgrf;
+	struct rk3399_grf_regs *grf;
+
+	/*
+	 * Disable DDR and SRAM security regions.
+	 *
+	 * As we are entered from the BootROM, the region from
+	 * 0x0 through 0xfffff (i.e. the first MB of memory) will
+	 * be protected. This will cause issues with the DW_MMC
+	 * driver, which tries to DMA from/to the stack (likely)
+	 * located in this range.
+	 */
+	sgrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUSGRF);
+	rk_clrsetreg(&sgrf->ddr_rgn_con[16], 0x1ff, 0);
+	rk_clrreg(&sgrf->slv_secure_con4, 0x2000);
+
+	/*  eMMC clock generator: disable the clock multipilier */
+	grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
+	printf("%s sgrf %lx grf %lx\n", __func__, (u64)sgrf, (u64)grf);
+	printf("%s %x\n", __func__, &grf->emmccore_con[11]);
 	rk_clrreg(&grf->emmccore_con[11], 0x0ff);
+#endif
 
 	return 0;
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 32/35] rockchip: rk3399; move spl_board_init() into soc file
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (30 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 31/35] rockchip: rk3399: move SoC setting into arch_cpu_init() Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 33/35] rockchip: rk3399: move boot_devices " Kever Yang
                   ` (2 subsequent siblings)
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

Move spl_board_init() into rk3399.c so that we can re-use the
common SPL board file later.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/rk3399-board-spl.c | 61 ---------------------
 arch/arm/mach-rockchip/rk3399/rk3399.c    | 64 ++++++++++++++++++++++-
 2 files changed, 63 insertions(+), 62 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
index 2757c27da0..81a99f8e40 100644
--- a/arch/arm/mach-rockchip/rk3399-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
@@ -10,16 +10,13 @@
 #include <ram.h>
 #include <spl.h>
 #include <spl_gpio.h>
-#include <syscon.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch-rockchip/bootrom.h>
-#include <asm/arch-rockchip/clock.h>
 #include <asm/arch-rockchip/cru_rk3399.h>
 #include <asm/arch-rockchip/hardware.h>
 #include <asm/arch-rockchip/periph.h>
 #include <asm/arch-rockchip/sys_proto.h>
-#include <power/regulator.h>
 
 void board_return_to_bootrom(void)
 {
@@ -121,64 +118,6 @@ void board_init_f(ulong dummy)
 	preloader_console_init();
 }
 
-#if defined(SPL_GPIO_SUPPORT)
-static void rk3399_force_power_on_reset(void)
-{
-	ofnode node;
-	struct gpio_desc sysreset_gpio;
-
-	debug("%s: trying to force a power-on reset\n", __func__);
-
-	node = ofnode_path("/config");
-	if (!ofnode_valid(node)) {
-		debug("%s: no /config node?\n", __func__);
-		return;
-	}
-
-	if (gpio_request_by_name_nodev(node, "sysreset-gpio", 0,
-				       &sysreset_gpio, GPIOD_IS_OUT)) {
-		debug("%s: could not find a /config/sysreset-gpio\n", __func__);
-		return;
-	}
-
-	dm_gpio_set_value(&sysreset_gpio, 1);
-}
-#endif
-
-void spl_board_init(void)
-{
-#if defined(SPL_GPIO_SUPPORT)
-	struct rk3399_cru *cru = rockchip_get_cru();
-
-	/*
-	 * The RK3399 resets only 'almost all logic' (see also in the TRM
-	 * "3.9.4 Global software reset"), when issuing a software reset.
-	 * This may cause issues during boot-up for some configurations of
-	 * the application software stack.
-	 *
-	 * To work around this, we test whether the last reset reason was
-	 * a power-on reset and (if not) issue an overtemp-reset to reset
-	 * the entire module.
-	 *
-	 * While this was previously fixed by modifying the various places
-	 * that could generate a software reset (e.g. U-Boot's sysreset
-	 * driver, the ATF or Linux), we now have it here to ensure that
-	 * we no longer have to track this through the various components.
-	 */
-	if (cru->glb_rst_st != 0)
-		rk3399_force_power_on_reset();
-#endif
-
-#if defined(SPL_DM_REGULATOR)
-	/*
-	 * Turning the eMMC and SPI back on (if disabled via the Qseven
-	 * BIOS_ENABLE) signal is done through a always-on regulator).
-	 */
-	if (regulators_enable_boot_on(false))
-		debug("%s: Cannot enable boot on regulator\n", __func__);
-#endif
-}
-
 #ifdef CONFIG_SPL_LOAD_FIT
 int board_fit_config_name_match(const char *name)
 {
diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c
index 6c8fdc195a..3f414f1ca5 100644
--- a/arch/arm/mach-rockchip/rk3399/rk3399.c
+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
@@ -4,12 +4,16 @@
  */
 
 #include <common.h>
+#include <spl.h>
 #include <spl_gpio.h>
+#include <syscon.h>
 #include <asm/armv8/mmu.h>
 #include <asm/io.h>
+#include <asm/arch-rockchip/clock.h>
 #include <asm/arch-rockchip/gpio.h>
 #include <asm/arch-rockchip/grf_rk3399.h>
 #include <asm/arch-rockchip/hardware.h>
+#include <power/regulator.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -166,7 +170,7 @@ void board_debug_uart_init(void)
 }
 #endif
 
-#ifdef CONFIG_SPL_BUILD
+#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD)
 const char *spl_decode_boot_device(u32 boot_device)
 {
 	int i;
@@ -214,4 +218,62 @@ void spl_perform_fixups(struct spl_image_info *spl_image)
 	fdt_setprop_string(blob, chosen,
 			   "u-boot,spl-boot-device", boot_ofpath);
 }
+
+#if defined(SPL_GPIO_SUPPORT)
+static void rk3399_force_power_on_reset(void)
+{
+	ofnode node;
+	struct gpio_desc sysreset_gpio;
+
+	debug("%s: trying to force a power-on reset\n", __func__);
+
+	node = ofnode_path("/config");
+	if (!ofnode_valid(node)) {
+		debug("%s: no /config node?\n", __func__);
+		return;
+	}
+
+	if (gpio_request_by_name_nodev(node, "sysreset-gpio", 0,
+				       &sysreset_gpio, GPIOD_IS_OUT)) {
+		debug("%s: could not find a /config/sysreset-gpio\n", __func__);
+		return;
+	}
+
+	dm_gpio_set_value(&sysreset_gpio, 1);
+}
+#endif
+
+void spl_board_init(void)
+{
+#if defined(SPL_GPIO_SUPPORT)
+	struct rk3399_cru *cru = rockchip_get_cru();
+
+	/*
+	 * The RK3399 resets only 'almost all logic' (see also in the TRM
+	 * "3.9.4 Global software reset"), when issuing a software reset.
+	 * This may cause issues during boot-up for some configurations of
+	 * the application software stack.
+	 *
+	 * To work around this, we test whether the last reset reason was
+	 * a power-on reset and (if not) issue an overtemp-reset to reset
+	 * the entire module.
+	 *
+	 * While this was previously fixed by modifying the various places
+	 * that could generate a software reset (e.g. U-Boot's sysreset
+	 * driver, the ATF or Linux), we now have it here to ensure that
+	 * we no longer have to track this through the various components.
+	 */
+	if (cru->glb_rst_st != 0)
+		rk3399_force_power_on_reset();
+#endif
+
+#if defined(SPL_DM_REGULATOR)
+	/*
+	 * Turning the eMMC and SPI back on (if disabled via the Qseven
+	 * BIOS_ENABLE) signal is done through a always-on regulator).
+	 */
+	if (regulators_enable_boot_on(false))
+		debug("%s: Cannot enable boot on regulator\n", __func__);
+#endif
+}
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 33/35] rockchip: rk3399: move boot_devices into soc file
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (31 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 32/35] rockchip: rk3399; move spl_board_init() into soc file Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 34/35] rockchip: rk3399: move chromebook bob specific flow to its board file Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 35/35] rockchip: rk3399: Migrate to use common spl " Kever Yang
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

Move boot_devices definition into rk3399.c, so that we can
share the common code for board_spl_was_booted_from().

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/rk3399-board-spl.c | 6 +-----
 arch/arm/mach-rockchip/rk3399/rk3399.c    | 7 +++++++
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
index 81a99f8e40..e6325274c3 100644
--- a/arch/arm/mach-rockchip/rk3399-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
@@ -23,11 +23,7 @@ void board_return_to_bootrom(void)
 	back_to_bootrom(BROM_BOOT_NEXTSTAGE);
 }
 
-static const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
-	[BROM_BOOTSOURCE_EMMC] = "/sdhci at fe330000",
-	[BROM_BOOTSOURCE_SPINOR] = "/spi at ff1d0000",
-	[BROM_BOOTSOURCE_SD] = "/dwmmc at fe320000",
-};
+__weak const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {};
 
 const char *board_spl_was_booted_from(void)
 {
diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c
index 3f414f1ca5..bca1871b9a 100644
--- a/arch/arm/mach-rockchip/rk3399/rk3399.c
+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
@@ -9,6 +9,7 @@
 #include <syscon.h>
 #include <asm/armv8/mmu.h>
 #include <asm/io.h>
+#include <asm/arch-rockchip/bootrom.h>
 #include <asm/arch-rockchip/clock.h>
 #include <asm/arch-rockchip/gpio.h>
 #include <asm/arch-rockchip/grf_rk3399.h>
@@ -20,6 +21,12 @@ DECLARE_GLOBAL_DATA_PTR;
 #define GRF_EMMCCORE_CON11 0xff77f02c
 #define GRF_BASE	0xff770000
 
+const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
+	[BROM_BOOTSOURCE_EMMC] = "/sdhci at fe330000",
+	[BROM_BOOTSOURCE_SPINOR] = "/spi at ff1d0000",
+	[BROM_BOOTSOURCE_SD] = "/dwmmc at fe320000",
+};
+
 static struct mm_region rk3399_mem_map[] = {
 	{
 		.virt = 0x0UL,
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 34/35] rockchip: rk3399: move chromebook bob specific flow to its board file
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (32 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 33/35] rockchip: rk3399: move boot_devices " Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  2019-07-22 11:59 ` [U-Boot] [PATCH 35/35] rockchip: rk3399: Migrate to use common spl " Kever Yang
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

Add a board_early_init_f() in board_init_f() and move the board
specific init code into its own board file.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 .../arm/include/asm/arch-rockchip/sys_proto.h |  4 ----
 arch/arm/mach-rockchip/rk3399-board-spl.c     | 20 ++++++------------
 board/google/gru/gru.c                        | 21 +++++++++++++++++++
 3 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/arch/arm/include/asm/arch-rockchip/sys_proto.h b/arch/arm/include/asm/arch-rockchip/sys_proto.h
index 905c774c15..de5a8f11a9 100644
--- a/arch/arm/include/asm/arch-rockchip/sys_proto.h
+++ b/arch/arm/include/asm/arch-rockchip/sys_proto.h
@@ -6,8 +6,4 @@
 #ifndef _ASM_ARCH_SYS_PROTO_H
 #define _ASM_ARCH_SYS_PROTO_H
 
-
-/* provided to defeat compiler optimisation in board_init_f() */
-void gru_dummy_function(int i);
-
 #endif /* _ASM_ARCH_SYS_PROTO_H */
diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
index e6325274c3..cb481c58ec 100644
--- a/arch/arm/mach-rockchip/rk3399-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
@@ -57,6 +57,11 @@ __weak void rockchip_stimer_init(void)
 {
 }
 
+__weak int board_early_init_f(void)
+{
+	return 0;
+}
+
 __weak int arch_cpu_init(void)
 {
 	return 0;
@@ -70,20 +75,6 @@ void board_init_f(ulong dummy)
 #ifdef CONFIG_DEBUG_UART
 	debug_uart_init();
 
-# ifdef CONFIG_TARGET_CHROMEBOOK_BOB
-	int sum, i;
-
-	/*
-	 * Add a delay and ensure that the compiler does not optimise this out.
-	 * This is needed since the power rails tail a while to turn on, and
-	 * we get garbage serial output otherwise.
-	 */
-	sum = 0;
-	for (i = 0; i < 150000; i++)
-		sum += i;
-	gru_dummy_function(sum);
-#endif /* CONFIG_TARGET_CHROMEBOOK_BOB */
-
 	/*
 	 * Debug UART can be used from here if required:
 	 *
@@ -95,6 +86,7 @@ void board_init_f(ulong dummy)
 	debug("U-Boot SPL board init\n");
 #endif
 
+	board_early_init_f();
 	arch_cpu_init();
 
 	ret = spl_early_init();
diff --git a/board/google/gru/gru.c b/board/google/gru/gru.c
index b116b1a549..c2895e1267 100644
--- a/board/google/gru/gru.c
+++ b/board/google/gru/gru.c
@@ -10,7 +10,28 @@ int board_init(void)
 	return 0;
 }
 
+#ifdef CONFIG_SPL_BUILD
 /* provided to defeat compiler optimisation in board_init_f() */
 void gru_dummy_function(int i)
 {
 }
+
+int board_early_init_f(void)
+{
+# ifdef CONFIG_TARGET_CHROMEBOOK_BOB
+	int sum, i;
+
+	/*
+	 * Add a delay and ensure that the compiler does not optimise this out.
+	 * This is needed since the power rails tail a while to turn on, and
+	 * we get garbage serial output otherwise.
+	 */
+	sum = 0;
+	for (i = 0; i < 150000; i++)
+		sum += i;
+	gru_dummy_function(sum);
+#endif /* CONFIG_TARGET_CHROMEBOOK_BOB */
+
+	return 0;
+}
+#endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 35/35] rockchip: rk3399: Migrate to use common spl board file
  2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
                   ` (33 preceding siblings ...)
  2019-07-22 11:59 ` [U-Boot] [PATCH 34/35] rockchip: rk3399: move chromebook bob specific flow to its board file Kever Yang
@ 2019-07-22 11:59 ` Kever Yang
  34 siblings, 0 replies; 37+ messages in thread
From: Kever Yang @ 2019-07-22 11:59 UTC (permalink / raw)
  To: u-boot

rk3399 has similar boot flow in SPL with other Rockchip SoCs,
migrate to use common spl board file.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/mach-rockchip/Kconfig            |   1 +
 arch/arm/mach-rockchip/Makefile           |   1 -
 arch/arm/mach-rockchip/rk3399-board-spl.c | 117 ----------------------
 3 files changed, 1 insertion(+), 118 deletions(-)
 delete mode 100644 arch/arm/mach-rockchip/rk3399-board-spl.c

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 25214bca9c..81dee9e5c7 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -170,6 +170,7 @@ config ROCKCHIP_RK3399
 	select DM_PMIC
 	select DM_REGULATOR_FIXED
 	select BOARD_LATE_INIT
+	imply SPL_ROCKCHIP_COMMON_BOARD
 	imply TPL_SERIAL_SUPPORT
 	imply TPL_LIBCOMMON_SUPPORT
 	imply TPL_LIBGENERIC_SUPPORT
diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
index c7ab72c13b..5cb2c6dcc9 100644
--- a/arch/arm/mach-rockchip/Makefile
+++ b/arch/arm/mach-rockchip/Makefile
@@ -12,7 +12,6 @@ obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
 obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o
 
 obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o
-obj-spl-$(CONFIG_ROCKCHIP_RK3399) += rk3399-board-spl.o spl-boot-order.o
 
 ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
 
diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
deleted file mode 100644
index cb481c58ec..0000000000
--- a/arch/arm/mach-rockchip/rk3399-board-spl.c
+++ /dev/null
@@ -1,117 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2016 Rockchip Electronics Co., Ltd
- * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
- */
-
-#include <common.h>
-#include <debug_uart.h>
-#include <dm.h>
-#include <ram.h>
-#include <spl.h>
-#include <spl_gpio.h>
-#include <asm/gpio.h>
-#include <asm/io.h>
-#include <asm/arch-rockchip/bootrom.h>
-#include <asm/arch-rockchip/cru_rk3399.h>
-#include <asm/arch-rockchip/hardware.h>
-#include <asm/arch-rockchip/periph.h>
-#include <asm/arch-rockchip/sys_proto.h>
-
-void board_return_to_bootrom(void)
-{
-	back_to_bootrom(BROM_BOOT_NEXTSTAGE);
-}
-
-__weak const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {};
-
-const char *board_spl_was_booted_from(void)
-{
-	u32  bootdevice_brom_id = readl(BROM_BOOTSOURCE_ID_ADDR);
-	const char *bootdevice_ofpath = NULL;
-
-	if (bootdevice_brom_id < ARRAY_SIZE(boot_devices))
-		bootdevice_ofpath = boot_devices[bootdevice_brom_id];
-
-	if (bootdevice_ofpath)
-		debug("%s: brom_bootdevice_id %x maps to '%s'\n",
-		      __func__, bootdevice_brom_id, bootdevice_ofpath);
-	else
-		debug("%s: failed to resolve brom_bootdevice_id %x\n",
-		      __func__, bootdevice_brom_id);
-
-	return bootdevice_ofpath;
-}
-
-u32 spl_boot_device(void)
-{
-	u32 boot_device = BOOT_DEVICE_MMC1;
-
-	if (CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM))
-		return BOOT_DEVICE_BOOTROM;
-
-	return boot_device;
-}
-
-__weak void rockchip_stimer_init(void)
-{
-}
-
-__weak int board_early_init_f(void)
-{
-	return 0;
-}
-
-__weak int arch_cpu_init(void)
-{
-	return 0;
-}
-
-void board_init_f(ulong dummy)
-{
-	struct udevice *dev;
-	int ret;
-
-#ifdef CONFIG_DEBUG_UART
-	debug_uart_init();
-
-	/*
-	 * Debug UART can be used from here if required:
-	 *
-	 * debug_uart_init();
-	 * printch('a');
-	 * printhex8(0x1234);
-	 * printascii("string");
-	 */
-	debug("U-Boot SPL board init\n");
-#endif
-
-	board_early_init_f();
-	arch_cpu_init();
-
-	ret = spl_early_init();
-	if (ret) {
-		debug("spl_early_init() failed: %d\n", ret);
-		hang();
-	}
-
-	rockchip_stimer_init();
-
-	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
-	if (ret) {
-		pr_err("DRAM init failed: %d\n", ret);
-		return;
-	}
-
-	preloader_console_init();
-}
-
-#ifdef CONFIG_SPL_LOAD_FIT
-int board_fit_config_name_match(const char *name)
-{
-	/* Just empty function now - can't decide what to choose */
-	debug("%s: %s\n", __func__, name);
-
-	return 0;
-}
-#endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 18/35] rockchip: rk3288-phycore: move phycore_init() to its own board file
  2019-07-22 11:59 ` [U-Boot] [PATCH 18/35] rockchip: rk3288-phycore: move phycore_init() to its own board file Kever Yang
@ 2019-07-23 10:36   ` Wadim Egorov
  0 siblings, 0 replies; 37+ messages in thread
From: Wadim Egorov @ 2019-07-23 10:36 UTC (permalink / raw)
  To: u-boot

Hi Kever,

this is fine for me. You can drop the phycore_init() code completely. No
need to carry this around in our board code.
The SOM was redesigned and is equipped with an STM8 connected to the
RK818. The required setup we did before in the SPL is now done by the ST
controller. I know there are only a few SOMs without the STM8 out in the
wild. So if you remove it it will affect only a few people who probably
already have both boards.

Thanks,
Wadim

On 22.07.19 13:59, Kever Yang wrote:
> phycore_init() is use for phycore board only, it should be move back
> to phycore-rk3288.c
>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>
>  arch/arm/mach-rockchip/rk3288-board-spl.c    | 39 ----------------
>  arch/arm/mach-rockchip/rk3288/Kconfig        |  1 +
>  board/phytec/phycore_rk3288/phycore-rk3288.c | 47 ++++++++++++++++++++
>  3 files changed, 48 insertions(+), 39 deletions(-)
>
> diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c
> index 6db5369a10..13cd86079b 100644
> --- a/arch/arm/mach-rockchip/rk3288-board-spl.c
> +++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
> @@ -25,8 +25,6 @@
>  #include <dm/root.h>
>  #include <dm/test.h>
>  #include <dm/util.h>
> -#include <power/regulator.h>
> -#include <power/rk8xx_pmic.h>
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> @@ -81,32 +79,6 @@ fallback:
>  	return BOOT_DEVICE_MMC1;
>  }
>  
> -#if !defined(CONFIG_SPL_OF_PLATDATA)
> -static int phycore_init(void)
> -{
> -	struct udevice *pmic;
> -	int ret;
> -
> -	ret = uclass_first_device_err(UCLASS_PMIC, &pmic);
> -	if (ret)
> -		return ret;
> -
> -#if defined(CONFIG_SPL_POWER_SUPPORT)
> -	/* Increase USB input current to 2A */
> -	ret = rk818_spl_configure_usb_input_current(pmic, 2000);
> -	if (ret)
> -		return ret;
> -
> -	/* Close charger when USB lower then 3.26V */
> -	ret = rk818_spl_configure_usb_chrg_shutdown(pmic, 3260000);
> -	if (ret)
> -		return ret;
> -#endif
> -
> -	return 0;
> -}
> -#endif
> -
>  __weak int arch_cpu_init(void)
>  {
>  	return 0;
> @@ -175,17 +147,6 @@ void board_init_f(ulong dummy)
>  		return;
>  	}
>  
> -#if !defined(CONFIG_SPL_OF_PLATDATA)
> -	if (of_machine_is_compatible("phytec,rk3288-phycore-som")) {
> -		ret = phycore_init();
> -		if (ret) {
> -			debug("Failed to set up phycore power settings: %d\n",
> -			      ret);
> -			return;
> -		}
> -	}
> -#endif
> -
>  #if !defined(CONFIG_SUPPORT_TPL)
>  	debug("\nspl:init dram\n");
>  	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
> diff --git a/arch/arm/mach-rockchip/rk3288/Kconfig b/arch/arm/mach-rockchip/rk3288/Kconfig
> index 6e3ab1d06b..87d0786ba8 100644
> --- a/arch/arm/mach-rockchip/rk3288/Kconfig
> +++ b/arch/arm/mach-rockchip/rk3288/Kconfig
> @@ -85,6 +85,7 @@ config TARGET_MIQI_RK3288
>  config TARGET_PHYCORE_RK3288
>  	bool "phyCORE-RK3288"
>          select BOARD_LATE_INIT
> +	select SPL_BOARD_INIT if SPL
>  	help
>  	  Add basic support for the PCM-947 carrier board, a RK3288 based
>  	  development board made by PHYTEC. This board works in a combination
> diff --git a/board/phytec/phycore_rk3288/phycore-rk3288.c b/board/phytec/phycore_rk3288/phycore-rk3288.c
> index ffe1833b06..fbf1511978 100644
> --- a/board/phytec/phycore_rk3288/phycore-rk3288.c
> +++ b/board/phytec/phycore_rk3288/phycore-rk3288.c
> @@ -8,10 +8,13 @@
>  #include <common.h>
>  #include <dm.h>
>  #include <environment.h>
> +#include <fdtdec.h>
>  #include <i2c.h>
>  #include <i2c_eeprom.h>
>  #include <netdev.h>
>  #include "som.h"
> +#include <power/regulator.h>
> +#include <power/rk8xx_pmic.h>
>  
>  static int valid_rk3288_som(struct rk3288_som *som)
>  {
> @@ -68,3 +71,47 @@ int rk_board_late_init(void)
>  
>  	return 0;
>  }
> +
> +#ifdef CONFIG_SPL_BUILD
> +#if !defined(CONFIG_SPL_OF_PLATDATA)
> +static int phycore_init(void)
> +{
> +	struct udevice *pmic;
> +	int ret;
> +
> +	ret = uclass_first_device_err(UCLASS_PMIC, &pmic);
> +	if (ret)
> +		return ret;
> +
> +#if defined(CONFIG_SPL_POWER_SUPPORT)
> +	/* Increase USB input current to 2A */
> +	ret = rk818_spl_configure_usb_input_current(pmic, 2000);
> +	if (ret)
> +		return ret;
> +
> +	/* Close charger when USB lower then 3.26V */
> +	ret = rk818_spl_configure_usb_chrg_shutdown(pmic, 3260000);
> +	if (ret)
> +		return ret;
> +#endif
> +
> +	return 0;
> +}
> +#endif
> +
> +void spl_board_init(void)
> +{
> +#if !defined(CONFIG_SPL_OF_PLATDATA)
> +	int ret;
> +
> +	if (of_machine_is_compatible("phytec,rk3288-phycore-som")) {
> +		ret = phycore_init();
> +		if (ret) {
> +			debug("Failed to set up phycore power settings: %d\n",
> +			      ret);
> +			return;
> +		}
> +	}
> +#endif
> +}
> +#endif

^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2019-07-23 10:36 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 01/35] rockchip: remove redundant CONFIG_SYS_NS16550_MEM32 Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 02/35] rockchip: add CONFIG_IRAM_BASE for all SoCs Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 03/35] rockchip: intruduce common BROM_BOOTSOURCE_ID_ADDR Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 04/35] rockchip: declear boot_devices in bootrom.h Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 05/35] rockchip: add common spl board file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 06/35] rockchip: rk3188: init CPU freq in clock driver Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 07/35] rockchip: rk3188: move usb uart init into arch_cpu_init() Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 08/35] rockchip: Migrate to use BOOTROM_SUPPORT driver Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 09/35] rockchip: rk3188: move spl_board_init() into rk3188.c Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 10/35] rockchip: rk3188: add boot_devices mapping to support 'same-as-spl' Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 11/35] rockchip: rk3188: migrate to use common spl board file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 12/35] rockchip: rk322x: introduce arch_cpu_init() for SoC setting init Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 13/35] rockchip: rk322x: migrate to use common spl board file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 14/35] rockchip: rk322x: add boot_devices mapping to support 'same-as-spl' Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 15/35] rockchip: fit_spl_optee: rockchip: fix warning unit_address_vs_reg Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 16/35] rockchip: rk3288: show SPL BANNER earlier in board_init_f() Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 17/35] rockchip: rk3288: move setup_led() to firefly-rk3288 Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 18/35] rockchip: rk3288-phycore: move phycore_init() to its own board file Kever Yang
2019-07-23 10:36   ` Wadim Egorov
2019-07-22 11:59 ` [U-Boot] [PATCH 19/35] rockchip: rk3288: move dram_init_banksize() into soc file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 20/35] rockchip: rk3288: Migrate to use common spl board file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 21/35] rockchip: phycore: remove no use "u-boot, boot0" in dts Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 22/35] rockchip: rk3288-veyron: Migrate "u-boot, boot0" to "u-boot, spl-boot-order" Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 23/35] rockchip: rk3288: add boot_devices mapping to support 'same-as-spl' Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 24/35] rockchip: rk3328: add STIMER_BASE definition Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 25/35] rockchip: rk3328: migrate to use common spl board file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 26/35] rockchip: rk3328: add boot_devices mapping to support 'same-as-spl' Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 27/35] rockchip: rk3368: migrate to use common spl board file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 28/35] rockchip: rk3368: add boot_devices mapping to support 'same-as-spl' Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 29/35] rockchip: rk3399: move spl_perform_fixups() into soc file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 30/35] rockchip: rk3399: show SPL BANNER earlier in board_init_f() Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 31/35] rockchip: rk3399: move SoC setting into arch_cpu_init() Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 32/35] rockchip: rk3399; move spl_board_init() into soc file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 33/35] rockchip: rk3399: move boot_devices " Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 34/35] rockchip: rk3399: move chromebook bob specific flow to its board file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 35/35] rockchip: rk3399: Migrate to use common spl " Kever Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox