[U-Boot] [PATCHv2 10/21] net: sunxi: Enable I2C bus set via NET_ETHADDR_EEPROM_I2C_BUS

Olliver Schinagl
2017-04-10T15:33:45Z

A user may select the connected eeprom address via
NET_ETHADDR_EEPROM_I2C_BUS, but not enable it (I2Cn_ENABLE). To prevent
this mistake, enable the I2C controller selected via
NET_ETHADDR_EEPROM_I2C_BUS.

This in turn simplifies the defconfig.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
---
board/sunxi/Kconfig | 4 ++++
configs/A10-OLinuXino-Lime_defconfig | 1 -
configs/A20-OLinuXino-Lime2_defconfig | 1 -
configs/A20-OLinuXino-Lime_defconfig | 1 -
configs/A20-OLinuXino_MICRO_defconfig | 1 -
5 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 962da09136..e515175117 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -441,6 +441,7 @@ config I2C0_ENABLE

config I2C1_ENABLE
bool "Enable I2C/TWI controller 1"
+ default y if (NET_ETHADDR_EEPROM_I2C_BUS = 1)
default n
select CMD_I2C
---help---
@@ -448,6 +449,7 @@ config I2C1_ENABLE

config I2C2_ENABLE
bool "Enable I2C/TWI controller 2"
+ default y if (NET_ETHADDR_EEPROM_I2C_BUS = 2)
default n
select CMD_I2C
---help---
@@ -455,6 +457,7 @@ config I2C2_ENABLE

if MACH_SUN6I || MACH_SUN7I
config I2C3_ENABLE
+ default y if (NET_ETHADDR_EEPROM_I2C_BUS = 3)
bool "Enable I2C/TWI controller 3"
default n
select CMD_I2C
@@ -475,6 +478,7 @@ endif
if MACH_SUN7I
config I2C4_ENABLE
bool "Enable I2C/TWI controller 4"
+ default y if (NET_ETHADDR_EEPROM_I2C_BUS = 4)
default n
select CMD_I2C
---help---
diff --git a/configs/A10-OLinuXino-Lime_defconfig b/configs/A10-OLinuXino-Lime_defconfig
index 6634139ab8..7a8756620a 100644
--- a/configs/A10-OLinuXino-Lime_defconfig
+++ b/configs/A10-OLinuXino-Lime_defconfig
@@ -17,7 +17,6 @@ CONFIG_SPL_I2C_SUPPORT=y
CONFIG_NET_ETHADDR_EEPROM=y
CONFIG_NET_ETHADDR_EEPROM_I2C=y
CONFIG_NET_ETHADDR_EEPROM_I2C_BUS=1
-CONFIG_I2C1_ENABLE=y
# CONFIG_SPL_DOS_PARTITION is not set
# CONFIG_SPL_ISO_PARTITION is not set
# CONFIG_SPL_EFI_PARTITION is not set
diff --git a/configs/A20-OLinuXino-Lime2_defconfig b/configs/A20-OLinuXino-Lime2_defconfig
index 4c720b3109..0d7d5f042f 100644
--- a/configs/A20-OLinuXino-Lime2_defconfig
+++ b/configs/A20-OLinuXino-Lime2_defconfig
@@ -24,7 +24,6 @@ CONFIG_ETH_DESIGNWARE=y
CONFIG_NET_ETHADDR_EEPROM=y
CONFIG_NET_ETHADDR_EEPROM_I2C=y
CONFIG_NET_ETHADDR_EEPROM_I2C_BUS=1
-CONFIG_I2C1_ENABLE=y
CONFIG_AXP_ALDO3_VOLT=2800
CONFIG_AXP_ALDO4_VOLT=2800
CONFIG_USB_EHCI_HCD=y
diff --git a/configs/A20-OLinuXino-Lime_defconfig b/configs/A20-OLinuXino-Lime_defconfig
index 564ae256a3..a90d681064 100644
--- a/configs/A20-OLinuXino-Lime_defconfig
+++ b/configs/A20-OLinuXino-Lime_defconfig
@@ -19,7 +19,6 @@ CONFIG_ETH_DESIGNWARE=y
CONFIG_NET_ETHADDR_EEPROM=y
CONFIG_NET_ETHADDR_EEPROM_I2C=y
CONFIG_NET_ETHADDR_EEPROM_I2C_BUS=1
-CONFIG_I2C1_ENABLE=y
CONFIG_AXP_ALDO3_VOLT=2800
CONFIG_AXP_ALDO4_VOLT=2800
CONFIG_USB_EHCI_HCD=y
diff --git a/configs/A20-OLinuXino_MICRO_defconfig b/configs/A20-OLinuXino_MICRO_defconfig
index 93be13b407..d0bfa9c3c0 100644
--- a/configs/A20-OLinuXino_MICRO_defconfig
+++ b/configs/A20-OLinuXino_MICRO_defconfig
@@ -22,7 +22,6 @@ CONFIG_ETH_DESIGNWARE=y
CONFIG_NET_ETHADDR_EEPROM=y
CONFIG_NET_ETHADDR_EEPROM_I2C=y
CONFIG_NET_ETHADDR_EEPROM_I2C_BUS=1
-CONFIG_I2C1_ENABLE=y
CONFIG_AXP_ALDO3_VOLT=2800
CONFIG_AXP_ALDO4_VOLT=2800
CONFIG_USB_EHCI_HCD=y
--
2.11.0