[U-Boot] [PATCH] rockchip: rk3399: correct the env setting

Dr. Philipp Tomsich philipp.tomsich at theobroma-systems.com
Wed Jul 19 12:20:21 UTC 2017


Kever,

> On 19 Jul 2017, at 14:02, Kever Yang <kever.yang at rock-chips.com> wrote:
> 
> The mmc0(emmc) is the default boot device, so let's use
> mmc device 0 as default env device.
> The SPL size in rk3399 is lager than other Rockchip SoC,
> we need to using a new offset and not to conflict with
> SPL memory space.
> 
> Signed-off-by: Kever Yang <kever.yang at rock-chips.com>
> ---
> 
> include/configs/evb_rk3399.h | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/include/configs/evb_rk3399.h b/include/configs/evb_rk3399.h
> index b9fd5b4..bdb1159 100644
> --- a/include/configs/evb_rk3399.h
> +++ b/include/configs/evb_rk3399.h
> @@ -10,13 +10,14 @@
> #include <configs/rk3399_common.h>
> 
> #define CONFIG_ENV_IS_IN_MMC
> -#define CONFIG_SYS_MMC_ENV_DEV 1
> +#define CONFIG_SYS_MMC_ENV_DEV 0
> /*
> - * SPL @ 32k for ~36k
> - * ENV @ 96k
> - * u-boot @ 128K
> + * SPL @ 32k for ~128k
> + * ENV @ 240k
> + * u-boot @ 256K
>  */
> -#define CONFIG_ENV_OFFSET (96 * 1024)
> +#undef CONFIG_ENV_OFFSET
> +#define CONFIG_ENV_OFFSET (240 * 1024)

Can we standardise on using the DTS to configure this for the RK3399 and RK3368?
We added 'u-boot,spl-payload-offset’ and 'u-boot,mmc-env-offset’ a while back to make
it simple to configure these on a per-board basis, if customers want to override it.

On the RK3399-Q7 and the RK3368-uQ7, I’ve set up SPL to use full OF_CONTROL
(in contrast to OF_PLATDATA) and we have the following in our DTS (this is in my
patch-queue and hasn’t made it upstream yet):

--- a/arch/arm/dts/rk3399-puma.dtsi
+++ b/arch/arm/dts/rk3399-puma.dtsi
@@ -12,7 +12,8 @@
        compatible = "tsd,rk3399-q7", "tsd,puma", "rockchip,rk3399";
 
        config {
-               u-boot,spl-payload-offset = <0x40000>; /* 256kbyte */
+               u-boot,spl-payload-offset = <0x40000>; /* @ 256KB */
+               u-boot,mmc-env-offset = <0x4000>;      /* @  16KB */
                u-boot,boot-led = "module_led";
        };
 
If this is agreeable, I could even submit this against rk3399.dtsi and then we
could standardise on this across all boards?

> #define SDRAM_BANK_SIZE			(2UL << 30)
> 
> -- 
> 1.9.1
> 



More information about the U-Boot mailing list