diff options
-rw-r--r-- | arch/powerpc/platforms/celleb/beat.c | 17 | ||||
-rw-r--r-- | arch/powerpc/platforms/celleb/beat.h | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/celleb/beat_wrapper.h | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/celleb/htab.c | 7 | ||||
-rw-r--r-- | arch/powerpc/platforms/celleb/interrupt.c | 26 | ||||
-rw-r--r-- | arch/powerpc/platforms/celleb/scc_epci.c | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/celleb/scc_sio.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/celleb/spu_priv1.c | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/celleb/udbg_beat.c | 5 |
9 files changed, 39 insertions, 38 deletions
diff --git a/arch/powerpc/platforms/celleb/beat.c b/arch/powerpc/platforms/celleb/beat.c index 93ebb7d8512..b64b171f245 100644 --- a/arch/powerpc/platforms/celleb/beat.c +++ b/arch/powerpc/platforms/celleb/beat.c | |||
@@ -48,6 +48,7 @@ void beat_power_off(void) | |||
48 | } | 48 | } |
49 | 49 | ||
50 | u64 beat_halt_code = 0x1000000000000000UL; | 50 | u64 beat_halt_code = 0x1000000000000000UL; |
51 | EXPORT_SYMBOL(beat_halt_code); | ||
51 | 52 | ||
52 | void beat_halt(void) | 53 | void beat_halt(void) |
53 | { | 54 | { |
@@ -94,9 +95,8 @@ ssize_t beat_nvram_read(char *buf, size_t count, loff_t *index) | |||
94 | len = count; | 95 | len = count; |
95 | if (len > BEAT_NVRW_CNT) | 96 | if (len > BEAT_NVRW_CNT) |
96 | len = BEAT_NVRW_CNT; | 97 | len = BEAT_NVRW_CNT; |
97 | if (beat_eeprom_read(i, len, p)) { | 98 | if (beat_eeprom_read(i, len, p)) |
98 | return -EIO; | 99 | return -EIO; |
99 | } | ||
100 | 100 | ||
101 | p += len; | 101 | p += len; |
102 | i += len; | 102 | i += len; |
@@ -121,9 +121,8 @@ ssize_t beat_nvram_write(char *buf, size_t count, loff_t *index) | |||
121 | len = count; | 121 | len = count; |
122 | if (len > BEAT_NVRW_CNT) | 122 | if (len > BEAT_NVRW_CNT) |
123 | len = BEAT_NVRW_CNT; | 123 | len = BEAT_NVRW_CNT; |
124 | if (beat_eeprom_write(i, len, p)) { | 124 | if (beat_eeprom_write(i, len, p)) |
125 | return -EIO; | 125 | return -EIO; |
126 | } | ||
127 | 126 | ||
128 | p += len; | 127 | p += len; |
129 | i += len; | 128 | i += len; |
@@ -149,13 +148,14 @@ int64_t beat_get_term_char(u64 vterm, u64 *len, u64 *t1, u64 *t2) | |||
149 | u64 db[2]; | 148 | u64 db[2]; |
150 | s64 ret; | 149 | s64 ret; |
151 | 150 | ||
152 | ret = beat_get_characters_from_console(vterm, len, (u8*)db); | 151 | ret = beat_get_characters_from_console(vterm, len, (u8 *)db); |
153 | if (ret == 0) { | 152 | if (ret == 0) { |
154 | *t1 = db[0]; | 153 | *t1 = db[0]; |
155 | *t2 = db[1]; | 154 | *t2 = db[1]; |
156 | } | 155 | } |
157 | return ret; | 156 | return ret; |
158 | } | 157 | } |
158 | EXPORT_SYMBOL(beat_get_term_char); | ||
159 | 159 | ||
160 | int64_t beat_put_term_char(u64 vterm, u64 len, u64 t1, u64 t2) | 160 | int64_t beat_put_term_char(u64 vterm, u64 len, u64 t1, u64 t2) |
161 | { | 161 | { |
@@ -163,8 +163,9 @@ int64_t beat_put_term_char(u64 vterm, u64 len, u64 t1, u64 t2) | |||
163 | 163 | ||
164 | db[0] = t1; | 164 | db[0] = t1; |
165 | db[1] = t2; | 165 | db[1] = t2; |
166 | return beat_put_characters_to_console(vterm, len, (u8*)db); | 166 | return beat_put_characters_to_console(vterm, len, (u8 *)db); |
167 | } | 167 | } |
168 | EXPORT_SYMBOL(beat_put_term_char); | ||
168 | 169 | ||
169 | void beat_power_save(void) | 170 | void beat_power_save(void) |
170 | { | 171 | { |
@@ -261,7 +262,3 @@ static int __init beat_event_init(void) | |||
261 | } | 262 | } |
262 | 263 | ||
263 | device_initcall(beat_event_init); | 264 | device_initcall(beat_event_init); |
264 | |||
265 | EXPORT_SYMBOL(beat_get_term_char); | ||
266 | EXPORT_SYMBOL(beat_put_term_char); | ||
267 | EXPORT_SYMBOL(beat_halt_code); | ||
diff --git a/arch/powerpc/platforms/celleb/beat.h b/arch/powerpc/platforms/celleb/beat.h index ac82ac35b99..32c8efcedc8 100644 --- a/arch/powerpc/platforms/celleb/beat.h +++ b/arch/powerpc/platforms/celleb/beat.h | |||
@@ -21,8 +21,8 @@ | |||
21 | #ifndef _CELLEB_BEAT_H | 21 | #ifndef _CELLEB_BEAT_H |
22 | #define _CELLEB_BEAT_H | 22 | #define _CELLEB_BEAT_H |
23 | 23 | ||
24 | int64_t beat_get_term_char(uint64_t,uint64_t*,uint64_t*,uint64_t*); | 24 | int64_t beat_get_term_char(uint64_t, uint64_t *, uint64_t *, uint64_t *); |
25 | int64_t beat_put_term_char(uint64_t,uint64_t,uint64_t,uint64_t); | 25 | int64_t beat_put_term_char(uint64_t, uint64_t, uint64_t, uint64_t); |
26 | int64_t beat_repository_encode(int, const char *, uint64_t[4]); | 26 | int64_t beat_repository_encode(int, const char *, uint64_t[4]); |
27 | void beat_restart(char *); | 27 | void beat_restart(char *); |
28 | void beat_power_off(void); | 28 | void beat_power_off(void); |
diff --git a/arch/powerpc/platforms/celleb/beat_wrapper.h b/arch/powerpc/platforms/celleb/beat_wrapper.h index cbc1487df7d..b47dfda48d0 100644 --- a/arch/powerpc/platforms/celleb/beat_wrapper.h +++ b/arch/powerpc/platforms/celleb/beat_wrapper.h | |||
@@ -197,7 +197,8 @@ static inline s64 beat_put_characters_to_console(u64 termno, u64 len, | |||
197 | u64 b[2]; | 197 | u64 b[2]; |
198 | 198 | ||
199 | memcpy(b, buffer, len); | 199 | memcpy(b, buffer, len); |
200 | return beat_hcall_norets(HV_put_characters_to_console, termno, len, b[0], b[1]); | 200 | return beat_hcall_norets(HV_put_characters_to_console, termno, len, |
201 | b[0], b[1]); | ||
201 | } | 202 | } |
202 | 203 | ||
203 | static inline s64 beat_get_spe_privileged_state_1_registers( | 204 | static inline s64 beat_get_spe_privileged_state_1_registers( |
diff --git a/arch/powerpc/platforms/celleb/htab.c b/arch/powerpc/platforms/celleb/htab.c index fbf27c74ebd..81467ff055c 100644 --- a/arch/powerpc/platforms/celleb/htab.c +++ b/arch/powerpc/platforms/celleb/htab.c | |||
@@ -35,9 +35,9 @@ | |||
35 | #include "beat_wrapper.h" | 35 | #include "beat_wrapper.h" |
36 | 36 | ||
37 | #ifdef DEBUG_LOW | 37 | #ifdef DEBUG_LOW |
38 | #define DBG_LOW(fmt...) do { udbg_printf(fmt); } while(0) | 38 | #define DBG_LOW(fmt...) do { udbg_printf(fmt); } while (0) |
39 | #else | 39 | #else |
40 | #define DBG_LOW(fmt...) do { } while(0) | 40 | #define DBG_LOW(fmt...) do { } while (0) |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | static DEFINE_SPINLOCK(beat_htab_lock); | 43 | static DEFINE_SPINLOCK(beat_htab_lock); |
@@ -116,7 +116,8 @@ static long beat_lpar_hpte_insert(unsigned long hpte_group, | |||
116 | hpte_r &= ~_PAGE_COHERENT; | 116 | hpte_r &= ~_PAGE_COHERENT; |
117 | 117 | ||
118 | spin_lock(&beat_htab_lock); | 118 | spin_lock(&beat_htab_lock); |
119 | if ((lpar_rc = beat_read_mask(hpte_group)) == 0) { | 119 | lpar_rc = beat_read_mask(hpte_group); |
120 | if (lpar_rc == 0) { | ||
120 | if (!(vflags & HPTE_V_BOLTED)) | 121 | if (!(vflags & HPTE_V_BOLTED)) |
121 | DBG_LOW(" full\n"); | 122 | DBG_LOW(" full\n"); |
122 | spin_unlock(&beat_htab_lock); | 123 | spin_unlock(&beat_htab_lock); |
diff --git a/arch/powerpc/platforms/celleb/interrupt.c b/arch/powerpc/platforms/celleb/interrupt.c index c7c68ca70c8..69562a86787 100644 --- a/arch/powerpc/platforms/celleb/interrupt.c +++ b/arch/powerpc/platforms/celleb/interrupt.c | |||
@@ -34,7 +34,7 @@ static DEFINE_SPINLOCK(beatic_irq_mask_lock); | |||
34 | static uint64_t beatic_irq_mask_enable[(MAX_IRQS+255)/64]; | 34 | static uint64_t beatic_irq_mask_enable[(MAX_IRQS+255)/64]; |
35 | static uint64_t beatic_irq_mask_ack[(MAX_IRQS+255)/64]; | 35 | static uint64_t beatic_irq_mask_ack[(MAX_IRQS+255)/64]; |
36 | 36 | ||
37 | static struct irq_host *beatic_host = NULL; | 37 | static struct irq_host *beatic_host; |
38 | 38 | ||
39 | /* | 39 | /* |
40 | * In this implementation, "virq" == "IRQ plug number", | 40 | * In this implementation, "virq" == "IRQ plug number", |
@@ -49,13 +49,13 @@ static inline void beatic_update_irq_mask(unsigned int irq_plug) | |||
49 | 49 | ||
50 | off = (irq_plug / 256) * 4; | 50 | off = (irq_plug / 256) * 4; |
51 | masks[0] = beatic_irq_mask_enable[off + 0] | 51 | masks[0] = beatic_irq_mask_enable[off + 0] |
52 | & beatic_irq_mask_ack[off + 0]; | 52 | & beatic_irq_mask_ack[off + 0]; |
53 | masks[1] = beatic_irq_mask_enable[off + 1] | 53 | masks[1] = beatic_irq_mask_enable[off + 1] |
54 | & beatic_irq_mask_ack[off + 1]; | 54 | & beatic_irq_mask_ack[off + 1]; |
55 | masks[2] = beatic_irq_mask_enable[off + 2] | 55 | masks[2] = beatic_irq_mask_enable[off + 2] |
56 | & beatic_irq_mask_ack[off + 2]; | 56 | & beatic_irq_mask_ack[off + 2]; |
57 | masks[3] = beatic_irq_mask_enable[off + 3] | 57 | masks[3] = beatic_irq_mask_enable[off + 3] |
58 | & beatic_irq_mask_ack[off + 3]; | 58 | & beatic_irq_mask_ack[off + 3]; |
59 | if (beat_set_interrupt_mask(irq_plug&~255UL, | 59 | if (beat_set_interrupt_mask(irq_plug&~255UL, |
60 | masks[0], masks[1], masks[2], masks[3]) != 0) | 60 | masks[0], masks[1], masks[2], masks[3]) != 0) |
61 | panic("Failed to set mask IRQ!"); | 61 | panic("Failed to set mask IRQ!"); |
@@ -96,7 +96,8 @@ static void beatic_end_irq(unsigned int irq_plug) | |||
96 | s64 err; | 96 | s64 err; |
97 | unsigned long flags; | 97 | unsigned long flags; |
98 | 98 | ||
99 | if ((err = beat_downcount_of_interrupt(irq_plug)) != 0) { | 99 | err = beat_downcount_of_interrupt(irq_plug); |
100 | if (err != 0) { | ||
100 | if ((err & 0xFFFFFFFF) != 0xFFFFFFF5) /* -11: wrong state */ | 101 | if ((err & 0xFFFFFFFF) != 0xFFFFFFF5) /* -11: wrong state */ |
101 | panic("Failed to downcount IRQ! Error = %16lx", err); | 102 | panic("Failed to downcount IRQ! Error = %16lx", err); |
102 | 103 | ||
@@ -138,7 +139,8 @@ static int beatic_pic_host_map(struct irq_host *h, unsigned int virq, | |||
138 | struct irq_desc *desc = get_irq_desc(virq); | 139 | struct irq_desc *desc = get_irq_desc(virq); |
139 | int64_t err; | 140 | int64_t err; |
140 | 141 | ||
141 | if ((err = beat_construct_and_connect_irq_plug(virq, hw)) < 0) | 142 | err = beat_construct_and_connect_irq_plug(virq, hw); |
143 | if (err < 0) | ||
142 | return -EIO; | 144 | return -EIO; |
143 | 145 | ||
144 | desc->status |= IRQ_LEVEL; | 146 | desc->status |= IRQ_LEVEL; |
@@ -202,22 +204,22 @@ static inline unsigned int beatic_get_irq_plug(void) | |||
202 | beat_detect_pending_interrupts(i, pending); | 204 | beat_detect_pending_interrupts(i, pending); |
203 | __asm__ ("cntlzd %0,%1":"=r"(ub): | 205 | __asm__ ("cntlzd %0,%1":"=r"(ub): |
204 | "r"(pending[0] & beatic_irq_mask_enable[i/64+0] | 206 | "r"(pending[0] & beatic_irq_mask_enable[i/64+0] |
205 | & beatic_irq_mask_ack[i/64+0])); | 207 | & beatic_irq_mask_ack[i/64+0])); |
206 | if (ub != 64) | 208 | if (ub != 64) |
207 | return i + ub + 0; | 209 | return i + ub + 0; |
208 | __asm__ ("cntlzd %0,%1":"=r"(ub): | 210 | __asm__ ("cntlzd %0,%1":"=r"(ub): |
209 | "r"(pending[1] & beatic_irq_mask_enable[i/64+1] | 211 | "r"(pending[1] & beatic_irq_mask_enable[i/64+1] |
210 | & beatic_irq_mask_ack[i/64+1])); | 212 | & beatic_irq_mask_ack[i/64+1])); |
211 | if (ub != 64) | 213 | if (ub != 64) |
212 | return i + ub + 64; | 214 | return i + ub + 64; |
213 | __asm__ ("cntlzd %0,%1":"=r"(ub): | 215 | __asm__ ("cntlzd %0,%1":"=r"(ub): |
214 | "r"(pending[2] & beatic_irq_mask_enable[i/64+2] | 216 | "r"(pending[2] & beatic_irq_mask_enable[i/64+2] |
215 | & beatic_irq_mask_ack[i/64+2])); | 217 | & beatic_irq_mask_ack[i/64+2])); |
216 | if (ub != 64) | 218 | if (ub != 64) |
217 | return i + ub + 128; | 219 | return i + ub + 128; |
218 | __asm__ ("cntlzd %0,%1":"=r"(ub): | 220 | __asm__ ("cntlzd %0,%1":"=r"(ub): |
219 | "r"(pending[3] & beatic_irq_mask_enable[i/64+3] | 221 | "r"(pending[3] & beatic_irq_mask_enable[i/64+3] |
220 | & beatic_irq_mask_ack[i/64+3])); | 222 | & beatic_irq_mask_ack[i/64+3])); |
221 | if (ub != 64) | 223 | if (ub != 64) |
222 | return i + ub + 192; | 224 | return i + ub + 192; |
223 | } | 225 | } |
@@ -250,7 +252,7 @@ void __init beatic_init_IRQ(void) | |||
250 | 252 | ||
251 | /* Allocate an irq host */ | 253 | /* Allocate an irq host */ |
252 | beatic_host = irq_alloc_host(NULL, IRQ_HOST_MAP_NOMAP, 0, | 254 | beatic_host = irq_alloc_host(NULL, IRQ_HOST_MAP_NOMAP, 0, |
253 | &beatic_pic_host_ops, | 255 | &beatic_pic_host_ops, |
254 | 0); | 256 | 0); |
255 | BUG_ON(beatic_host == NULL); | 257 | BUG_ON(beatic_host == NULL); |
256 | irq_set_default_host(beatic_host); | 258 | irq_set_default_host(beatic_host); |
diff --git a/arch/powerpc/platforms/celleb/scc_epci.c b/arch/powerpc/platforms/celleb/scc_epci.c index a3c7cfbcb32..a999b393f6f 100644 --- a/arch/powerpc/platforms/celleb/scc_epci.c +++ b/arch/powerpc/platforms/celleb/scc_epci.c | |||
@@ -161,9 +161,9 @@ static PCI_IO_ADDR celleb_epci_make_config_addr( | |||
161 | if (bus != hose->bus) | 161 | if (bus != hose->bus) |
162 | addr = celleb_epci_get_epci_cfg(hose) + | 162 | addr = celleb_epci_get_epci_cfg(hose) + |
163 | (((bus->number & 0xff) << 16) | 163 | (((bus->number & 0xff) << 16) |
164 | | ((devfn & 0xff) << 8) | 164 | | ((devfn & 0xff) << 8) |
165 | | (where & 0xff) | 165 | | (where & 0xff) |
166 | | 0x01000000); | 166 | | 0x01000000); |
167 | else | 167 | else |
168 | addr = celleb_epci_get_epci_cfg(hose) + | 168 | addr = celleb_epci_get_epci_cfg(hose) + |
169 | (((devfn & 0xff) << 8) | (where & 0xff)); | 169 | (((devfn & 0xff) << 8) | (where & 0xff)); |
@@ -174,7 +174,7 @@ static PCI_IO_ADDR celleb_epci_make_config_addr( | |||
174 | } | 174 | } |
175 | 175 | ||
176 | static int celleb_epci_read_config(struct pci_bus *bus, | 176 | static int celleb_epci_read_config(struct pci_bus *bus, |
177 | unsigned int devfn, int where, int size, u32 * val) | 177 | unsigned int devfn, int where, int size, u32 *val) |
178 | { | 178 | { |
179 | PCI_IO_ADDR epci_base; | 179 | PCI_IO_ADDR epci_base; |
180 | PCI_IO_ADDR addr; | 180 | PCI_IO_ADDR addr; |
diff --git a/arch/powerpc/platforms/celleb/scc_sio.c b/arch/powerpc/platforms/celleb/scc_sio.c index 610008211ca..3a16c5b3c46 100644 --- a/arch/powerpc/platforms/celleb/scc_sio.c +++ b/arch/powerpc/platforms/celleb/scc_sio.c | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | /* sio irq0=0xb00010022 irq0=0xb00010023 irq2=0xb00010024 | 29 | /* sio irq0=0xb00010022 irq0=0xb00010023 irq2=0xb00010024 |
30 | mmio=0xfff000-0x1000,0xff2000-0x1000 */ | 30 | mmio=0xfff000-0x1000,0xff2000-0x1000 */ |
31 | static int txx9_serial_bitmap __initdata = 0; | 31 | static int txx9_serial_bitmap __initdata; |
32 | 32 | ||
33 | static struct { | 33 | static struct { |
34 | uint32_t offset; | 34 | uint32_t offset; |
@@ -84,7 +84,7 @@ static int __init txx9_serial_config(char *ptr) | |||
84 | int i; | 84 | int i; |
85 | 85 | ||
86 | for (;;) { | 86 | for (;;) { |
87 | switch(get_option(&ptr, &i)) { | 87 | switch (get_option(&ptr, &i)) { |
88 | default: | 88 | default: |
89 | return 0; | 89 | return 0; |
90 | case 2: | 90 | case 2: |
diff --git a/arch/powerpc/platforms/celleb/spu_priv1.c b/arch/powerpc/platforms/celleb/spu_priv1.c index 2bf6700f747..bcc17f7fe8a 100644 --- a/arch/powerpc/platforms/celleb/spu_priv1.c +++ b/arch/powerpc/platforms/celleb/spu_priv1.c | |||
@@ -183,8 +183,7 @@ static u64 resource_allocation_enable_get(struct spu *spu) | |||
183 | return enable; | 183 | return enable; |
184 | } | 184 | } |
185 | 185 | ||
186 | const struct spu_priv1_ops spu_priv1_beat_ops = | 186 | const struct spu_priv1_ops spu_priv1_beat_ops = { |
187 | { | ||
188 | .int_mask_and = int_mask_and, | 187 | .int_mask_and = int_mask_and, |
189 | .int_mask_or = int_mask_or, | 188 | .int_mask_or = int_mask_or, |
190 | .int_mask_set = int_mask_set, | 189 | .int_mask_set = int_mask_set, |
diff --git a/arch/powerpc/platforms/celleb/udbg_beat.c b/arch/powerpc/platforms/celleb/udbg_beat.c index d888c4674c6..6b418f6b617 100644 --- a/arch/powerpc/platforms/celleb/udbg_beat.c +++ b/arch/powerpc/platforms/celleb/udbg_beat.c | |||
@@ -54,7 +54,8 @@ static int udbg_getc_poll_beat(void) | |||
54 | if (inbuflen == 0) { | 54 | if (inbuflen == 0) { |
55 | /* get some more chars. */ | 55 | /* get some more chars. */ |
56 | inbuflen = 0; | 56 | inbuflen = 0; |
57 | rc = beat_get_term_char(celleb_vtermno, &inbuflen, inbuf+0, inbuf+1); | 57 | rc = beat_get_term_char(celleb_vtermno, &inbuflen, |
58 | inbuf+0, inbuf+1); | ||
58 | if (rc != 0) | 59 | if (rc != 0) |
59 | inbuflen = 0; /* otherwise inbuflen is garbage */ | 60 | inbuflen = 0; /* otherwise inbuflen is garbage */ |
60 | } | 61 | } |
@@ -78,7 +79,7 @@ static int udbg_getc_beat(void) | |||
78 | if (ch == -1) { | 79 | if (ch == -1) { |
79 | /* This shouldn't be needed...but... */ | 80 | /* This shouldn't be needed...but... */ |
80 | volatile unsigned long delay; | 81 | volatile unsigned long delay; |
81 | for (delay=0; delay < 2000000; delay++) | 82 | for (delay = 0; delay < 2000000; delay++) |
82 | ; | 83 | ; |
83 | } else { | 84 | } else { |
84 | return ch; | 85 | return ch; |