diff options
author | Tom Rini <trini@konsulko.com> | 2022-06-08 08:24:24 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-06-28 17:03:30 -0400 |
commit | d6e9efa6b2309d6582366dd4c6a95c4c7fb8f2af (patch) | |
tree | a9217236122bfc7d47e2eb220a9a075d87a7443f | |
parent | 5c511ea93683cbdc94ec7e837b0a5b96495151f2 (diff) |
Convert CONFIG_EFLASH_PROTSECTORS to Kconfig
This converts the following to Kconfig:
CONFIG_EFLASH_PROTSECTORS
Signed-off-by: Tom Rini <trini@konsulko.com>
-rw-r--r-- | arch/arm/mach-at91/Kconfig | 7 | ||||
-rw-r--r-- | arch/arm/mach-at91/arm926ejs/eflash.c | 4 | ||||
-rw-r--r-- | configs/ethernut5_defconfig | 1 | ||||
-rw-r--r-- | include/configs/ethernut5.h | 1 |
4 files changed, 10 insertions, 3 deletions
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index b87639f8c07..4fee9772bf1 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig @@ -327,6 +327,13 @@ config AT91_EFLASH Enable the driver for the embedded flash used in the Atmel AT91SAM9XE devices. +config EFLASH_PROTSECTORS + int "Number of flash sectors to protect from erasing" + depends on AT91_EFLASH + help + If non-zero, this will be the number of sectors of the flash to disallow + U-Boot to ease, starting from the beginning of flash. + config AT91_GPIO_PULLUP bool "Keep pullups on peripheral pins" depends on CPU_ARM926EJS diff --git a/arch/arm/mach-at91/arm926ejs/eflash.c b/arch/arm/mach-at91/arm926ejs/eflash.c index 23c24936edf..043f06a8271 100644 --- a/arch/arm/mach-at91/arm926ejs/eflash.c +++ b/arch/arm/mach-at91/arm926ejs/eflash.c @@ -120,7 +120,7 @@ unsigned long flash_init(void) if (i%32 == 0) tmp = readl(&eefc->frr); flash_info[0].protect[i] = (tmp >> (i%32)) & 1; -#if defined(CONFIG_EFLASH_PROTSECTORS) +#if CONFIG_VAL(EFLASH_PROTSECTORS) if (i < CONFIG_EFLASH_PROTSECTORS) flash_info[0].protect[i] = 1; #endif @@ -158,7 +158,7 @@ int flash_real_protect (flash_info_t *info, long sector, int prot) debug("protect sector=%ld prot=%d\n", sector, prot); -#if defined(CONFIG_EFLASH_PROTSECTORS) +#if CONFIG_VAL(EFLASH_PROTSECTORS) if (sector < CONFIG_EFLASH_PROTSECTORS) { if (!prot) { printf("eflash: sector %lu cannot be unprotected\n", diff --git a/configs/ethernut5_defconfig b/configs/ethernut5_defconfig index da8c0bd9cbe..256f6520a59 100644 --- a/configs/ethernut5_defconfig +++ b/configs/ethernut5_defconfig @@ -6,6 +6,7 @@ CONFIG_SYS_TEXT_BASE=0x27000000 CONFIG_SYS_MALLOC_LEN=0x121000 CONFIG_TARGET_ETHERNUT5=y CONFIG_AT91_EFLASH=y +CONFIG_EFLASH_PROTSECTORS=1 CONFIG_NR_DRAM_BANKS=1 CONFIG_ENV_SIZE=0x21000 CONFIG_ENV_OFFSET=0x3DE000 diff --git a/include/configs/ethernut5.h b/include/configs/ethernut5.h index 8e7bfadf64e..8f9cfd50bc1 100644 --- a/include/configs/ethernut5.h +++ b/include/configs/ethernut5.h @@ -32,7 +32,6 @@ /* 512kB on-chip NOR flash */ # define CONFIG_SYS_FLASH_BASE 0x00200000 /* AT91SAM9XE_FLASH_BASE */ # define CONFIG_SYS_MAX_FLASH_SECT 32 -# define CONFIG_EFLASH_PROTSECTORS 1 /* bootstrap + u-boot + env + linux in dataflash on CS0 */ |