[U-Boot] [PATCH] arm: socfpga: allow configs without network support

Simon Goldschmidt sgoldschmidt at de.pepperl-fuchs.com
Thu Jan 11 08:07:57 UTC 2018


Currently, socfpga_common.h does not allow configurations without
network support. This is because CONFIG_CMD_PXE is defined in this
file and distro mode has DHCP hard-coded as available.

Fix this by moving CONFIG_CMD_PXE and CONFIG_MENU to the defconfigs
and by making DHCP optional in BOOT_TARGET_DEVICES(func).

Signed-off-by: Simon Goldschmidt <sgoldschmidt at de.pepperl-fuchs.com>
---

  configs/socfpga_arria10_defconfig           |  1 +
  configs/socfpga_arria5_defconfig            |  1 +
  configs/socfpga_cyclone5_defconfig          |  1 +
  configs/socfpga_de0_nano_soc_defconfig      |  1 +
  configs/socfpga_de10_nano_defconfig         |  1 +
  configs/socfpga_de1_soc_defconfig           |  1 +
  configs/socfpga_is1_defconfig               |  1 +
  configs/socfpga_mcvevk_defconfig            |  1 +
  configs/socfpga_pf_aplfieldswitch_defconfig |  1 +
  configs/socfpga_pf_aplpowerswitch_defconfig |  1 +
  configs/socfpga_pf_riolbfbgw_defconfig      |  1 +
  configs/socfpga_sockit_defconfig            |  1 +
  configs/socfpga_socrates_defconfig          |  1 +
  configs/socfpga_sr1500_defconfig            |  1 +
  configs/socfpga_vining_fpga_defconfig       |  1 +
  include/configs/socfpga_common.h            | 11 +++++++----
  16 files changed, 22 insertions(+), 4 deletions(-)
  mode change 100755 => 100644 configs/socfpga_pf_riolbfbgw_defconfig

diff --git a/configs/socfpga_arria10_defconfig 
b/configs/socfpga_arria10_defconfig
index f7bcce3bae..8bb7b4f318 100644
--- a/configs/socfpga_arria10_defconfig
+++ b/configs/socfpga_arria10_defconfig
@@ -16,6 +16,7 @@ CONFIG_CMD_GREPENV=y
  CONFIG_CMD_GPIO=y
  CONFIG_CMD_MMC=y
  CONFIG_CMD_DHCP=y
+CONFIG_CMD_PXE=y
  CONFIG_CMD_PING=y
  CONFIG_CMD_CACHE=y
  CONFIG_CMD_EXT4=y
diff --git a/configs/socfpga_arria5_defconfig 
b/configs/socfpga_arria5_defconfig
index 8ed6169531..e9ae3f3163 100644
--- a/configs/socfpga_arria5_defconfig
+++ b/configs/socfpga_arria5_defconfig
@@ -28,6 +28,7 @@ CONFIG_CMD_SPI=y
  CONFIG_CMD_USB=y
  CONFIG_CMD_USB_MASS_STORAGE=y
  CONFIG_CMD_DHCP=y
+CONFIG_CMD_PXE=y
  CONFIG_CMD_MII=y
  CONFIG_CMD_PING=y
  CONFIG_CMD_CACHE=y
diff --git a/configs/socfpga_cyclone5_defconfig 
b/configs/socfpga_cyclone5_defconfig
index 54c3495f2c..0f84553a5c 100644
--- a/configs/socfpga_cyclone5_defconfig
+++ b/configs/socfpga_cyclone5_defconfig
@@ -28,6 +28,7 @@ CONFIG_CMD_SPI=y
  CONFIG_CMD_USB=y
  CONFIG_CMD_USB_MASS_STORAGE=y
  CONFIG_CMD_DHCP=y
+CONFIG_CMD_PXE=y
  CONFIG_CMD_MII=y
  CONFIG_CMD_PING=y
  CONFIG_CMD_CACHE=y
diff --git a/configs/socfpga_de0_nano_soc_defconfig 
b/configs/socfpga_de0_nano_soc_defconfig
index 2787b60a39..ab6721d887 100644
--- a/configs/socfpga_de0_nano_soc_defconfig
+++ b/configs/socfpga_de0_nano_soc_defconfig
@@ -30,6 +30,7 @@ CONFIG_CMD_SPI=y
  CONFIG_CMD_USB=y
  CONFIG_CMD_USB_MASS_STORAGE=y
  CONFIG_CMD_DHCP=y
