[U-Boot] [PATCH v2 1/3] rockchip: configs: correct env offset when enable CONFIG_ROCKCHIP_SPL_BACK_TO_BROM

With CONFIG_ROCKCHIP_SPL_BACK_TO_BROM enabled, the environment is inside u-boot. So solve it by moving environment after u-boot.
Signed-off-by: Jacob Chen jacob2.chen@rock-chips.com ---
Changes in v2: - add a commit message
include/configs/evb_rk3288.h | 9 +++++++++ include/configs/fennec_rk3288.h | 9 +++++++++ include/configs/miniarm_rk3288.h | 9 +++++++++ include/configs/popmetal_rk3288.h | 9 +++++++++ 4 files changed, 36 insertions(+)
diff --git a/include/configs/evb_rk3288.h b/include/configs/evb_rk3288.h index 390c243..90b810a 100644 --- a/include/configs/evb_rk3288.h +++ b/include/configs/evb_rk3288.h @@ -12,11 +12,20 @@
#define CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 1 + +#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 diff --git a/include/configs/fennec_rk3288.h b/include/configs/fennec_rk3288.h index 390c243..90b810a 100644 --- a/include/configs/fennec_rk3288.h +++ b/include/configs/fennec_rk3288.h @@ -12,11 +12,20 @@
#define CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 1 + +#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 diff --git a/include/configs/miniarm_rk3288.h b/include/configs/miniarm_rk3288.h index aa259db..645d023 100644 --- a/include/configs/miniarm_rk3288.h +++ b/include/configs/miniarm_rk3288.h @@ -17,11 +17,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 diff --git a/include/configs/popmetal_rk3288.h b/include/configs/popmetal_rk3288.h index 390c243..90b810a 100644 --- a/include/configs/popmetal_rk3288.h +++ b/include/configs/popmetal_rk3288.h @@ -12,11 +12,20 @@
#define CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 1 + +#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

To make rockchip soc keep the same partition map
Signed-off-by: Jacob Chen jacob2.chen@rock-chips.com ---
Changes in v2: - add a commit message
include/configs/kylin_rk3036.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/include/configs/kylin_rk3036.h b/include/configs/kylin_rk3036.h index 4f0bd84..bc28525 100644 --- a/include/configs/kylin_rk3036.h +++ b/include/configs/kylin_rk3036.h @@ -19,9 +19,20 @@ #define CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 0 /* emmc */ #define CONFIG_SYS_MMC_ENV_PART 0 /* user area */ -#define CONFIG_ENV_OFFSET (SZ_4M - SZ_64K) /* reserved area */ -#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) -#define CONFIG_SYS_REDUNDAND_ENVIRONMENT + +#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
#endif

Hi Jacob,
On 18 November 2016 at 00:52, Jacob Chen jacob2.chen@rock-chips.com wrote:
To make rockchip soc keep the same partition map
Signed-off-by: Jacob Chen jacob2.chen@rock-chips.com
Changes in v2:
- add a commit message
include/configs/kylin_rk3036.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
Can this happen in the common file?
Regards, Simon

On 19 November 2016 at 06:48, Simon Glass sjg@chromium.org wrote:
Hi Jacob,
On 18 November 2016 at 00:52, Jacob Chen jacob2.chen@rock-chips.com wrote:
To make rockchip soc keep the same partition map
Signed-off-by: Jacob Chen jacob2.chen@rock-chips.com
Changes in v2:
- add a commit message
include/configs/kylin_rk3036.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
Can this happen in the common file?
Regards, Simon
Applied to u-boot-rockchip, thanks!

It should be 112M, to make rootfs start at 0x40000
Signed-off-by: Jacob Chen jacob2.chen@rock-chips.com Acked-by: Simon Glass sjg@chromium.org ---
Changes in v2: None
include/configs/rockchip-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h index 86c81b0..d077824 100644 --- a/include/configs/rockchip-common.h +++ b/include/configs/rockchip-common.h @@ -28,7 +28,7 @@ "name=reserved2,size=4M,uuid=${uuid_gpt_reserved2};" \ "name=loader2,size=4MB,uuid=${uuid_gpt_loader2};" \ "name=atf,size=4M,uuid=${uuid_gpt_atf};" \ - "name=boot,size=128M,bootable,uuid=${uuid_gpt_boot};" \ + "name=boot,size=112M,bootable,uuid=${uuid_gpt_boot};" \ "name=rootfs,size=-,uuid=${uuid_gpt_rootfs};\0" \
#endif

Hi Jacob,
On 18 November 2016 at 00:52, Jacob Chen jacob2.chen@rock-chips.com wrote:
With CONFIG_ROCKCHIP_SPL_BACK_TO_BROM enabled, the environment is inside u-boot. So solve it by moving environment after u-boot.
Can this not happen in the rk3288_common.h file?
Signed-off-by: Jacob Chen jacob2.chen@rock-chips.com
Changes in v2:
- add a commit message
include/configs/evb_rk3288.h | 9 +++++++++ include/configs/fennec_rk3288.h | 9 +++++++++ include/configs/miniarm_rk3288.h | 9 +++++++++ include/configs/popmetal_rk3288.h | 9 +++++++++ 4 files changed, 36 insertions(+)
Regards, Simon

On 19 November 2016 at 06:48, Simon Glass sjg@chromium.org wrote:
Hi Jacob,
On 18 November 2016 at 00:52, Jacob Chen jacob2.chen@rock-chips.com wrote:
With CONFIG_ROCKCHIP_SPL_BACK_TO_BROM enabled, the environment is inside u-boot. So solve it by moving environment after u-boot.
Can this not happen in the rk3288_common.h file?
Signed-off-by: Jacob Chen jacob2.chen@rock-chips.com
Changes in v2:
- add a commit message
include/configs/evb_rk3288.h | 9 +++++++++ include/configs/fennec_rk3288.h | 9 +++++++++ include/configs/miniarm_rk3288.h | 9 +++++++++ include/configs/popmetal_rk3288.h | 9 +++++++++ 4 files changed, 36 insertions(+)
Regards, Simon
Applied to u-boot-rockchip, thanks!
participants (2)
-
Jacob Chen
-
Simon Glass