Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/rockchip Make sure to write our MAC address to ...



details:   https://anonhg.NetBSD.org/src/rev/479d6dddcb0b
branches:  trunk
changeset: 335423:479d6dddcb0b
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Jan 06 11:22:09 2015 +0000

description:
Make sure to write our MAC address to the chip

diffstat:

 sys/arch/arm/rockchip/rockchip_emac.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 9f489dd41232 -r 479d6dddcb0b sys/arch/arm/rockchip/rockchip_emac.c
--- a/sys/arch/arm/rockchip/rockchip_emac.c     Tue Jan 06 11:19:16 2015 +0000
+++ b/sys/arch/arm/rockchip/rockchip_emac.c     Tue Jan 06 11:22:09 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rockchip_emac.c,v 1.6 2015/01/06 11:19:16 jmcneill Exp $ */
+/* $NetBSD: rockchip_emac.c,v 1.7 2015/01/06 11:22:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "opt_rkemac.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rockchip_emac.c,v 1.6 2015/01/06 11:19:16 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rockchip_emac.c,v 1.7 2015/01/06 11:22:09 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -232,6 +232,12 @@
                enaddr[5] = (addrh >> 8) & 0xff;
        }
 
+       const uint32_t addrl = enaddr[0] | (enaddr[1] << 8) |
+           (enaddr[2] << 16) | (enaddr[3] << 24);
+       const uint32_t addrh = enaddr[4] | (enaddr[5] << 8);
+       EMAC_WRITE(sc, EMAC_ADDRL_REG, addrl);
+       EMAC_WRITE(sc, EMAC_ADDRH_REG, addrh);
+
        aprint_normal_dev(sc->sc_dev, "Ethernet address: %s\n",
            ether_sprintf(enaddr));
 



Home | Main Index | Thread Index | Old Index