Skip to contentSkip to conversation

With this change the SPL binary shrinks from 32k to 23k when

PATCH New Sandy Patterson 2 participants 7 messages Aug 29, 2016 – Sep 24, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v3 cover With this change the SPL binary shrinks from 32k to 23k when

ROCKCHIP_SPL_BACK_TO_BROM is enabled. This has been tested on the rock2 board. It should work with any rk3288 though since the bootrom is loading the SPL already it should load the main U-Boot as well.

Rock2 has been tested with ROCKCHIP_SPL_BACK_TO_BROM.

Also, this moves around the images on the disk, so I had to move the environment so it doesn't overwrite u-boot. The new env location works with both boot methods.

Changes in v3:
- Move activate in rock2_defconfig to proper commit.
- Make environment changes dependent on ROCKCHIP_SPL_BACK_TO_BROM.

Changes in v2:
- Rebase after "Kconfig: Move CONFIG_SPL_..._SUPPORT to Kconfig."
- Remove all the refactoring in the configs.
- Split enabling featuring in rock2 into separate commit.

Sandy Patterson (2):
Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled. Enable ROCKCHIP_SPL_BACK_TO_BROM for rock2 board

 arch/arm/mach-rockchip/Kconfig | 3 +++
 configs/rock2_defconfig        | 2 +-
 include/configs/rock2.h        | 9 +++++++++
 3 files changed, 13 insertions(+), 1 deletion(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH v3 1/2 Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled.

Default SPL_MMC_SUPPORT to false when ROCKCHIP_SPL_BACK_TO_BROM is enabled.

---

Changes in v3:
- Move activate in rock2_defconfig to proper commit.

Changes in v2:
- Rebase after "Kconfig: Move CONFIG_SPL_..._SUPPORT to Kconfig."
- Remove all the refactoring in the configs.
- Split enabling featuring in rock2 into separate commit.

 arch/arm/mach-rockchip/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-rockchip/Kconfig +3 -0
index 1aac3c8..8a5d62a 100644
@@ -42,6 +42,9 @@ config ROCKCHIP_SPL_BACK_TO_BROM
           SPL will return to the boot rom, which will then load the U-Boot
           binary to keep going on.
 
+config SPL_MMC_SUPPORT
+	default y if !ROCKCHIP_SPL_BACK_TO_BROM
+
 source "arch/arm/mach-rockchip/rk3036/Kconfig"
 source "arch/arm/mach-rockchip/rk3288/Kconfig"
 source "arch/arm/mach-rockchip/rk3399/Kconfig"
Signature · 1 line
1.9.1
#2 lore raw

PATCH v3 1/2 Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled.

Quoted 9 lines · Sandy Patterson

Default SPL_MMC_SUPPORT to false when ROCKCHIP_SPL_BACK_TO_BROM is enabled.

---

Changes in v3:
- Move activate in rock2_defconfig to proper commit.

Quoted 7 lines

Changes in v2:
- Rebase after "Kconfig: Move CONFIG_SPL_..._SUPPORT to Kconfig."
- Remove all the refactoring in the configs.
- Split enabling featuring in rock2 into separate commit.

 arch/arm/mach-rockchip/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
#3 lore raw

PATCH v3 1/2 Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled.

Quoted 15 lines · Simon Glass
Quoted 14 lines · Sandy Patterson

Default SPL_MMC_SUPPORT to false when ROCKCHIP_SPL_BACK_TO_BROM is enabled.

---

Changes in v3:
- Move activate in rock2_defconfig to proper commit.

Changes in v2:
- Rebase after "Kconfig: Move CONFIG_SPL_..._SUPPORT to Kconfig."
- Remove all the refactoring in the configs.
- Split enabling featuring in rock2 into separate commit.

Quoted 4 lines
Quoted 2 lines
 arch/arm/mach-rockchip/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

Applied to u-boot-rockchip, thanks!

#4 lore raw

PATCH v3 2/2 Enable ROCKCHIP_SPL_BACK_TO_BROM for rock2 board

In reply to Sandy Patterson

Rock2 has been tested with back to brom feature. The tricky part is that with this feature the default environment is inside u-boot, and it's defined for every rk3288 board independetly. So I just changed it for rock2 here if ROCKCHIP_SPL_BACK_TO_BROM.

Solve by moving environment after u-boot before 1M boundary

---

Changes in v3:
- Move activate in rock2_defconfig to proper commit.
- Make environment changes dependent on ROCKCHIP_SPL_BACK_TO_BROM.

Changes in v2: None

 configs/rock2_defconfig | 2 +-
 include/configs/rock2.h | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
configs/rock2_defconfig +1 -1
index b1294f0..e34d8b3 100644
@@ -10,7 +10,7 @@ CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_SPL_MMC_SUPPORT=y
+CONFIG_ROCKCHIP_SPL_BACK_TO_BROM=y
 CONFIG_SPL_PINCTRL_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
include/configs/rock2.h +9 -0
index ee924c3..99d6915 100644
@@ -16,11 +16,20 @@
 
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
+
+#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+/* SPL @ 32k for 34k
+ * u-boot directly after @ 68k for 400k or so
+ * ENV @ 992k
+ */
+#define CONFIG_ENV_OFFSET ((1024-32) * 1024)
+#else
 /* SPL @ 32k for ~36k
  * ENV @ 96k
  * u-boot @ 128K
  */
 #define CONFIG_ENV_OFFSET (96 * 1024)
+#endif
 
 #define CONFIG_SYS_WHITE_ON_BLACK
 #define CONFIG_CONSOLE_SCROLL_LINES		10
Signature · 1 line
1.9.1
#5 lore raw

PATCH v3 2/2 Enable ROCKCHIP_SPL_BACK_TO_BROM for rock2 board

Quoted 14 lines · Sandy Patterson

Rock2 has been tested with back to brom feature. The tricky part is that with this feature the default environment is inside u-boot, and it's defined for every rk3288 board independetly. So I just changed it for rock2 here if ROCKCHIP_SPL_BACK_TO_BROM.

Solve by moving environment after u-boot before 1M boundary

---

Changes in v3:
- Move activate in rock2_defconfig to proper commit.
- Make environment changes dependent on ROCKCHIP_SPL_BACK_TO_BROM.

Quoted 5 lines

Changes in v2: None

 configs/rock2_defconfig | 2 +-
 include/configs/rock2.h | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
#6 lore raw

PATCH v3 2/2 Enable ROCKCHIP_SPL_BACK_TO_BROM for rock2 board

Quoted 15 lines · Simon Glass
Quoted 14 lines · Sandy Patterson

Rock2 has been tested with back to brom feature. The tricky part is that with this feature the default environment is inside u-boot, and it's defined for every rk3288 board independetly. So I just changed it for rock2 here if ROCKCHIP_SPL_BACK_TO_BROM.

Solve by moving environment after u-boot before 1M boundary

---

Changes in v3:
- Move activate in rock2_defconfig to proper commit.
- Make environment changes dependent on ROCKCHIP_SPL_BACK_TO_BROM.

Quoted 7 lines
Quoted 5 lines

Changes in v2: None

 configs/rock2_defconfig | 2 +-
 include/configs/rock2.h | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

Applied to u-boot-rockchip, thanks!