summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/shared/uart/apbuart_rasta.c
blob: 349a9c59ca7ca62316fd34ff6870a04e2b2cca28 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#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(struct ambapp_bus *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);
}