Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/evbarm/amlogic Support for passing mac address from...



details:   https://anonhg.NetBSD.org/src/rev/a72db039fba5
branches:  trunk
changeset: 806673:a72db039fba5
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed Mar 04 23:52:54 2015 +0000

description:
Support for passing mac address from u-boot to the kernel with the
awge0.mac-address cmdline option.

diffstat:

 sys/arch/evbarm/amlogic/amlogic_machdep.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r 031c15c3428b -r a72db039fba5 sys/arch/evbarm/amlogic/amlogic_machdep.c
--- a/sys/arch/evbarm/amlogic/amlogic_machdep.c Wed Mar 04 23:42:26 2015 +0000
+++ b/sys/arch/evbarm/amlogic/amlogic_machdep.c Wed Mar 04 23:52:54 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amlogic_machdep.c,v 1.12 2015/03/03 23:20:04 jmcneill Exp $ */
+/*     $NetBSD: amlogic_machdep.c,v 1.13 2015/03/04 23:52:54 jmcneill Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amlogic_machdep.c,v 1.12 2015/03/03 23:20:04 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amlogic_machdep.c,v 1.13 2015/03/04 23:52:54 jmcneill Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -524,6 +524,17 @@
                 */
                prop_dictionary_set_uint32(dict, "offset", 0xfff00000);
        }
+
+       if (device_is_a(self, "awge") && device_unit(self) == 0) {
+               uint8_t enaddr[ETHER_ADDR_LEN];
+               if (get_bootconf_option(boot_args, "awge0.mac-address",
+                   BOOTOPT_TYPE_MACADDR, enaddr)) {
+                       prop_data_t pd = prop_data_create_data(enaddr,
+                           sizeof(enaddr));
+                       prop_dictionary_set(dict, "mac-address", pd);
+                       prop_object_release(pd);
+               }
+       }
 }
 
 #if defined(MULTIPROCESSOR)



Home | Main Index | Thread Index | Old Index