|
@@ -51,6 +51,8 @@
|
|
NETIF_MSG_PKTDATA | NETIF_MSG_TX_QUEUED | \
|
|
NETIF_MSG_PKTDATA | NETIF_MSG_TX_QUEUED | \
|
|
NETIF_MSG_RX_STATUS)
|
|
NETIF_MSG_RX_STATUS)
|
|
|
|
|
|
|
|
+#define NETCP_EFUSE_ADDR_SWAP 2
|
|
|
|
+
|
|
#define knav_queue_get_id(q) knav_queue_device_control(q, \
|
|
#define knav_queue_get_id(q) knav_queue_device_control(q, \
|
|
KNAV_QUEUE_GET_ID, (unsigned long)NULL)
|
|
KNAV_QUEUE_GET_ID, (unsigned long)NULL)
|
|
|
|
|
|
@@ -172,13 +174,22 @@ static void set_words(u32 *words, int num_words, u32 *desc)
|
|
}
|
|
}
|
|
|
|
|
|
/* Read the e-fuse value as 32 bit values to be endian independent */
|
|
/* Read the e-fuse value as 32 bit values to be endian independent */
|
|
-static int emac_arch_get_mac_addr(char *x, void __iomem *efuse_mac)
|
|
|
|
|
|
+static int emac_arch_get_mac_addr(char *x, void __iomem *efuse_mac, u32 swap)
|
|
{
|
|
{
|
|
unsigned int addr0, addr1;
|
|
unsigned int addr0, addr1;
|
|
|
|
|
|
addr1 = readl(efuse_mac + 4);
|
|
addr1 = readl(efuse_mac + 4);
|
|
addr0 = readl(efuse_mac);
|
|
addr0 = readl(efuse_mac);
|
|
|
|
|
|
|
|
+ switch (swap) {
|
|
|
|
+ case NETCP_EFUSE_ADDR_SWAP:
|
|
|
|
+ addr0 = addr1;
|
|
|
|
+ addr1 = readl(efuse_mac);
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
x[0] = (addr1 & 0x0000ff00) >> 8;
|
|
x[0] = (addr1 & 0x0000ff00) >> 8;
|
|
x[1] = addr1 & 0x000000ff;
|
|
x[1] = addr1 & 0x000000ff;
|
|
x[2] = (addr0 & 0xff000000) >> 24;
|
|
x[2] = (addr0 & 0xff000000) >> 24;
|
|
@@ -1902,7 +1913,7 @@ static int netcp_create_interface(struct netcp_device *netcp_device,
|
|
goto quit;
|
|
goto quit;
|
|
}
|
|
}
|
|
|
|
|
|
- emac_arch_get_mac_addr(efuse_mac_addr, efuse);
|
|
|
|
|
|
+ emac_arch_get_mac_addr(efuse_mac_addr, efuse, efuse_mac);
|
|
if (is_valid_ether_addr(efuse_mac_addr))
|
|
if (is_valid_ether_addr(efuse_mac_addr))
|
|
ether_addr_copy(ndev->dev_addr, efuse_mac_addr);
|
|
ether_addr_copy(ndev->dev_addr, efuse_mac_addr);
|
|
else
|
|
else
|