From 3e6468f751f803bc0d0ed28e2e6e6a0b67d82cba Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 25 Oct 2007 07:05:38 +0000 Subject: [PATCH] Load the bytes into the EMAC's MAC address register in the proper order. The kernel used to shuffle them around to get things right, but that was recently fixed. This makes our boot loader match the behavior of most other boot loaders for the atmel parts. This bug was inherited from the Kwikbyte loader that we started from. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This bug was discovered by Bj.ANvrn KNvnig back in June, but fell on the floor. He provided patches to the kernel, include backwards compatibility options that were similar to Olivier's if_ate.c commit. --- sys/boot/arm/at91/libat91/emac_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/boot/arm/at91/libat91/emac_init.c b/sys/boot/arm/at91/libat91/emac_init.c index 32f45639c59..30246226d61 100644 --- a/sys/boot/arm/at91/libat91/emac_init.c +++ b/sys/boot/arm/at91/libat91/emac_init.c @@ -79,8 +79,8 @@ EMAC_SetMACAddress(unsigned char mac[6]) pPMC->PMC_PCER = ((unsigned) 1 << AT91C_ID_EMAC); memcpy(localMACAddr, mac, 6); - localMAClow = (mac[2] << 24) | (mac[3] << 16) | (mac[4] << 8) | mac[5]; - localMAChigh = (mac[0] << 8) | mac[1]; + localMAClow = (mac[3] << 24) | (mac[2] << 16) | (mac[1] << 8) | mac[0]; + localMAChigh = (mac[5] << 8) | mac[4]; localMACSet = 1; AT91C_BASE_PMC->PMC_PCER = 1u << AT91C_ID_EMAC;