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

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


> 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

I think this should either be implemented similarily to 'u-boot,spl-boot-order’
property and allow a list of devices to be searched in a given order for a valid
environment… or it should be tied to what device the full U-Boot was booted
from.

On an earlier board we had the SPL inject a property into the FDT used by
the full U-Boot to indicate what device it had been booted from… and I
might update and extend this for this purpose.

> /*
> - * 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

This #undef is necessary due to rockchip-common.h also defining this symbol.
I have a patch on our production tree to the same effect (and adding an #ifdef
check to rockchip-common.h), but am generally unhappy about how these
config files work.

Could you clean this up across all our configs, so we don’t end up with a pattern
of #define and #undef across various newer boards (that may have largish SPL
stages)?

> +#define CONFIG_ENV_OFFSET (240 * 1024)
> 
> #define SDRAM_BANK_SIZE			(2UL << 30)
> 
> -- 
> 1.9.1
> 



More information about the U-Boot mailing list