Skip to contentSkip to conversation

rockchip: Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled.

PATCH New Sandy Patterson 2 participants 5 messages Aug 13, 2016 – Aug 27, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rockchip: Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled.

CONFIG_SPL_MMC_SUPPORT is used pretty much for every board except jerry, so we can refactor the define into rk3288_common.h. Then only define it if we are using using the Bootrom to load the non SPL U-Boot.

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 So enabled for rock2.

---

 configs/rock2_defconfig            | 1 +
 include/configs/chromebook_jerry.h | 1 +
 include/configs/evb_rk3288.h       | 2 --
 include/configs/fennec_rk3288.h    | 2 --
 include/configs/firefly-rk3288.h   | 2 --
 include/configs/miniarm_rk3288.h   | 2 --
 include/configs/popmetal_rk3288.h  | 2 --
 include/configs/rk3288_common.h    | 4 ++++
 include/configs/rock2.h            | 2 --
 9 files changed, 6 insertions(+), 12 deletions(-)
configs/rock2_defconfig +1 -0
index 3b6d7d9..8f730e5 100644
@@ -67,3 +67,4 @@ CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_USE_TINY_PRINTF=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_ERRNO_STR=y
+CONFIG_ROCKCHIP_SPL_BACK_TO_BROM=y
include/configs/chromebook_jerry.h +1 -0
index d1f5b46..9800ffb 100644
@@ -22,6 +22,7 @@
 
 #define CONFIG_CMD_SF_TEST
 
+#undef CONFIG_SPL_MMC_SUPPORT
 #undef CONFIG_SPL_GPIO_SUPPORT
 
 #define CONFIG_KEYBOARD
include/configs/evb_rk3288.h +0 -2
index 342557f..390c243 100644
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
include/configs/fennec_rk3288.h +0 -2
index 342557f..390c243 100644
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
include/configs/firefly-rk3288.h +0 -2
index a29f557..ee924c3 100644
@@ -14,8 +14,6 @@
 
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
 /* SPL @ 32k for ~36k
include/configs/miniarm_rk3288.h +0 -2
index 342557f..390c243 100644
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
include/configs/popmetal_rk3288.h +0 -2
index 342557f..390c243 100644
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
include/configs/rk3288_common.h +4 -0
index d3d4c68..bc0de3d 100644
@@ -33,6 +33,10 @@
 #define CONFIG_SYS_NS16550_MEM32
 #define CONFIG_SPL_BOARD_INIT
 
+#ifndef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+#define CONFIG_SPL_MMC_SUPPORT
+#endif
+
 #ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
 /* Bootrom will load u-boot binary to 0x0 once return from SPL */
 #define CONFIG_SYS_TEXT_BASE		0x00000000
include/configs/rock2.h +0 -2
index a29f557..ee924c3 100644
@@ -14,8 +14,6 @@
 
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
 /* SPL @ 32k for ~36k
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 rockchip: Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled.

Quoted 147 lines · Sandy Patterson

CONFIG_SPL_MMC_SUPPORT is used pretty much for every board except jerry, so we can refactor the define into rk3288_common.h. Then only define it if we are using using the Bootrom to load the non SPL U-Boot.

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 So enabled for rock2.

---

 configs/rock2_defconfig            | 1 +
 include/configs/chromebook_jerry.h | 1 +
 include/configs/evb_rk3288.h       | 2 --
 include/configs/fennec_rk3288.h    | 2 --
 include/configs/firefly-rk3288.h   | 2 --
 include/configs/miniarm_rk3288.h   | 2 --
 include/configs/popmetal_rk3288.h  | 2 --
 include/configs/rk3288_common.h    | 4 ++++
 include/configs/rock2.h            | 2 --
 9 files changed, 6 insertions(+), 12 deletions(-)
configs/rock2_defconfig +1 -0
index 3b6d7d9..8f730e5 100644
@@ -67,3 +67,4 @@ CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_USE_TINY_PRINTF=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_ERRNO_STR=y
+CONFIG_ROCKCHIP_SPL_BACK_TO_BROM=y
include/configs/chromebook_jerry.h +1 -0
index d1f5b46..9800ffb 100644
@@ -22,6 +22,7 @@
 
 #define CONFIG_CMD_SF_TEST
 
+#undef CONFIG_SPL_MMC_SUPPORT
 #undef CONFIG_SPL_GPIO_SUPPORT
 
 #define CONFIG_KEYBOARD
include/configs/evb_rk3288.h +0 -2
index 342557f..390c243 100644
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
include/configs/fennec_ renamed from include/configs/fennec_rk3288.h +0 -0

rk3288.h
index 342557f..390c243 100644

include/configs/fennec_rk3288.h +0 -2
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
include/configs/firefly- renamed from include/configs/firefly-rk3288.h +0 -0

rk3288.h
index a29f557..ee924c3 100644

include/configs/firefly-rk3288.h +0 -2
@@ -14,8 +14,6 @@
 
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
 /* SPL @ 32k for ~36k
include/configs/miniarm_ renamed from include/configs/miniarm_rk3288.h +0 -0

rk3288.h
index 342557f..390c243 100644

include/configs/miniarm_rk3288.h +0 -2
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
include/configs/popmetal_ renamed from include/configs/popmetal_rk3288.h +0 -0

rk3288.h
index 342557f..390c243 100644

include/configs/popmetal_rk3288.h +0 -2
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
include/configs/rk3288_ renamed from include/configs/rk3288_common.h +0 -0

common.h
index d3d4c68..bc0de3d 100644

include/configs/rk3288_common.h +4 -0
@@ -33,6 +33,10 @@
 #define CONFIG_SYS_NS16550_MEM32
 #define CONFIG_SPL_BOARD_INIT
 
+#ifndef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+#define CONFIG_SPL_MMC_SUPPORT
+#endif
+
 #ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
 /* Bootrom will load u-boot binary to 0x0 once return from SPL */
 #define CONFIG_SYS_TEXT_BASE           0x00000000
