]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
imx: aristainetos: enable U-Boot Environment variables protection
authorHeiko Schocher <hs@denx.de>
Mon, 30 Nov 2020 19:46:05 +0000 (20:46 +0100)
committerStefano Babic <sbabic@denx.de>
Sun, 6 Dec 2020 14:07:40 +0000 (15:07 +0100)
enable Environment protection with:

CONFIG_ENV_APPEND=y
CONFIG_ENV_WRITEABLE_LIST=y
CONFIG_ENV_ACCESS_IGNORE_FORCE

and add board specific env_get_location()
function.

Signed-off-by: Heiko Schocher <hs@denx.de>
board/aristainetos/aristainetos.c
configs/aristainetos2c_defconfig
configs/aristainetos2ccslb_defconfig
include/configs/aristainetos2.h

index 6bfaaed666a6fca6b0dd7b973bad585d417a3c8c..07d2e3ec7bb0c7cb2c0ff66361534c40b05144d0 100644 (file)
@@ -27,6 +27,7 @@
 #include <bmp_logo.h>
 #include <dm/root.h>
 #include <env.h>
+#include <env_internal.h>
 #include <i2c_eeprom.h>
 #include <i2c.h>
 #include <micrel.h>
@@ -527,3 +528,22 @@ int embedded_dtb_select(void)
        return 0;
 }
 #endif
+
+enum env_location env_get_location(enum env_operation op, int prio)
+{
+       if (op == ENVOP_SAVE || op == ENVOP_ERASE)
+               return ENVL_SPI_FLASH;
+
+       switch (prio) {
+       case 0:
+               return ENVL_NOWHERE;
+
+       case 1:
+               return ENVL_SPI_FLASH;
+
+       default:
+               return ENVL_UNKNOWN;
+       }
+
+       return ENVL_UNKNOWN;
+}
index 773d7f67748028bec4c1b896e9b2ed4508e8ede9..df0b26d6a0abc8d706794e2af5d716bec3feb15f 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MX6=y
 CONFIG_SYS_TEXT_BASE=0x17800000
-CONFIG_SYS_MALLOC_F_LEN=0xe000
+CONFIG_SYS_MALLOC_F_LEN=0x13000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_ENV_OFFSET=0xD0000
 CONFIG_MX6DL=y
@@ -30,6 +30,8 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_BOOTM_PLAN9 is not set
 # CONFIG_BOOTM_RTEMS is not set
 # CONFIG_BOOTM_VXWORKS is not set
+CONFIG_CMD_ENV_FLAGS=y
+CONFIG_CMD_NVEDIT_INFO=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -54,10 +56,14 @@ CONFIG_OF_CONTROL=y
 CONFIG_DTB_RESELECT=y
 CONFIG_MULTI_DTB_FIT=y
 CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_IS_NOWHERE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_SPI_EARLY=y
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_ENV_APPEND=y
+CONFIG_ENV_WRITEABLE_LIST=y
+CONFIG_ENV_ACCESS_IGNORE_FORCE=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_APBH_DMA=y
index 16d3c88fe13cb34326a6b828a7e0606fbb650378..0156493934cc1e14dc954b1186c0754694cd5e3b 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MX6=y
 CONFIG_SYS_TEXT_BASE=0x17800000
-CONFIG_SYS_MALLOC_F_LEN=0xe000
+CONFIG_SYS_MALLOC_F_LEN=0x13000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_ENV_OFFSET=0xD0000
 CONFIG_MX6DL=y
@@ -30,6 +30,8 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_BOOTM_PLAN9 is not set
 # CONFIG_BOOTM_RTEMS is not set
 # CONFIG_BOOTM_VXWORKS is not set
+CONFIG_CMD_ENV_FLAGS=y
+CONFIG_CMD_NVEDIT_INFO=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -54,10 +56,14 @@ CONFIG_OF_CONTROL=y
 CONFIG_DTB_RESELECT=y
 CONFIG_MULTI_DTB_FIT=y
 CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_IS_NOWHERE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_SPI_EARLY=y
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_ENV_APPEND=y
+CONFIG_ENV_WRITEABLE_LIST=y
+CONFIG_ENV_ACCESS_IGNORE_FORCE=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_APBH_DMA=y
@@ -114,5 +120,7 @@ CONFIG_DISPLAY=y
 CONFIG_VIDEO_IPUV3=y
 CONFIG_SPLASH_SCREEN=y
 CONFIG_SPLASH_SCREEN_ALIGN=y
+CONFIG_VIDEO_BMP_RLE8=y
+CONFIG_BMP_16BPP=y
 CONFIG_IMX_WATCHDOG=y
 # CONFIG_EFI_LOADER is not set
index c1e8b4a10c3b3173948844b2162128212ebbd1b9..78fa1a969e7f953dc9aa6fe601374a984a853c7a 100644 (file)
 
 #define CONFIG_IMX6_PWM_PER_CLK        66000000
 
+#define CONFIG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,serial#:sw,board_type:sw," \
+               "sysnum:dw,panel:sw,ipaddr:iw,serverip:iw"
+
 #endif                         /* __ARISTAINETOS2_CONFIG_H */