forked from Imagelibrary/rtems
SMC91111: updated to use shared IRQ service
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
This commit is contained in:
committed by
Joel Sherrill
parent
c500cbc384
commit
0f04edd9cc
@@ -26,12 +26,12 @@
|
|||||||
|
|
||||||
|
|
||||||
#define SMC91111_BASE_ADDR (void*)0x20000300
|
#define SMC91111_BASE_ADDR (void*)0x20000300
|
||||||
#define SMC91111_BASE_IRQ LEON_TRAP_TYPE(4)
|
#define SMC91111_BASE_IRQ 4
|
||||||
#define SMC91111_BASE_PIO 4
|
#define SMC91111_BASE_PIO 4
|
||||||
|
|
||||||
scmv91111_configuration_t leon_scmv91111_configuration = {
|
scmv91111_configuration_t leon_scmv91111_configuration = {
|
||||||
SMC91111_BASE_ADDR, /* base address */
|
SMC91111_BASE_ADDR, /* base address */
|
||||||
SMC91111_BASE_IRQ, /* vector number */
|
SMC91111_BASE_IRQ, /* IRQ number (on LEON vector is irq) */
|
||||||
SMC91111_BASE_PIO, /* PIO */
|
SMC91111_BASE_PIO, /* PIO */
|
||||||
100, /* 100b */
|
100, /* 100b */
|
||||||
1, /* fulldx */
|
1, /* fulldx */
|
||||||
@@ -55,9 +55,7 @@ int rtems_smc91111_driver_attach_leon2(struct rtems_bsdnet_ifconfig *config)
|
|||||||
*((volatile unsigned int *)0x80000000) |= 0x10f80000;
|
*((volatile unsigned int *)0x80000000) |= 0x10f80000;
|
||||||
*((volatile unsigned int *)0x800000A8) |=
|
*((volatile unsigned int *)0x800000A8) |=
|
||||||
(0xe0 | leon_scmv91111_configuration.pio)
|
(0xe0 | leon_scmv91111_configuration.pio)
|
||||||
<< (8 * ((leon_scmv91111_configuration.vector & 0x0f) - 4));
|
<< (8 * (leon_scmv91111_configuration.vector - 4)); /* vector = irq-no */
|
||||||
|
|
||||||
return _rtems_smc91111_driver_attach(config,&leon_scmv91111_configuration);
|
return _rtems_smc91111_driver_attach(config,&leon_scmv91111_configuration);
|
||||||
|
}
|
||||||
};
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
scmv91111_configuration_t leon_scmv91111_configuration = {
|
scmv91111_configuration_t leon_scmv91111_configuration = {
|
||||||
SMC91111_BASE_ADDR, /* base address */
|
SMC91111_BASE_ADDR, /* base address */
|
||||||
LEON_TRAP_TYPE (SMC91111_BASE_IRQ), /* vector number */
|
SMC91111_BASE_IRQ, /* IRQ number (on LEON vector is irq) */
|
||||||
SMC91111_BASE_PIO, /* PIO */
|
SMC91111_BASE_PIO, /* PIO */
|
||||||
100, /* 100b */
|
100, /* 100b */
|
||||||
1, /* fulldx */
|
1, /* fulldx */
|
||||||
|
|||||||
@@ -61,12 +61,6 @@
|
|||||||
|
|
||||||
#ifdef BSP_FEATURE_IRQ_EXTENSION
|
#ifdef BSP_FEATURE_IRQ_EXTENSION
|
||||||
#include <rtems/irq-extension.h>
|
#include <rtems/irq-extension.h>
|
||||||
#else
|
|
||||||
#if defined(__m68k__)
|
|
||||||
extern m68k_isr_entry set_vector( rtems_isr_entry, rtems_vector_number, int );
|
|
||||||
#else
|
|
||||||
extern rtems_isr_entry set_vector( rtems_isr_entry, rtems_vector_number, int );
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct lan91cxx_priv_data smc91111;
|
struct lan91cxx_priv_data smc91111;
|
||||||
@@ -92,9 +86,9 @@ static void lan91cxx_phy_configure(struct lan91cxx_priv_data *cpd);
|
|||||||
#define max(l,r) ((l) > (r) ? (l) : (r))
|
#define max(l,r) ((l) > (r) ? (l) : (r))
|
||||||
|
|
||||||
/* \ ------------- Interrupt ------------- \ */
|
/* \ ------------- Interrupt ------------- \ */
|
||||||
rtems_isr lan91cxx_interrupt_handler(rtems_vector_number v)
|
void lan91cxx_interrupt_handler(void *arg)
|
||||||
{
|
{
|
||||||
struct lan91cxx_priv_data *cpd = &smc91111;
|
struct lan91cxx_priv_data *cpd = arg;
|
||||||
unsigned short irq, event;
|
unsigned short irq, event;
|
||||||
unsigned short oldbase;
|
unsigned short oldbase;
|
||||||
unsigned short oldpointer;
|
unsigned short oldpointer;
|
||||||
@@ -1029,7 +1023,7 @@ static void smc91111_stop(struct lan91cxx_priv_data *cpd)
|
|||||||
int lan91cxx_hardware_init(struct lan91cxx_priv_data *cpd)
|
int lan91cxx_hardware_init(struct lan91cxx_priv_data *cpd)
|
||||||
{
|
{
|
||||||
unsigned short val;
|
unsigned short val;
|
||||||
int i;
|
int i, rc;
|
||||||
|
|
||||||
DEBUG_FUNCTION();
|
DEBUG_FUNCTION();
|
||||||
|
|
||||||
@@ -1053,8 +1047,11 @@ int lan91cxx_hardware_init(struct lan91cxx_priv_data *cpd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
db_printf("Install lan91cxx irqvector at %d\n", cpd->config.vector);
|
db_printf("Install lan91cxx isr at vec/irq %d\n", cpd->config.vector);
|
||||||
set_vector(lan91cxx_interrupt_handler, cpd->config.vector, 1);
|
rc = rtems_interrupt_handler_install(cpd->config.vector, "smc91cxx",
|
||||||
|
RTEMS_INTERRUPT_SHARED, lan91cxx_interrupt_handler, cpd);
|
||||||
|
if (rc != RTEMS_SUCCESSFUL)
|
||||||
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Reset chip */
|
/* Reset chip */
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
typedef struct scmv91111_configuration {
|
typedef struct scmv91111_configuration {
|
||||||
void *baseaddr;
|
void *baseaddr;
|
||||||
unsigned int vector;
|
rtems_vector_number vector;
|
||||||
unsigned int pio;
|
unsigned int pio;
|
||||||
unsigned int ctl_rspeed;
|
unsigned int ctl_rspeed;
|
||||||
unsigned int ctl_rfduplx;
|
unsigned int ctl_rfduplx;
|
||||||
|
|||||||
Reference in New Issue
Block a user