+CONFIG_CMD_PXE=y
  CONFIG_CMD_MII=y
  CONFIG_CMD_PING=y
  CONFIG_CMD_CACHE=y
diff --git a/configs/socfpga_de10_nano_defconfig 
b/configs/socfpga_de10_nano_defconfig
index ecf6de3807..ab162ed8ff 100644
--- a/configs/socfpga_de10_nano_defconfig
+++ b/configs/socfpga_de10_nano_defconfig
@@ -27,6 +27,7 @@ CONFIG_CMD_SPI=y
  CONFIG_CMD_USB=y
  CONFIG_CMD_USB_MASS_STORAGE=y
  CONFIG_CMD_DHCP=y
+CONFIG_CMD_PXE=y
  CONFIG_CMD_MII=y
  CONFIG_CMD_PING=y
  CONFIG_CMD_CACHE=y
diff --git a/configs/socfpga_de1_soc_defconfig 
b/configs/socfpga_de1_soc_defconfig
index 97a6c5e5df..0c85140e9e 100644
--- a/configs/socfpga_de1_soc_defconfig
+++ b/configs/socfpga_de1_soc_defconfig
@@ -28,6 +28,7 @@ CONFIG_CMD_MMC=y
  CONFIG_CMD_SPI=y
  CONFIG_CMD_USB=y
  CONFIG_CMD_DHCP=y
+CONFIG_CMD_PXE=y
  CONFIG_CMD_MII=y
  CONFIG_CMD_PING=y
  CONFIG_CMD_CACHE=y
diff --git a/configs/socfpga_is1_defconfig b/configs/socfpga_is1_defconfig
index bba90d9cda..39a4878631 100644
--- a/configs/socfpga_is1_defconfig
+++ b/configs/socfpga_is1_defconfig
@@ -24,6 +24,7 @@ CONFIG_CMD_I2C=y
  CONFIG_CMD_SF=y
  CONFIG_CMD_SPI=y
  CONFIG_CMD_DHCP=y
+CONFIG_CMD_PXE=y
  CONFIG_CMD_MII=y
  CONFIG_CMD_PING=y
  CONFIG_CMD_CACHE=y
diff --git a/configs/socfpga_mcvevk_defconfig 
b/configs/socfpga_mcvevk_defconfig
index 5bae037d63..7188052f39 100644
--- a/configs/socfpga_mcvevk_defconfig
+++ b/configs/socfpga_mcvevk_defconfig
@@ -29,6 +29,7 @@ CONFIG_CMD_SPI=y
  CONFIG_CMD_USB=y
  CONFIG_CMD_USB_MASS_STORAGE=y
  CONFIG_CMD_DHCP=y
+CONFIG_CMD_PXE=y
  CONFIG_CMD_MII=y
  CONFIG_CMD_PING=y
  CONFIG_CMD_CACHE=y
diff --git a/configs/socfpga_pf_aplfieldswitch_defconfig 
b/configs/socfpga_pf_aplfieldswitch_defconfig
index 29d1e79fb7..7db9e9acc9 100644
--- a/configs/socfpga_pf_aplfieldswitch_defconfig
+++ b/configs/socfpga_pf_aplfieldswitch_defconfig
@@ -31,6 +31,7 @@ CONFIG_CMD_PART=y
  CONFIG_CMD_SF=y
  CONFIG_CMD_SPI=y
  CONFIG_CMD_DHCP=y
+CONFIG_CMD_PXE=y
  # CONFIG_CMD_NFS is not set
  CONFIG_CMD_MII=y
  CONFIG_CMD_PING=y
diff --git a/configs/socfpga_pf_aplpowerswitch_defconfig 
b/configs/socfpga_pf_aplpowerswitch_defconfig
index aefd888d14..4969dc9904 100644
--- a/configs/socfpga_pf_aplpowerswitch_defconfig
+++ b/configs/socfpga_pf_aplpowerswitch_defconfig
@@ -31,6 +31,7 @@ CONFIG_CMD_PART=y
  CONFIG_CMD_SF=y
  CONFIG_CMD_SPI=y
  CONFIG_CMD_DHCP=y
+CONFIG_CMD_PXE=y
  # CONFIG_CMD_NFS is not set
  CONFIG_CMD_MII=y
  CONFIG_CMD_PING=y
