aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/sibyte
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/sibyte')
-rw-r--r--arch/mips/sibyte/bcm1480/irq.c15
-rw-r--r--arch/mips/sibyte/common/cfe.c4
-rw-r--r--arch/mips/sibyte/common/sb_tbprof.c2
-rw-r--r--arch/mips/sibyte/sb1250/irq.c15
-rw-r--r--arch/mips/sibyte/sb1250/setup.c15
-rw-r--r--arch/mips/sibyte/swarm/setup.c17
6 files changed, 39 insertions, 29 deletions
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c
index 4070268aa769..7a8b0a8b643a 100644
--- a/arch/mips/sibyte/bcm1480/irq.c
+++ b/arch/mips/sibyte/bcm1480/irq.c
@@ -22,7 +22,6 @@
22#include <linux/smp.h> 22#include <linux/smp.h>
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/mm.h> 24#include <linux/mm.h>
25#include <linux/slab.h>
26#include <linux/kernel_stat.h> 25#include <linux/kernel_stat.h>
27 26
28#include <asm/errno.h> 27#include <asm/errno.h>
@@ -73,14 +72,14 @@ static struct irq_chip bcm1480_irq_type = {
73/* Store the CPU id (not the logical number) */ 72/* Store the CPU id (not the logical number) */
74int bcm1480_irq_owner[BCM1480_NR_IRQS]; 73int bcm1480_irq_owner[BCM1480_NR_IRQS];
75 74
76DEFINE_SPINLOCK(bcm1480_imr_lock); 75static DEFINE_RAW_SPINLOCK(bcm1480_imr_lock);
77 76
78void bcm1480_mask_irq(int cpu, int irq) 77void bcm1480_mask_irq(int cpu, int irq)
79{ 78{
80 unsigned long flags, hl_spacing; 79 unsigned long flags, hl_spacing;
81 u64 cur_ints; 80 u64 cur_ints;
82 81
83 spin_lock_irqsave(&bcm1480_imr_lock, flags); 82 raw_spin_lock_irqsave(&bcm1480_imr_lock, flags);
84 hl_spacing = 0; 83 hl_spacing = 0;
85 if ((irq >= BCM1480_NR_IRQS_HALF) && (irq <= BCM1480_NR_IRQS)) { 84 if ((irq >= BCM1480_NR_IRQS_HALF) && (irq <= BCM1480_NR_IRQS)) {
86 hl_spacing = BCM1480_IMR_HL_SPACING; 85 hl_spacing = BCM1480_IMR_HL_SPACING;
@@ -89,7 +88,7 @@ void bcm1480_mask_irq(int cpu, int irq)
89 cur_ints = ____raw_readq(IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing)); 88 cur_ints = ____raw_readq(IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing));
90 cur_ints |= (((u64) 1) << irq); 89 cur_ints |= (((u64) 1) << irq);
91 ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing)); 90 ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing));
92 spin_unlock_irqrestore(&bcm1480_imr_lock, flags); 91 raw_spin_unlock_irqrestore(&bcm1480_imr_lock, flags);
93} 92}
94 93
95void bcm1480_unmask_irq(int cpu, int irq) 94void bcm1480_unmask_irq(int cpu, int irq)
@@ -97,7 +96,7 @@ void bcm1480_unmask_irq(int cpu, int irq)
97 unsigned long flags, hl_spacing; 96 unsigned long flags, hl_spacing;
98 u64 cur_ints; 97 u64 cur_ints;
99 98
100 spin_lock_irqsave(&bcm1480_imr_lock, flags); 99 raw_spin_lock_irqsave(&bcm1480_imr_lock, flags);
101 hl_spacing = 0; 100 hl_spacing = 0;
102 if ((irq >= BCM1480_NR_IRQS_HALF) && (irq <= BCM1480_NR_IRQS)) { 101 if ((irq >= BCM1480_NR_IRQS_HALF) && (irq <= BCM1480_NR_IRQS)) {
103 hl_spacing = BCM1480_IMR_HL_SPACING; 102 hl_spacing = BCM1480_IMR_HL_SPACING;
@@ -106,7 +105,7 @@ void bcm1480_unmask_irq(int cpu, int irq)
106 cur_ints = ____raw_readq(IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing)); 105 cur_ints = ____raw_readq(IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing));
107 cur_ints &= ~(((u64) 1) << irq); 106 cur_ints &= ~(((u64) 1) << irq);
108 ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing)); 107 ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + hl_spacing));
109 spin_unlock_irqrestore(&bcm1480_imr_lock, flags); 108 raw_spin_unlock_irqrestore(&bcm1480_imr_lock, flags);
110} 109}
111 110
112#ifdef CONFIG_SMP 111#ifdef CONFIG_SMP
@@ -123,7 +122,7 @@ static int bcm1480_set_affinity(unsigned int irq, const struct cpumask *mask)
123 cpu = cpu_logical_map(i); 122 cpu = cpu_logical_map(i);
124 123
125 /* Protect against other affinity changers and IMR manipulation */ 124 /* Protect against other affinity changers and IMR manipulation */
126 spin_lock_irqsave(&bcm1480_imr_lock, flags); 125 raw_spin_lock_irqsave(&bcm1480_imr_lock, flags);
127 126
128 /* Swizzle each CPU's IMR (but leave the IP selection alone) */ 127 /* Swizzle each CPU's IMR (but leave the IP selection alone) */
129 old_cpu = bcm1480_irq_owner[irq]; 128 old_cpu = bcm1480_irq_owner[irq];
@@ -148,7 +147,7 @@ static int bcm1480_set_affinity(unsigned int irq, const struct cpumask *mask)
148 ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + (k*BCM1480_IMR_HL_SPACING))); 147 ____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + (k*BCM1480_IMR_HL_SPACING)));
149 } 148 }
150 } 149 }
151 spin_unlock_irqrestore(&bcm1480_imr_lock, flags); 150 raw_spin_unlock_irqrestore(&bcm1480_imr_lock, flags);
152 151
153 return 0; 152 return 0;
154} 153}
diff --git a/arch/mips/sibyte/common/cfe.c b/arch/mips/sibyte/common/cfe.c
index eb5396cf81bb..6343011e9902 100644
--- a/arch/mips/sibyte/common/cfe.c
+++ b/arch/mips/sibyte/common/cfe.c
@@ -287,7 +287,7 @@ void __init prom_init(void)
287 * boot console 287 * boot console
288 */ 288 */
289 cfe_cons_handle = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE); 289 cfe_cons_handle = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE);
290 if (cfe_getenv("LINUX_CMDLINE", arcs_cmdline, CL_SIZE) < 0) { 290 if (cfe_getenv("LINUX_CMDLINE", arcs_cmdline, COMMAND_LINE_SIZE) < 0) {
291 if (argc >= 0) { 291 if (argc >= 0) {
292 /* The loader should have set the command line */ 292 /* The loader should have set the command line */
293 /* too early for panic to do any good */ 293 /* too early for panic to do any good */
@@ -318,7 +318,7 @@ void __init prom_init(void)
318#endif /* CONFIG_BLK_DEV_INITRD */ 318#endif /* CONFIG_BLK_DEV_INITRD */
319 319
320 /* Not sure this is needed, but it's the safe way. */ 320 /* Not sure this is needed, but it's the safe way. */
321 arcs_cmdline[CL_SIZE-1] = 0; 321 arcs_cmdline[COMMAND_LINE_SIZE-1] = 0;
322 322
323 prom_meminit(); 323 prom_meminit();
324 324
diff --git a/arch/mips/sibyte/common/sb_tbprof.c b/arch/mips/sibyte/common/sb_tbprof.c
index 15ea778b5e66..d4ed7a9156f5 100644
--- a/arch/mips/sibyte/common/sb_tbprof.c
+++ b/arch/mips/sibyte/common/sb_tbprof.c
@@ -27,8 +27,6 @@
27#include <linux/types.h> 27#include <linux/types.h>
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/interrupt.h> 29#include <linux/interrupt.h>
30#include <linux/slab.h>
31#include <linux/smp_lock.h>
32#include <linux/vmalloc.h> 30#include <linux/vmalloc.h>
33#include <linux/fs.h> 31#include <linux/fs.h>
34#include <linux/errno.h> 32#include <linux/errno.h>
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c
index 5e7f2016cceb..62371f772553 100644
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@ -22,7 +22,6 @@
22#include <linux/spinlock.h> 22#include <linux/spinlock.h>
23#include <linux/smp.h> 23#include <linux/smp.h>
24#include <linux/mm.h> 24#include <linux/mm.h>
25#include <linux/slab.h>
26#include <linux/kernel_stat.h> 25#include <linux/kernel_stat.h>
27 26
28#include <asm/errno.h> 27#include <asm/errno.h>
@@ -72,20 +71,20 @@ static struct irq_chip sb1250_irq_type = {
72/* Store the CPU id (not the logical number) */ 71/* Store the CPU id (not the logical number) */
73int sb1250_irq_owner[SB1250_NR_IRQS]; 72int sb1250_irq_owner[SB1250_NR_IRQS];
74 73
75DEFINE_SPINLOCK(sb1250_imr_lock); 74static DEFINE_RAW_SPINLOCK(sb1250_imr_lock);
76 75
77void sb1250_mask_irq(int cpu, int irq) 76void sb1250_mask_irq(int cpu, int irq)
78{ 77{
79 unsigned long flags; 78 unsigned long flags;
80 u64 cur_ints; 79 u64 cur_ints;
81 80
82 spin_lock_irqsave(&sb1250_imr_lock, flags); 81 raw_spin_lock_irqsave(&sb1250_imr_lock, flags);
83 cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(cpu) + 82 cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(cpu) +
84 R_IMR_INTERRUPT_MASK)); 83 R_IMR_INTERRUPT_MASK));
85 cur_ints |= (((u64) 1) << irq); 84 cur_ints |= (((u64) 1) << irq);
86 ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + 85 ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) +
87 R_IMR_INTERRUPT_MASK)); 86 R_IMR_INTERRUPT_MASK));
88 spin_unlock_irqrestore(&sb1250_imr_lock, flags); 87 raw_spin_unlock_irqrestore(&sb1250_imr_lock, flags);
89} 88}
90 89
91void sb1250_unmask_irq(int cpu, int irq) 90void sb1250_unmask_irq(int cpu, int irq)
@@ -93,13 +92,13 @@ void sb1250_unmask_irq(int cpu, int irq)
93 unsigned long flags; 92 unsigned long flags;
94 u64 cur_ints; 93 u64 cur_ints;
95 94
96 spin_lock_irqsave(&sb1250_imr_lock, flags); 95 raw_spin_lock_irqsave(&sb1250_imr_lock, flags);
97 cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(cpu) + 96 cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(cpu) +
98 R_IMR_INTERRUPT_MASK)); 97 R_IMR_INTERRUPT_MASK));
99 cur_ints &= ~(((u64) 1) << irq); 98 cur_ints &= ~(((u64) 1) << irq);
100 ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + 99 ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) +
101 R_IMR_INTERRUPT_MASK)); 100 R_IMR_INTERRUPT_MASK));
102 spin_unlock_irqrestore(&sb1250_imr_lock, flags); 101 raw_spin_unlock_irqrestore(&sb1250_imr_lock, flags);
103} 102}
104 103
105#ifdef CONFIG_SMP 104#ifdef CONFIG_SMP
@@ -115,7 +114,7 @@ static int sb1250_set_affinity(unsigned int irq, const struct cpumask *mask)
115 cpu = cpu_logical_map(i); 114 cpu = cpu_logical_map(i);
116 115
117 /* Protect against other affinity changers and IMR manipulation */ 116 /* Protect against other affinity changers and IMR manipulation */
118 spin_lock_irqsave(&sb1250_imr_lock, flags); 117 raw_spin_lock_irqsave(&sb1250_imr_lock, flags);
119 118
120 /* Swizzle each CPU's IMR (but leave the IP selection alone) */ 119 /* Swizzle each CPU's IMR (but leave the IP selection alone) */
121 old_cpu = sb1250_irq_owner[irq]; 120 old_cpu = sb1250_irq_owner[irq];
@@ -137,7 +136,7 @@ static int sb1250_set_affinity(unsigned int irq, const struct cpumask *mask)
137 ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + 136 ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) +
138 R_IMR_INTERRUPT_MASK)); 137 R_IMR_INTERRUPT_MASK));
139 } 138 }
140 spin_unlock_irqrestore(&sb1250_imr_lock, flags); 139 raw_spin_unlock_irqrestore(&sb1250_imr_lock, flags);
141 140
142 return 0; 141 return 0;
143} 142}
diff --git a/arch/mips/sibyte/sb1250/setup.c b/arch/mips/sibyte/sb1250/setup.c
index 0444da1e23c2..92da3155ce07 100644
--- a/arch/mips/sibyte/sb1250/setup.c
+++ b/arch/mips/sibyte/sb1250/setup.c
@@ -87,6 +87,21 @@ static int __init setup_bcm1250(void)
87 return ret; 87 return ret;
88} 88}
89 89
90int sb1250_m3_workaround_needed(void)
91{
92 switch (soc_type) {
93 case K_SYS_SOC_TYPE_BCM1250:
94 case K_SYS_SOC_TYPE_BCM1250_ALT:
95 case K_SYS_SOC_TYPE_BCM1250_ALT2:
96 case K_SYS_SOC_TYPE_BCM1125:
97 case K_SYS_SOC_TYPE_BCM1125H:
98 return soc_pass < K_SYS_REVISION_BCM1250_C0;
99
100 default:
101 return 0;
102 }
103}
104
90static int __init setup_bcm112x(void) 105static int __init setup_bcm112x(void)
91{ 106{
92 int ret = 0; 107 int ret = 0;
diff --git a/arch/mips/sibyte/swarm/setup.c b/arch/mips/sibyte/swarm/setup.c
index 5277aac96b0f..c308989fc464 100644
--- a/arch/mips/sibyte/swarm/setup.c
+++ b/arch/mips/sibyte/swarm/setup.c
@@ -145,15 +145,14 @@ void __init plat_mem_setup(void)
145 145
146#ifdef CONFIG_VT 146#ifdef CONFIG_VT
147 screen_info = (struct screen_info) { 147 screen_info = (struct screen_info) {
148 0, 0, /* orig-x, orig-y */ 148 .orig_video_page = 52,
149 0, /* unused */ 149 .orig_video_mode = 3,
150 52, /* orig_video_page */ 150 .orig_video_cols = 80,
151 3, /* orig_video_mode */ 151 .flags = 12,
152 80, /* orig_video_cols */ 152 .orig_video_ega_bx = 3,
153 4626, 3, 9, /* unused, ega_bx, unused */ 153 .orig_video_lines = 25,
154 25, /* orig_video_lines */ 154 .orig_video_isVGA = 0x22,
155 0x22, /* orig_video_isVGA */ 155 .orig_video_points = 16,
156 16 /* orig_video_points */
157 }; 156 };
158 /* XXXKW for CFE, get lines/cols from environment */ 157 /* XXXKW for CFE, get lines/cols from environment */
159#endif 158#endif