22 #define EXI_CLK_32MHZ 5
25 #define EXI_CSR_CLKMASK (0x7<<4)
26 #define EXI_CSR_CLK_32MHZ (EXI_CLK_32MHZ<<4)
27 #define EXI_CSR_CSMASK (0x7<<7)
28 #define EXI_CSR_CS_0 (0x1<<7)
31 #define EXI_CR_TSTART (1<<0)
32 #define EXI_CR_WRITE (1<<2)
33 #define EXI_CR_READ_WRITE (2<<2)
34 #define EXI_CR_TLEN(len) (((len)-1)<<4)
40 static void *ug_io_base;
70 static int ug_is_txfifo_ready(
void)
72 return ug_io_transaction(0xc0000000) & 0x04000000;
75 static void ug_raw_putc(
char ch)
77 ug_io_transaction(0xb0000000 | (ch << 20));
87 while (!ug_is_txfifo_ready() && count--)
95 char *
b = (
char *)buf;
104 static int ug_is_adapter_present(
void)
108 return ug_io_transaction(0x90000000) == 0x04700000;
111 static void *ug_grab_exi_io_base(
void)
116 devp = find_node_by_compatible(
NULL,
"nintendo,flipper-exi");
119 if (getprop(devp,
"virtual-reg", &v,
sizeof(v)) !=
sizeof(v))
133 exi_io_base = ug_grab_exi_io_base();
138 for (i = 0; i < 2; i++) {
139 ug_io_base = exi_io_base + 0x14 *
i;
140 if (ug_is_adapter_present())