diff --git a/configs/socfpga_pf_riolbfbgw_defconfig 
b/configs/socfpga_pf_riolbfbgw_defconfig
old mode 100755
new mode 100644
index 4357326c4c..ce23ba7527
--- a/configs/socfpga_pf_riolbfbgw_defconfig
+++ b/configs/socfpga_pf_riolbfbgw_defconfig
@@ -31,6 +31,7 @@ CONFIG_CMD_PART=y
  CONFIG_CMD_SF=y
  CONFIG_CMD_SPI=y
  CONFIG_CMD_DHCP=y
+CONFIG_CMD_PXE=y
  # CONFIG_CMD_NFS is not set
  CONFIG_CMD_MII=y
  CONFIG_CMD_PING=y
diff --git a/configs/socfpga_sockit_defconfig 
b/configs/socfpga_sockit_defconfig
index 079d46569e..3300dfbfb5 100644
--- a/configs/socfpga_sockit_defconfig
+++ b/configs/socfpga_sockit_defconfig
@@ -28,6 +28,7 @@ CONFIG_CMD_SPI=y
  CONFIG_CMD_USB=y
  CONFIG_CMD_USB_MASS_STORAGE=y
  CONFIG_CMD_DHCP=y
+CONFIG_CMD_PXE=y
  CONFIG_CMD_MII=y
  CONFIG_CMD_PING=y
  CONFIG_CMD_CACHE=y
diff --git a/configs/socfpga_socrates_defconfig 
b/configs/socfpga_socrates_defconfig
index 35773e6adb..92adcd22aa 100644
--- a/configs/socfpga_socrates_defconfig
+++ b/configs/socfpga_socrates_defconfig
@@ -28,6 +28,7 @@ CONFIG_CMD_SPI=y
  CONFIG_CMD_USB=y
  CONFIG_CMD_USB_MASS_STORAGE=y
  CONFIG_CMD_DHCP=y
+CONFIG_CMD_PXE=y
  CONFIG_CMD_MII=y
  CONFIG_CMD_PING=y
  CONFIG_CMD_CACHE=y
diff --git a/configs/socfpga_sr1500_defconfig 
b/configs/socfpga_sr1500_defconfig
index 961b862d79..2f4f25f03f 100644
--- a/configs/socfpga_sr1500_defconfig
+++ b/configs/socfpga_sr1500_defconfig
@@ -28,6 +28,7 @@ CONFIG_CMD_MMC=y
  CONFIG_CMD_SF=y
  CONFIG_CMD_SPI=y
  CONFIG_CMD_DHCP=y
+CONFIG_CMD_PXE=y
  CONFIG_CMD_MII=y
  CONFIG_CMD_PING=y
  CONFIG_CMD_CACHE=y
diff --git a/configs/socfpga_vining_fpga_defconfig 
b/configs/socfpga_vining_fpga_defconfig
index c5dbe89543..73880051ac 100644
--- a/configs/socfpga_vining_fpga_defconfig
+++ b/configs/socfpga_vining_fpga_defconfig
@@ -31,6 +31,7 @@ CONFIG_CMD_SPI=y
  CONFIG_CMD_USB=y
  CONFIG_CMD_USB_MASS_STORAGE=y
  CONFIG_CMD_DHCP=y
+CONFIG_CMD_PXE=y
  CONFIG_CMD_MII=y
  CONFIG_CMD_PING=y
  CONFIG_CMD_CACHE=y
diff --git a/include/configs/socfpga_common.h 
b/include/configs/socfpga_common.h
index f6607b101e..d343a6ec0a 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -65,9 +65,6 @@
  #define CONFIG_SYS_HOSTNAME    CONFIG_SYS_BOARD
  #endif

-#define CONFIG_CMD_PXE
-#define CONFIG_MENU
-
  /*
   * Cache
   */
@@ -304,6 +301,12 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
  #ifndef CONFIG_SPL_BUILD
  #include <config_distro_defaults.h>

+#ifdef CONFIG_CMD_DHCP
+#define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
+#else
+#define BOOT_TARGET_DEVICES_DHCP(func)
+#endif
+
  #ifdef CONFIG_CMD_PXE
  #define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
  #else
@@ -319,7 +322,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
  #define BOOT_TARGET_DEVICES(func) \
      BOOT_TARGET_DEVICES_MMC(func) \
      BOOT_TARGET_DEVICES_PXE(func) \
-    func(DHCP, dhcp, na)
+    BOOT_TARGET_DEVICES_DHCP(func)

  #include <config_distro_bootcmd.h>

-- 
2.11.0



More information about the U-Boot mailing list