diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-09-06 13:27:25 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-09-06 13:27:25 +0000 |
commit | 226455f9fffef4c88b67aeef113a97dcaabd4b00 (patch) | |
tree | 8771eee8053655a1c09977a68efd2ba35ee173c5 /c/src/lib/libbsp/sparc/shared/uart/apbuart_rasta.c | |
parent | 2007-09-06 Daniel Hellstrom <daniel@gaisler.com> (diff) | |
download | rtems-226455f9fffef4c88b67aeef113a97dcaabd4b00.tar.bz2 |
2007-09-06 Daniel Hellstrom <daniel@gaisler.com>
New drivers: PCI, b1553BRM, SpaceWire(GRSPW), CAN (GRCAN,OC_CAN),
Raw UART.
* shared/1553/b1553brm.c, shared/1553/b1553brm_pci.c,
shared/1553/b1553brm_rasta.c, shared/can/grcan.c,
shared/can/grcan_rasta.c, shared/can/occan.c, shared/can/occan_pci.c,
shared/spw/grspw.c, shared/spw/grspw_pci.c, shared/spw/grspw_rasta.c,
shared/uart/apbuart.c, shared/uart/apbuart_pci.c,
shared/uart/apbuart_rasta.c: New files missed in previous commit.
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/sparc/shared/uart/apbuart_rasta.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/uart/apbuart_rasta.c b/c/src/lib/libbsp/sparc/shared/uart/apbuart_rasta.c new file mode 100644 index 0000000000..a5c365eb77 --- /dev/null +++ b/c/src/lib/libbsp/sparc/shared/uart/apbuart_rasta.c @@ -0,0 +1,42 @@ + +#undef DEBUG + +/* Set registered device name */ +#define APBUART_DEVNAME "/dev/apburasta0" +#define APBUART_DEVNAME_NO(devstr,no) ((devstr)[14]='0'+(no)) + +/* Any non-static function will begin with */ +#define APBUART_PREFIX(name) apbuartrasta##name + +/* do nothing, assume that the interrupt handler is called + * setup externally calling apbuartrasta_interrupt_handler. + */ +#define APBUART_REG_INT(handler,irq,arg) \ + if ( apbuart_rasta_int_reg ) \ + apbuart_rasta_int_reg(handler,irq,arg); + +void (*apbuart_rasta_int_reg)(void *handler, int irq, void *arg) = 0; + +void apbuartrasta_interrupt_handler(int irq, void *arg); + +/* AMBA Bus is clocked using the RASTA internal clock (30MHz) */ +#define SYS_FREQ_HZ 30000000 + +#include "apbuart.c" + +int apbuart_rasta_register(amba_confarea_type *bus) +{ + /* Setup configuration */ + + /* Register the driver */ + return APBUART_PREFIX(_register)(bus); +} + + +/* Call this from RASTA interrupt handler + * irq = the irq number of the HW device local to that IRQMP controller + * + */ +void apbuartrasta_interrupt_handler(int irq, void *arg){ + apbuart_interrupt(arg); +} |