brcm63xx: add NULL clock fix send upstream
[openwrt/openwrt.git] / target / linux / brcm63xx / patches-4.4 / 339-MIPS-BCM63XX-add-support-for-BCM63268.patch
1 From 98f63141190ac02c58b78d58f771bd263c61d756 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Sat, 7 Dec 2013 17:14:17 +0100
4 Subject: [PATCH 48/56] MIPS: BCM63XX: add support for BCM63268
5
6 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
7 ---
8 arch/mips/bcm63xx/Kconfig | 5 +
9 arch/mips/bcm63xx/boards/board_bcm963xx.c | 2 +-
10 arch/mips/bcm63xx/clk.c | 25 ++++-
11 arch/mips/bcm63xx/cpu.c | 59 +++++++++-
12 arch/mips/bcm63xx/dev-flash.c | 6 +
13 arch/mips/bcm63xx/dev-spi.c | 4 +-
14 arch/mips/bcm63xx/irq.c | 20 +++-
15 arch/mips/bcm63xx/reset.c | 21 ++++
16 arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h | 130 ++++++++++++++++++++++
17 arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h | 2 +
18 arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h | 79 +++++++++++++
19 arch/mips/include/asm/mach-bcm63xx/ioremap.h | 1 +
20 12 files changed, 342 insertions(+), 12 deletions(-)
21
22 --- a/arch/mips/bcm63xx/Kconfig
23 +++ b/arch/mips/bcm63xx/Kconfig
24 @@ -60,6 +60,11 @@ config BCM63XX_CPU_6368
25 select HW_HAS_PCI
26 select BCM63XX_OHCI
27 select BCM63XX_EHCI
28 +
29 +config BCM63XX_CPU_63268
30 + bool "support 63268 CPU"
31 + select SYS_HAS_CPU_BMIPS4350
32 + select HW_HAS_PCI
33 endmenu
34
35 source "arch/mips/bcm63xx/boards/Kconfig"
36 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
37 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
38 @@ -713,7 +713,7 @@ void __init board_prom_init(void)
39 /* read base address of boot chip select (0)
40 * 6328/6362 do not have MPI but boot from a fixed address
41 */
42 - if (BCMCPU_IS_6328() || BCMCPU_IS_6362()) {
43 + if (BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_63268()) {
44 val = 0x18000000;
45 } else {
46 val = bcm_mpi_readl(MPI_CSBASE_REG(0));
47 --- a/arch/mips/bcm63xx/clk.c
48 +++ b/arch/mips/bcm63xx/clk.c
49 @@ -133,6 +133,8 @@ static void enetsw_set(struct clk *clk,
50 CKCTL_6368_SWPKT_USB_EN |
51 CKCTL_6368_SWPKT_SAR_EN,
52 enable);
53 + else if (BCMCPU_IS_63268())
54 + bcm_hwclock_set(CKCTL_63268_ROBOSW_EN, enable);
55 else
56 return;
57
58 @@ -177,6 +179,8 @@ static void usbh_set(struct clk *clk, in
59 bcm_hwclock_set(CKCTL_6362_USBH_EN, enable);
60 else if (BCMCPU_IS_6368())
61 bcm_hwclock_set(CKCTL_6368_USBH_EN, enable);
62 + else if (BCMCPU_IS_63268())
63 + bcm_hwclock_set(CKCTL_63268_USBH_EN, enable);
64 else
65 return;
66
67 @@ -199,6 +203,8 @@ static void usbd_set(struct clk *clk, in
68 bcm_hwclock_set(CKCTL_6362_USBD_EN, enable);
69 else if (BCMCPU_IS_6368())
70 bcm_hwclock_set(CKCTL_6368_USBD_EN, enable);
71 + else if (BCMCPU_IS_63268())
72 + bcm_hwclock_set(CKCTL_63268_USBD_EN, enable);
73 else
74 return;
75
76 @@ -225,9 +231,13 @@ static void spi_set(struct clk *clk, int
77 mask = CKCTL_6358_SPI_EN;
78 else if (BCMCPU_IS_6362())
79 mask = CKCTL_6362_SPI_EN;
80 - else
81 - /* BCMCPU_IS_6368 */
82 + else if (BCMCPU_IS_6368())
83 mask = CKCTL_6368_SPI_EN;
84 + else if (BCMCPU_IS_63268())
85 + mask = CKCTL_63268_SPI_EN;
86 + else
87 + return;
88 +
89 bcm_hwclock_set(mask, enable);
90 }
91
92 @@ -246,6 +256,8 @@ static void hsspi_set(struct clk *clk, i
93 mask = CKCTL_6328_HSSPI_EN;
94 else if (BCMCPU_IS_6362())
95 mask = CKCTL_6362_HSSPI_EN;
96 + else if (BCMCPU_IS_63268())
97 + mask = CKCTL_63268_HSSPI_EN;
98 else
99 return;
100
101 @@ -307,6 +319,8 @@ static void pcie_set(struct clk *clk, in
102 bcm_hwclock_set(CKCTL_6328_PCIE_EN, enable);
103 else if (BCMCPU_IS_6362())
104 bcm_hwclock_set(CKCTL_6362_PCIE_EN, enable);
105 + else if (BCMCPU_IS_63268())
106 + bcm_hwclock_set(CKCTL_63268_PCIE_EN, enable);
107 }
108
109 static struct clk clk_pcie = {
110 @@ -389,9 +403,11 @@ struct clk *clk_get(struct device *dev,
111 return &clk_periph;
112 if ((BCMCPU_IS_3368() || BCMCPU_IS_6358()) && !strcmp(id, "pcm"))
113 return &clk_pcm;
114 - if ((BCMCPU_IS_6362() || BCMCPU_IS_6368()) && !strcmp(id, "ipsec"))
115 + if ((BCMCPU_IS_6362() || BCMCPU_IS_6368() || BCMCPU_IS_63268()) &&
116 + !strcmp(id, "ipsec"))
117 return &clk_ipsec;
118 - if ((BCMCPU_IS_6328() || BCMCPU_IS_6362()) && !strcmp(id, "pcie"))
119 + if ((BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_63268()) &&
120 + !strcmp(id, "pcie"))
121 return &clk_pcie;
122 return ERR_PTR(-ENOENT);
123 }
124 @@ -414,6 +430,7 @@ static int __init bcm63xx_clk_init(void)
125 clk_hsspi.rate = HSSPI_PLL_HZ_6328;
126 break;
127 case BCM6362_CPU_ID:
128 + case BCM63268_CPU_ID:
129 clk_hsspi.rate = HSSPI_PLL_HZ_6362;
130 break;
131 }
132 --- a/arch/mips/bcm63xx/cpu.c
133 +++ b/arch/mips/bcm63xx/cpu.c
134 @@ -101,6 +101,15 @@ static const int bcm6368_irqs[] = {
135
136 };
137
138 +static const unsigned long bcm63268_regs_base[] = {
139 + __GEN_CPU_REGS_TABLE(63268)
140 +};
141 +
142 +static const int bcm63268_irqs[] = {
143 + __GEN_CPU_IRQ_TABLE(63268)
144 +
145 +};
146 +
147 u32 bcm63xx_get_cpu_variant(void)
148 {
149 return bcm63xx_cpu_variant;
150 @@ -253,6 +262,27 @@ static unsigned int detect_cpu_clock(voi
151
152 return (((64 * 1000000) / p1) * p2 * ndiv) / m1;
153 }
154 + case BCM63268_CPU_ID:
155 + {
156 + unsigned int tmp, mips_pll_fcvo;
157 +
158 + tmp = bcm_misc_readl(MISC_STRAPBUS_63268_REG);
159 + mips_pll_fcvo = (tmp & STRAPBUS_63268_FCVO_MASK) >>
160 + STRAPBUS_63268_FCVO_SHIFT;
161 + switch (mips_pll_fcvo) {
162 + case 0x3:
163 + case 0xe:
164 + return 320000000;
165 + case 0xa:
166 + return 333000000;
167 + case 0x2:
168 + case 0xb:
169 + case 0xf:
170 + return 400000000;
171 + default:
172 + return 0;
173 + }
174 + }
175
176 default:
177 panic("Failed to detect clock for CPU with id=%04X\n", cpu_id);
178 @@ -267,7 +297,7 @@ static unsigned int detect_memory_size(v
179 unsigned int cols = 0, rows = 0, is_32bits = 0, banks = 0;
180 u32 val;
181
182 - if (BCMCPU_IS_6328() || BCMCPU_IS_6362())
183 + if (BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_63268())
184 return bcm_ddr_readl(DDR_CSEND_REG) << 24;
185
186 if (BCMCPU_IS_6345()) {
187 @@ -305,6 +335,7 @@ void __init bcm63xx_cpu_init(void)
188 unsigned int tmp;
189 unsigned int cpu = smp_processor_id();
190 u32 chipid_reg;
191 + bool long_chipid = false;
192 u8 __maybe_unused varid = 0;
193
194 /* soc registers location depends on cpu type */
195 @@ -326,6 +357,9 @@ void __init bcm63xx_cpu_init(void)
196 case 0x10:
197 chipid_reg = BCM_6345_PERF_BASE;
198 break;
199 + case 0x80:
200 + long_chipid = true;
201 + /* fall-through */
202 default:
203 chipid_reg = BCM_6368_PERF_BASE;
204 break;
205 @@ -333,6 +367,7 @@ void __init bcm63xx_cpu_init(void)
206 break;
207 }
208
209 +
210 /*
211 * really early to panic, but delaying panic would not help since we
212 * will never get any working console
213 @@ -342,10 +377,17 @@ void __init bcm63xx_cpu_init(void)
214
215 /* read out CPU type */
216 tmp = bcm_readl(chipid_reg);
217 - bcm63xx_cpu_id = (tmp & REV_CHIPID_MASK) >> REV_CHIPID_SHIFT;
218 - bcm63xx_cpu_variant = bcm63xx_cpu_id;
219 +
220 + if (long_chipid) {
221 + bcm63xx_cpu_id = tmp & REV_LONG_CHIPID_MASK;
222 + bcm63xx_cpu_id >>= REV_LONG_CHIPID_SHIFT;
223 + } else {
224 + bcm63xx_cpu_id = (tmp & REV_CHIPID_MASK) >> REV_CHIPID_SHIFT;
225 + varid = (tmp & REV_VARID_MASK) >> REV_VARID_SHIFT;
226 + }
227 +
228 bcm63xx_cpu_rev = (tmp & REV_REVID_MASK) >> REV_REVID_SHIFT;
229 - varid = (tmp & REV_VARID_MASK) >> REV_VARID_SHIFT;
230 + bcm63xx_cpu_variant = bcm63xx_cpu_id;
231
232 switch (bcm63xx_cpu_id) {
233 case BCM3368_CPU_ID:
234 @@ -400,6 +442,15 @@ void __init bcm63xx_cpu_init(void)
235 /* BCM6369 is a BCM6368 without xDSL, so treat it the same */
236 bcm63xx_cpu_id = BCM6368_CPU_ID;
237 break;
238 + case BCM63168_CPU_ID:
239 + case BCM63169_CPU_ID:
240 + case BCM63268_CPU_ID:
241 + case BCM63269_CPU_ID:
242 + bcm63xx_regs_base = bcm63268_regs_base;
243 + bcm63xx_irqs = bcm63268_irqs;
244 +
245 + bcm63xx_cpu_id = BCM63268_CPU_ID;
246 + break;
247 default:
248 panic("unsupported broadcom CPU %x", bcm63xx_cpu_id);
249 break;
250 --- a/arch/mips/bcm63xx/dev-flash.c
251 +++ b/arch/mips/bcm63xx/dev-flash.c
252 @@ -94,6 +94,12 @@ static int __init bcm63xx_detect_flash_t
253 case STRAPBUS_6368_BOOT_SEL_PARALLEL:
254 return BCM63XX_FLASH_TYPE_PARALLEL;
255 }
256 + case BCM63268_CPU_ID:
257 + val = bcm_misc_readl(MISC_STRAPBUS_63268_REG);
258 + if (val & STRAPBUS_63268_BOOT_SEL_SERIAL)
259 + return BCM63XX_FLASH_TYPE_SERIAL;
260 + else
261 + return BCM63XX_FLASH_TYPE_NAND;
262 default:
263 return -EINVAL;
264 }
265 --- a/arch/mips/bcm63xx/dev-spi.c
266 +++ b/arch/mips/bcm63xx/dev-spi.c
267 @@ -51,7 +51,7 @@ int __init bcm63xx_spi_register(void)
268 }
269
270 if (BCMCPU_IS_3368() || BCMCPU_IS_6358() || BCMCPU_IS_6362() ||
271 - BCMCPU_IS_6368()) {
272 + BCMCPU_IS_6368() || BCMCPU_IS_63268()) {
273 bcm63xx_spi_device.name = "bcm6358-spi",
274 spi_resources[0].end += BCM_6358_RSET_SPI_SIZE - 1;
275 }
276 --- a/arch/mips/bcm63xx/irq.c
277 +++ b/arch/mips/bcm63xx/irq.c
278 @@ -150,6 +150,20 @@ void __init arch_init_irq(void)
279 ext_irqs[5] = BCM_6368_EXT_IRQ5;
280 ext_shift = 4;
281 break;
282 + case BCM63268_CPU_ID:
283 + periph_bases[0] += PERF_IRQMASK_63268_REG(0);
284 + periph_bases[1] += PERF_IRQMASK_63268_REG(1);
285 + periph_irq_count = 2;
286 + periph_width = 4;
287 +
288 + ext_intc_bases[0] += PERF_EXTIRQ_CFG_REG_63268;
289 + ext_irq_count = 4;
290 + ext_irqs[0] = BCM_63268_EXT_IRQ0;
291 + ext_irqs[1] = BCM_63268_EXT_IRQ1;
292 + ext_irqs[2] = BCM_63268_EXT_IRQ2;
293 + ext_irqs[3] = BCM_63268_EXT_IRQ3;
294 + ext_shift = 4;
295 + break;
296 default:
297 BUG();
298 }
299 --- a/arch/mips/bcm63xx/reset.c
300 +++ b/arch/mips/bcm63xx/reset.c
301 @@ -125,6 +125,20 @@
302 #define BCM6368_RESET_PCIE 0
303 #define BCM6368_RESET_PCIE_EXT 0
304
305 +#define BCM63268_RESET_SPI SOFTRESET_63268_SPI_MASK
306 +#define BCM63268_RESET_ENET 0
307 +#define BCM63268_RESET_USBH SOFTRESET_63268_USBH_MASK
308 +#define BCM63268_RESET_USBD SOFTRESET_63268_USBS_MASK
309 +#define BCM63268_RESET_DSL 0
310 +#define BCM63268_RESET_SAR SOFTRESET_63268_SAR_MASK
311 +#define BCM63268_RESET_EPHY 0
312 +#define BCM63268_RESET_ENETSW SOFTRESET_63268_ENETSW_MASK
313 +#define BCM63268_RESET_PCM SOFTRESET_63268_PCM_MASK
314 +#define BCM63268_RESET_MPI 0
315 +#define BCM63268_RESET_PCIE (SOFTRESET_63268_PCIE_MASK | \
316 + SOFTRESET_63268_PCIE_CORE_MASK)
317 +#define BCM63268_RESET_PCIE_EXT SOFTRESET_63268_PCIE_EXT_MASK
318 +
319 /*
320 * core reset bits
321 */
322 @@ -156,6 +170,10 @@ static const u32 bcm6368_reset_bits[] =
323 __GEN_RESET_BITS_TABLE(6368)
324 };
325
326 +static const u32 bcm63268_reset_bits[] = {
327 + __GEN_RESET_BITS_TABLE(63268)
328 +};
329 +
330 const u32 *bcm63xx_reset_bits;
331 static int reset_reg;
332
333 @@ -182,6 +200,9 @@ static int __init bcm63xx_reset_bits_ini
334 } else if (BCMCPU_IS_6368()) {
335 reset_reg = PERF_SOFTRESET_6368_REG;
336 bcm63xx_reset_bits = bcm6368_reset_bits;
337 + } else if (BCMCPU_IS_63268()) {
338 + reset_reg = PERF_SOFTRESET_63268_REG;
339 + bcm63xx_reset_bits = bcm63268_reset_bits;
340 }
341
342 return 0;
343 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
344 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
345 @@ -21,6 +21,10 @@
346 #define BCM6362_CPU_ID 0x6362
347 #define BCM6368_CPU_ID 0x6368
348 #define BCM6369_CPU_ID 0x6369
349 +#define BCM63168_CPU_ID 0x63168
350 +#define BCM63169_CPU_ID 0x63169
351 +#define BCM63268_CPU_ID 0x63268
352 +#define BCM63269_CPU_ID 0x63269
353
354 void __init bcm63xx_cpu_init(void);
355 u32 bcm63xx_get_cpu_variant(void);
356 @@ -61,6 +65,10 @@ static inline u32 __pure __bcm63xx_get_c
357 #ifdef CONFIG_BCM63XX_CPU_6368
358 case BCM6368_CPU_ID:
359 #endif
360 +
361 +#ifdef CONFIG_BCM63XX_CPU_63268
362 + case BCM63268_CPU_ID:
363 +#endif
364 break;
365 default:
366 unreachable();
367 @@ -86,6 +94,7 @@ static inline u32 __pure bcm63xx_get_cpu
368 #define BCMCPU_IS_6358() (bcm63xx_get_cpu_id() == BCM6358_CPU_ID)
369 #define BCMCPU_IS_6362() (bcm63xx_get_cpu_id() == BCM6362_CPU_ID)
370 #define BCMCPU_IS_6368() (bcm63xx_get_cpu_id() == BCM6368_CPU_ID)
371 +#define BCMCPU_IS_63268() (bcm63xx_get_cpu_id() == BCM63268_CPU_ID)
372
373 #define BCMCPU_VARIANT_IS_3368() \
374 (bcm63xx_get_cpu_variant() == BCM3368_CPU_ID)
375 @@ -109,6 +118,14 @@ static inline u32 __pure bcm63xx_get_cpu
376 (bcm63xx_get_cpu_variant() == BCM6368_CPU_ID)
377 #define BCMCPU_VARIANT_IS_6369() \
378 (bcm63xx_get_cpu_variant() == BCM6369_CPU_ID)
379 +#define BCMCPU_VARIANT_IS_63168() \
380 + (bcm63xx_get_cpu_variant() == BCM63168_CPU_ID)
381 +#define BCMCPU_VARIANT_IS_63169() \
382 + (bcm63xx_get_cpu_variant() == BCM63169_CPU_ID)
383 +#define BCMCPU_VARIANT_IS_63268() \
384 + (bcm63xx_get_cpu_variant() == BCM63268_CPU_ID)
385 +#define BCMCPU_VARIANT_IS_63269() \
386 + (bcm63xx_get_cpu_variant() == BCM63269_CPU_ID)
387
388 /*
389 * While registers sets are (mostly) the same across 63xx CPU, base
390 @@ -573,6 +590,52 @@ enum bcm63xx_regs_set {
391 #define BCM_6368_RNG_BASE (0xb0004180)
392 #define BCM_6368_MISC_BASE (0xdeadbeef)
393
394 +/*
395 + * 63268 register sets base address
396 + */
397 +#define BCM_63268_DSL_LMEM_BASE (0xdeadbeef)
398 +#define BCM_63268_PERF_BASE (0xb0000000)
399 +#define BCM_63268_TIMER_BASE (0xb0000080)
400 +#define BCM_63268_WDT_BASE (0xb000009c)
401 +#define BCM_63268_UART0_BASE (0xb0000180)
402 +#define BCM_63268_UART1_BASE (0xb00001a0)
403 +#define BCM_63268_GPIO_BASE (0xb00000c0)
404 +#define BCM_63268_SPI_BASE (0xb0000800)
405 +#define BCM_63268_HSSPI_BASE (0xb0001000)
406 +#define BCM_63268_UDC0_BASE (0xdeadbeef)
407 +#define BCM_63268_USBDMA_BASE (0xb000c800)
408 +#define BCM_63268_OHCI0_BASE (0xb0002600)
409 +#define BCM_63268_OHCI_PRIV_BASE (0xdeadbeef)
410 +#define BCM_63268_USBH_PRIV_BASE (0xb0002700)
411 +#define BCM_63268_USBD_BASE (0xb0002400)
412 +#define BCM_63268_MPI_BASE (0xdeadbeef)
413 +#define BCM_63268_PCMCIA_BASE (0xdeadbeef)
414 +#define BCM_63268_PCIE_BASE (0xb06e0000)
415 +#define BCM_63268_SDRAM_REGS_BASE (0xdeadbeef)
416 +#define BCM_63268_DSL_BASE (0xdeadbeef)
417 +#define BCM_63268_UBUS_BASE (0xdeadbeef)
418 +#define BCM_63268_ENET0_BASE (0xdeadbeef)
419 +#define BCM_63268_ENET1_BASE (0xdeadbeef)
420 +#define BCM_63268_ENETDMA_BASE (0xb000d800)
421 +#define BCM_63268_ENETDMAC_BASE (0xb000da00)
422 +#define BCM_63268_ENETDMAS_BASE (0xb000dc00)
423 +#define BCM_63268_ENETSW_BASE (0xb0700000)
424 +#define BCM_63268_EHCI0_BASE (0xb0002500)
425 +#define BCM_63268_SDRAM_BASE (0xdeadbeef)
426 +#define BCM_63268_MEMC_BASE (0xdeadbeef)
427 +#define BCM_63268_DDR_BASE (0xb0003000)
428 +#define BCM_63268_M2M_BASE (0xdeadbeef)
429 +#define BCM_63268_ATM_BASE (0xdeadbeef)
430 +#define BCM_63268_XTM_BASE (0xb0007000)
431 +#define BCM_63268_XTMDMA_BASE (0xb000b800)
432 +#define BCM_63268_XTMDMAC_BASE (0xdeadbeef)
433 +#define BCM_63268_XTMDMAS_BASE (0xdeadbeef)
434 +#define BCM_63268_PCM_BASE (0xb000b000)
435 +#define BCM_63268_PCMDMA_BASE (0xb000b800)
436 +#define BCM_63268_PCMDMAC_BASE (0xdeadbeef)
437 +#define BCM_63268_PCMDMAS_BASE (0xdeadbeef)
438 +#define BCM_63268_RNG_BASE (0xdeadbeef)
439 +#define BCM_63268_MISC_BASE (0xb0001800)
440
441 extern const unsigned long *bcm63xx_regs_base;
442
443 @@ -1041,6 +1104,73 @@ enum bcm63xx_irq {
444 #define BCM_6368_EXT_IRQ4 (IRQ_INTERNAL_BASE + 24)
445 #define BCM_6368_EXT_IRQ5 (IRQ_INTERNAL_BASE + 25)
446
447 +/*
448 + * 63268 irqs
449 + */
450 +#define BCM_63268_HIGH_IRQ_BASE (IRQ_INTERNAL_BASE + 32)
451 +#define BCM_63268_VERY_HIGH_IRQ_BASE (BCM_63268_HIGH_IRQ_BASE + 32)
452 +
453 +#define BCM_63268_TIMER_IRQ (IRQ_INTERNAL_BASE + 0)
454 +#define BCM_63268_SPI_IRQ (BCM_63268_VERY_HIGH_IRQ_BASE + 16)
455 +#define BCM_63268_UART0_IRQ (IRQ_INTERNAL_BASE + 5)
456 +#define BCM_63268_UART1_IRQ (BCM_63268_HIGH_IRQ_BASE + 2)
457 +#define BCM_63268_DSL_IRQ (IRQ_INTERNAL_BASE + 23)
458 +#define BCM_63268_UDC0_IRQ 0
459 +#define BCM_63268_ENET0_IRQ 0
460 +#define BCM_63268_ENET1_IRQ 0
461 +#define BCM_63268_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 13)
462 +#define BCM_63268_HSSPI_IRQ (IRQ_INTERNAL_BASE + 6)
463 +#define BCM_63268_OHCI0_IRQ (IRQ_INTERNAL_BASE + 9)
464 +#define BCM_63268_EHCI0_IRQ (IRQ_INTERNAL_BASE + 10)
465 +#define BCM_63268_USBD_IRQ (IRQ_INTERNAL_BASE + 11)
466 +#define BCM_63268_USBD_RXDMA0_IRQ (IRQ_INTERNAL_BASE + 19)
467 +#define BCM_63268_USBD_TXDMA0_IRQ (BCM_63268_HIGH_IRQ_BASE + 4)
468 +#define BCM_63268_USBD_RXDMA1_IRQ (IRQ_INTERNAL_BASE + 20)
469 +#define BCM_63268_USBD_TXDMA1_IRQ (BCM_63268_HIGH_IRQ_BASE + 5)
470 +#define BCM_63268_USBD_RXDMA2_IRQ (IRQ_INTERNAL_BASE + 21)
471 +#define BCM_63268_USBD_TXDMA2_IRQ (BCM_63268_HIGH_IRQ_BASE + 6)
472 +#define BCM_63268_PCMCIA_IRQ 0
473 +#define BCM_63268_ENET0_RXDMA_IRQ 0
474 +#define BCM_63268_ENET0_TXDMA_IRQ 0
475 +#define BCM_63268_ENET1_RXDMA_IRQ 0
476 +#define BCM_63268_ENET1_TXDMA_IRQ 0
477 +#define BCM_63268_PCI_IRQ (BCM_63268_HIGH_IRQ_BASE + 8)
478 +#define BCM_63268_ATM_IRQ 0
479 +#define BCM_63268_ENETSW_RXDMA0_IRQ (IRQ_INTERNAL_BASE + 1)
480 +#define BCM_63268_ENETSW_RXDMA1_IRQ (IRQ_INTERNAL_BASE + 2)
481 +#define BCM_63268_ENETSW_RXDMA2_IRQ (IRQ_INTERNAL_BASE + 3)
482 +#define BCM_63268_ENETSW_RXDMA3_IRQ (IRQ_INTERNAL_BASE + 4)
483 +#define BCM_63268_ENETSW_TXDMA0_IRQ (BCM_63268_VERY_HIGH_IRQ_BASE + 0)
484 +#define BCM_63268_ENETSW_TXDMA1_IRQ (BCM_63268_VERY_HIGH_IRQ_BASE + 1)
485 +#define BCM_63268_ENETSW_TXDMA2_IRQ (BCM_63268_VERY_HIGH_IRQ_BASE + 2)
486 +#define BCM_63268_ENETSW_TXDMA3_IRQ (BCM_63268_VERY_HIGH_IRQ_BASE + 3)
487 +#define BCM_63268_XTM_IRQ (BCM_63268_HIGH_IRQ_BASE + 17)
488 +#define BCM_63268_XTM_DMA0_IRQ (IRQ_INTERNAL_BASE + 26)
489 +
490 +#define BCM_63268_RING_OSC_IRQ (BCM_63268_HIGH_IRQ_BASE + 20)
491 +#define BCM_63268_WLAN_GPIO_IRQ (BCM_63268_HIGH_IRQ_BASE + 3)
492 +#define BCM_63268_WLAN_IRQ (IRQ_INTERNAL_BASE + 7)
493 +#define BCM_63268_IPSEC_IRQ (IRQ_INTERNAL_BASE + 8)
494 +#define BCM_63268_NAND_IRQ (BCM_63268_HIGH_IRQ_BASE + 18)
495 +#define BCM_63268_PCM_IRQ (IRQ_INTERNAL_BASE + 13)
496 +#define BCM_63268_DG_IRQ (IRQ_INTERNAL_BASE + 15)
497 +#define BCM_63268_EPHY_ENERGY0_IRQ (IRQ_INTERNAL_BASE + 16)
498 +#define BCM_63268_EPHY_ENERGY1_IRQ (IRQ_INTERNAL_BASE + 17)
499 +#define BCM_63268_EPHY_ENERGY2_IRQ (IRQ_INTERNAL_BASE + 18)
500 +#define BCM_63268_EPHY_ENERGY3_IRQ (IRQ_INTERNAL_BASE + 19)
501 +#define BCM_63268_IPSEC_DMA0_IRQ (IRQ_INTERNAL_BASE + 22)
502 +#define BCM_63268_IPSEC_DMA1_IRQ (BCM_63268_HIGH_IRQ_BASE + 7)
503 +#define BCM_63268_FAP0_IRQ (IRQ_INTERNAL_BASE + 24)
504 +#define BCM_63268_FAP1_IRQ (IRQ_INTERNAL_BASE + 25)
505 +#define BCM_63268_PCM_DMA0_IRQ (BCM_63268_HIGH_IRQ_BASE + 10)
506 +#define BCM_63268_PCM_DMA1_IRQ (BCM_63268_HIGH_IRQ_BASE + 11)
507 +#define BCM_63268_DECT0_IRQ (BCM_63268_HIGH_IRQ_BASE + 0)
508 +#define BCM_63268_DECT1_IRQ (BCM_63268_HIGH_IRQ_BASE + 1)
509 +#define BCM_63268_EXT_IRQ0 (BCM_63268_HIGH_IRQ_BASE + 12)
510 +#define BCM_63268_EXT_IRQ1 (BCM_63268_HIGH_IRQ_BASE + 13)
511 +#define BCM_63268_EXT_IRQ2 (BCM_63268_HIGH_IRQ_BASE + 14)
512 +#define BCM_63268_EXT_IRQ3 (BCM_63268_HIGH_IRQ_BASE + 15)
513 +
514 extern const int *bcm63xx_irqs;
515
516 #define __GEN_CPU_IRQ_TABLE(__cpu) \
517 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h
518 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h
519 @@ -22,6 +22,8 @@ static inline unsigned long bcm63xx_gpio
520 return 48;
521 case BCM6368_CPU_ID:
522 return 38;
523 + case BCM63268_CPU_ID:
524 + return 52;
525 case BCM6348_CPU_ID:
526 default:
527 return 37;
528 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
529 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
530 @@ -9,6 +9,8 @@
531 #define PERF_REV_REG 0x0
532 #define REV_CHIPID_SHIFT 16
533 #define REV_CHIPID_MASK (0xffff << REV_CHIPID_SHIFT)
534 +#define REV_LONG_CHIPID_SHIFT 12
535 +#define REV_LONG_CHIPID_MASK (0xfffff << REV_LONG_CHIPID_SHIFT)
536 #define REV_VARID_SHIFT 12
537 #define REV_VARID_MASK (0xf << REV_VARID_SHIFT)
538 #define REV_REVID_SHIFT 0
539 @@ -211,6 +213,52 @@
540 CKCTL_6368_NAND_EN | \
541 CKCTL_6368_IPSEC_EN)
542
543 +#define CKCTL_63268_DISABLE_GLESS (1 << 0)
544 +#define CKCTL_63268_VDSL_QPROC_EN (1 << 1)
545 +#define CKCTL_63268_VDSL_AFE_EN (1 << 2)
546 +#define CKCTL_63268_VDSL_EN (1 << 3)
547 +#define CKCTL_63268_MIPS_EN (1 << 4)
548 +#define CKCTL_63268_WLAN_OCP_EN (1 << 5)
549 +#define CKCTL_63268_DECT_EN (1 << 6)
550 +#define CKCTL_63268_FAP0_EN (1 << 7)
551 +#define CKCTL_63268_FAP1_EN (1 << 8)
552 +#define CKCTL_63268_SAR_EN (1 << 9)
553 +#define CKCTL_63268_ROBOSW_EN (1 << 10)
554 +#define CKCTL_63268_PCM_EN (1 << 11)
555 +#define CKCTL_63268_USBD_EN (1 << 12)
556 +#define CKCTL_63268_USBH_EN (1 << 13)
557 +#define CKCTL_63268_IPSEC_EN (1 << 14)
558 +#define CKCTL_63268_SPI_EN (1 << 15)
559 +#define CKCTL_63268_HSSPI_EN (1 << 16)
560 +#define CKCTL_63268_PCIE_EN (1 << 17)
561 +#define CKCTL_63268_PHYMIPS_EN (1 << 18)
562 +#define CKCTL_63268_GMAC_EN (1 << 19)
563 +#define CKCTL_63268_NAND_EN (1 << 20)
564 +#define CKCTL_63268_TBUS_EN (1 << 27)
565 +#define CKCTL_63268_ROBOSW250_EN (1 << 31)
566 +
567 +#define CKCTL_63268_ALL_SAFE_EN (CKCTL_63268_VDSL_QPROC_EN | \
568 + CKCTL_63268_VDSL_AFE_EN | \
569 + CKCTL_63268_VDSL_EN | \
570 + CKCTL_63268_WLAN_OCP_EN | \
571 + CKCTL_63268_DECT_EN | \
572 + CKCTL_63268_FAP0_EN | \
573 + CKCTL_63268_FAP1_EN | \
574 + CKCTL_63268_SAR_EN | \
575 + CKCTL_63268_ROBOSW_EN | \
576 + CKCTL_63268_PCM_EN | \
577 + CKCTL_63268_USBD_EN | \
578 + CKCTL_63268_USBH_EN | \
579 + CKCTL_63268_IPSEC_EN | \
580 + CKCTL_63268_SPI_EN | \
581 + CKCTL_63268_HSSPI_EN | \
582 + CKCTL_63268_PCIE_EN | \
583 + CKCTL_63268_PHYMIPS_EN | \
584 + CKCTL_63268_GMAC_EN | \
585 + CKCTL_63268_NAND_EN | \
586 + CKCTL_63268_TBUS_EN | \
587 + CKCTL_63268_ROBOSW250_EN)
588 +
589 /* System PLL Control register */
590 #define PERF_SYS_PLL_CTL_REG 0x8
591 #define SYS_PLL_SOFT_RESET 0x1
592 @@ -224,6 +272,7 @@
593 #define PERF_IRQMASK_6358_REG(x) (0xc + (x) * 0x2c)
594 #define PERF_IRQMASK_6362_REG(x) (0x20 + (x) * 0x10)
595 #define PERF_IRQMASK_6368_REG(x) (0x20 + (x) * 0x10)
596 +#define PERF_IRQMASK_63268_REG(x) (0x20 + (x) * 0x20)
597
598 /* Interrupt Status register */
599 #define PERF_IRQSTAT_3368_REG 0x10
600 @@ -234,6 +283,7 @@
601 #define PERF_IRQSTAT_6358_REG(x) (0x10 + (x) * 0x2c)
602 #define PERF_IRQSTAT_6362_REG(x) (0x28 + (x) * 0x10)
603 #define PERF_IRQSTAT_6368_REG(x) (0x28 + (x) * 0x10)
604 +#define PERF_IRQSTAT_63268_REG(x) (0x30 + (x) * 0x20)
605
606 /* External Interrupt Configuration register */
607 #define PERF_EXTIRQ_CFG_REG_3368 0x14
608 @@ -244,6 +294,7 @@
609 #define PERF_EXTIRQ_CFG_REG_6358 0x14
610 #define PERF_EXTIRQ_CFG_REG_6362 0x18
611 #define PERF_EXTIRQ_CFG_REG_6368 0x18
612 +#define PERF_EXTIRQ_CFG_REG_63268 0x18
613
614 #define PERF_EXTIRQ_CFG_REG2_6358 0x1c
615 #define PERF_EXTIRQ_CFG_REG2_6368 0x1c
616 @@ -274,6 +325,7 @@
617 #define PERF_SOFTRESET_6358_REG 0x34
618 #define PERF_SOFTRESET_6362_REG 0x10
619 #define PERF_SOFTRESET_6368_REG 0x10
620 +#define PERF_SOFTRESET_63268_REG 0x10
621
622 #define SOFTRESET_3368_SPI_MASK (1 << 0)
623 #define SOFTRESET_3368_ENET_MASK (1 << 2)
624 @@ -367,6 +419,26 @@
625 #define SOFTRESET_6368_USBH_MASK (1 << 12)
626 #define SOFTRESET_6368_PCM_MASK (1 << 13)
627
628 +#define SOFTRESET_63268_SPI_MASK (1 << 0)
629 +#define SOFTRESET_63268_IPSEC_MASK (1 << 1)
630 +#define SOFTRESET_63268_EPHY_MASK (1 << 2)
631 +#define SOFTRESET_63268_SAR_MASK (1 << 3)
632 +#define SOFTRESET_63268_ENETSW_MASK (1 << 4)
633 +#define SOFTRESET_63268_USBS_MASK (1 << 5)
634 +#define SOFTRESET_63268_USBH_MASK (1 << 6)
635 +#define SOFTRESET_63268_PCM_MASK (1 << 7)
636 +#define SOFTRESET_63268_PCIE_CORE_MASK (1 << 8)
637 +#define SOFTRESET_63268_PCIE_MASK (1 << 9)
638 +#define SOFTRESET_63268_PCIE_EXT_MASK (1 << 10)
639 +#define SOFTRESET_63268_WLAN_SHIM_MASK (1 << 11)
640 +#define SOFTRESET_63268_DDR_PHY_MASK (1 << 12)
641 +#define SOFTRESET_63268_FAP0_MASK (1 << 13)
642 +#define SOFTRESET_63268_WLAN_UBUS_MASK (1 << 14)
643 +#define SOFTRESET_63268_DECT_MASK (1 << 15)
644 +#define SOFTRESET_63268_FAP1_MASK (1 << 16)
645 +#define SOFTRESET_63268_PCIE_HARD_MASK (1 << 17)
646 +#define SOFTRESET_63268_GPHY_MASK (1 << 18)
647 +
648 /* MIPS PLL control register */
649 #define PERF_MIPSPLLCTL_REG 0x34
650 #define MIPSPLLCTL_N1_SHIFT 20
651 @@ -1366,6 +1438,13 @@
652 #define STRAPBUS_6362_BOOT_SEL_SERIAL (1 << 15)
653 #define STRAPBUS_6362_BOOT_SEL_NAND (0 << 15)
654
655 +#define MISC_STRAPBUS_63268_REG 0x14
656 +#define STRAPBUS_63268_HSSPI_CLK_FAST (1 << 9)
657 +#define STRAPBUS_63268_BOOT_SEL_SERIAL (1 << 11)
658 +#define STRAPBUS_63268_BOOT_SEL_NAND (0 << 11)
659 +#define STRAPBUS_63268_FCVO_SHIFT 21
660 +#define STRAPBUS_63268_FCVO_MASK (0xf << STRAPBUS_63268_FCVO_SHIFT)
661 +
662 #define MISC_STRAPBUS_6328_REG 0x240
663 #define STRAPBUS_6328_FCVO_SHIFT 7
664 #define STRAPBUS_6328_FCVO_MASK (0x1f << STRAPBUS_6328_FCVO_SHIFT)
665 --- a/arch/mips/include/asm/mach-bcm63xx/ioremap.h
666 +++ b/arch/mips/include/asm/mach-bcm63xx/ioremap.h
667 @@ -25,6 +25,7 @@ static inline int is_bcm63xx_internal_re
668 case BCM6328_CPU_ID:
669 case BCM6362_CPU_ID:
670 case BCM6368_CPU_ID:
671 + case BCM63268_CPU_ID:
672 if (offset >= 0xb0000000 && offset < 0xb1000000)
673 return 1;
674 break;
675 --- a/arch/mips/bcm63xx/dev-hsspi.c
676 +++ b/arch/mips/bcm63xx/dev-hsspi.c
677 @@ -35,7 +35,7 @@ static struct platform_device bcm63xx_hs
678
679 int __init bcm63xx_hsspi_register(void)
680 {
681 - if (!BCMCPU_IS_6328() && !BCMCPU_IS_6362())
682 + if (!BCMCPU_IS_6328() && !BCMCPU_IS_6362() && !BCMCPU_IS_63268())
683 return -ENODEV;
684
685 spi_resources[0].start = bcm63xx_regset_address(RSET_HSSPI);
686 --- a/arch/mips/bcm63xx/dev-enet.c
687 +++ b/arch/mips/bcm63xx/dev-enet.c
688 @@ -176,7 +176,8 @@ static int __init register_shared(void)
689 else
690 shared_res[0].end += (RSET_ENETDMA_SIZE) - 1;
691
692 - if (BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_6368())
693 + if (BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_6368() ||
694 + BCMCPU_IS_63268())
695 chan_count = 32;
696 else if (BCMCPU_IS_6345())
697 chan_count = 8;
698 @@ -276,7 +277,8 @@ bcm63xx_enetsw_register(const struct bcm
699 {
700 int ret;
701
702 - if (!BCMCPU_IS_6328() && !BCMCPU_IS_6362() && !BCMCPU_IS_6368())
703 + if (!BCMCPU_IS_6328() && !BCMCPU_IS_6362() && !BCMCPU_IS_6368() &&
704 + !BCMCPU_IS_63268())
705 return -ENODEV;
706
707 ret = register_shared();
708 @@ -297,6 +299,8 @@ bcm63xx_enetsw_register(const struct bcm
709 enetsw_pd.num_ports = ENETSW_PORTS_6328;
710 else if (BCMCPU_IS_6362() || BCMCPU_IS_6368())
711 enetsw_pd.num_ports = ENETSW_PORTS_6368;
712 + else if (BCMCPU_IS_63268())
713 + enetsw_pd.num_ports = ENETSW_PORTS_63268;
714
715 enetsw_pd.dma_has_sram = true;
716 enetsw_pd.dma_chan_width = ENETDMA_CHAN_WIDTH;
717 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h
718 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h
719 @@ -62,6 +62,7 @@ struct bcm63xx_enet_platform_data {
720 #define ENETSW_MAX_PORT 8
721 #define ENETSW_PORTS_6328 5 /* 4 FE PHY + 1 RGMII */
722 #define ENETSW_PORTS_6368 6 /* 4 FE PHY + 2 RGMII */
723 +#define ENETSW_PORTS_63268 8 /* 3 FE PHY + 1 GE PHY + 4 RGMII */
724
725 #define ENETSW_RGMII_PORT0 4
726