21 #define MPSC_CHR_1 0x000c
23 #define MPSC_CHR_2 0x0010
24 #define MPSC_CHR_2_TA (1<<7)
25 #define MPSC_CHR_2_TCS (1<<9)
26 #define MPSC_CHR_2_RA (1<<23)
27 #define MPSC_CHR_2_CRD (1<<25)
28 #define MPSC_CHR_2_EH (1<<31)
30 #define MPSC_CHR_4 0x0018
31 #define MPSC_CHR_4_Z (1<<29)
33 #define MPSC_CHR_5 0x001c
34 #define MPSC_CHR_5_CTL1_INTR (1<<12)
35 #define MPSC_CHR_5_CTL1_VALID (1<<15)
37 #define MPSC_CHR_10 0x0030
39 #define MPSC_INTR_CAUSE 0x0000
40 #define MPSC_INTR_CAUSE_RCC (1<<6)
41 #define MPSC_INTR_MASK 0x0080
43 #define SDMA_SDCM 0x0008
44 #define SDMA_SDCM_AR (1<<15)
45 #define SDMA_SDCM_AT (1<<31)
47 static volatile char *mpsc_base;
48 static volatile char *mpscintr_base;
49 static u32 chr1, chr2;
51 static int mpsc_open(
void)
64 static void mpsc_putc(
unsigned char c)
72 static unsigned char mpsc_getc(
void)
83 cause & ~MPSC_INTR_CAUSE_RCC);
88 static u8 mpsc_tstc(
void)
94 static void mpsc_stop_dma(
volatile char *sdma_base)
104 static volatile char *mpsc_get_virtreg_of_phandle(
void *devp,
char *prop)
109 n = getprop(devp, prop, &v,
sizeof(v));
113 devp = find_node_by_linuxphandle((
u32)v);
117 n = getprop(devp,
"virtual-reg", &v,
sizeof(v));
129 volatile char *sdma_base;
131 n = getprop(devp,
"virtual-reg", &v,
sizeof(v));
136 sdma_base = mpsc_get_virtreg_of_phandle(devp,
"sdma");
137 if (sdma_base ==
NULL)
140 mpscintr_base = mpsc_get_virtreg_of_phandle(devp,
"mpscintr");
141 if (mpscintr_base ==
NULL)
144 n = getprop(devp,
"cell-index", &v,
sizeof(v));
149 mpscintr_base += (reg_set == 0) ? 0x4 : 0
xc;
157 mpsc_stop_dma(sdma_base);
159 scdp->
open = mpsc_open;
160 scdp->
putc = mpsc_putc;
161 scdp->
getc = mpsc_getc;
162 scdp->
tstc = mpsc_tstc;