4 #include <linux/types.h>
5 #include <linux/init.h>
8 * Macro to fetch bcm63xx cpu id and revision, should be optimized at
9 * compile time if only one CPU support is enabled (idea stolen from
12 #define BCM6338_CPU_ID 0x6338
13 #define BCM6348_CPU_ID 0x6348
14 #define BCM6358_CPU_ID 0x6358
16 void __init
bcm63xx_cpu_init(void);
17 u16
__bcm63xx_get_cpu_id(void);
18 u16
bcm63xx_get_cpu_rev(void);
19 unsigned int bcm63xx_get_cpu_freq(void);
21 #ifdef CONFIG_BCM63XX_CPU_6338
22 # ifdef bcm63xx_get_cpu_id
23 # undef bcm63xx_get_cpu_id
24 # define bcm63xx_get_cpu_id() __bcm63xx_get_cpu_id()
25 # define BCMCPU_RUNTIME_DETECT
27 # define bcm63xx_get_cpu_id() BCM6338_CPU_ID
29 # define BCMCPU_IS_6338() (bcm63xx_get_cpu_id() == BCM6338_CPU_ID)
31 # define BCMCPU_IS_6338() (0)
34 #ifdef CONFIG_BCM63XX_CPU_6348
35 # ifdef bcm63xx_get_cpu_id
36 # undef bcm63xx_get_cpu_id
37 # define bcm63xx_get_cpu_id() __bcm63xx_get_cpu_id()
38 # define BCMCPU_RUNTIME_DETECT
40 # define bcm63xx_get_cpu_id() BCM6348_CPU_ID
42 # define BCMCPU_IS_6348() (bcm63xx_get_cpu_id() == BCM6348_CPU_ID)
44 # define BCMCPU_IS_6348() (0)
47 #ifdef CONFIG_BCM63XX_CPU_6358
48 # ifdef bcm63xx_get_cpu_id
49 # undef bcm63xx_get_cpu_id
50 # define bcm63xx_get_cpu_id() __bcm63xx_get_cpu_id()
51 # define BCMCPU_RUNTIME_DETECT
53 # define bcm63xx_get_cpu_id() BCM6358_CPU_ID
55 # define BCMCPU_IS_6358() (bcm63xx_get_cpu_id() == BCM6358_CPU_ID)
57 # define BCMCPU_IS_6358() (0)
60 #ifndef bcm63xx_get_cpu_id
61 #error "No CPU support configured"
65 * While registers sets are (mostly) the same across 63xx CPU, base
66 * address of these sets do change.
68 enum bcm63xx_regs_set
{
92 #define RSET_DSL_LMEM_SIZE (64 * 1024 * 4)
93 #define RSET_DSL_SIZE 4096
94 #define RSET_WDT_SIZE 12
95 #define RSET_ENET_SIZE 2048
96 #define RSET_ENETDMA_SIZE 2048
97 #define RSET_UART_SIZE 24
98 #define RSET_SPI_SIZE 2048
99 #define RSET_UDC_SIZE 256
100 #define RSET_OHCI_SIZE 256
101 #define RSET_EHCI_SIZE 256
102 #define RSET_PCMCIA_SIZE 12
105 * 6338 register sets base address
108 #define BCM_6338_PERF_BASE (0xfffe0000)
109 #define BCM_6338_TIMER_BASE (0xfffe0000)
110 #define BCM_6338_WDT_BASE (0xfffe001c)
111 #define BCM_6338_UART0_BASE (0xfffe0300)
112 #define BCM_6338_GPIO_BASE (0xfffe0400)
113 #define BCM_6338_SPI_BASE (0xfffe0c00)
114 #define BCM_6338_SAR_BASE (0xfffe2000)
115 #define BCM_6338_MEMC_BASE (0xfffe3100)
118 * 6348 register sets base address
120 #define BCM_6348_DSL_LMEM_BASE (0xfff00000)
121 #define BCM_6348_PERF_BASE (0xfffe0000)
122 #define BCM_6348_TIMER_BASE (0xfffe0200)
123 #define BCM_6348_WDT_BASE (0xfffe021c)
124 #define BCM_6348_UART0_BASE (0xfffe0300)
125 #define BCM_6348_GPIO_BASE (0xfffe0400)
126 #define BCM_6348_SPI_BASE (0xfffe0c00)
127 #define BCM_6348_UDC0_BASE (0xfffe1000)
128 #define BCM_6348_OHCI0_BASE (0xfffe1b00)
129 #define BCM_6348_OHCI_PRIV_BASE (0xfffe1c00)
130 #define BCM_6348_USBH_PRIV_BASE (0xdeadbeef)
131 #define BCM_6348_MPI_BASE (0xfffe2000)
132 #define BCM_6348_PCMCIA_BASE (0xfffe2054)
133 #define BCM_6348_SDRAM_REGS_BASE (0xfffe2300)
134 #define BCM_6348_DSL_BASE (0xfffe3000)
135 #define BCM_6348_ENET0_BASE (0xfffe6000)
136 #define BCM_6348_ENET1_BASE (0xfffe6800)
137 #define BCM_6348_ENETDMA_BASE (0xfffe7000)
138 #define BCM_6348_EHCI0_BASE (0xdeadbeef)
139 #define BCM_6348_SDRAM_BASE (0xfffe2300)
140 #define BCM_6348_MEMC_BASE (0xdeadbeef)
141 #define BCM_6348_DDR_BASE (0xdeadbeef)
144 * 6358 register sets base address
146 #define BCM_6358_DSL_LMEM_BASE (0xfff00000)
147 #define BCM_6358_PERF_BASE (0xfffe0000)
148 #define BCM_6358_TIMER_BASE (0xfffe0040)
149 #define BCM_6358_WDT_BASE (0xfffe005c)
150 #define BCM_6358_GPIO_BASE (0xfffe0080)
151 #define BCM_6358_UART0_BASE (0xfffe0100)
152 #define BCM_6358_UDC0_BASE (0xfffe0400)
153 #define BCM_6358_SPI_BASE (0xfffe0800)
154 #define BCM_6358_MPI_BASE (0xfffe1000)
155 #define BCM_6358_PCMCIA_BASE (0xfffe1054)
156 #define BCM_6358_OHCI0_BASE (0xfffe1400)
157 #define BCM_6358_OHCI_PRIV_BASE (0xdeadbeef)
158 #define BCM_6358_USBH_PRIV_BASE (0xfffe1500)
159 #define BCM_6358_SDRAM_REGS_BASE (0xfffe2300)
160 #define BCM_6358_DSL_BASE (0xfffe3000)
161 #define BCM_6358_ENET0_BASE (0xfffe4000)
162 #define BCM_6358_ENET1_BASE (0xfffe4800)
163 #define BCM_6358_ENETDMA_BASE (0xfffe5000)
164 #define BCM_6358_EHCI0_BASE (0xfffe1300)
165 #define BCM_6358_SDRAM_BASE (0xdeadbeef)
166 #define BCM_6358_MEMC_BASE (0xfffe1200)
167 #define BCM_6358_DDR_BASE (0xfffe12a0)
170 extern const unsigned long *bcm63xx_regs_base
;
172 static inline unsigned long bcm63xx_regset_address(enum bcm63xx_regs_set set
)
174 #ifdef BCMCPU_RUNTIME_DETECT
175 return bcm63xx_regs_base
[set
];
177 #ifdef CONFIG_BCM63XX_CPU_6338
180 return BCM_6338_PERF_BASE
;
182 return BCM_6338_TIMER_BASE
;
184 return BCM_6338_WDT_BASE
;
186 return BCM_6338_UART0_BASE
;
188 return BCM_6338_GPIO_BASE
;
190 return BCM_6338_SPI_BASE
;
192 return BCM_6338_MEMC_BASE
;
195 #ifdef CONFIG_BCM63XX_CPU_6348
198 return BCM_6348_DSL_LMEM_BASE
;
200 return BCM_6348_PERF_BASE
;
202 return BCM_6348_TIMER_BASE
;
204 return BCM_6348_WDT_BASE
;
206 return BCM_6348_UART0_BASE
;
208 return BCM_6348_GPIO_BASE
;
210 return BCM_6348_SPI_BASE
;
212 return BCM_6348_UDC0_BASE
;
214 return BCM_6348_OHCI0_BASE
;
216 return BCM_6348_OHCI_PRIV_BASE
;
218 return BCM_6348_USBH_PRIV_BASE
;
220 return BCM_6348_MPI_BASE
;
222 return BCM_6348_PCMCIA_BASE
;
224 return BCM_6348_DSL_BASE
;
226 return BCM_6348_ENET0_BASE
;
228 return BCM_6348_ENET1_BASE
;
230 return BCM_6348_ENETDMA_BASE
;
232 return BCM_6348_EHCI0_BASE
;
234 return BCM_6348_SDRAM_BASE
;
236 return BCM_6348_MEMC_BASE
;
238 return BCM_6348_DDR_BASE
;
241 #ifdef CONFIG_BCM63XX_CPU_6358
244 return BCM_6358_DSL_LMEM_BASE
;
246 return BCM_6358_PERF_BASE
;
248 return BCM_6358_TIMER_BASE
;
250 return BCM_6358_WDT_BASE
;
252 return BCM_6358_UART0_BASE
;
254 return BCM_6358_GPIO_BASE
;
256 return BCM_6358_SPI_BASE
;
258 return BCM_6358_UDC0_BASE
;
260 return BCM_6358_OHCI0_BASE
;
262 return BCM_6358_OHCI_PRIV_BASE
;
264 return BCM_6358_USBH_PRIV_BASE
;
266 return BCM_6358_MPI_BASE
;
268 return BCM_6358_PCMCIA_BASE
;
270 return BCM_6358_ENET0_BASE
;
272 return BCM_6358_ENET1_BASE
;
274 return BCM_6358_ENETDMA_BASE
;
276 return BCM_6358_DSL_BASE
;
278 return BCM_6358_EHCI0_BASE
;
280 return BCM_6358_SDRAM_BASE
;
282 return BCM_6358_MEMC_BASE
;
284 return BCM_6358_DDR_BASE
;
293 * IRQ number changes across CPU too
317 #define BCM_6338_TIMER_IRQ (IRQ_INTERNAL_BASE + 0)
318 #define BCM_6338_SPI_IR (IRQ_INTERNAL_BASE + 1)
319 #define BCM_6338_UART0_IRQ (IRQ_INTERNAL_BASE + 2)
320 #define BCM_6338_DG_IRQ (IRQ_INTERNAL_BASE + 4)
321 #define BCM_6338_DSL_IRQ (IRQ_INTERNAL_BASE + 5)
322 #define BCM_6338_ATM_IRQ (IRQ_INTERNAL_BASE + 6)
323 #define BCM_6338_USBS_IRQ (IRQ_INTERNAL_BASE + 7)
324 #define BCM_6338_ENET0_IRQ (IRQ_INTERNAL_BASE + 8)
325 #define BCM_6338_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 9)
326 #define BCM_6338_SDRAM_IRQ (IRQ_INTERNAL_BASE + 10)
327 #define BCM_6338_USB_CNTL_RX_DMA_IRQ (IRQ_INTERNAL_BASE + 11)
328 #define BCM_6338_USB_CNTL_TX_DMA_IRQ (IRQ_INTERNAL_BASE + 12)
329 #define BCM_6338_USB_BULK_RX_DMA_IRQ (IRQ_INTERNAL_BASE + 13)
330 #define BCM_6338_USB_BULK_TX_DMA_IRQ (IRQ_INTERNAL_BASE + 14)
331 #define BCM_6338_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 15)
332 #define BCM_6338_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 16)
333 #define BCM_6338_SDIO_IRQ (IRQ_INTERNAL_BASE + 17)
338 #define BCM_6348_TIMER_IRQ (IRQ_INTERNAL_BASE + 0)
339 #define BCM_6348_SPI_IRQ (IRQ_INTERNAL_BASE + 1)
340 #define BCM_6348_UART0_IRQ (IRQ_INTERNAL_BASE + 2)
341 #define BCM_6348_DSL_IRQ (IRQ_INTERNAL_BASE + 4)
342 #define BCM_6348_ENET1_IRQ (IRQ_INTERNAL_BASE + 7)
343 #define BCM_6348_ENET0_IRQ (IRQ_INTERNAL_BASE + 8)
344 #define BCM_6348_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 9)
345 #define BCM_6348_OHCI0_IRQ (IRQ_INTERNAL_BASE + 12)
346 #define BCM_6348_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 20)
347 #define BCM_6348_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 21)
348 #define BCM_6348_ENET1_RXDMA_IRQ (IRQ_INTERNAL_BASE + 22)
349 #define BCM_6348_ENET1_TXDMA_IRQ (IRQ_INTERNAL_BASE + 23)
350 #define BCM_6348_PCMCIA_IRQ (IRQ_INTERNAL_BASE + 24)
351 #define BCM_6348_PCI_IRQ (IRQ_INTERNAL_BASE + 24)
356 #define BCM_6358_TIMER_IRQ (IRQ_INTERNAL_BASE + 0)
357 #define BCM_6358_SPI_IRQ (IRQ_INTERNAL_BASE + 1)
358 #define BCM_6358_UART0_IRQ (IRQ_INTERNAL_BASE + 2)
359 #define BCM_6358_OHCI0_IRQ (IRQ_INTERNAL_BASE + 5)
360 #define BCM_6358_ENET1_IRQ (IRQ_INTERNAL_BASE + 6)
361 #define BCM_6358_ENET0_IRQ (IRQ_INTERNAL_BASE + 8)
362 #define BCM_6358_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 9)
363 #define BCM_6358_EHCI0_IRQ (IRQ_INTERNAL_BASE + 10)
364 #define BCM_6358_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 15)
365 #define BCM_6358_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 16)
366 #define BCM_6358_ENET1_RXDMA_IRQ (IRQ_INTERNAL_BASE + 17)
367 #define BCM_6358_ENET1_TXDMA_IRQ (IRQ_INTERNAL_BASE + 18)
368 #define BCM_6358_DSL_IRQ (IRQ_INTERNAL_BASE + 29)
369 #define BCM_6358_PCI_IRQ (IRQ_INTERNAL_BASE + 31)
370 #define BCM_6358_PCMCIA_IRQ (IRQ_INTERNAL_BASE + 24)
372 extern const int *bcm63xx_irqs
;
374 static inline int bcm63xx_get_irq_number(enum bcm63xx_irq irq
)
376 return bcm63xx_irqs
[irq
];
380 * return installed memory size
382 unsigned int bcm63xx_get_memory_size(void);
384 #endif /* !BCM63XX_CPU_H_ */
This page took 0.068459 seconds and 5 git commands to generate.