aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/bcm63xx
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/bcm63xx')
-rw-r--r--arch/mips/bcm63xx/Kconfig4
-rw-r--r--arch/mips/bcm63xx/boards/board_bcm963xx.c6
-rw-r--r--arch/mips/bcm63xx/clk.c43
-rw-r--r--arch/mips/bcm63xx/cpu.c142
-rw-r--r--arch/mips/bcm63xx/dev-flash.c6
-rw-r--r--arch/mips/bcm63xx/dev-spi.c26
-rw-r--r--arch/mips/bcm63xx/irq.c22
-rw-r--r--arch/mips/bcm63xx/prom.c2
-rw-r--r--arch/mips/bcm63xx/reset.c28
-rw-r--r--arch/mips/bcm63xx/setup.c5
10 files changed, 204 insertions, 80 deletions
diff --git a/arch/mips/bcm63xx/Kconfig b/arch/mips/bcm63xx/Kconfig
index d03e8799d1cf..5639662fd503 100644
--- a/arch/mips/bcm63xx/Kconfig
+++ b/arch/mips/bcm63xx/Kconfig
@@ -25,6 +25,10 @@ config BCM63XX_CPU_6358
25 bool "support 6358 CPU" 25 bool "support 6358 CPU"
26 select HW_HAS_PCI 26 select HW_HAS_PCI
27 27
28config BCM63XX_CPU_6362
29 bool "support 6362 CPU"
30 select HW_HAS_PCI
31
28config BCM63XX_CPU_6368 32config BCM63XX_CPU_6368
29 bool "support 6368 CPU" 33 bool "support 6368 CPU"
30 select HW_HAS_PCI 34 select HW_HAS_PCI
diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
index 9aa7d44898ed..a9505c4867e8 100644
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -726,11 +726,11 @@ void __init board_prom_init(void)
726 u32 val; 726 u32 val;
727 727
728 /* read base address of boot chip select (0) 728 /* read base address of boot chip select (0)
729 * 6328 does not have MPI but boots from a fixed address 729 * 6328/6362 do not have MPI but boot from a fixed address
730 */ 730 */
731 if (BCMCPU_IS_6328()) 731 if (BCMCPU_IS_6328() || BCMCPU_IS_6362()) {
732 val = 0x18000000; 732 val = 0x18000000;
733 else { 733 } else {
734 val = bcm_mpi_readl(MPI_CSBASE_REG(0)); 734 val = bcm_mpi_readl(MPI_CSBASE_REG(0));
735 val &= MPI_CSBASE_BASE_MASK; 735 val &= MPI_CSBASE_BASE_MASK;
736 } 736 }
diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c
index b9e948d59430..c726a97fc798 100644
--- a/arch/mips/bcm63xx/clk.c
+++ b/arch/mips/bcm63xx/clk.c
@@ -15,7 +15,13 @@
15#include <bcm63xx_io.h> 15#include <bcm63xx_io.h>
16#include <bcm63xx_regs.h> 16#include <bcm63xx_regs.h>
17#include <bcm63xx_reset.h> 17#include <bcm63xx_reset.h>
18#include <bcm63xx_clk.h> 18
19struct clk {
20 void (*set)(struct clk *, int);
21 unsigned int rate;
22 unsigned int usage;
23 int id;
24};
19 25
20static DEFINE_MUTEX(clocks_mutex); 26static DEFINE_MUTEX(clocks_mutex);
21 27
@@ -119,11 +125,18 @@ static struct clk clk_ephy = {
119 */ 125 */
120static void enetsw_set(struct clk *clk, int enable) 126static void enetsw_set(struct clk *clk, int enable)
121{ 127{
122 if (!BCMCPU_IS_6368()) 128 if (BCMCPU_IS_6328())
129 bcm_hwclock_set(CKCTL_6328_ROBOSW_EN, enable);
130 else if (BCMCPU_IS_6362())
131 bcm_hwclock_set(CKCTL_6362_ROBOSW_EN, enable);
132 else if (BCMCPU_IS_6368())
133 bcm_hwclock_set(CKCTL_6368_ROBOSW_EN |
134 CKCTL_6368_SWPKT_USB_EN |
135 CKCTL_6368_SWPKT_SAR_EN,
136 enable);
137 else
123 return; 138 return;
124 bcm_hwclock_set(CKCTL_6368_ROBOSW_EN | 139
125 CKCTL_6368_SWPKT_USB_EN |
126 CKCTL_6368_SWPKT_SAR_EN, enable);
127 if (enable) { 140 if (enable) {
128 /* reset switch core afer clock change */ 141 /* reset switch core afer clock change */
129 bcm63xx_core_set_reset(BCM63XX_RESET_ENETSW, 1); 142 bcm63xx_core_set_reset(BCM63XX_RESET_ENETSW, 1);
@@ -160,6 +173,8 @@ static void usbh_set(struct clk *clk, int enable)
160 bcm_hwclock_set(CKCTL_6328_USBH_EN, enable); 173 bcm_hwclock_set(CKCTL_6328_USBH_EN, enable);
161 else if (BCMCPU_IS_6348()) 174 else if (BCMCPU_IS_6348())
162 bcm_hwclock_set(CKCTL_6348_USBH_EN, enable); 175 bcm_hwclock_set(CKCTL_6348_USBH_EN, enable);
176 else if (BCMCPU_IS_6362())
177 bcm_hwclock_set(CKCTL_6362_USBH_EN, enable);
163 else if (BCMCPU_IS_6368()) 178 else if (BCMCPU_IS_6368())
164 bcm_hwclock_set(CKCTL_6368_USBH_EN, enable); 179 bcm_hwclock_set(CKCTL_6368_USBH_EN, enable);
165} 180}
@@ -175,6 +190,8 @@ static void usbd_set(struct clk *clk, int enable)
175{ 190{
176 if (BCMCPU_IS_6328()) 191 if (BCMCPU_IS_6328())
177 bcm_hwclock_set(CKCTL_6328_USBD_EN, enable); 192 bcm_hwclock_set(CKCTL_6328_USBD_EN, enable);
193 else if (BCMCPU_IS_6362())
194 bcm_hwclock_set(CKCTL_6362_USBD_EN, enable);
178 else if (BCMCPU_IS_6368()) 195 else if (BCMCPU_IS_6368())
179 bcm_hwclock_set(CKCTL_6368_USBD_EN, enable); 196 bcm_hwclock_set(CKCTL_6368_USBD_EN, enable);
180} 197}
@@ -196,6 +213,8 @@ static void spi_set(struct clk *clk, int enable)
196 mask = CKCTL_6348_SPI_EN; 213 mask = CKCTL_6348_SPI_EN;
197 else if (BCMCPU_IS_6358()) 214 else if (BCMCPU_IS_6358())
198 mask = CKCTL_6358_SPI_EN; 215 mask = CKCTL_6358_SPI_EN;
216 else if (BCMCPU_IS_6362())
217 mask = CKCTL_6362_SPI_EN;
199 else 218 else
200 /* BCMCPU_IS_6368 */ 219 /* BCMCPU_IS_6368 */
201 mask = CKCTL_6368_SPI_EN; 220 mask = CKCTL_6368_SPI_EN;
@@ -236,7 +255,10 @@ static struct clk clk_xtm = {
236 */ 255 */
237static void ipsec_set(struct clk *clk, int enable) 256static void ipsec_set(struct clk *clk, int enable)
238{ 257{
239 bcm_hwclock_set(CKCTL_6368_IPSEC_EN, enable); 258 if (BCMCPU_IS_6362())
259 bcm_hwclock_set(CKCTL_6362_IPSEC_EN, enable);
260 else if (BCMCPU_IS_6368())
261 bcm_hwclock_set(CKCTL_6368_IPSEC_EN, enable);
240} 262}
241 263
242static struct clk clk_ipsec = { 264static struct clk clk_ipsec = {
@@ -249,7 +271,10 @@ static struct clk clk_ipsec = {
249 271
250static void pcie_set(struct clk *clk, int enable) 272static void pcie_set(struct clk *clk, int enable)
251{ 273{
252 bcm_hwclock_set(CKCTL_6328_PCIE_EN, enable); 274 if (BCMCPU_IS_6328())
275 bcm_hwclock_set(CKCTL_6328_PCIE_EN, enable);
276 else if (BCMCPU_IS_6362())
277 bcm_hwclock_set(CKCTL_6362_PCIE_EN, enable);
253} 278}
254 279
255static struct clk clk_pcie = { 280static struct clk clk_pcie = {
@@ -315,9 +340,9 @@ struct clk *clk_get(struct device *dev, const char *id)
315 return &clk_periph; 340 return &clk_periph;
316 if (BCMCPU_IS_6358() && !strcmp(id, "pcm")) 341 if (BCMCPU_IS_6358() && !strcmp(id, "pcm"))
317 return &clk_pcm; 342 return &clk_pcm;
318 if (BCMCPU_IS_6368() && !strcmp(id, "ipsec")) 343 if ((BCMCPU_IS_6362() || BCMCPU_IS_6368()) && !strcmp(id, "ipsec"))
319 return &clk_ipsec; 344 return &clk_ipsec;
320 if (BCMCPU_IS_6328() && !strcmp(id, "pcie")) 345 if ((BCMCPU_IS_6328() || BCMCPU_IS_6362()) && !strcmp(id, "pcie"))
321 return &clk_pcie; 346 return &clk_pcie;
322 return ERR_PTR(-ENOENT); 347 return ERR_PTR(-ENOENT);
323} 348}
diff --git a/arch/mips/bcm63xx/cpu.c b/arch/mips/bcm63xx/cpu.c
index a7afb289b15a..79fe32df5e96 100644
--- a/arch/mips/bcm63xx/cpu.c
+++ b/arch/mips/bcm63xx/cpu.c
@@ -25,7 +25,7 @@ const int *bcm63xx_irqs;
25EXPORT_SYMBOL(bcm63xx_irqs); 25EXPORT_SYMBOL(bcm63xx_irqs);
26 26
27static u16 bcm63xx_cpu_id; 27static u16 bcm63xx_cpu_id;
28static u16 bcm63xx_cpu_rev; 28static u8 bcm63xx_cpu_rev;
29static unsigned int bcm63xx_cpu_freq; 29static unsigned int bcm63xx_cpu_freq;
30static unsigned int bcm63xx_memory_size; 30static unsigned int bcm63xx_memory_size;
31 31
@@ -71,6 +71,15 @@ static const int bcm6358_irqs[] = {
71 71
72}; 72};
73 73
74static const unsigned long bcm6362_regs_base[] = {
75 __GEN_CPU_REGS_TABLE(6362)
76};
77
78static const int bcm6362_irqs[] = {
79 __GEN_CPU_IRQ_TABLE(6362)
80
81};
82
74static const unsigned long bcm6368_regs_base[] = { 83static const unsigned long bcm6368_regs_base[] = {
75 __GEN_CPU_REGS_TABLE(6368) 84 __GEN_CPU_REGS_TABLE(6368)
76}; 85};
@@ -87,7 +96,7 @@ u16 __bcm63xx_get_cpu_id(void)
87 96
88EXPORT_SYMBOL(__bcm63xx_get_cpu_id); 97EXPORT_SYMBOL(__bcm63xx_get_cpu_id);
89 98
90u16 bcm63xx_get_cpu_rev(void) 99u8 bcm63xx_get_cpu_rev(void)
91{ 100{
92 return bcm63xx_cpu_rev; 101 return bcm63xx_cpu_rev;
93} 102}
@@ -169,6 +178,42 @@ static unsigned int detect_cpu_clock(void)
169 return (16 * 1000000 * n1 * n2) / m1; 178 return (16 * 1000000 * n1 * n2) / m1;
170 } 179 }
171 180
181 case BCM6362_CPU_ID:
182 {
183 unsigned int tmp, mips_pll_fcvo;
184
185 tmp = bcm_misc_readl(MISC_STRAPBUS_6362_REG);
186 mips_pll_fcvo = (tmp & STRAPBUS_6362_FCVO_MASK)
187 >> STRAPBUS_6362_FCVO_SHIFT;
188 switch (mips_pll_fcvo) {
189 case 0x03:
190 case 0x0b:
191 case 0x13:
192 case 0x1b:
193 return 240000000;
194 case 0x04:
195 case 0x0c:
196 case 0x14:
197 case 0x1c:
198 return 160000000;
199 case 0x05:
200 case 0x0e:
201 case 0x16:
202 case 0x1e:
203 case 0x1f:
204 return 400000000;
205 case 0x06:
206 return 440000000;
207 case 0x07:
208 case 0x17:
209 return 384000000;
210 case 0x15:
211 case 0x1d:
212 return 200000000;
213 default:
214 return 320000000;
215 }
216 }
172 case BCM6368_CPU_ID: 217 case BCM6368_CPU_ID:
173 { 218 {
174 unsigned int tmp, p1, p2, ndiv, m1; 219 unsigned int tmp, p1, p2, ndiv, m1;
@@ -205,7 +250,7 @@ static unsigned int detect_memory_size(void)
205 unsigned int cols = 0, rows = 0, is_32bits = 0, banks = 0; 250 unsigned int cols = 0, rows = 0, is_32bits = 0, banks = 0;
206 u32 val; 251 u32 val;
207 252
208 if (BCMCPU_IS_6328()) 253 if (BCMCPU_IS_6328() || BCMCPU_IS_6362())
209 return bcm_ddr_readl(DDR_CSEND_REG) << 24; 254 return bcm_ddr_readl(DDR_CSEND_REG) << 24;
210 255
211 if (BCMCPU_IS_6345()) { 256 if (BCMCPU_IS_6345()) {
@@ -240,53 +285,27 @@ static unsigned int detect_memory_size(void)
240 285
241void __init bcm63xx_cpu_init(void) 286void __init bcm63xx_cpu_init(void)
242{ 287{
243 unsigned int tmp, expected_cpu_id; 288 unsigned int tmp;
244 struct cpuinfo_mips *c = &current_cpu_data; 289 struct cpuinfo_mips *c = &current_cpu_data;
245 unsigned int cpu = smp_processor_id(); 290 unsigned int cpu = smp_processor_id();
291 u32 chipid_reg;
246 292
247 /* soc registers location depends on cpu type */ 293 /* soc registers location depends on cpu type */
248 expected_cpu_id = 0; 294 chipid_reg = 0;
249 295
250 switch (c->cputype) { 296 switch (c->cputype) {
251 case CPU_BMIPS3300: 297 case CPU_BMIPS3300:
252 if ((read_c0_prid() & 0xff00) == PRID_IMP_BMIPS3300_ALT) { 298 if ((read_c0_prid() & 0xff00) != PRID_IMP_BMIPS3300_ALT)
253 expected_cpu_id = BCM6348_CPU_ID;
254 bcm63xx_regs_base = bcm6348_regs_base;
255 bcm63xx_irqs = bcm6348_irqs;
256 } else {
257 __cpu_name[cpu] = "Broadcom BCM6338"; 299 __cpu_name[cpu] = "Broadcom BCM6338";
258 expected_cpu_id = BCM6338_CPU_ID; 300 /* fall-through */
259 bcm63xx_regs_base = bcm6338_regs_base;
260 bcm63xx_irqs = bcm6338_irqs;
261 }
262 break;
263 case CPU_BMIPS32: 301 case CPU_BMIPS32:
264 expected_cpu_id = BCM6345_CPU_ID; 302 chipid_reg = BCM_6345_PERF_BASE;
265 bcm63xx_regs_base = bcm6345_regs_base;
266 bcm63xx_irqs = bcm6345_irqs;
267 break; 303 break;
268 case CPU_BMIPS4350: 304 case CPU_BMIPS4350:
269 if ((read_c0_prid() & 0xf0) == 0x10) { 305 if ((read_c0_prid() & 0xf0) == 0x10)
270 expected_cpu_id = BCM6358_CPU_ID; 306 chipid_reg = BCM_6345_PERF_BASE;
271 bcm63xx_regs_base = bcm6358_regs_base; 307 else
272 bcm63xx_irqs = bcm6358_irqs; 308 chipid_reg = BCM_6368_PERF_BASE;
273 } else {
274 /* all newer chips have the same chip id location */
275 u16 chip_id = bcm_readw(BCM_6368_PERF_BASE);
276
277 switch (chip_id) {
278 case BCM6328_CPU_ID:
279 expected_cpu_id = BCM6328_CPU_ID;
280 bcm63xx_regs_base = bcm6328_regs_base;
281 bcm63xx_irqs = bcm6328_irqs;
282 break;
283 case BCM6368_CPU_ID:
284 expected_cpu_id = BCM6368_CPU_ID;
285 bcm63xx_regs_base = bcm6368_regs_base;
286 bcm63xx_irqs = bcm6368_irqs;
287 break;
288 }
289 }
290 break; 309 break;
291 } 310 }
292 311
@@ -294,20 +313,47 @@ void __init bcm63xx_cpu_init(void)
294 * really early to panic, but delaying panic would not help since we 313 * really early to panic, but delaying panic would not help since we
295 * will never get any working console 314 * will never get any working console
296 */ 315 */
297 if (!expected_cpu_id) 316 if (!chipid_reg)
298 panic("unsupported Broadcom CPU"); 317 panic("unsupported Broadcom CPU");
299 318
300 /* 319 /* read out CPU type */
301 * bcm63xx_regs_base is set, we can access soc registers 320 tmp = bcm_readl(chipid_reg);
302 */
303
304 /* double check CPU type */
305 tmp = bcm_perf_readl(PERF_REV_REG);
306 bcm63xx_cpu_id = (tmp & REV_CHIPID_MASK) >> REV_CHIPID_SHIFT; 321 bcm63xx_cpu_id = (tmp & REV_CHIPID_MASK) >> REV_CHIPID_SHIFT;
307 bcm63xx_cpu_rev = (tmp & REV_REVID_MASK) >> REV_REVID_SHIFT; 322 bcm63xx_cpu_rev = (tmp & REV_REVID_MASK) >> REV_REVID_SHIFT;
308 323
309 if (bcm63xx_cpu_id != expected_cpu_id) 324 switch (bcm63xx_cpu_id) {
310 panic("bcm63xx CPU id mismatch"); 325 case BCM6328_CPU_ID:
326 bcm63xx_regs_base = bcm6328_regs_base;
327 bcm63xx_irqs = bcm6328_irqs;
328 break;
329 case BCM6338_CPU_ID:
330 bcm63xx_regs_base = bcm6338_regs_base;
331 bcm63xx_irqs = bcm6338_irqs;
332 break;
333 case BCM6345_CPU_ID:
334 bcm63xx_regs_base = bcm6345_regs_base;
335 bcm63xx_irqs = bcm6345_irqs;
336 break;
337 case BCM6348_CPU_ID:
338 bcm63xx_regs_base = bcm6348_regs_base;
339 bcm63xx_irqs = bcm6348_irqs;
340 break;
341 case BCM6358_CPU_ID:
342 bcm63xx_regs_base = bcm6358_regs_base;
343 bcm63xx_irqs = bcm6358_irqs;
344 break;
345 case BCM6362_CPU_ID:
346 bcm63xx_regs_base = bcm6362_regs_base;
347 bcm63xx_irqs = bcm6362_irqs;
348 break;
349 case BCM6368_CPU_ID:
350 bcm63xx_regs_base = bcm6368_regs_base;
351 bcm63xx_irqs = bcm6368_irqs;
352 break;
353 default:
354 panic("unsupported broadcom CPU %x", bcm63xx_cpu_id);
355 break;
356 }
311 357
312 bcm63xx_cpu_freq = detect_cpu_clock(); 358 bcm63xx_cpu_freq = detect_cpu_clock();
313 bcm63xx_memory_size = detect_memory_size(); 359 bcm63xx_memory_size = detect_memory_size();
diff --git a/arch/mips/bcm63xx/dev-flash.c b/arch/mips/bcm63xx/dev-flash.c
index 58371c7deac2..588d1ec622e4 100644
--- a/arch/mips/bcm63xx/dev-flash.c
+++ b/arch/mips/bcm63xx/dev-flash.c
@@ -77,6 +77,12 @@ static int __init bcm63xx_detect_flash_type(void)
77 return BCM63XX_FLASH_TYPE_PARALLEL; 77 return BCM63XX_FLASH_TYPE_PARALLEL;
78 else 78 else
79 return BCM63XX_FLASH_TYPE_SERIAL; 79 return BCM63XX_FLASH_TYPE_SERIAL;
80 case BCM6362_CPU_ID:
81 val = bcm_misc_readl(MISC_STRAPBUS_6362_REG);
82 if (val & STRAPBUS_6362_BOOT_SEL_SERIAL)
83 return BCM63XX_FLASH_TYPE_SERIAL;
84 else
85 return BCM63XX_FLASH_TYPE_NAND;
80 case BCM6368_CPU_ID: 86 case BCM6368_CPU_ID:
81 val = bcm_gpio_readl(GPIO_STRAPBUS_REG); 87 val = bcm_gpio_readl(GPIO_STRAPBUS_REG);
82 switch (val & STRAPBUS_6368_BOOT_SEL_MASK) { 88 switch (val & STRAPBUS_6368_BOOT_SEL_MASK) {
diff --git a/arch/mips/bcm63xx/dev-spi.c b/arch/mips/bcm63xx/dev-spi.c
index e97fd60e92ef..3065bb61820d 100644
--- a/arch/mips/bcm63xx/dev-spi.c
+++ b/arch/mips/bcm63xx/dev-spi.c
@@ -22,10 +22,6 @@
22/* 22/*
23 * register offsets 23 * register offsets
24 */ 24 */
25static const unsigned long bcm6338_regs_spi[] = {
26 __GEN_SPI_REGS_TABLE(6338)
27};
28
29static const unsigned long bcm6348_regs_spi[] = { 25static const unsigned long bcm6348_regs_spi[] = {
30 __GEN_SPI_REGS_TABLE(6348) 26 __GEN_SPI_REGS_TABLE(6348)
31}; 27};
@@ -34,23 +30,15 @@ static const unsigned long bcm6358_regs_spi[] = {
34 __GEN_SPI_REGS_TABLE(6358) 30 __GEN_SPI_REGS_TABLE(6358)
35}; 31};
36 32
37static const unsigned long bcm6368_regs_spi[] = {
38 __GEN_SPI_REGS_TABLE(6368)
39};
40
41const unsigned long *bcm63xx_regs_spi; 33const unsigned long *bcm63xx_regs_spi;
42EXPORT_SYMBOL(bcm63xx_regs_spi); 34EXPORT_SYMBOL(bcm63xx_regs_spi);
43 35
44static __init void bcm63xx_spi_regs_init(void) 36static __init void bcm63xx_spi_regs_init(void)
45{ 37{
46 if (BCMCPU_IS_6338()) 38 if (BCMCPU_IS_6338() || BCMCPU_IS_6348())
47 bcm63xx_regs_spi = bcm6338_regs_spi;
48 if (BCMCPU_IS_6348())
49 bcm63xx_regs_spi = bcm6348_regs_spi; 39 bcm63xx_regs_spi = bcm6348_regs_spi;
50 if (BCMCPU_IS_6358()) 40 if (BCMCPU_IS_6358() || BCMCPU_IS_6362() || BCMCPU_IS_6368())
51 bcm63xx_regs_spi = bcm6358_regs_spi; 41 bcm63xx_regs_spi = bcm6358_regs_spi;
52 if (BCMCPU_IS_6368())
53 bcm63xx_regs_spi = bcm6368_regs_spi;
54} 42}
55#else 43#else
56static __init void bcm63xx_spi_regs_init(void) { } 44static __init void bcm63xx_spi_regs_init(void) { }
@@ -93,13 +81,13 @@ int __init bcm63xx_spi_register(void)
93 spi_resources[1].start = bcm63xx_get_irq_number(IRQ_SPI); 81 spi_resources[1].start = bcm63xx_get_irq_number(IRQ_SPI);
94 82
95 if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) { 83 if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) {
96 spi_resources[0].end += BCM_6338_RSET_SPI_SIZE - 1; 84 spi_resources[0].end += BCM_6348_RSET_SPI_SIZE - 1;
97 spi_pdata.fifo_size = SPI_6338_MSG_DATA_SIZE; 85 spi_pdata.fifo_size = SPI_6348_MSG_DATA_SIZE;
98 spi_pdata.msg_type_shift = SPI_6338_MSG_TYPE_SHIFT; 86 spi_pdata.msg_type_shift = SPI_6348_MSG_TYPE_SHIFT;
99 spi_pdata.msg_ctl_width = SPI_6338_MSG_CTL_WIDTH; 87 spi_pdata.msg_ctl_width = SPI_6348_MSG_CTL_WIDTH;
100 } 88 }
101 89
102 if (BCMCPU_IS_6358() || BCMCPU_IS_6368()) { 90 if (BCMCPU_IS_6358() || BCMCPU_IS_6362() || BCMCPU_IS_6368()) {
103 spi_resources[0].end += BCM_6358_RSET_SPI_SIZE - 1; 91 spi_resources[0].end += BCM_6358_RSET_SPI_SIZE - 1;
104 spi_pdata.fifo_size = SPI_6358_MSG_DATA_SIZE; 92 spi_pdata.fifo_size = SPI_6358_MSG_DATA_SIZE;
105 spi_pdata.msg_type_shift = SPI_6358_MSG_TYPE_SHIFT; 93 spi_pdata.msg_type_shift = SPI_6358_MSG_TYPE_SHIFT;
diff --git a/arch/mips/bcm63xx/irq.c b/arch/mips/bcm63xx/irq.c
index da24c2bd9b7c..c0ab3887f42e 100644
--- a/arch/mips/bcm63xx/irq.c
+++ b/arch/mips/bcm63xx/irq.c
@@ -82,6 +82,17 @@ static void __internal_irq_unmask_64(unsigned int irq) __maybe_unused;
82#define ext_irq_cfg_reg1 PERF_EXTIRQ_CFG_REG_6358 82#define ext_irq_cfg_reg1 PERF_EXTIRQ_CFG_REG_6358
83#define ext_irq_cfg_reg2 0 83#define ext_irq_cfg_reg2 0
84#endif 84#endif
85#ifdef CONFIG_BCM63XX_CPU_6362
86#define irq_stat_reg PERF_IRQSTAT_6362_REG
87#define irq_mask_reg PERF_IRQMASK_6362_REG
88#define irq_bits 64
89#define is_ext_irq_cascaded 1
90#define ext_irq_start (BCM_6362_EXT_IRQ0 - IRQ_INTERNAL_BASE)
91#define ext_irq_end (BCM_6362_EXT_IRQ3 - IRQ_INTERNAL_BASE)
92#define ext_irq_count 4
93#define ext_irq_cfg_reg1 PERF_EXTIRQ_CFG_REG_6362
94#define ext_irq_cfg_reg2 0
95#endif
85#ifdef CONFIG_BCM63XX_CPU_6368 96#ifdef CONFIG_BCM63XX_CPU_6368
86#define irq_stat_reg PERF_IRQSTAT_6368_REG 97#define irq_stat_reg PERF_IRQSTAT_6368_REG
87#define irq_mask_reg PERF_IRQMASK_6368_REG 98#define irq_mask_reg PERF_IRQMASK_6368_REG
@@ -170,6 +181,16 @@ static void bcm63xx_init_irq(void)
170 ext_irq_end = BCM_6358_EXT_IRQ3 - IRQ_INTERNAL_BASE; 181 ext_irq_end = BCM_6358_EXT_IRQ3 - IRQ_INTERNAL_BASE;
171 ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_6358; 182 ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_6358;
172 break; 183 break;
184 case BCM6362_CPU_ID:
185 irq_stat_addr += PERF_IRQSTAT_6362_REG;
186 irq_mask_addr += PERF_IRQMASK_6362_REG;
187 irq_bits = 64;
188 ext_irq_count = 4;
189 is_ext_irq_cascaded = 1;
190 ext_irq_start = BCM_6362_EXT_IRQ0 - IRQ_INTERNAL_BASE;
191 ext_irq_end = BCM_6362_EXT_IRQ3 - IRQ_INTERNAL_BASE;
192 ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_6362;
193 break;
173 case BCM6368_CPU_ID: 194 case BCM6368_CPU_ID:
174 irq_stat_addr += PERF_IRQSTAT_6368_REG; 195 irq_stat_addr += PERF_IRQSTAT_6368_REG;
175 irq_mask_addr += PERF_IRQMASK_6368_REG; 196 irq_mask_addr += PERF_IRQMASK_6368_REG;
@@ -458,6 +479,7 @@ static int bcm63xx_external_irq_set_type(struct irq_data *d,
458 case BCM6338_CPU_ID: 479 case BCM6338_CPU_ID:
459 case BCM6345_CPU_ID: 480 case BCM6345_CPU_ID:
460 case BCM6358_CPU_ID: 481 case BCM6358_CPU_ID:
482 case BCM6362_CPU_ID:
461 case BCM6368_CPU_ID: 483 case BCM6368_CPU_ID:
462 if (levelsense) 484 if (levelsense)
463 reg |= EXTIRQ_CFG_LEVELSENSE(irq); 485 reg |= EXTIRQ_CFG_LEVELSENSE(irq);
diff --git a/arch/mips/bcm63xx/prom.c b/arch/mips/bcm63xx/prom.c
index 10eaff458071..fd698087fbfd 100644
--- a/arch/mips/bcm63xx/prom.c
+++ b/arch/mips/bcm63xx/prom.c
@@ -36,6 +36,8 @@ void __init prom_init(void)
36 mask = CKCTL_6348_ALL_SAFE_EN; 36 mask = CKCTL_6348_ALL_SAFE_EN;
37 else if (BCMCPU_IS_6358()) 37 else if (BCMCPU_IS_6358())
38 mask = CKCTL_6358_ALL_SAFE_EN; 38 mask = CKCTL_6358_ALL_SAFE_EN;
39 else if (BCMCPU_IS_6362())
40 mask = CKCTL_6362_ALL_SAFE_EN;
39 else if (BCMCPU_IS_6368()) 41 else if (BCMCPU_IS_6368())
40 mask = CKCTL_6368_ALL_SAFE_EN; 42 mask = CKCTL_6368_ALL_SAFE_EN;
41 else 43 else
diff --git a/arch/mips/bcm63xx/reset.c b/arch/mips/bcm63xx/reset.c
index 68a31bb90cbf..317931c6cf58 100644
--- a/arch/mips/bcm63xx/reset.c
+++ b/arch/mips/bcm63xx/reset.c
@@ -85,6 +85,20 @@
85#define BCM6358_RESET_PCIE 0 85#define BCM6358_RESET_PCIE 0
86#define BCM6358_RESET_PCIE_EXT 0 86#define BCM6358_RESET_PCIE_EXT 0
87 87
88#define BCM6362_RESET_SPI SOFTRESET_6362_SPI_MASK
89#define BCM6362_RESET_ENET 0
90#define BCM6362_RESET_USBH SOFTRESET_6362_USBH_MASK
91#define BCM6362_RESET_USBD SOFTRESET_6362_USBS_MASK
92#define BCM6362_RESET_DSL 0
93#define BCM6362_RESET_SAR SOFTRESET_6362_SAR_MASK
94#define BCM6362_RESET_EPHY SOFTRESET_6362_EPHY_MASK
95#define BCM6362_RESET_ENETSW SOFTRESET_6362_ENETSW_MASK
96#define BCM6362_RESET_PCM SOFTRESET_6362_PCM_MASK
97#define BCM6362_RESET_MPI 0
98#define BCM6362_RESET_PCIE (SOFTRESET_6362_PCIE_MASK | \
99 SOFTRESET_6362_PCIE_CORE_MASK)
100#define BCM6362_RESET_PCIE_EXT SOFTRESET_6362_PCIE_EXT_MASK
101
88#define BCM6368_RESET_SPI SOFTRESET_6368_SPI_MASK 102#define BCM6368_RESET_SPI SOFTRESET_6368_SPI_MASK
89#define BCM6368_RESET_ENET 0 103#define BCM6368_RESET_ENET 0
90#define BCM6368_RESET_USBH SOFTRESET_6368_USBH_MASK 104#define BCM6368_RESET_USBH SOFTRESET_6368_USBH_MASK
@@ -119,6 +133,10 @@ static const u32 bcm6358_reset_bits[] = {
119 __GEN_RESET_BITS_TABLE(6358) 133 __GEN_RESET_BITS_TABLE(6358)
120}; 134};
121 135
136static const u32 bcm6362_reset_bits[] = {
137 __GEN_RESET_BITS_TABLE(6362)
138};
139
122static const u32 bcm6368_reset_bits[] = { 140static const u32 bcm6368_reset_bits[] = {
123 __GEN_RESET_BITS_TABLE(6368) 141 __GEN_RESET_BITS_TABLE(6368)
124}; 142};
@@ -140,6 +158,9 @@ static int __init bcm63xx_reset_bits_init(void)
140 } else if (BCMCPU_IS_6358()) { 158 } else if (BCMCPU_IS_6358()) {
141 reset_reg = PERF_SOFTRESET_6358_REG; 159 reset_reg = PERF_SOFTRESET_6358_REG;
142 bcm63xx_reset_bits = bcm6358_reset_bits; 160 bcm63xx_reset_bits = bcm6358_reset_bits;
161 } else if (BCMCPU_IS_6362()) {
162 reset_reg = PERF_SOFTRESET_6362_REG;
163 bcm63xx_reset_bits = bcm6362_reset_bits;
143 } else if (BCMCPU_IS_6368()) { 164 } else if (BCMCPU_IS_6368()) {
144 reset_reg = PERF_SOFTRESET_6368_REG; 165 reset_reg = PERF_SOFTRESET_6368_REG;
145 bcm63xx_reset_bits = bcm6368_reset_bits; 166 bcm63xx_reset_bits = bcm6368_reset_bits;
@@ -182,6 +203,13 @@ static const u32 bcm63xx_reset_bits[] = {
182#define reset_reg PERF_SOFTRESET_6358_REG 203#define reset_reg PERF_SOFTRESET_6358_REG
183#endif 204#endif
184 205
206#ifdef CONFIG_BCM63XX_CPU_6362
207static const u32 bcm63xx_reset_bits[] = {
208 __GEN_RESET_BITS_TABLE(6362)
209};
210#define reset_reg PERF_SOFTRESET_6362_REG
211#endif
212
185#ifdef CONFIG_BCM63XX_CPU_6368 213#ifdef CONFIG_BCM63XX_CPU_6368
186static const u32 bcm63xx_reset_bits[] = { 214static const u32 bcm63xx_reset_bits[] = {
187 __GEN_RESET_BITS_TABLE(6368) 215 __GEN_RESET_BITS_TABLE(6368)
diff --git a/arch/mips/bcm63xx/setup.c b/arch/mips/bcm63xx/setup.c
index 35e18e98beb9..24a24445db64 100644
--- a/arch/mips/bcm63xx/setup.c
+++ b/arch/mips/bcm63xx/setup.c
@@ -83,6 +83,9 @@ void bcm63xx_machine_reboot(void)
83 case BCM6358_CPU_ID: 83 case BCM6358_CPU_ID:
84 perf_regs[0] = PERF_EXTIRQ_CFG_REG_6358; 84 perf_regs[0] = PERF_EXTIRQ_CFG_REG_6358;
85 break; 85 break;
86 case BCM6362_CPU_ID:
87 perf_regs[0] = PERF_EXTIRQ_CFG_REG_6362;
88 break;
86 } 89 }
87 90
88 for (i = 0; i < 2; i++) { 91 for (i = 0; i < 2; i++) {
@@ -126,7 +129,7 @@ static void __bcm63xx_machine_reboot(char *p)
126const char *get_system_type(void) 129const char *get_system_type(void)
127{ 130{
128 static char buf[128]; 131 static char buf[128];
129 snprintf(buf, sizeof(buf), "bcm63xx/%s (0x%04x/0x%04X)", 132 snprintf(buf, sizeof(buf), "bcm63xx/%s (0x%04x/0x%02X)",
130 board_get_name(), 133 board_get_name(),
131 bcm63xx_get_cpu_id(), bcm63xx_get_cpu_rev()); 134 bcm63xx_get_cpu_id(), bcm63xx_get_cpu_rev());
132 return buf; 135 return buf;