Skip to content
Permalink
Browse files

drivers: eth_stellaris: update for dts change to local-mac-address

uint8_array values are now generated as structure initializers.  Update
the code accordingly.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
  • Loading branch information...
pabigot authored and galak committed Jul 10, 2019
1 parent ec2ba8d commit 7f00f38dfe8059bad98c3f7aac1675561a23ee89
Showing with 9 additions and 20 deletions.
  1. +8 −14 drivers/ethernet/eth_stellaris.c
  2. +1 −6 soc/arm/ti_lm3s6965/dts_fixup.h
@@ -20,17 +20,18 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);

static void eth_stellaris_assign_mac(struct device *dev)
{
u8_t mac_addr[6] = DT_ETH_MAC_ADDR;
u32_t value = 0x0;

value |= DT_ETH_MAC_ADDR_0;
value |= DT_ETH_MAC_ADDR_1 << 8;
value |= DT_ETH_MAC_ADDR_2 << 16;
value |= DT_ETH_MAC_ADDR_3 << 24;
value |= mac_addr[0];
value |= mac_addr[1] << 8;
value |= mac_addr[2] << 16;
value |= mac_addr[3] << 24;
sys_write32(value, REG_MACIA0);

value = 0x0;
value |= DT_ETH_MAC_ADDR_4;
value |= DT_ETH_MAC_ADDR_5 << 8;
value |= mac_addr[4];
value |= mac_addr[5] << 8;
sys_write32(value, REG_MACIA1);
}

@@ -334,14 +335,7 @@ struct eth_stellaris_config eth_cfg = {
};

struct eth_stellaris_runtime eth_data = {
.mac_addr = {
(u8_t)DT_ETH_MAC_ADDR_0,
(u8_t)DT_ETH_MAC_ADDR_1,
(u8_t)DT_ETH_MAC_ADDR_2,
(u8_t)DT_ETH_MAC_ADDR_3,
(u8_t)DT_ETH_MAC_ADDR_4,
(u8_t)DT_ETH_MAC_ADDR_5
},
.mac_addr = DT_ETH_MAC_ADDR,
.tx_err = false,
.tx_word = 0,
.tx_pos = 0,
@@ -7,12 +7,7 @@
#define DT_ETH_DRV_NAME DT_TI_STELLARIS_ETHERNET_40048000_LABEL
#define DT_ETH_IRQ DT_TI_STELLARIS_ETHERNET_40048000_IRQ_0
#define DT_ETH_IRQ_PRIO DT_TI_STELLARIS_ETHERNET_40048000_IRQ_0_PRIORITY
#define DT_ETH_MAC_ADDR_0 DT_TI_STELLARIS_ETHERNET_40048000_LOCAL_MAC_ADDRESS_0
#define DT_ETH_MAC_ADDR_1 DT_TI_STELLARIS_ETHERNET_40048000_LOCAL_MAC_ADDRESS_1
#define DT_ETH_MAC_ADDR_2 DT_TI_STELLARIS_ETHERNET_40048000_LOCAL_MAC_ADDRESS_2
#define DT_ETH_MAC_ADDR_3 DT_TI_STELLARIS_ETHERNET_40048000_LOCAL_MAC_ADDRESS_3
#define DT_ETH_MAC_ADDR_4 DT_TI_STELLARIS_ETHERNET_40048000_LOCAL_MAC_ADDRESS_4
#define DT_ETH_MAC_ADDR_5 DT_TI_STELLARIS_ETHERNET_40048000_LOCAL_MAC_ADDRESS_5
#define DT_ETH_MAC_ADDR DT_TI_STELLARIS_ETHERNET_40048000_LOCAL_MAC_ADDRESS

#define DT_GPIO_A_BASE_ADDRESS DT_TI_STELLARIS_GPIO_40004000_BASE_ADDRESS
#define DT_GPIO_A_LABEL DT_TI_STELLARIS_GPIO_40004000_LABEL

0 comments on commit 7f00f38

Please sign in to comment.
You can’t perform that action at this time.