include/configs/rock2.h +0 -3
index a29f557..ee924c3 100644
@@ -14,8 +14,6 @@
 
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
 /* SPL @ 32k for ~36k
--
Quoted 3 lines

1.9.1

Hi Simon,

Just wondering if this commit got lost, or maybe there is some advice you could give me on how to make this more helpful.

Sandy

#2 lore raw

PATCH 1/1 rockchip: Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled.

Quoted 157 lines · Sandy Patterson
Quoted 147 lines · Sandy Patterson

CONFIG_SPL_MMC_SUPPORT is used pretty much for every board except jerry, so we can refactor the define into rk3288_common.h. Then only define it if we are using using the Bootrom to load the non SPL U-Boot.

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 So enabled for rock2.

---

 configs/rock2_defconfig            | 1 +
 include/configs/chromebook_jerry.h | 1 +
 include/configs/evb_rk3288.h       | 2 --
 include/configs/fennec_rk3288.h    | 2 --
 include/configs/firefly-rk3288.h   | 2 --
 include/configs/miniarm_rk3288.h   | 2 --
 include/configs/popmetal_rk3288.h  | 2 --
 include/configs/rk3288_common.h    | 4 ++++
 include/configs/rock2.h            | 2 --
 9 files changed, 6 insertions(+), 12 deletions(-)
configs/rock2_defconfig +1 -0
index 3b6d7d9..8f730e5 100644
@@ -67,3 +67,4 @@ CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_USE_TINY_PRINTF=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_ERRNO_STR=y
+CONFIG_ROCKCHIP_SPL_BACK_TO_BROM=y
include/configs/chromebook_jerry.h +1 -0
index d1f5b46..9800ffb 100644
@@ -22,6 +22,7 @@
 
 #define CONFIG_CMD_SF_TEST
 
+#undef CONFIG_SPL_MMC_SUPPORT
 #undef CONFIG_SPL_GPIO_SUPPORT
 
 #define CONFIG_KEYBOARD
include/configs/evb_rk3288.h +0 -2
index 342557f..390c243 100644
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
include/configs/fennec_rk3288.h +0 -2
index 342557f..390c243 100644
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
include/configs/firefly-rk3288.h +0 -2
index a29f557..ee924c3 100644
@@ -14,8 +14,6 @@
 
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
 /* SPL @ 32k for ~36k
include/configs/miniarm_rk3288.h +0 -2
index 342557f..390c243 100644
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
include/configs/popmetal_rk3288.h +0 -2
index 342557f..390c243 100644
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
include/configs/rk3288_common.h +4 -0
index d3d4c68..bc0de3d 100644
@@ -33,6 +33,10 @@
 #define CONFIG_SYS_NS16550_MEM32
 #define CONFIG_SPL_BOARD_INIT
 
+#ifndef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+#define CONFIG_SPL_MMC_SUPPORT
+#endif
+
 #ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
 /* Bootrom will load u-boot binary to 0x0 once return from SPL */
 #define CONFIG_SYS_TEXT_BASE           0x00000000
