[U-Boot] [PATCH 1/2] rockchip: config: sync the ENV offset from rockchip legacy U-Boot

Using the ENV offset from rockchip legacy U-Boot for all SoCs, the offset is 4MB-32KB
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
include/configs/rockchip-common.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h index 96b5fce..3fc1b71 100644 --- a/include/configs/rockchip-common.h +++ b/include/configs/rockchip-common.h @@ -61,19 +61,10 @@
#endif
-#if CONFIG_IS_ENABLED(ROCKCHIP_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 +/* + * Rockchip SoCs use fixed ENV 32KB@(4MB-32KB) */ -#define CONFIG_ENV_OFFSET (96 * 1024) -#endif +#define CONFIG_ENV_OFFSET (SZ_4M - SZ_32K)
#define CONFIG_DISPLAY_BOARDINFO_LATE

All Rockchip SoCs use 32KB as CONFIG_ENV_SIZE.
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
include/configs/evb_rk3229.h | 2 -- include/configs/kylin_rk3036.h | 2 -- include/configs/lion_rk3368.h | 1 - include/configs/rk3036_common.h | 1 - include/configs/rk3128_common.h | 1 - include/configs/rk3188_common.h | 1 - include/configs/rk322x_common.h | 1 - include/configs/rk3288_common.h | 1 - include/configs/rk3328_common.h | 1 - include/configs/rk3399_common.h | 1 - include/configs/rockchip-common.h | 1 + include/configs/sheep_rk3368.h | 1 - 12 files changed, 1 insertion(+), 13 deletions(-)
diff --git a/include/configs/evb_rk3229.h b/include/configs/evb_rk3229.h index 8906c8f..ae981f7 100644 --- a/include/configs/evb_rk3229.h +++ b/include/configs/evb_rk3229.h @@ -11,8 +11,6 @@
/* Store env in emmc */ -#undef CONFIG_ENV_SIZE -#define CONFIG_ENV_SIZE (32 << 10) #define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_SYS_MMC_ENV_PART 0 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT diff --git a/include/configs/kylin_rk3036.h b/include/configs/kylin_rk3036.h index 36009b8..d2d630d 100644 --- a/include/configs/kylin_rk3036.h +++ b/include/configs/kylin_rk3036.h @@ -13,8 +13,6 @@ #ifndef CONFIG_SPL_BUILD
/* Store env in emmc */ -#undef CONFIG_ENV_SIZE -#define CONFIG_ENV_SIZE SZ_32K #define CONFIG_SYS_MMC_ENV_DEV 0 /* emmc */ #define CONFIG_SYS_MMC_ENV_PART 0 /* user area */
diff --git a/include/configs/lion_rk3368.h b/include/configs/lion_rk3368.h index 4118ffd..c40dbad 100644 --- a/include/configs/lion_rk3368.h +++ b/include/configs/lion_rk3368.h @@ -13,6 +13,5 @@ #define KERNEL_LOAD_ADDR 0x280000 #define DTB_LOAD_ADDR 0x5600000 #define INITRD_LOAD_ADDR 0x5bf0000 -#define CONFIG_ENV_SIZE 0x2000
#endif diff --git a/include/configs/rk3036_common.h b/include/configs/rk3036_common.h index 9ac0df5..4ed8f5a 100644 --- a/include/configs/rk3036_common.h +++ b/include/configs/rk3036_common.h @@ -10,7 +10,6 @@ #include "rockchip-common.h"
#define CONFIG_NR_DRAM_BANKS 1 -#define CONFIG_ENV_SIZE 0x2000 #define CONFIG_SYS_MALLOC_LEN (32 << 20) #define CONFIG_SYS_CBSIZE 1024 #define CONFIG_SKIP_LOWLEVEL_INIT diff --git a/include/configs/rk3128_common.h b/include/configs/rk3128_common.h index af90132..068229a 100644 --- a/include/configs/rk3128_common.h +++ b/include/configs/rk3128_common.h @@ -9,7 +9,6 @@
#include "rockchip-common.h"
-#define CONFIG_ENV_SIZE 0x2000 #define CONFIG_SYS_MAXARGS 16 #define CONFIG_BAUDRATE 115200 #define CONFIG_SYS_MALLOC_LEN (32 << 20) diff --git a/include/configs/rk3188_common.h b/include/configs/rk3188_common.h index 5e46234..cfa5364 100644 --- a/include/configs/rk3188_common.h +++ b/include/configs/rk3188_common.h @@ -14,7 +14,6 @@
#define CONFIG_SKIP_LOWLEVEL_INIT_ONLY #define CONFIG_NR_DRAM_BANKS 1 -#define CONFIG_ENV_SIZE 0x2000 #define CONFIG_SYS_MALLOC_LEN (32 << 20) #define CONFIG_SYS_CBSIZE 1024
diff --git a/include/configs/rk322x_common.h b/include/configs/rk322x_common.h index fa9abc0..b22169d 100644 --- a/include/configs/rk322x_common.h +++ b/include/configs/rk322x_common.h @@ -10,7 +10,6 @@ #include "rockchip-common.h"
#define CONFIG_SKIP_LOWLEVEL_INIT -#define CONFIG_ENV_SIZE 0x2000 #define CONFIG_SYS_MALLOC_LEN (32 << 20) #define CONFIG_SYS_CBSIZE 1024 #define CONFIG_SYS_BOOTM_LEN (64 << 20) /* 64M */ diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h index 34f2558..2b8f618 100644 --- a/include/configs/rk3288_common.h +++ b/include/configs/rk3288_common.h @@ -12,7 +12,6 @@
#define CONFIG_SKIP_LOWLEVEL_INIT_ONLY #define CONFIG_NR_DRAM_BANKS 1 -#define CONFIG_ENV_SIZE 0x2000 #define CONFIG_SYS_MALLOC_LEN (32 << 20) #define CONFIG_SYS_CBSIZE 1024
diff --git a/include/configs/rk3328_common.h b/include/configs/rk3328_common.h index 9819b22..af55632 100644 --- a/include/configs/rk3328_common.h +++ b/include/configs/rk3328_common.h @@ -9,7 +9,6 @@
#include "rockchip-common.h"
-#define CONFIG_ENV_SIZE 0x2000 #define CONFIG_SYS_MALLOC_LEN (32 << 20) #define CONFIG_SYS_CBSIZE 1024 #define CONFIG_SKIP_LOWLEVEL_INIT diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h index 1d7a872..561bfa7 100644 --- a/include/configs/rk3399_common.h +++ b/include/configs/rk3399_common.h @@ -10,7 +10,6 @@ #include "rockchip-common.h"
#define CONFIG_NR_DRAM_BANKS 1 -#define CONFIG_ENV_SIZE 0x2000 #define CONFIG_SYS_MALLOC_LEN (32 << 20) #define CONFIG_SYS_CBSIZE 1024 #define CONFIG_SKIP_LOWLEVEL_INIT diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h index 3fc1b71..35d948a 100644 --- a/include/configs/rockchip-common.h +++ b/include/configs/rockchip-common.h @@ -65,6 +65,7 @@ * Rockchip SoCs use fixed ENV 32KB@(4MB-32KB) */ #define CONFIG_ENV_OFFSET (SZ_4M - SZ_32K) +#define CONFIG_ENV_SIZE SZ_32K
#define CONFIG_DISPLAY_BOARDINFO_LATE
diff --git a/include/configs/sheep_rk3368.h b/include/configs/sheep_rk3368.h index eac9755..4eb4fb0 100644 --- a/include/configs/sheep_rk3368.h +++ b/include/configs/sheep_rk3368.h @@ -13,7 +13,6 @@ #define KERNEL_LOAD_ADDR 0x280000 #define DTB_LOAD_ADDR 0x5600000 #define INITRD_LOAD_ADDR 0x5bf0000 -#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_CONSOLE_SCROLL_LINES 10

