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 BCM6348_CPU_ID 0x6348
13 #define BCM6358_CPU_ID 0x6358
15 void __init
bcm63xx_cpu_init(void);
16 u16
__bcm63xx_get_cpu_id(void);
17 u16
bcm63xx_get_cpu_rev(void);
18 unsigned int bcm63xx_get_cpu_freq(void);
20 #ifdef CONFIG_BCM63XX_CPU_6348
21 # ifdef bcm63xx_get_cpu_id
22 # undef bcm63xx_get_cpu_id
23 # define bcm63xx_get_cpu_id() __bcm63xx_get_cpu_id()
24 # define BCMCPU_RUNTIME_DETECT
26 # define bcm63xx_get_cpu_id() BCM6348_CPU_ID
28 # define BCMCPU_IS_6348() (bcm63xx_get_cpu_id() == BCM6348_CPU_ID)
30 # define BCMCPU_IS_6348() (0)
33 #ifdef CONFIG_BCM63XX_CPU_6358
34 # ifdef bcm63xx_get_cpu_id
35 # undef bcm63xx_get_cpu_id
36 # define bcm63xx_get_cpu_id() __bcm63xx_get_cpu_id()
37 # define BCMCPU_RUNTIME_DETECT
39 # define bcm63xx_get_cpu_id() BCM6358_CPU_ID
41 # define BCMCPU_IS_6358() (bcm63xx_get_cpu_id() == BCM6358_CPU_ID)
43 # define BCMCPU_IS_6358() (0)
46 #ifndef bcm63xx_get_cpu_id
47 #error "No CPU support configured"
51 * While registers sets are (mostly) the same across 63xx CPU, base
52 * address of these sets do change.
54 enum bcm63xx_regs_set
{
78 #define RSET_DSL_LMEM_SIZE (64 * 1024 * 4)
79 #define RSET_DSL_SIZE 4096
80 #define RSET_WDT_SIZE 12
81 #define RSET_ENET_SIZE 2048
82 #define RSET_ENETDMA_SIZE 2048
83 #define RSET_UART_SIZE 24
84 #define RSET_UDC_SIZE 256
85 #define RSET_OHCI_SIZE 256
86 #define RSET_EHCI_SIZE 256
87 #define RSET_PCMCIA_SIZE 12
90 * 6348 register sets base address
92 #define BCM_6348_DSL_LMEM_BASE (0xfff00000)
93 #define BCM_6348_PERF_BASE (0xfffe0000)
94 #define BCM_6348_TIMER_BASE (0xfffe0200)
95 #define BCM_6348_WDT_BASE (0xfffe021c)
96 #define BCM_6348_UART0_BASE (0xfffe0300)
97 #define BCM_6348_GPIO_BASE (0xfffe0400)
98 #define BCM_6348_SPI_BASE (0xfffe0c00)
99 #define BCM_6348_UDC0_BASE (0xfffe1000)
100 #define BCM_6348_OHCI0_BASE (0xfffe1b00)
101 #define BCM_6348_OHCI_PRIV_BASE (0xfffe1c00)
102 #define BCM_6348_USBH_PRIV_BASE (0xdeadbeef)
103 #define BCM_6348_MPI_BASE (0xfffe2000)
104 #define BCM_6348_PCMCIA_BASE (0xfffe2054)
105 #define BCM_6348_SDRAM_REGS_BASE (0xfffe2300)
106 #define BCM_6348_DSL_BASE (0xfffe3000)
107 #define BCM_6348_ENET0_BASE (0xfffe6000)
108 #define BCM_6348_ENET1_BASE (0xfffe6800)
109 #define BCM_6348_ENETDMA_BASE (0xfffe7000)
110 #define BCM_6348_EHCI0_BASE (0xdeadbeef)
111 #define BCM_6348_SDRAM_BASE (0xfffe2300)
112 #define BCM_6348_MEMC_BASE (0xdeadbeef)
113 #define BCM_6348_DDR_BASE (0xdeadbeef)
116 * 6358 register sets base address
118 #define BCM_6358_DSL_LMEM_BASE (0xfff00000)
119 #define BCM_6358_PERF_BASE (0xfffe0000)
120 #define BCM_6358_TIMER_BASE (0xfffe0040)
121 #define BCM_6358_WDT_BASE (0xfffe005c)
122 #define BCM_6358_UART0_BASE (0xfffe0100)
123 #define BCM_6358_GPIO_BASE (0xfffe0080)
124 #define BCM_6358_SPI_BASE (0xdeadbeef)
125 #define BCM_6358_UDC0_BASE (0xfffe0800)
126 #define BCM_6358_OHCI0_BASE (0xfffe1400)
127 #define BCM_6358_OHCI_PRIV_BASE (0xdeadbeef)
128 #define BCM_6358_USBH_PRIV_BASE (0xfffe1500)
129 #define BCM_6358_MPI_BASE (0xfffe1000)
130 #define BCM_6358_PCMCIA_BASE (0xfffe1054)
131 #define BCM_6358_SDRAM_REGS_BASE (0xfffe2300)
132 #define BCM_6358_DSL_BASE (0xfffe3000)
133 #define BCM_6358_ENET0_BASE (0xfffe4000)
134 #define BCM_6358_ENET1_BASE (0xfffe4800)
135 #define BCM_6358_ENETDMA_BASE (0xfffe5000)
136 #define BCM_6358_EHCI0_BASE (0xfffe1300)
137 #define BCM_6358_SDRAM_BASE (0xdeadbeef)
138 #define BCM_6358_MEMC_BASE (0xfffe1200)
139 #define BCM_6358_DDR_BASE (0xfffe12a0)
142 extern const unsigned long *bcm63xx_regs_base
;
144 static inline unsigned long bcm63xx_regset_address(enum bcm63xx_regs_set set
)
146 #ifdef BCMCPU_RUNTIME_DETECT
147 return bcm63xx_regs_base
[set
];
149 #ifdef CONFIG_BCM63XX_CPU_6348
152 return BCM_6348_DSL_LMEM_BASE
;
154 return BCM_6348_PERF_BASE
;
156 return BCM_6348_TIMER_BASE
;
158 return BCM_6348_WDT_BASE
;
160 return BCM_6348_UART0_BASE
;
162 return BCM_6348_GPIO_BASE
;
164 return BCM_6348_SPI_BASE
;
166 return BCM_6348_UDC0_BASE
;
168 return BCM_6348_OHCI0_BASE
;
170 return BCM_6348_OHCI_PRIV_BASE
;
172 return BCM_6348_USBH_PRIV_BASE
;
174 return BCM_6348_MPI_BASE
;
176 return BCM_6348_PCMCIA_BASE
;
178 return BCM_6348_DSL_BASE
;
180 return BCM_6348_ENET0_BASE
;
182 return BCM_6348_ENET1_BASE
;
184 return BCM_6348_ENETDMA_BASE
;
186 return BCM_6348_EHCI0_BASE
;
188 return BCM_6348_SDRAM_BASE
;
190 return BCM_6348_MEMC_BASE
;
192 return BCM_6348_DDR_BASE
;
195 #ifdef CONFIG_BCM63XX_CPU_6358
198 return BCM_6358_DSL_LMEM_BASE
;
200 return BCM_6358_PERF_BASE
;
202 return BCM_6358_TIMER_BASE
;
204 return BCM_6358_WDT_BASE
;
206 return BCM_6358_UART0_BASE
;
208 return BCM_6358_GPIO_BASE
;
210 return BCM_6358_SPI_BASE
;
212 return BCM_6358_UDC0_BASE
;
214 return BCM_6358_OHCI0_BASE
;
216 return BCM_6358_OHCI_PRIV_BASE
;
218 return BCM_6358_USBH_PRIV_BASE
;
220 return BCM_6358_MPI_BASE
;
222 return BCM_6358_PCMCIA_BASE
;
224 return BCM_6358_ENET0_BASE
;
226 return BCM_6358_ENET1_BASE
;
228 return BCM_6358_ENETDMA_BASE
;
230 return BCM_6358_DSL_BASE
;
232 return BCM_6358_EHCI0_BASE
;
234 return BCM_6358_SDRAM_BASE
;
236 return BCM_6358_MEMC_BASE
;
238 return BCM_6358_DDR_BASE
;
247 * IRQ number changes across CPU too
270 #define BCM_6348_TIMER_IRQ (IRQ_INTERNAL_BASE + 0)
271 #define BCM_6348_UART0_IRQ (IRQ_INTERNAL_BASE + 2)
272 #define BCM_6348_DSL_IRQ (IRQ_INTERNAL_BASE + 4)
273 #define BCM_6348_ENET1_IRQ (IRQ_INTERNAL_BASE + 7)
274 #define BCM_6348_ENET0_IRQ (IRQ_INTERNAL_BASE + 8)
275 #define BCM_6348_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 9)
276 #define BCM_6348_OHCI0_IRQ (IRQ_INTERNAL_BASE + 12)
277 #define BCM_6348_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 20)
278 #define BCM_6348_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 21)
279 #define BCM_6348_ENET1_RXDMA_IRQ (IRQ_INTERNAL_BASE + 22)
280 #define BCM_6348_ENET1_TXDMA_IRQ (IRQ_INTERNAL_BASE + 23)
281 #define BCM_6348_PCMCIA_IRQ (IRQ_INTERNAL_BASE + 24)
282 #define BCM_6348_PCI_IRQ (IRQ_INTERNAL_BASE + 24)
287 #define BCM_6358_TIMER_IRQ (IRQ_INTERNAL_BASE + 0)
288 #define BCM_6358_UART0_IRQ (IRQ_INTERNAL_BASE + 2)
289 #define BCM_6358_OHCI0_IRQ (IRQ_INTERNAL_BASE + 5)
290 #define BCM_6358_ENET1_IRQ (IRQ_INTERNAL_BASE + 6)
291 #define BCM_6358_ENET0_IRQ (IRQ_INTERNAL_BASE + 8)
292 #define BCM_6358_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 9)
293 #define BCM_6358_EHCI0_IRQ (IRQ_INTERNAL_BASE + 10)
294 #define BCM_6358_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 15)
295 #define BCM_6358_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 16)
296 #define BCM_6358_ENET1_RXDMA_IRQ (IRQ_INTERNAL_BASE + 17)
297 #define BCM_6358_ENET1_TXDMA_IRQ (IRQ_INTERNAL_BASE + 18)
298 #define BCM_6358_DSL_IRQ (IRQ_INTERNAL_BASE + 29)
299 #define BCM_6358_PCI_IRQ (IRQ_INTERNAL_BASE + 31)
300 #define BCM_6358_PCMCIA_IRQ (IRQ_INTERNAL_BASE + 24)
302 extern const int *bcm63xx_irqs
;
304 static inline int bcm63xx_get_irq_number(enum bcm63xx_irq irq
)
306 return bcm63xx_irqs
[irq
];
310 * return installed memory size
312 unsigned int bcm63xx_get_memory_size(void);
314 #endif /* !BCM63XX_CPU_H_ */
This page took 0.049278 seconds and 5 git commands to generate.