LPC546XX: Correct Ethernet MAC address write

Patch to LPC546XX SDK code - write the low Ethernet MAC address
register last, as that synchronises the update.

Without this change, the ENET_SetMacAddr call only seems to work prior
to MAC initialisation, causing problems for the new mbed OS EMAC system,
which expects it to be changable later.

Updated emac greentea tests #6851.
pull/6847/head
Kevin Bracey 2018-05-18 11:54:52 +03:00
parent fd2c6ba12b
commit 97b9980c8c
1 changed files with 2 additions and 2 deletions

View File

@ -674,10 +674,10 @@ static inline void ENET_SetMacAddr(ENET_Type *base, uint8_t *macAddr)
{
assert(macAddr);
/* Set Macaddr */
/* Set Macaddr - low last as that synchronizes the update */
base->MAC_ADDR_HIGH = ((uint32_t)macAddr[5] << 8) | ((uint32_t)macAddr[4]);
base->MAC_ADDR_LOW = ((uint32_t)macAddr[3] << 24) | ((uint32_t)macAddr[2] << 16) | ((uint32_t)macAddr[1] << 8) |
((uint32_t)macAddr[0]);
base->MAC_ADDR_HIGH = ((uint32_t)macAddr[5] << 8) | ((uint32_t)macAddr[4]);
}
/*!