SAMV7: Updates to Ethernet driver based on comparison with Atmel sample code. Add configuration for other PHY GPIOs. Still no Ethernet interrupts

This commit is contained in:
Gregory Nutt 2015-03-18 15:55:00 -06:00
parent 2ba7a82738
commit 8e2c27f4d5
2 changed files with 23 additions and 10 deletions

View File

@ -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

View File

@ -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
*