[U-Boot] [PATCH 00/30] standardize mac address handling in u-boot (v2)

Mike Frysinger vapier at gentoo.org
Tue Feb 17 06:10:21 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)
	- add format strings from Linux for printf-ing mac addresses
	- 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.

v2 of the patchset brings these changes:
	- import updated printf modifiers from the kernel
	- convert str_enetaddr() to %pM
	- convert print_IPaddr() to %pI4
	- convert board_get_enetaddr() to board specific code
	- misc fixes/changes based on feedback from people

while the new printf code is bigger by about 900bytes, i think we make up
most of that by converting str_enetaddr/print_IPaddr users over to it.

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

Mike Frysinger (30):
  vsprintf: pull updates from Linux kernel
  convert print_IPaddr() to %pI4
  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
  boards: move board_get_enetaddr() into board-specific init
  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: mark global bi_enet*addr as legacy
  drop now unused load_sernum_ethaddr() function
  remove bi_enet*addr from global data for all arches

 board/MAI/AmigaOneG3SE/enet.c           |   42 +---
 board/RPXClassic/RPXClassic.c           |   16 +-
 board/cmc_pu2/load_sernum_ethaddr.c     |   18 +-
 board/etin/debris/debris.c              |   10 +-
 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/mbx8xx/mbx8xx.c                   |   14 +-
 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/sandburst/common/sb_common.c      |    4 +-
 board/sandburst/common/sb_common.h      |    1 +
 board/sandburst/karef/karef.c           |   29 ++
 board/sandburst/metrobox/metrobox.c     |   29 ++
 board/siemens/IAD210/IAD210.c           |   14 +-
 board/sixnet/sixnet.c                   |   11 +-
 board/tqc/tqm8xx/load_sernum_ethaddr.c  |    2 +-
 board/tqc/tqm8xx/tqm8xx.c               |    3 +
 board/v38b/v38b.c                       |   12 +
 board/xilinx/xilinx_enet/emac_adapter.c |    8 +-
 board/xpedite1k/xpedite1k.c             |   51 +++-
 common/cmd_bdinfo.c                     |  166 ++++--------
 common/cmd_elf.c                        |    6 +-
 common/cmd_ide.c                        |   10 +-
 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 +-
 disk/part.c                             |    2 +-
 doc/README.enetaddr                     |   97 +++++++
 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                    |   56 +---
 drivers/net/dc2114x.c                   |    9 +-
 drivers/net/dm9000x.c                   |   26 +--
 drivers/net/enc28j60.c                  |    4 +-
 drivers/net/fsl_mcdmafec.c              |   11 +-
 drivers/net/ks8695eth.c                 |    8 +-
 drivers/net/lan91c96.c                  |   75 +----
 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                  |   72 +----
 drivers/net/smc911x.c                   |   14 +-
 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                |   14 +-
 include/asm-sh/u-boot.h                 |    1 -
 include/asm-sparc/u-boot.h              |   12 -
 include/common.h                        |    9 -
 include/configs/IAD210.h                |    1 +
 include/configs/MBX860T.h               |    2 +
 include/configs/RPXClassic.h            |    1 +
 include/configs/XPEDITE1K.h             |    1 +
 include/configs/cmc_pu2.h               |    1 +
 include/configs/v38b.h                  |    1 +
 include/net.h                           |    6 +-
 lib_arm/board.c                         |   47 +---
 lib_blackfin/board.c                    |   48 +---
 lib_generic/vsprintf.c                  |  479 ++++++++++++++++++++++++-------
 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                         |   92 +------
 lib_sh/board.c                          |   10 -
 lib_sparc/board.c                       |   19 --
 net/bootp.c                             |   29 +--
 net/eth.c                               |   76 +++--
 net/net.c                               |   30 +--
 net/nfs.c                               |   10 +-
 net/tftp.c                              |   10 +-
 post/cpu/mpc8xx/ether.c                 |    4 +-
 105 files changed, 1055 insertions(+), 1188 deletions(-)
 create mode 100644 doc/README.enetaddr



More information about the U-Boot mailing list