Skip to content

Commit

Permalink
Convert CONFIG_OVERWRITE_ETHADDR_ONCE to Kconfig
Browse files Browse the repository at this point in the history
This converts the following to Kconfig:
   CONFIG_OVERWRITE_ETHADDR_ONCE

Signed-off-by: Tom Rini <[email protected]>
  • Loading branch information
trini committed Dec 22, 2022
1 parent 3348c6b commit 0a69d6a
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 17 deletions.
7 changes: 0 additions & 7 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -1071,13 +1071,6 @@ The following options need to be configured:
completely disabled. Anybody can change or delete
these parameters.

Alternatively, if you define _both_ an ethaddr in the
default env _and_ CONFIG_OVERWRITE_ETHADDR_ONCE, a default
Ethernet address is installed in the environment,
which can be changed exactly ONCE by the user. [The
serial# is unaffected by this, i. e. it remains
read-only.]

The same can be accomplished in a more flexible way
for any variable by configuring the type of access
to allow for those variables in the ".flags" variable
Expand Down
1 change: 1 addition & 0 deletions configs/M5253DEMO_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ CONFIG_CMD_CACHE=y
CONFIG_CMD_EXT2=y
CONFIG_CMD_FAT=y
CONFIG_MAC_PARTITION=y
CONFIG_OVERWRITE_ETHADDR_ONCE=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_USE_HOSTNAME=y
CONFIG_HOSTNAME="M5253DEMO"
Expand Down
1 change: 1 addition & 0 deletions configs/M5275EVB_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ CONFIG_CMD_MII=y
CONFIG_MII_INIT=y
CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
CONFIG_OVERWRITE_ETHADDR_ONCE=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_SYS_FAULT_ECHO_LINK_DOWN=y
CONFIG_SYS_RX_ETH_BUFFER=8
Expand Down
1 change: 1 addition & 0 deletions configs/eb_cpu5282_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ CONFIG_BOOTP_BOOTFILESIZE=y
CONFIG_CMD_MII=y
CONFIG_MII_INIT=y
CONFIG_CMD_DATE=y
CONFIG_OVERWRITE_ETHADDR_ONCE=y
CONFIG_SYS_FAULT_ECHO_LINK_DOWN=y
CONFIG_SYS_RX_ETH_BUFFER=8
CONFIG_SYS_I2C_LEGACY=y
Expand Down
1 change: 1 addition & 0 deletions configs/eb_cpu5282_internal_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ CONFIG_BOOTP_BOOTFILESIZE=y
CONFIG_CMD_MII=y
CONFIG_MII_INIT=y
CONFIG_CMD_DATE=y
CONFIG_OVERWRITE_ETHADDR_ONCE=y
CONFIG_SYS_FAULT_ECHO_LINK_DOWN=y
CONFIG_SYS_RX_ETH_BUFFER=8
CONFIG_SYS_I2C_LEGACY=y
Expand Down
9 changes: 9 additions & 0 deletions env/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ config ENV_OVERWRITE
Use this to permit overriding of certain environmental variables
like Ethernet and Serial

config OVERWRITE_ETHADDR_ONCE
bool "Enable overwriting ethaddr environment variables once"
depends on !ENV_OVERWRITE
help
Enable this to allow for the ethaddr environment variables to be
overwritten one time per boot, only. This allows for a default
to be installed in the environment, which can be changed exactly ONCE
by the user.

config ENV_MIN_ENTRIES
int "Minimum number of entries in the environment hashtable"
default 64
Expand Down
2 changes: 0 additions & 2 deletions include/configs/M5253DEMO.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
env/embedded.o(.text*);

#ifdef CONFIG_DRIVER_DM9000
# define CONFIG_OVERWRITE_ETHADDR_ONCE

# define CONFIG_EXTRA_ENV_SETTINGS \
"netdev=eth0\0" \
"inpclk=" __stringify(CONFIG_SYS_INPUT_CLKSRC) "\0" \
Expand Down
4 changes: 0 additions & 4 deletions include/configs/M5275EVB.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@
#define CFG_SYS_I2C_PINMUX_CLR (0xFFF0)
#define CFG_SYS_I2C_PINMUX_SET (0x000F)

#ifdef CONFIG_MCFFEC
# define CONFIG_OVERWRITE_ETHADDR_ONCE
#endif /* FEC_ENET */

#define CONFIG_EXTRA_ENV_SETTINGS \
"netdev=eth0\0" \
"loadaddr=10000\0" \
Expand Down
4 changes: 0 additions & 4 deletions include/configs/eb_cpu5282.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@
* Network *
*----------------------------------------------------------------------*/

#ifdef CONFIG_MCFFEC
#define CONFIG_OVERWRITE_ETHADDR_ONCE
#endif

/*-------------------------------------------------------------------------
* Low Level Configuration Settings
* (address mappings, register initial values, etc.)
Expand Down

0 comments on commit 0a69d6a

Please sign in to comment.