mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:22:32 +08:00
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:
@@ -106,14 +106,14 @@ static xcpt_t g_emac0_handler;
|
|||||||
#ifdef CONFIG_SAMV7_PIOA_IRQ
|
#ifdef CONFIG_SAMV7_PIOA_IRQ
|
||||||
static void sam_emac0_phy_enable(bool enable)
|
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)
|
if (enable)
|
||||||
{
|
{
|
||||||
sam_pioirqenable(IRQ_INT_ETH0);
|
sam_pioirqenable(IRQ_EMAC0_INT);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sam_pioirqdisable(IRQ_INT_ETH0);
|
sam_pioirqdisable(IRQ_EMAC0_INT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -134,8 +134,16 @@ void weak_function sam_netinitialize(void)
|
|||||||
{
|
{
|
||||||
/* Configure the PHY interrupt GPIO */
|
/* Configure the PHY interrupt GPIO */
|
||||||
|
|
||||||
phydbg("Configuring %08x\n", GPIO_INT_ETH0);
|
phydbg("Configuring %08x\n", GPIO_EMAC0_INT);
|
||||||
sam_configgpio(GPIO_INT_ETH0);
|
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");
|
phydbg("Select EMAC0\n");
|
||||||
phandler = &g_emac0_handler;
|
phandler = &g_emac0_handler;
|
||||||
pinset = GPIO_INT_ETH0;
|
pinset = GPIO_EMAC0_INT;
|
||||||
irq = IRQ_INT_ETH0;
|
irq = IRQ_EMAC0_INT;
|
||||||
enabler = sam_emac0_phy_enable;
|
enabler = sam_emac0_phy_enable;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -200,9 +200,14 @@
|
|||||||
* ------ --------- --------- --------------------------
|
* ------ --------- --------- --------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define GPIO_INT_ETH0 (GPIO_INPUT | GPIO_CFG_PULLUP | GPIO_CFG_DEGLITCH | \
|
#define GPIO_EMAC0_INT (GPIO_INPUT | GPIO_CFG_PULLUP | GPIO_CFG_DEGLITCH | \
|
||||||
GPIO_INT_FALLING | GPIO_PORT_PIOA | GPIO_PIN19)
|
GPIO_INT_FALLING | GPIO_PORT_PIOA | GPIO_PIN19)
|
||||||
#define IRQ_INT_ETH0 SAM_IRQ_PA19
|
#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
|
/* LEDs
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user