All Rockchip SoCs use 32KB as CONFIG_ENV_SIZE.
Signed-off-by: Kever Yang kever.yang@rock-chips.com
include/configs/evb_rk3229.h | 2 -- include/configs/kylin_rk3036.h | 2 -- include/configs/lion_rk3368.h | 1 - include/configs/rk3036_common.h | 1 - include/configs/rk3128_common.h | 1 - include/configs/rk3188_common.h | 1 - include/configs/rk322x_common.h | 1 - include/configs/rk3288_common.h | 1 - include/configs/rk3328_common.h | 1 - include/configs/rk3399_common.h | 1 - include/configs/rockchip-common.h | 1 + include/configs/sheep_rk3368.h | 1 - 12 files changed, 1 insertion(+), 13 deletions(-)
Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

All Rockchip SoCs use 32KB as CONFIG_ENV_SIZE.
Signed-off-by: Kever Yang kever.yang@rock-chips.com
include/configs/evb_rk3229.h | 2 -- include/configs/kylin_rk3036.h | 2 -- include/configs/lion_rk3368.h | 1 - include/configs/rk3036_common.h | 1 - include/configs/rk3128_common.h | 1 - include/configs/rk3188_common.h | 1 - include/configs/rk322x_common.h | 1 - include/configs/rk3288_common.h | 1 - include/configs/rk3328_common.h | 1 - include/configs/rk3399_common.h | 1 - include/configs/rockchip-common.h | 1 + include/configs/sheep_rk3368.h | 1 - 12 files changed, 1 insertion(+), 13 deletions(-)
Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

