From 9c150102bc1de375d36d97a1cc2dd0e9639b15df Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 11 Feb 2009 20:09:52 -0500 Subject: boards: get mac address from env and move load_sernum_ethaddr() to board init The environment is the canonical storage location of the mac address, so we're killing off the global data location and moving everything to querying the env directly. Rather than have common ppc code call a board-specific function like load_sernum_ethaddr(), have each board call it in its own board-specific misc_init_r() function. The boards that get converted here are: - kup4k/kup4x - pcs440ep - tqm8xx Signed-off-by: Mike Frysinger CC: Ben Warren CC: Stefan Roese --- board/kup/common/kup.h | 2 ++ board/kup/kup4k/kup4k.c | 1 + board/kup/kup4x/kup4x.c | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'board/kup') diff --git a/board/kup/common/kup.h b/board/kup/common/kup.h index 70d7f01e6..b73628310 100644 --- a/board/kup/common/kup.h +++ b/board/kup/common/kup.h @@ -41,4 +41,6 @@ extern void poweron_key (void); +extern void load_sernum_ethaddr(void); + #endif /* __KUP_H */ diff --git a/board/kup/kup4k/kup4k.c b/board/kup/kup4k/kup4k.c index df3ffb4d7..98f5f5a30 100644 --- a/board/kup/kup4k/kup4k.c +++ b/board/kup/kup4k/kup4k.c @@ -250,6 +250,7 @@ int misc_init_r (void) immap->im_ioport.iop_papar &= ~0x80; immap->im_ioport.iop_padat |= 0x80; /* turn it off */ #endif + load_sernum_ethaddr(); setenv("hw","4k"); poweron_key(); return (0); diff --git a/board/kup/kup4x/kup4x.c b/board/kup/kup4x/kup4x.c index c5b742dd7..65a222b5e 100644 --- a/board/kup/kup4x/kup4x.c +++ b/board/kup/kup4x/kup4x.c @@ -295,7 +295,6 @@ static long int dram_size (long int mamr_value, long int *base, int misc_init_r (void) { volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; - #ifdef CONFIG_IDE_LED /* Configure PA8 as output port */ immap->im_ioport.iop_padir |= 0x80; @@ -306,6 +305,7 @@ int misc_init_r (void) #ifdef KUP4X_USB usb_init_kup4x (); #endif + load_sernum_ethaddr(); setenv ("hw", "4x"); poweron_key (); return (0); -- cgit v1.2.3