diff options
author | raj <raj@FreeBSD.org> | 2008-03-12 16:32:08 +0000 |
---|---|---|
committer | raj <raj@FreeBSD.org> | 2008-03-12 16:32:08 +0000 |
commit | 8e81cff1fea20b1d0d53988daff826286c50640c (patch) | |
tree | bee3dfa13f4fb01fa9d5de6630099aac13d777f4 /sys/powerpc/booke | |
parent | 054d727b12bc095749d9c28ef9354f5aab773391 (diff) | |
download | FreeBSD-src-8e81cff1fea20b1d0d53988daff826286c50640c.zip FreeBSD-src-8e81cff1fea20b1d0d53988daff826286c50640c.tar.gz |
Obtain TSEC h/w address from the parent bus (OCP) and not rely blindly on what
might be currently programmed into the registers.
Underlying firmware (U-Boot) would typically program MAC address into the
first unit only, and others are left uninitialized. It is now possible to
retrieve and program MAC address for all units properly, provided they were
passed on in the bootinfo metadata.
Reviewed by: imp, marcel
Approved by: cognet (mentor)
Diffstat (limited to 'sys/powerpc/booke')
-rw-r--r-- | sys/powerpc/booke/machdep.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/sys/powerpc/booke/machdep.c b/sys/powerpc/booke/machdep.c index f5a1e06..98d1b77 100644 --- a/sys/powerpc/booke/machdep.c +++ b/sys/powerpc/booke/machdep.c @@ -313,6 +313,29 @@ print_kernel_section_addr(void) debugf(" _end = 0x%08x\n", (u_int32_t)_end); } +struct bi_mem_region * +bootinfo_mr(void) +{ + + return((struct bi_mem_region *)bootinfo->bi_data); +} + +struct bi_eth_addr * +bootinfo_eth(void) +{ + struct bi_mem_region *mr; + struct bi_eth_addr *eth; + int i; + + /* Advance to the eth section */ + mr = bootinfo_mr(); + for (i = 0; i < bootinfo->bi_mem_reg_no; i++, mr++) + ; + + eth = (struct bi_eth_addr *)mr; + return (eth); +} + void e500_init(u_int32_t startkernel, u_int32_t endkernel, void *mdp) { @@ -358,7 +381,7 @@ e500_init(u_int32_t startkernel, u_int32_t endkernel, void *mdp) } /* Initialize memory regions table */ - mr = (struct bi_mem_region *)bootinfo->bi_data; + mr = bootinfo_mr(); for (i = 0; i < bootinfo->bi_mem_reg_no; i++, mr++) { if (i == MEM_REGIONS) break; |