include/configs/rock2.h +0 -3
index a29f557..ee924c3 100644
@@ -14,8 +14,6 @@
 
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
 /* SPL @ 32k for ~36k
--
Quoted 3 lines

1.9.1

Hi Simon,

Quoted 5 lines

Just wondering if this commit got lost, or maybe there is some advice you could give me on how to make this more helpful.

Sandy

Ah, I see why you didn't grab this. I'll resubmit after I've had a chance to digest the SPL Kconfig changeset.

#3 lore raw

PATCH 1/1 rockchip: Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled.

Hi Sandy,

Quoted 162 lines · Sandy Patterson
Quoted 159 lines · Sandy Patterson
Quoted 149 lines · Sandy Patterson

CONFIG_SPL_MMC_SUPPORT is used pretty much for every board except jerry, so we can refactor the define into rk3288_common.h. Then only define it if
we are using using the Bootrom to load the non SPL U-Boot.

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 So enabled for rock2.

---

 configs/rock2_defconfig            | 1 +
 include/configs/chromebook_jerry.h | 1 +
 include/configs/evb_rk3288.h       | 2 --
 include/configs/fennec_rk3288.h    | 2 --
 include/configs/firefly-rk3288.h   | 2 --
 include/configs/miniarm_rk3288.h   | 2 --
 include/configs/popmetal_rk3288.h  | 2 --
 include/configs/rk3288_common.h    | 4 ++++
 include/configs/rock2.h            | 2 --
 9 files changed, 6 insertions(+), 12 deletions(-)
configs/rock2_defconfig +1 -0
index 3b6d7d9..8f730e5 100644
@@ -67,3 +67,4 @@ CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_USE_TINY_PRINTF=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_ERRNO_STR=y
+CONFIG_ROCKCHIP_SPL_BACK_TO_BROM=y
include/configs/chromebook_jerry.h +1 -0
index d1f5b46..9800ffb 100644
@@ -22,6 +22,7 @@
 
 #define CONFIG_CMD_SF_TEST
 
+#undef CONFIG_SPL_MMC_SUPPORT
 #undef CONFIG_SPL_GPIO_SUPPORT
 
 #define CONFIG_KEYBOARD
include/configs/evb_rk3288.h +0 -2
index 342557f..390c243 100644
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
include/configs/fennec_rk3288.h +0 -2
index 342557f..390c243 100644
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
include/configs/firefly-rk3288.h +0 -2
index a29f557..ee924c3 100644
@@ -14,8 +14,6 @@
 
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
 /* SPL @ 32k for ~36k
include/configs/miniarm_rk3288.h +0 -2
index 342557f..390c243 100644
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
include/configs/popmetal_rk3288.h +0 -2
index 342557f..390c243 100644
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
include/configs/rk3288_common.h +4 -0
index d3d4c68..bc0de3d 100644
@@ -33,6 +33,10 @@
 #define CONFIG_SYS_NS16550_MEM32
 #define CONFIG_SPL_BOARD_INIT
 
+#ifndef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+#define CONFIG_SPL_MMC_SUPPORT
+#endif
+
 #ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
 /* Bootrom will load u-boot binary to 0x0 once return from SPL */
 #define CONFIG_SYS_TEXT_BASE           0x00000000
include/configs/rock2.h +0 -3
index a29f557..ee924c3 100644
@@ -14,8 +14,6 @@
 
 #include <configs/rk3288_common.h>
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
 /* SPL @ 32k for ~36k
--
Quoted 2 lines

1.9.1

Hi Simon,

Quoted 8 lines
Quoted 4 lines

Just wondering if this commit got lost, or maybe there is some advice you could give me on how to make this more helpful.

Sandy

Ah, I see why you didn't grab this. I'll resubmit after I've had a chance to digest the SPL Kconfig changeset.

No it's not that. You patch comes before that series.

But I would like to see review/ tags from others on Rockchip patches - just so that I know that people are on-board with the change.

Will add my tag to encourage people!

Regards,
Simon

#4 lore raw

PATCH 1/1 rockchip: Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled.

Hi Sandy,

Quoted 6 lines · Simon Glass

Hi Sandy,

Quoted 3 lines · Sandy Patterson

On Wed, Aug 24, 2016 at 9:27 AM, Sandy Patterson <[email protected]> wrote:

[...]

Quoted 12 lines
Quoted 11 lines
Quoted 7 lines

Hi Simon,

Just wondering if this commit got lost, or maybe there is some advice you could give me on how to make this more helpful.

Sandy

Ah, I see why you didn't grab this. I'll resubmit after I've had a chance to digest the SPL Kconfig changeset.

Quoted 8 lines

No it's not that. You patch comes before that series.

But I would like to see review/ tags from others on Rockchip patches - just so that I know that people are on-board with the change.

Will add my tag to encourage people!

But on closer inspection, yes this will be a pain to update after the SPL series. So please can you take a look and resend? It looks like you should do something like this in arch/arm/mach-rockchip/Kconfig or similar:

config SPL_MMC_SUPPORT
default y if !ROCKCHIP_SPL_BACK_TO_BROM

Quoted 3 lines

Regards,
Simon

Regards,
Simon