[U-Boot] [PATCH 00/27] standardize mac address handling in u-boot

Mike Frysinger vapier at gentoo.org
Sat Feb 14 08:22:43 CET 2009


this set of patches aims to standardize the mac address handling in all of
u-boot by doing the following:
	- add helper funcs for working with mac addresses (binary & string)
	- convert all duplicated code to use aforementioned helper funcs
	- convert all places to get the mac address from the environment
	- drop the global data instances of bi_enet*addr
	- document the whole damned thing

ive taken pains to make sure the patchset doesnt break along the way (in
terms of doing bisection and such).  but in general, the interdependency
looks something like:
	- add util funcs
	- convert net/boards/drivers/cpu/commands from global data to env
	- convert arch/board.c init to not touch global data
	- remove global data from all arch headers

the ppc steps with load_sernum_ethaddr() are a little hairy due to the
spread of code and trying to make sure things don't break bisection.  but
the other option is to squash all these commits (the common ppc board code
as well as each individual board) into one change.  doesn't matter to me
either way.

currently this patch series is maintained in my tree:
	git://www.denx.de/git/u-boot-blackfin.git macaddr

Mike Frysinger (27):
  net: new utility functions for working with enetaddr's
  doc/README.enetaddr: document proper MAC usage
  Blackfin: bfin_mac: force boards to setup the MAC themselves
  net: get mac address from environment and use eth util funcs
  bdinfo: get mac address from environment
  bootvx: get mac address from environment
  lynxkdi: get mac address from environment
  nvedit: do not update global bi_enetaddr and do not call
    eth_set_enetaddr()
  AmigaOneG3SE/enet: get mac address from environment
  boards: get mac address from environment
  drivers/net/: get mac address from environment
  bcm570x: get mac address from environment
  cs8900: get mac address from environment
  sh_eth: get mac address from environment
  lan91c96/smc91111/smc911x: get mac address from environment
  cpu/: get mac address from environment
  npe: get mac address from environment
  lib_*/board.c: do not initialize bi_enet*addr in global data
  nx823: get mac address from environment
  arm: get mac address from environment
  cmc_pu2: get mac address from environment
  pcs440ep: get mac address from environment and move
    load_sernum_ethaddr() to board init
  kup4k/kup4x: rename load_sernum_ethaddr() to
    kup_load_sernum_ethaddr()
  tqm8xx: rename load_sernum_ethaddr() to tqc_load_sernum_ethaddr()
  ppc: do not initialize bi_enet*addr in global data
  drop now unused load_sernum_ethaddr() function
  remove bi_enet*addr from global data for all arches

 board/MAI/AmigaOneG3SE/enet.c           |   42 ++--------
 board/cmc_pu2/load_sernum_ethaddr.c     |   18 +----
 board/etin/debris/debris.c              |    6 +-
 board/keymile/mgcoge/mgcoge.c           |    4 +-
 board/keymile/mgsuvd/mgsuvd.c           |    4 +-
 board/kup/common/load_sernum_ethaddr.c  |    2 +-
 board/kup/kup4k/kup4k.c                 |    3 +
 board/kup/kup4x/kup4x.c                 |    4 +-
 board/m501sk/m501sk.c                   |    5 -
 board/mpl/vcma9/cmd_vcma9.c             |   11 +--
 board/muas3001/muas3001.c               |    4 +-
 board/netstal/common/nm_bsp.c           |   40 +++-------
 board/nx823/flash.c                     |    5 +-
 board/nx823/nx823.c                     |   41 ++++------
 board/pcs440ep/pcs440ep.c               |   31 +++----
 board/pn62/pn62.c                       |   24 ++----
 board/sixnet/sixnet.c                   |   11 +--
 board/tqc/tqm8xx/load_sernum_ethaddr.c  |    2 +-
 board/tqc/tqm8xx/tqm8xx.c               |    3 +
 board/xilinx/xilinx_enet/emac_adapter.c |    8 ++-
 common/cmd_bdinfo.c                     |  136 +++++++++----------------------
 common/cmd_elf.c                        |    6 +-
 common/cmd_nvedit.c                     |   24 +-----
 common/lynxkdi.c                        |    2 +-
 cpu/arm920t/at91rm9200/ether.c          |    8 +-
 cpu/ixp/npe/npe.c                       |   36 +++------
 cpu/mpc512x/cpu.c                       |    6 +-
 cpu/mpc5xxx/cpu.c                       |    6 +-
 cpu/mpc8260/ether_fcc.c                 |    4 +-
 cpu/mpc8260/ether_scc.c                 |    4 +-
 cpu/ppc4xx/cpu_init.c                   |   14 ++--
 doc/README.enetaddr                     |   96 ++++++++++++++++++++++
 drivers/net/3c589.c                     |    7 +-
 drivers/net/4xx_enet.c                  |   13 +--
 drivers/net/bcm570x.c                   |    4 +-
 drivers/net/bcm570x_lm.h                |    2 +-
 drivers/net/bfin_mac.c                  |   16 ++--
 drivers/net/bfin_mac.h                  |    2 +-
 drivers/net/cs8900.c                    |   58 ++++---------
 drivers/net/dc2114x.c                   |    9 ++-
 drivers/net/dm9000x.c                   |   27 ++-----
 drivers/net/enc28j60.c                  |    4 +-
 drivers/net/fsl_mcdmafec.c              |   11 ++-
 drivers/net/ks8695eth.c                 |    9 +--
 drivers/net/lan91c96.c                  |   79 ++++---------------
 drivers/net/mcffec.c                    |   10 +-
 drivers/net/rtl8019.c                   |   14 ++--
 drivers/net/rtl8169.c                   |    2 +-
 drivers/net/s3c4510b_eth.c              |    2 +-
 drivers/net/s3c4510b_eth.h              |    2 +-
 drivers/net/sh_eth.c                    |   28 ++-----
 drivers/net/smc91111.c                  |   76 ++++--------------
 drivers/net/smc911x.c                   |   15 ++--
 drivers/net/tigon3.c                    |    7 +-
 drivers/net/xilinx_emac.c               |   12 ++-
 drivers/net/xilinx_emaclite.c           |   11 ++-
 include/asm-arm/u-boot.h                |    5 -
 include/asm-avr32/u-boot.h              |    1 -
 include/asm-blackfin/u-boot.h           |    1 -
 include/asm-i386/u-boot.h               |    1 -
 include/asm-m68k/u-boot.h               |   13 ---
 include/asm-microblaze/u-boot.h         |    1 -
 include/asm-mips/u-boot.h               |    1 -
 include/asm-nios/u-boot.h               |    1 -
 include/asm-nios2/u-boot.h              |    1 -
 include/asm-ppc/u-boot.h                |   19 -----
 include/asm-sh/u-boot.h                 |    1 -
 include/asm-sparc/u-boot.h              |   12 ---
 include/common.h                        |    2 -
 include/configs/cmc_pu2.h               |    1 +
 include/net.h                           |    4 +
 lib_arm/board.c                         |   47 +++--------
 lib_blackfin/board.c                    |   48 +-----------
 lib_i386/board.c                        |   17 ----
 lib_m68k/board.c                        |   38 ---------
 lib_microblaze/board.c                  |    8 --
 lib_mips/board.c                        |    8 --
 lib_nios/board.c                        |    5 -
 lib_nios2/board.c                       |    5 -
 lib_ppc/board.c                         |   96 ----------------------
 lib_sh/board.c                          |   10 ---
 lib_sparc/board.c                       |   19 -----
 net/bootp.c                             |   13 +---
 net/eth.c                               |   79 +++++++++++-------
 net/net.c                               |   20 ++---
 post/cpu/mpc8xx/ether.c                 |    4 +-
 86 files changed, 497 insertions(+), 1014 deletions(-)
 create mode 100644 doc/README.enetaddr



More information about the U-Boot mailing list