]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: Move enetaddr env access code to env config instead of net config
authorAlex Kiernan <alex.kiernan@gmail.com>
Sun, 1 Apr 2018 09:22:38 +0000 (09:22 +0000)
committerTom Rini <trini@konsulko.com>
Mon, 9 Apr 2018 03:00:58 +0000 (23:00 -0400)
In order that we can use eth_env_* even when CONFIG_NET isn't set, move
these functions to environment code from net code.

This fixes failures such as:

  board/ti/am335x/built-in.o: In function `board_late_init':
  board/ti/am335x/board.c:752: undefined reference to `eth_env_set_enetaddr'
  u-boot/board/ti/am335x/board.c:766: undefined reference to `eth_env_set_enetaddr'

which caters for use cases such as:

commit f411b5cca48f ("board: am335x: Always set eth/eth1addr environment
variable")

when Ethernet is required in Linux, but not U-Boot.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
66 files changed:
arch/arm/cpu/arm926ejs/spear/spr_misc.c
arch/arm/mach-davinci/misc.c
arch/arm/mach-omap2/utils.c
arch/powerpc/cpu/mpc85xx/fdt.c
board/BuR/common/common.c
board/CZ.NIC/turris_omnia/turris_omnia.c
board/LaCie/net2big_v2/net2big_v2.c
board/LaCie/netspace_v2/netspace_v2.c
board/amlogic/khadas-vim/khadas-vim.c
board/amlogic/libretech-cc/libretech-cc.c
board/amlogic/odroid-c2/odroid-c2.c
board/amlogic/p212/p212.c
board/atmel/common/mac_eeprom.c
board/buffalo/lsxl/lsxl.c
board/compulab/cl-som-am57x/eth.c
board/compulab/cl-som-imx7/cl-som-imx7.c
board/compulab/cm_fx6/cm_fx6.c
board/compulab/cm_t335/cm_t335.c
board/compulab/cm_t35/cm_t35.c
board/compulab/cm_t3517/cm_t3517.c
board/compulab/cm_t54/cm_t54.c
board/davinci/da8xxevm/da850evm.c
board/dhelectronics/dh_imx6/dh_imx6.c
board/gateworks/gw_ventana/gw_ventana.c
board/ge/mx53ppd/mx53ppd.c
board/kosagi/novena/novena.c
board/logicpd/zoom1/zoom1.c
board/phytec/pcm051/board.c
board/phytec/phycore_rk3288/phycore-rk3288.c
board/raspberrypi/rpi/rpi.c
board/renesas/alt/alt.c
board/renesas/blanche/blanche.c
board/renesas/gose/gose.c
board/renesas/koelsch/koelsch.c
board/renesas/lager/lager.c
board/renesas/sh7752evb/sh7752evb.c
board/renesas/sh7753evb/sh7753evb.c
board/renesas/sh7757lcr/sh7757lcr.c
board/renesas/silk/silk.c
board/renesas/stout/stout.c
board/rockchip/tinker_rk3288/tinker-rk3288.c
board/samtec/vining_2000/vining_2000.c
board/samtec/vining_fpga/socfpga.c
board/siemens/common/factoryset.c
board/siemens/pxm2/board.c
board/silica/pengwyn/board.c
board/technologic/ts4800/ts4800.c
board/theobroma-systems/puma_rk3399/puma-rk3399.c
board/ti/am43xx/board.c
board/ti/ti814x/evm.c
board/ti/ti816x/evm.c
board/timll/devkit8000/devkit8000.c
board/toradex/common/tdx-common.c
cmd/elf.c
cmd/ethsw.c
cmd/nvedit.c
drivers/net/cpsw-common.c
drivers/net/fec_mxc.c
drivers/net/fsl_mcdmafec.c
drivers/net/mcffec.c
drivers/net/ne2000_base.c
drivers/net/sh_eth.c
drivers/usb/gadget/ether.c
include/environment.h
include/net.h
net/eth_common.c

index a02304f49ee0b4c27e8f57a8dc3fec42bdada873..f072f2e4741bd580598176621fb39550509c8ae1 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <environment.h>
 #include <i2c.h>
 #include <net.h>
 #include <linux/mtd/st_smi.h>
index 461ff778c28bf21a8798dd7f97286bedf8c2e35c..7b9d9619bb5fcba7152057ccdf73b9e597918f3b 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <i2c.h>
 #include <net.h>
 #include <asm/arch/hardware.h>
index 7d1ca274bf3a3cd722d754529f494cb449e143ac..1d3962500d25a6afd8e061c4ad6dd7e9fc59c688 100644 (file)
@@ -5,6 +5,7 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 #include <common.h>
+#include <environment.h>
 #include <asm/setup.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/omap_common.h>
index e1fee11540ca087e6c5b5b45224a33533f639204..3bdaa5fe7bf92484b2d793c8a6e59f66c9d00e9e 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <linux/libfdt.h>
 #include <fdt_support.h>
 #include <asm/processor.h>
index d82b8cdfe2e5e79814471781691ba9e0a5bb2f4d..f0a97faa95903d653b75139ed750c4d4a762a3fd 100644 (file)
@@ -11,6 +11,7 @@
  */
 #include <version.h>
 #include <common.h>
+#include <environment.h>
 #include <errno.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/hardware.h>
index b03c0a3714b19833a0a486a94c3929443a647978..c693aaef63dbdeeb2b8aa698a3fb191d56413e16 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <i2c.h>
 #include <miiphy.h>
 #include <netdev.h>
index f639a37d4da01416dc26f6ad63198c1716c14345..3e070d2b015b65b502674951bb411f05358848a5 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <environment.h>
 #include <i2c.h>
 #include <asm/mach-types.h>
 #include <asm/arch/cpu.h>
index 52f36644a3ea7c6dc8d18cb8eff3df61a02b7fda..3bd9fa96338f8b1ab1dd3731774d5b7dfbefc52e 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <environment.h>
 #include <asm/mach-types.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
index 5e198569db40edfc95d19a7203bb595ce5299d70..83b1b6ed6f4ea2a0069d70a4ef818ef5e13eb868 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <environment.h>
 #include <asm/io.h>
 #include <asm/arch/gxbb.h>
 #include <asm/arch/mem.h>
index 6be6e2ae93b49a9d215e1ec4883b9f7692faa55a..57953404fecf835b55c6fcc59293afaa74349d92 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <environment.h>
 #include <asm/io.h>
 #include <asm/arch/gxbb.h>
 #include <asm/arch/sm.h>
index 0cb571432f0bc46157cc136fc2f7231df369f310..8645f22e874a3476a70415cb70eb634bf27bf8cc 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <environment.h>
 #include <asm/io.h>
 #include <asm/arch/gxbb.h>
 #include <asm/arch/sm.h>
index 5fde53438ecd5f1f293f1e27f84ed07916f18870..7c0abbcc0a7a7bc56dc662dfc426aa51afa54002 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <environment.h>
 #include <asm/io.h>
 #include <asm/arch/gxbb.h>
 #include <asm/arch/sm.h>
index 60ddf00d4576dec4e3085f4f6cf591454e69a174..91b86e0c622d9ba7db46d4f5f897823883c7b986 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <environment.h>
 #include <i2c_eeprom.h>
 #include <netdev.h>
 
index 2d01ac25d85e13684f92a88ebe6e7fbc215a59cc..8ae420740d1bab3055798e7459437cfe047b2bec 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <net.h>
 #include <malloc.h>
 #include <netdev.h>
index b615fb9e7ee830b7b75a390aa4e244b1291eba68..9f9525eeb0131d8f22a0f72ab2d19c3b2783ca92 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <cpsw.h>
+#include <environment.h>
 #include <miiphy.h>
 #include <asm/gpio.h>
 #include <asm/arch/sys_proto.h>
index f8b1cda5bb1a3c854aa60702ed6f5769de1159cd..dfa81f52213c155b8247935149002fddf5c8872a 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <mmc.h>
 #include <phy.h>
 #include <netdev.h>
index 673de030714ff0b3f8ebe80816815ce49328bced..c72efc5964277754f080dab4538cece3c4a31dc1 100644 (file)
@@ -12,6 +12,7 @@
 #include <ahci.h>
 #include <dm.h>
 #include <dwc_ahsata.h>
+#include <environment.h>
 #include <fsl_esdhc.h>
 #include <miiphy.h>
 #include <mtd_node.h>
index 6f6ba49af578a4450ab4c4f7eb13d3bd6807f20c..6eabd38375a424e22c6262a7d54d33ce9efb6856 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <errno.h>
 #include <miiphy.h>
 #include <cpsw.h>
index d5cfba4270773a792cc705c4ea58ee04d4b294fc..e8f604f5db095f4248eea19f6b3ba460ac110c34 100644 (file)
@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <status_led.h>
 #include <netdev.h>
 #include <net.h>
index 0ff49dcdccc4ff8c8c76745cda4a1580fd7a2e01..e4e346077c990b0f9920338c109cfd113b5fa7bc 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <status_led.h>
 #include <net.h>
 #include <netdev.h>
index 3e6235a3b7e05eaa5939dd6769beb85e427590e6..a1aeafbafdfc4ee00df240bf735183dc7d741e91 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <fdt_support.h>
 #include <usb.h>
 #include <mmc.h>
index 83c9f2940fe87791908d6c7a739ad14bd98ad4ee..37a0d72fe13adb17e30f3ba7d38bfed4fcce9eeb 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <i2c.h>
 #include <net.h>
 #include <netdev.h>
index b00d0e4b6d85ff4834db49863b95c08b7c462165..1d8b8310544a6ee93430760d8368db4e5ba52e9a 100644 (file)
@@ -19,6 +19,7 @@
 #include <asm/mach-imx/iomux-v3.h>
 #include <asm/mach-imx/mxc_i2c.h>
 #include <asm/mach-imx/sata.h>
+#include <environment.h>
 #include <errno.h>
 #include <fsl_esdhc.h>
 #include <fuse.h>
index 4ddc7e1fa218613c023360c886b1fcda91b5c0fe..332c506dfef7dc214d7b56668bd5cb7e1009be89 100644 (file)
@@ -22,6 +22,7 @@
 #include <asm/setup.h>
 #include <dm.h>
 #include <dm/platform_data/serial_mxc.h>
+#include <environment.h>
 #include <hwconfig.h>
 #include <i2c.h>
 #include <fdt_support.h>
index 90dbccc5edf42f17dbfe9fa40cb04baf562c496d..0010998d66cf2fd3ab4d2329ca95c77f25a2cea3 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/errno.h>
 #include <asm/mach-imx/mxc_i2c.h>
 #include <asm/mach-imx/mx5_video.h>
+#include <environment.h>
 #include <netdev.h>
 #include <i2c.h>
 #include <mmc.h>
index f0ace03009e79d9b8d550d242dc1d16739f0c0c8..91bc9c265105a2c6756422f7456c30f023a0eecb 100644 (file)
@@ -21,6 +21,7 @@
 #include <asm/mach-imx/mxc_i2c.h>
 #include <asm/mach-imx/sata.h>
 #include <asm/mach-imx/video.h>
+#include <environment.h>
 #include <fsl_esdhc.h>
 #include <i2c.h>
 #include <input.h>
index e6c2526ea1520bc1f328de172fcf92f056b649a0..fe1183b0bd7a21c6d419f3d0d86bf6858e616d98 100644 (file)
@@ -16,6 +16,7 @@
  */
 #include <common.h>
 #include <dm.h>
+#include <environment.h>
 #include <ns16550.h>
 #include <netdev.h>
 #include <twl4030.h>
index 52ad5b64de7d58aceafc79037e5881cd70652997..c57625b041e7bdc774937eccf4b67f3fc647b48e 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <errno.h>
 #include <spl.h>
 #include <asm/arch/cpu.h>
index 47b069e2ad8f8d35161a461e24191a90a21758d3..a1b407d7074de14ff03a8dab1bf767427f0953e7 100644 (file)
@@ -8,6 +8,7 @@
 #include <asm/io.h>
 #include <common.h>
 #include <dm.h>
+#include <environment.h>
 #include <i2c.h>
 #include <i2c_eeprom.h>
 #include <netdev.h>
index de8e308f6c5fc33cf7f01a167c60b32f69b08837..30495057d1759e295a54996bddf0a0f35f448283 100644 (file)
@@ -8,6 +8,7 @@
 #include <inttypes.h>
 #include <config.h>
 #include <dm.h>
+#include <environment.h>
 #include <efi_loader.h>
 #include <fdt_support.h>
 #include <fdt_simplefb.h>
index 0bf8160f1fa2bcb8725de9e3a651ff2c42a694b8..f2200ef0810f0feba22bcbaac876503713298f89 100644 (file)
@@ -10,6 +10,7 @@
 #include <malloc.h>
 #include <dm.h>
 #include <dm/platform_data/serial_sh.h>
+#include <environment.h>
 #include <asm/processor.h>
 #include <asm/mach-types.h>
 #include <asm/io.h>
index 574dcda01bd1f05b45281133676012a4117c4fab..5dc307370d5c1676288ce19d02d35562e91c76a5 100644 (file)
@@ -12,6 +12,7 @@
 #include <netdev.h>
 #include <dm.h>
 #include <dm/platform_data/serial_sh.h>
+#include <environment.h>
 #include <asm/processor.h>
 #include <asm/mach-types.h>
 #include <asm/io.h>
index 54e126985b5d1b6f999f128d6c794fe4b7602e64..99d4ba6fd8b207669fa2b2156714a4f3eb12cf3b 100644 (file)
@@ -10,6 +10,7 @@
 #include <malloc.h>
 #include <dm.h>
 #include <dm/platform_data/serial_sh.h>
+#include <environment.h>
 #include <asm/processor.h>
 #include <asm/mach-types.h>
 #include <asm/io.h>
index 8fa648e40a94fcf2ee758c0de4587225eb98df71..e7b47ae299599f1b74908e9ec019ed0d152fa622 100644 (file)
@@ -11,6 +11,7 @@
 #include <malloc.h>
 #include <dm.h>
 #include <dm/platform_data/serial_sh.h>
+#include <environment.h>
 #include <asm/processor.h>
 #include <asm/mach-types.h>
 #include <asm/io.h>
index 562be04760febfa2d622019c9a45ae6013b7a00a..3566bcc78891c023b5ae171386a9cf80f0f87838 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <malloc.h>
 #include <netdev.h>
 #include <dm.h>
index 4a76fb73ee963bb9d8b8d0742a7d0f8fe4b6cb75..5da6f39ae332b23d33cb0bbf1a4266b6a028962e 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <malloc.h>
 #include <asm/processor.h>
 #include <asm/io.h>
index ca9e1447438334f66531dc2a1bdbc6c6794d8cae..8604d882474048c2487a64b14d34664d3c8f967b 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <malloc.h>
 #include <asm/processor.h>
 #include <asm/io.h>
index 3f970fc401bfe1773f7553812778a5108beb0af0..1c598fbedd895165b8179436af9faf5dd93b5dda 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <malloc.h>
 #include <asm/processor.h>
 #include <asm/io.h>
index a8de402d20433977daf2b4572ad46bbcd41802ab..9e2080bcea333badb1b841bb37282d07f6bcc06b 100644 (file)
@@ -11,6 +11,7 @@
 #include <malloc.h>
 #include <dm.h>
 #include <dm/platform_data/serial_sh.h>
+#include <environment.h>
 #include <asm/processor.h>
 #include <asm/mach-types.h>
 #include <asm/io.h>
index d68114827354f37a0f84eb773d6cb8351e5a50ca..3cb16db10f422372e925c912a060a3520dc2c673 100644 (file)
@@ -14,6 +14,7 @@
 #include <netdev.h>
 #include <dm.h>
 #include <dm/platform_data/serial_sh.h>
+#include <environment.h>
 #include <asm/processor.h>
 #include <asm/mach-types.h>
 #include <asm/io.h>
index 790a9215156e628592c5b24d9bd243126fcb3b27..0f2abe2f539223ece0c219f12133851037bab830 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <environment.h>
 #include <i2c_eeprom.h>
 #include <netdev.h>
 
index cced08b8b857a0b1ccd596f6739122988172c62b..0cc842116d43aa565fa581fdca581e2010b49482 100644 (file)
@@ -18,6 +18,7 @@
 #include <asm/mach-imx/mxc_i2c.h>
 #include <linux/sizes.h>
 #include <common.h>
+#include <environment.h>
 #include <fsl_esdhc.h>
 #include <mmc.h>
 #include <i2c.h>
index 229b12f308c92597bb56ed4e387a280a206baf61..14ac7efb8b657997993c4523fcb77bd8f9ed2339 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <asm/arch/reset_manager.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
index 7fa2673c2bff884345d432daf92a42ea6c4c2e91..f3e82d4f1891d25fee117c405ac5fc97636b3e4f 100644 (file)
@@ -9,6 +9,7 @@
 #if !defined(CONFIG_SPL_BUILD)
 
 #include <common.h>
+#include <environment.h>
 #include <i2c.h>
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
index 8bbb03561b18f980f1e9cceceefcf21352013287..ab54e58861a43f33dc487ae6decdaef4f4a72f9d 100644 (file)
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <errno.h>
 #include <spl.h>
 #include <asm/arch/cpu.h>
index 0429e6f0c7f792a810971cec560c568ba46b56c7..e736afbf9370e08ae907bd47e00dd6ed36356b0c 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/ddr_defs.h>
index e5bec57f4f21f1b8a0b4224fa98be09c30e4f2d3..c4dad6911094f45dcda10f35ddbd351f9cb425a5 100644 (file)
@@ -17,6 +17,7 @@
 #include <asm/arch/crm_regs.h>
 #include <asm/arch/clock.h>
 #include <asm/mach-imx/mx5_video.h>
+#include <environment.h>
 #include <mmc.h>
 #include <input.h>
 #include <fsl_esdhc.h>
index c6690fa06900844439589a74a3c1a71e4d1b4181..1d8b605b693e7d508eedd53a74f4114e2983b4af 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <environment.h>
 #include <misc.h>
 #include <spl.h>
 #include <syscon.h>
index 0564df2c00b8e887408e0997388a42eb6eb5463d..0431cd46067004738c6b0aac96473ebcc3ffb796 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <i2c.h>
 #include <linux/errno.h>
 #include <spl.h>
index cdde6a8ca338d2bc45481dbaf904858daf8a6e62..4a0f82975aa5b451bccb74a737765a9ee6696b65 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <cpsw.h>
+#include <environment.h>
 #include <errno.h>
 #include <spl.h>
 #include <asm/arch/cpu.h>
index cb40cc5f473ccde26e657fdcf2c0d8d1ae8b8653..abc961a86e06c5f7183e4c74ade85a145f5a8aee 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <spl.h>
 #include <netdev.h>
 #include <asm/cache.h>
index 741b3acce275378b2c996488d3a6bbd5865d6dcf..4bbbd818486ea9d9b00056200210d7cc834742fa 100644 (file)
@@ -18,6 +18,7 @@
  */
 #include <common.h>
 #include <dm.h>
+#include <environment.h>
 #include <ns16550.h>
 #include <twl4030.h>
 #include <asm/io.h>
index 6e12d279e881922b9a6744746ccf694d5083da57..d6d367161cf00f9f879f54b1986e11fa715b2c6f 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <g_dnl.h>
 #include <linux/libfdt.h>
 
index f874073280d05cf5dc1ba2377aa3d67053e16d4e..038796498c0b24f2e7a305282fc2b7ef43f2e113 100644 (file)
--- a/cmd/elf.c
+++ b/cmd/elf.c
@@ -16,6 +16,7 @@
 #include <common.h>
 #include <command.h>
 #include <elf.h>
+#include <environment.h>
 #include <net.h>
 #include <vxworks.h>
 #ifdef CONFIG_X86
index b600965e8ad43a4764b519e5b89b8be1714dd17b..92a60b4515b96a23e80451d1971fff5978aee45d 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <environment.h>
 #include <errno.h>
 #include <env_flags.h>
 #include <ethsw.h>
index 4cb25b824865f9aad6da83b5f63ee9312b3d8b4d..9838678262d9817d0a4e7d0451e3085163ae1a53 100644 (file)
@@ -341,6 +341,36 @@ ulong env_get_hex(const char *varname, ulong default_val)
        return value;
 }
 
+void eth_parse_enetaddr(const char *addr, uint8_t *enetaddr)
+{
+       char *end;
+       int i;
+
+       for (i = 0; i < 6; ++i) {
+               enetaddr[i] = addr ? simple_strtoul(addr, &end, 16) : 0;
+               if (addr)
+                       addr = (*end) ? end + 1 : end;
+       }
+}
+
+int eth_env_get_enetaddr(const char *name, uint8_t *enetaddr)
+{
+       eth_parse_enetaddr(env_get(name), enetaddr);
+       return is_valid_ethaddr(enetaddr);
+}
+
+int eth_env_set_enetaddr(const char *name, const uint8_t *enetaddr)
+{
+       char buf[ARP_HLEN_ASCII + 1];
+
+       if (eth_env_get_enetaddr(name, (uint8_t *)buf))
+               return -EEXIST;
+
+       sprintf(buf, "%pM", enetaddr);
+
+       return env_set(name, buf);
+}
+
 #ifndef CONFIG_SPL_BUILD
 static int do_env_set(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
index 0dc83ab820522bcd870e4fb30b9a83644284b59a..7bd312a6c045567ffa55b98be42f0f5a8d3145d5 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <environment.h>
 #include <fdt_support.h>
 #include <asm/io.h>
 #include <cpsw.h>
index ff7ad91116ce02aa813898616b303cca8581c227..29af85ce0a9a433deea905657d87241794cf66ff 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <environment.h>
 #include <malloc.h>
 #include <memalign.h>
 #include <miiphy.h>
index 2d89cea4a3e16b9d771dc1aeb956587e76da0199..00d905c299de4d6e3d451ec886067b88c7f9d523 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <malloc.h>
 #include <command.h>
 #include <config.h>
index ebcbed941a5d2acafd57d032bdefbac1568ea8d5..505a2d1bee8e4cc5be80f9f9181283e2eccb83cc 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <malloc.h>
 
 #include <command.h>
index fb088e06a43b8690fdc5af65e80ef1d6b735f41c..421aa20ea6af8f876944083b54f745374a12da4f 100644 (file)
@@ -74,6 +74,7 @@ Add SNMP
 
 #include <common.h>
 #include <command.h>
+#include <environment.h>
 #include <net.h>
 #include <malloc.h>
 #include <linux/compiler.h>
index 6f48e93ab53d2376575e5f928b6a54c98f5ea9e7..e3416f33911788733814990dffdc2ad1cff3a04f 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <environment.h>
 #include <malloc.h>
 #include <net.h>
 #include <netdev.h>
index a80486e91f1a7ba4a79d2ff58b94f2f956192515..386505d42de5f0e9eac4980191eb6f15496e61d0 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <console.h>
+#include <environment.h>
 #include <linux/errno.h>
 #include <linux/netdevice.h>
 #include <linux/usb/ch9.h>
index 7986a242778d1cc3cf37ea29953b4e74e01308f0..1b52353365ed03acd852e07e56e910b1e9d82aa7 100644 (file)
@@ -314,6 +314,10 @@ int env_load(void);
  */
 int env_save(void);
 
+void eth_parse_enetaddr(const char *addr, uint8_t *enetaddr);
+int eth_env_get_enetaddr(const char *name, uint8_t *enetaddr);
+int eth_env_set_enetaddr(const char *name, const uint8_t *enetaddr);
+
 #endif /* DO_DEPS_ONLY */
 
 #endif /* _ENVIRONMENT_H_ */
index 3101096e9a1c419325ca613b51e424d9fdebe73c..3469811aa0ea3a7f3910f45db52b882708f76c68 100644 (file)
@@ -238,9 +238,6 @@ void eth_try_another(int first_restart);    /* Change the device */
 void eth_set_current(void);            /* set nterface to ethcur var */
 
 int eth_get_dev_index(void);           /* get the device index */
-void eth_parse_enetaddr(const char *addr, uchar *enetaddr);
-int eth_env_get_enetaddr(const char *name, uchar *enetaddr);
-int eth_env_set_enetaddr(const char *name, const uchar *enetaddr);
 
 /**
  * eth_env_set_enetaddr_by_index() - set the MAC address environment variable
index 66d0d22966e01463d453a8e22a2898a65e67c8a1..0af91a9642ef1ebd0a48a1e888af0e968920d0fc 100644 (file)
@@ -8,40 +8,11 @@
 
 #include <common.h>
 #include <dm.h>
+#include <environment.h>
 #include <miiphy.h>
 #include <net.h>
 #include "eth_internal.h"
 
-void eth_parse_enetaddr(const char *addr, uchar *enetaddr)
-{
-       char *end;
-       int i;
-
-       for (i = 0; i < 6; ++i) {
-               enetaddr[i] = addr ? simple_strtoul(addr, &end, 16) : 0;
-               if (addr)
-                       addr = (*end) ? end + 1 : end;
-       }
-}
-
-int eth_env_get_enetaddr(const char *name, uchar *enetaddr)
-{
-       eth_parse_enetaddr(env_get(name), enetaddr);
-       return is_valid_ethaddr(enetaddr);
-}
-
-int eth_env_set_enetaddr(const char *name, const uchar *enetaddr)
-{
-       char buf[ARP_HLEN_ASCII + 1];
-
-       if (eth_env_get_enetaddr(name, (uchar *)buf))
-               return -EEXIST;
-
-       sprintf(buf, "%pM", enetaddr);
-
-       return env_set(name, buf);
-}
-
 int eth_env_get_enetaddr_by_index(const char *base_name, int index,
                                 uchar *enetaddr)
 {