Kinetis enet: initialize the MAC address

This commit is contained in:
Andrew Webster 2016-01-21 18:44:10 -06:00 committed by Gregory Nutt
parent a16cae2b74
commit a3f8be04ac

View File

@ -865,6 +865,7 @@ static void kinetis_polltimer(int argc, uint32_t arg, ...)
static int kinetis_ifup(struct net_driver_s *dev)
{
FAR struct kinetis_driver_s *priv = (FAR struct kinetis_driver_s *)dev->d_private;
uint8_t *mac = dev->d_mac.ether_addr_octet;
uint32_t regval;
ndbg("Bringing up: %d.%d.%d.%d\n",
@ -883,6 +884,12 @@ static int kinetis_ifup(struct net_driver_s *dev)
kinetis_initmii(priv);
/* Set the MAC address */
putreg32((mac[0] << 24) | (mac[1] << 16) | (mac[2] << 8) | mac[3],
KINETIS_ENET_PALR);
putreg32((mac[4] << 24) | (mac[5] << 16), KINETIS_ENET_PAUR);
/* Clear the Individual and Group Address Hash registers */
putreg32(0, KINETIS_ENET_IALR);