Commit 81f53b0dafdfe9458f6d04fc5ec2732c2ea23a71

Authored by Klaus Goger
Committed by Philipp Tomsich
1 parent aa41220f6f

rockchip: move CONFIG_ENV_SIZE and CONFIG_ENV_OFFSET to Kconfig

This commit adds ENV_SIZE and ENV_OFFSET configuration items for
ARCH_ROCKCHIP, but keeps these non-visible (i.e. not prompt is given).
With these new items present, the configuration from the header files
is moved to Kconfig.

Keeping these non-visible is necessary to have the possibility to
select new default values if CONFIG_IS_IN_* is changed (interactively
or with oldconfig). Otherwise it will always be set to a previous
value if used with a prompt.  As an example if we do a defconfig with
CONFIG_IS_IN_MMC and change it to CONFIG_IS_IN_SPI_FLASH via
menuconfig, ENV_SIZE and ENV_OFFSET will not be changed to the correct
values as defconfig will already have set them to the default values
of CONFIG_IS_IN_MMC in .config.

Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Showing 4 changed files with 24 additions and 14 deletions Side-by-side Diff

board/theobroma-systems/puma_rk3399/Kconfig
... ... @@ -12,5 +12,11 @@
12 12 config BOARD_SPECIFIC_OPTIONS # dummy
13 13 def_bool y
14 14  
  15 +config ENV_SIZE
  16 + default 0x2000 if ENV_IS_IN_SPI_FLASH
  17 +
  18 +config ENV_OFFSET
  19 + default 0x3c000 if ENV_IS_IN_SPI_FLASH
  20 +
15 21 endif
... ... @@ -427,5 +427,23 @@
427 427  
428 428 endif
429 429  
  430 +if ARCH_ROCKCHIP
  431 +
  432 +config ENV_OFFSET
  433 + hex
  434 + depends on !ENV_IS_IN_UBI
  435 + depends on !ENV_IS_NOWHERE
  436 + default 0x3f8000
  437 + help
  438 + Offset from the start of the device (or partition)
  439 +
  440 +config ENV_SIZE
  441 + hex
  442 + default 0x8000
  443 + help
  444 + Size of the environment storage area
  445 +
  446 +endif
  447 +
430 448 endmenu
include/configs/puma_rk3399.h
... ... @@ -9,14 +9,6 @@
9 9  
10 10 #include <configs/rk3399_common.h>
11 11  
12   -/*
13   - * SPL @ 32kB for ~130kB
14   - * ENV @ 240KB for 8kB
15   - * FIT payload (ATF, U-Boot, FDT) @ 256kB
16   - */
17   -#undef CONFIG_ENV_OFFSET
18   -#define CONFIG_ENV_OFFSET (240 * 1024)
19   -
20 12 #if defined(CONFIG_ENV_IS_IN_MMC)
21 13 #define CONFIG_SYS_MMC_ENV_DEV 1
22 14 #elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
include/configs/rockchip-common.h
... ... @@ -59,12 +59,6 @@
59 59  
60 60 #endif
61 61  
62   -/*
63   - * Rockchip SoCs use fixed ENV 32KB@(4MB-32KB)
64   - */
65   -#define CONFIG_ENV_OFFSET (SZ_4M - SZ_32K)
66   -#define CONFIG_ENV_SIZE SZ_32K
67   -
68 62 #define CONFIG_DISPLAY_BOARDINFO_LATE
69 63  
70 64 #endif /* _ROCKCHIP_COMMON_H_ */