diff --git a/configs/samv71-xult/src/sam_ethernet.c b/configs/samv71-xult/src/sam_ethernet.c index d8e5ed6e589..07cf8b6ef6b 100644 --- a/configs/samv71-xult/src/sam_ethernet.c +++ b/configs/samv71-xult/src/sam_ethernet.c @@ -106,14 +106,14 @@ static xcpt_t g_emac0_handler; #ifdef CONFIG_SAMV7_PIOA_IRQ static void sam_emac0_phy_enable(bool enable) { - phydbg("IRQ%d: enable=%d\n", IRQ_INT_ETH0, enable); + phydbg("IRQ%d: enable=%d\n", IRQ_EMAC0_INT, enable); if (enable) { - sam_pioirqenable(IRQ_INT_ETH0); + sam_pioirqenable(IRQ_EMAC0_INT); } else { - sam_pioirqdisable(IRQ_INT_ETH0); + sam_pioirqdisable(IRQ_EMAC0_INT); } } #endif @@ -134,8 +134,16 @@ void weak_function sam_netinitialize(void) { /* Configure the PHY interrupt GPIO */ - phydbg("Configuring %08x\n", GPIO_INT_ETH0); - sam_configgpio(GPIO_INT_ETH0); + phydbg("Configuring %08x\n", GPIO_EMAC0_INT); + sam_configgpio(GPIO_EMAC0_INT); + + /* Configure the PHY SIGDET input */ + + sam_configgpio(GPIO_EMAC0_SIGDET); + + /* Configure PHY /RESET output */ + + sam_configgpio(GPIO_EMAC0_RESET); } /************************************************************************************ @@ -307,8 +315,8 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) { phydbg("Select EMAC0\n"); phandler = &g_emac0_handler; - pinset = GPIO_INT_ETH0; - irq = IRQ_INT_ETH0; + pinset = GPIO_EMAC0_INT; + irq = IRQ_EMAC0_INT; enabler = sam_emac0_phy_enable; } else diff --git a/configs/samv71-xult/src/samv71-xult.h b/configs/samv71-xult/src/samv71-xult.h index f8ee00ac5d0..863629e8d4e 100644 --- a/configs/samv71-xult/src/samv71-xult.h +++ b/configs/samv71-xult/src/samv71-xult.h @@ -200,9 +200,14 @@ * ------ --------- --------- -------------------------- */ -#define GPIO_INT_ETH0 (GPIO_INPUT | GPIO_CFG_PULLUP | GPIO_CFG_DEGLITCH | \ - GPIO_INT_FALLING | GPIO_PORT_PIOA | GPIO_PIN19) -#define IRQ_INT_ETH0 SAM_IRQ_PA19 +#define GPIO_EMAC0_INT (GPIO_INPUT | GPIO_CFG_PULLUP | GPIO_CFG_DEGLITCH | \ + GPIO_INT_FALLING | GPIO_PORT_PIOA | GPIO_PIN19) +#define GPIO_EMAC0_SIGDET (GPIO_INPUT | GPIO_CFG_DEFAULT | \ + GPIO_PORT_PIOA | GPIO_PIN29) +#define GPIO_EMAC0_RESET (GPIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_SET | \ + GPIO_PORT_PIOC | GPIO_PIN10) + +#define IRQ_EMAC0_INT SAM_IRQ_PA19 /* LEDs *