Go to the documentation of this file.
20 #ifndef LINUX_SSB_EXTIFCORE_H_
21 #define LINUX_SSB_EXTIFCORE_H_
24 #define SSB_EXTIF_PCMCIA_MEMBASE(x) (x)
25 #define SSB_EXTIF_PCMCIA_IOBASE(x) ((x) + 0x100000)
26 #define SSB_EXTIF_PCMCIA_CFGBASE(x) ((x) + 0x200000)
27 #define SSB_EXTIF_CFGIF_BASE(x) ((x) + 0x800000)
28 #define SSB_EXTIF_FLASH_BASE(x) ((x) + 0xc00000)
30 #define SSB_EXTIF_NR_GPIOOUT 5
37 #define SSB_EXTIF_GPIO_OUT(index) ({ \
38 BUILD_BUG_ON(index >= SSB_EXTIF_NR_GPIOOUT); \
39 SSB_EXTIF_GPIO_OUT_BASE + ((index) * 8); \
41 #define SSB_EXTIF_GPIO_OUTEN(index) ({ \
42 BUILD_BUG_ON(index >= SSB_EXTIF_NR_GPIOOUT); \
43 SSB_EXTIF_GPIO_OUTEN_BASE + ((index) * 8); \
48 #define SSB_EXTIF_CTL 0x0000
49 #define SSB_EXTIF_CTL_UARTEN (1 << 0)
50 #define SSB_EXTIF_EXTSTAT 0x0004
51 #define SSB_EXTIF_EXTSTAT_EMODE (1 << 0)
52 #define SSB_EXTIF_EXTSTAT_EIRQPIN (1 << 1)
53 #define SSB_EXTIF_EXTSTAT_GPIOIRQPIN (1 << 2)
54 #define SSB_EXTIF_PCMCIA_CFG 0x0010
55 #define SSB_EXTIF_PCMCIA_MEMWAIT 0x0014
56 #define SSB_EXTIF_PCMCIA_ATTRWAIT 0x0018
57 #define SSB_EXTIF_PCMCIA_IOWAIT 0x001C
58 #define SSB_EXTIF_PROG_CFG 0x0020
59 #define SSB_EXTIF_PROG_WAITCNT 0x0024
60 #define SSB_EXTIF_FLASH_CFG 0x0028
61 #define SSB_EXTIF_FLASH_WAITCNT 0x002C
62 #define SSB_EXTIF_WATCHDOG 0x0040
63 #define SSB_EXTIF_CLOCK_N 0x0044
64 #define SSB_EXTIF_CLOCK_SB 0x0048
65 #define SSB_EXTIF_CLOCK_PCI 0x004C
66 #define SSB_EXTIF_CLOCK_MII 0x0050
67 #define SSB_EXTIF_GPIO_IN 0x0060
68 #define SSB_EXTIF_GPIO_OUT_BASE 0x0064
69 #define SSB_EXTIF_GPIO_OUTEN_BASE 0x0068
70 #define SSB_EXTIF_EJTAG_OUTEN 0x0090
71 #define SSB_EXTIF_GPIO_INTPOL 0x0094
72 #define SSB_EXTIF_GPIO_INTMASK 0x0098
73 #define SSB_EXTIF_UART_DATA 0x0300
74 #define SSB_EXTIF_UART_TIMER 0x0310
75 #define SSB_EXTIF_UART_FCR 0x0320
76 #define SSB_EXTIF_UART_LCR 0x0330
77 #define SSB_EXTIF_UART_MCR 0x0340
78 #define SSB_EXTIF_UART_LSR 0x0350
79 #define SSB_EXTIF_UART_MSR 0x0360
80 #define SSB_EXTIF_UART_SCRATCH 0x0370
86 #define SSB_EXTCFG_EN (1 << 0)
87 #define SSB_EXTCFG_MODE 0xE
88 #define SSB_EXTCFG_MODE_SHIFT 1
89 #define SSB_EXTCFG_MODE_FLASH 0x0
90 #define SSB_EXTCFG_MODE_SYNC 0x2
91 #define SSB_EXTCFG_MODE_PCMCIA 0x4
92 #define SSB_EXTCFG_DS16 (1 << 4)
93 #define SSB_EXTCFG_BSWAP (1 << 5)
94 #define SSB_EXTCFG_CLKDIV 0xC0
95 #define SSB_EXTCFG_CLKDIV_SHIFT 6
96 #define SSB_EXTCFG_CLKDIV_2 0x0
97 #define SSB_EXTCFG_CLKDIV_3 0x40
98 #define SSB_EXTCFG_CLKDIV_4 0x80
99 #define SSB_EXTCFG_CLKEN (1 << 8)
100 #define SSB_EXTCFG_STROBE (1 << 9)
103 #define SSB_PCMCIA_MEMW_0 0x0000003F
104 #define SSB_PCMCIA_MEMW_1 0x00001F00
105 #define SSB_PCMCIA_MEMW_1_SHIFT 8
106 #define SSB_PCMCIA_MEMW_2 0x001F0000
107 #define SSB_PCMCIA_MEMW_2_SHIFT 16
108 #define SSB_PCMCIA_MEMW_3 0x1F000000
109 #define SSB_PCMCIA_MEMW_3_SHIFT 24
112 #define SSB_PCMCIA_ATTW_0 0x0000003F
113 #define SSB_PCMCIA_ATTW_1 0x00001F00
114 #define SSB_PCMCIA_ATTW_1_SHIFT 8
115 #define SSB_PCMCIA_ATTW_2 0x001F0000
116 #define SSB_PCMCIA_ATTW_2_SHIFT 16
117 #define SSB_PCMCIA_ATTW_3 0x1F000000
118 #define SSB_PCMCIA_ATTW_3_SHIFT 24
121 #define SSB_PCMCIA_IOW_0 0x0000003F
122 #define SSB_PCMCIA_IOW_1 0x00001F00
123 #define SSB_PCMCIA_IOW_1_SHIFT 8
124 #define SSB_PCMCIA_IOW_2 0x001F0000
125 #define SSB_PCMCIA_IOW_2_SHIFT 16
126 #define SSB_PCMCIA_IOW_3 0x1F000000
127 #define SSB_PCMCIA_IOW_3_SHIFT 24
130 #define SSB_PROG_WCNT_0 0x0000001F
131 #define SSB_PROG_WCNT_1 0x00001F00
132 #define SSB_PROG_WCNT_1_SHIFT 8
133 #define SSB_PROG_WCNT_2 0x001F0000
134 #define SSB_PROG_WCNT_2_SHIFT 16
135 #define SSB_PROG_WCNT_3 0x1F000000
136 #define SSB_PROG_WCNT_3_SHIFT 24
138 #define SSB_PROG_W0 0x0000000C
139 #define SSB_PROG_W1 0x00000A00
140 #define SSB_PROG_W2 0x00020000
141 #define SSB_PROG_W3 0x01000000
144 #define SSB_FLASH_WCNT_0 0x0000001F
145 #define SSB_FLASH_WCNT_1 0x00001F00
146 #define SSB_FLASH_WCNT_1_SHIFT 8
147 #define SSB_FLASH_WCNT_2 0x001F0000
148 #define SSB_FLASH_WCNT_2_SHIFT 16
149 #define SSB_FLASH_WCNT_3 0x1F000000
150 #define SSB_FLASH_WCNT_3_SHIFT 24
153 #define SSB_EXTIF_WATCHDOG_CLK 48000000
157 #ifdef CONFIG_SSB_DRIVER_EXTIF
165 return (extif->dev !=
NULL);
184 #ifdef CONFIG_SSB_SERIAL
185 extern int ssb_extif_serial_init(
struct ssb_extif *extif,
186 struct ssb_serial_port *ports);
196 static inline bool ssb_extif_available(
struct ssb_extif *extif)