All Rockchip SoCs use 32KB as CONFIG_ENV_SIZE.
Signed-off-by: Kever Yang kever.yang@rock-chips.com Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
include/configs/evb_rk3229.h | 2 -- include/configs/kylin_rk3036.h | 2 -- include/configs/lion_rk3368.h | 1 - include/configs/rk3036_common.h | 1 - include/configs/rk3128_common.h | 1 - include/configs/rk3188_common.h | 1 - include/configs/rk322x_common.h | 1 - include/configs/rk3288_common.h | 1 - include/configs/rk3328_common.h | 1 - include/configs/rk3399_common.h | 1 - include/configs/rockchip-common.h | 1 + include/configs/sheep_rk3368.h | 1 - 12 files changed, 1 insertion(+), 13 deletions(-)
Applied to u-boot-rockchip, thanks!

On 31 Oct 2017, at 08:52, Kever Yang kever.yang@rock-chips.com wrote:
Using the ENV offset from rockchip legacy U-Boot for all SoCs, the offset is 4MB-32KB
Signed-off-by: Kever Yang kever.yang@rock-chips.com
include/configs/rockchip-common.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h index 96b5fce..3fc1b71 100644 --- a/include/configs/rockchip-common.h +++ b/include/configs/rockchip-common.h @@ -61,19 +61,10 @@
#endif
-#if CONFIG_IS_ENABLED(ROCKCHIP_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
+/*
- Rockchip SoCs use fixed ENV 32KB@(4MB-32KB)
*/ -#define CONFIG_ENV_OFFSET (96 * 1024) -#endif +#define CONFIG_ENV_OFFSET (SZ_4M - SZ_32K)
Is there a reason why we don’t move this to the DTS (there is a /config/u-boot,mmc-env-offset property node for this)?
#define CONFIG_DISPLAY_BOARDINFO_LATE
-- 1.9.1

Philipp,
On 11/03/2017 05:45 PM, Dr. Philipp Tomsich wrote:
On 31 Oct 2017, at 08:52, Kever Yang kever.yang@rock-chips.com wrote:
Using the ENV offset from rockchip legacy U-Boot for all SoCs, the offset is 4MB-32KB
Signed-off-by: Kever Yang kever.yang@rock-chips.com
include/configs/rockchip-common.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h index 96b5fce..3fc1b71 100644 --- a/include/configs/rockchip-common.h +++ b/include/configs/rockchip-common.h @@ -61,19 +61,10 @@
#endif
-#if CONFIG_IS_ENABLED(ROCKCHIP_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
+/*
*/
- Rockchip SoCs use fixed ENV 32KB@(4MB-32KB)
-#define CONFIG_ENV_OFFSET (96 * 1024) -#endif +#define CONFIG_ENV_OFFSET (SZ_4M - SZ_32K)
Is there a reason why we don’t move this to the DTS (there is a /config/u-boot,mmc-env-offset property node for this)?
Because it's simple enough for use.
To be honest, I didn't notice there is a DTS node for ENV offset. And I didn't see a good reason to move this to DTS: - Almost all the SoCs using the macro define in header file, using dts is not popular way; - I don't think we need to add a node for each SoC dtsi, we only need one MACRO define in common header and use it directly instead of parse it from different SoC dtsi; - kernel dtsi file does not have the 'u-boot,mmc-env-offset' node, that means we have to add them in dtsi for each soc when we add one soc support, I think most people do not have idea about this, why don't we make it easier?
Thanks, - Kever
#define CONFIG_DISPLAY_BOARDINFO_LATE
-- 1.9.1

Using the ENV offset from rockchip legacy U-Boot for all SoCs, the offset is 4MB-32KB
Signed-off-by: Kever Yang kever.yang@rock-chips.com
include/configs/rockchip-common.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)
Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

Using the ENV offset from rockchip legacy U-Boot for all SoCs, the offset is 4MB-32KB
Signed-off-by: Kever Yang kever.yang@rock-chips.com
include/configs/rockchip-common.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)
Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

Using the ENV offset from rockchip legacy U-Boot for all SoCs, the offset is 4MB-32KB
Signed-off-by: Kever Yang kever.yang@rock-chips.com Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
include/configs/rockchip-common.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)
Applied to u-boot-rockchip, thanks!
participants (3)
-
Dr. Philipp Tomsich
-
Kever Yang
-
Philipp Tomsich