diff options
Diffstat (limited to 'include/asm-sparc64')
26 files changed, 423 insertions, 197 deletions
diff --git a/include/asm-sparc64/cpudata.h b/include/asm-sparc64/cpudata.h index 9d6a6dbaf126..f2cc9411b4c7 100644 --- a/include/asm-sparc64/cpudata.h +++ b/include/asm-sparc64/cpudata.h | |||
@@ -74,8 +74,10 @@ struct trap_per_cpu { | |||
74 | unsigned long tsb_huge; | 74 | unsigned long tsb_huge; |
75 | unsigned long tsb_huge_temp; | 75 | unsigned long tsb_huge_temp; |
76 | 76 | ||
77 | /* Dcache line 8: Unused, needed to keep trap_block a power-of-2 in size. */ | 77 | /* Dcache line 8: IRQ work list, and keep trap_block a power-of-2 in size. */ |
78 | unsigned long __pad2[4]; | 78 | unsigned int irq_worklist; |
79 | unsigned int __pad1; | ||
80 | unsigned long __pad2[3]; | ||
79 | } __attribute__((aligned(64))); | 81 | } __attribute__((aligned(64))); |
80 | extern struct trap_per_cpu trap_block[NR_CPUS]; | 82 | extern struct trap_per_cpu trap_block[NR_CPUS]; |
81 | extern void init_cur_cpu_trap(struct thread_info *); | 83 | extern void init_cur_cpu_trap(struct thread_info *); |
@@ -119,6 +121,7 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch, | |||
119 | #define TRAP_PER_CPU_CPU_LIST_PA 0xc8 | 121 | #define TRAP_PER_CPU_CPU_LIST_PA 0xc8 |
120 | #define TRAP_PER_CPU_TSB_HUGE 0xd0 | 122 | #define TRAP_PER_CPU_TSB_HUGE 0xd0 |
121 | #define TRAP_PER_CPU_TSB_HUGE_TEMP 0xd8 | 123 | #define TRAP_PER_CPU_TSB_HUGE_TEMP 0xd8 |
124 | #define TRAP_PER_CPU_IRQ_WORKLIST 0xe0 | ||
122 | 125 | ||
123 | #define TRAP_BLOCK_SZ_SHIFT 8 | 126 | #define TRAP_BLOCK_SZ_SHIFT 8 |
124 | 127 | ||
@@ -171,11 +174,8 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch, | |||
171 | 174 | ||
172 | /* Clobbers TMP, loads local processor's IRQ work area into DEST. */ | 175 | /* Clobbers TMP, loads local processor's IRQ work area into DEST. */ |
173 | #define TRAP_LOAD_IRQ_WORK(DEST, TMP) \ | 176 | #define TRAP_LOAD_IRQ_WORK(DEST, TMP) \ |
174 | __GET_CPUID(TMP) \ | 177 | TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \ |
175 | sethi %hi(__irq_work), DEST; \ | 178 | add DEST, TRAP_PER_CPU_IRQ_WORKLIST, DEST; |
176 | sllx TMP, 6, TMP; \ | ||
177 | or DEST, %lo(__irq_work), DEST; \ | ||
178 | add DEST, TMP, DEST; | ||
179 | 179 | ||
180 | /* Clobbers TMP, loads DEST with current thread info pointer. */ | 180 | /* Clobbers TMP, loads DEST with current thread info pointer. */ |
181 | #define TRAP_LOAD_THREAD_REG(DEST, TMP) \ | 181 | #define TRAP_LOAD_THREAD_REG(DEST, TMP) \ |
@@ -211,9 +211,10 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch, | |||
211 | TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \ | 211 | TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \ |
212 | ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST; | 212 | ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST; |
213 | 213 | ||
214 | /* Clobbers TMP, loads local processor's IRQ work area into DEST. */ | ||
214 | #define TRAP_LOAD_IRQ_WORK(DEST, TMP) \ | 215 | #define TRAP_LOAD_IRQ_WORK(DEST, TMP) \ |
215 | sethi %hi(__irq_work), DEST; \ | 216 | TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \ |
216 | or DEST, %lo(__irq_work), DEST; | 217 | add DEST, TRAP_PER_CPU_IRQ_WORKLIST, DEST; |
217 | 218 | ||
218 | #define TRAP_LOAD_THREAD_REG(DEST, TMP) \ | 219 | #define TRAP_LOAD_THREAD_REG(DEST, TMP) \ |
219 | TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \ | 220 | TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \ |
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h index 3c2b5bc8650b..0f5b89c9323b 100644 --- a/include/asm-sparc64/dma-mapping.h +++ b/include/asm-sparc64/dma-mapping.h | |||
@@ -162,4 +162,47 @@ static inline void dma_free_coherent(struct device *dev, size_t size, | |||
162 | 162 | ||
163 | #endif /* PCI */ | 163 | #endif /* PCI */ |
164 | 164 | ||
165 | |||
166 | /* Now for the API extensions over the pci_ one */ | ||
167 | |||
168 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | ||
169 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | ||
170 | #define dma_is_consistent(d) (1) | ||
171 | |||
172 | static inline int | ||
173 | dma_get_cache_alignment(void) | ||
174 | { | ||
175 | /* no easy way to get cache size on all processors, so return | ||
176 | * the maximum possible, to be safe */ | ||
177 | return (1 << INTERNODE_CACHE_SHIFT); | ||
178 | } | ||
179 | |||
180 | static inline void | ||
181 | dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, | ||
182 | unsigned long offset, size_t size, | ||
183 | enum dma_data_direction direction) | ||
184 | { | ||
185 | /* just sync everything, that's all the pci API can do */ | ||
186 | dma_sync_single_for_cpu(dev, dma_handle, offset+size, direction); | ||
187 | } | ||
188 | |||
189 | static inline void | ||
190 | dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, | ||
191 | unsigned long offset, size_t size, | ||
192 | enum dma_data_direction direction) | ||
193 | { | ||
194 | /* just sync everything, that's all the pci API can do */ | ||
195 | dma_sync_single_for_device(dev, dma_handle, offset+size, direction); | ||
196 | } | ||
197 | |||
198 | static inline void | ||
199 | dma_cache_sync(void *vaddr, size_t size, | ||
200 | enum dma_data_direction direction) | ||
201 | { | ||
202 | /* could define this in terms of the dma_cache ... operations, | ||
203 | * but if you get this on a platform, you should convert the platform | ||
204 | * to using the generic device DMA API */ | ||
205 | BUG(); | ||
206 | } | ||
207 | |||
165 | #endif /* _ASM_SPARC64_DMA_MAPPING_H */ | 208 | #endif /* _ASM_SPARC64_DMA_MAPPING_H */ |
diff --git a/include/asm-sparc64/ebus.h b/include/asm-sparc64/ebus.h index 7a408a030f52..a4afe9d5703a 100644 --- a/include/asm-sparc64/ebus.h +++ b/include/asm-sparc64/ebus.h | |||
@@ -10,13 +10,14 @@ | |||
10 | 10 | ||
11 | #include <asm/pbm.h> | 11 | #include <asm/pbm.h> |
12 | #include <asm/oplib.h> | 12 | #include <asm/oplib.h> |
13 | #include <asm/prom.h> | ||
14 | #include <asm/of_device.h> | ||
13 | 15 | ||
14 | struct linux_ebus_child { | 16 | struct linux_ebus_child { |
15 | struct linux_ebus_child *next; | 17 | struct linux_ebus_child *next; |
16 | struct linux_ebus_device *parent; | 18 | struct linux_ebus_device *parent; |
17 | struct linux_ebus *bus; | 19 | struct linux_ebus *bus; |
18 | int prom_node; | 20 | struct device_node *prom_node; |
19 | char prom_name[64]; | ||
20 | struct resource resource[PROMREG_MAX]; | 21 | struct resource resource[PROMREG_MAX]; |
21 | int num_addrs; | 22 | int num_addrs; |
22 | unsigned int irqs[PROMINTR_MAX]; | 23 | unsigned int irqs[PROMINTR_MAX]; |
@@ -24,32 +25,29 @@ struct linux_ebus_child { | |||
24 | }; | 25 | }; |
25 | 26 | ||
26 | struct linux_ebus_device { | 27 | struct linux_ebus_device { |
28 | struct of_device ofdev; | ||
27 | struct linux_ebus_device *next; | 29 | struct linux_ebus_device *next; |
28 | struct linux_ebus_child *children; | 30 | struct linux_ebus_child *children; |
29 | struct linux_ebus *bus; | 31 | struct linux_ebus *bus; |
30 | int prom_node; | 32 | struct device_node *prom_node; |
31 | char prom_name[64]; | ||
32 | struct resource resource[PROMREG_MAX]; | 33 | struct resource resource[PROMREG_MAX]; |
33 | int num_addrs; | 34 | int num_addrs; |
34 | unsigned int irqs[PROMINTR_MAX]; | 35 | unsigned int irqs[PROMINTR_MAX]; |
35 | int num_irqs; | 36 | int num_irqs; |
36 | }; | 37 | }; |
38 | #define to_ebus_device(d) container_of(d, struct linux_ebus_device, ofdev.dev) | ||
37 | 39 | ||
38 | struct linux_ebus { | 40 | struct linux_ebus { |
41 | struct of_device ofdev; | ||
39 | struct linux_ebus *next; | 42 | struct linux_ebus *next; |
40 | struct linux_ebus_device *devices; | 43 | struct linux_ebus_device *devices; |
41 | struct pci_pbm_info *parent; | 44 | struct pci_pbm_info *parent; |
42 | struct pci_dev *self; | 45 | struct pci_dev *self; |
43 | int index; | 46 | int index; |
44 | int is_rio; | 47 | int is_rio; |
45 | int prom_node; | 48 | struct device_node *prom_node; |
46 | char prom_name[64]; | ||
47 | struct linux_prom_ebus_ranges ebus_ranges[PROMREG_MAX]; | ||
48 | int num_ebus_ranges; | ||
49 | struct linux_prom_ebus_intmap ebus_intmap[PROMREG_MAX]; | ||
50 | int num_ebus_intmap; | ||
51 | struct linux_prom_ebus_intmask ebus_intmask; | ||
52 | }; | 49 | }; |
50 | #define to_ebus(d) container_of(d, struct linux_ebus, ofdev.dev) | ||
53 | 51 | ||
54 | struct ebus_dma_info { | 52 | struct ebus_dma_info { |
55 | spinlock_t lock; | 53 | spinlock_t lock; |
diff --git a/include/asm-sparc64/fhc.h b/include/asm-sparc64/fhc.h index f29eaa254055..9e7f1b0d78b9 100644 --- a/include/asm-sparc64/fhc.h +++ b/include/asm-sparc64/fhc.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/timer.h> | 10 | #include <linux/timer.h> |
11 | 11 | ||
12 | #include <asm/oplib.h> | 12 | #include <asm/oplib.h> |
13 | #include <asm/prom.h> | ||
13 | #include <asm/upa.h> | 14 | #include <asm/upa.h> |
14 | 15 | ||
15 | struct linux_fhc; | 16 | struct linux_fhc; |
@@ -34,8 +35,7 @@ struct linux_central { | |||
34 | unsigned long clkregs; | 35 | unsigned long clkregs; |
35 | unsigned long clkver; | 36 | unsigned long clkver; |
36 | int slots; | 37 | int slots; |
37 | int prom_node; | 38 | struct device_node *prom_node; |
38 | char prom_name[64]; | ||
39 | 39 | ||
40 | struct linux_prom_ranges central_ranges[PROMREG_MAX]; | 40 | struct linux_prom_ranges central_ranges[PROMREG_MAX]; |
41 | int num_central_ranges; | 41 | int num_central_ranges; |
@@ -112,8 +112,7 @@ struct linux_fhc { | |||
112 | struct fhc_regs fhc_regs; | 112 | struct fhc_regs fhc_regs; |
113 | int board; | 113 | int board; |
114 | int jtag_master; | 114 | int jtag_master; |
115 | int prom_node; | 115 | struct device_node *prom_node; |
116 | char prom_name[64]; | ||
117 | 116 | ||
118 | struct linux_prom_ranges fhc_ranges[PROMREG_MAX]; | 117 | struct linux_prom_ranges fhc_ranges[PROMREG_MAX]; |
119 | int num_fhc_ranges; | 118 | int num_fhc_ranges; |
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h index 07ccd6f04b52..abf150038019 100644 --- a/include/asm-sparc64/floppy.h +++ b/include/asm-sparc64/floppy.h | |||
@@ -208,7 +208,55 @@ static void sun_fd_enable_dma(void) | |||
208 | pdma_areasize = pdma_size; | 208 | pdma_areasize = pdma_size; |
209 | } | 209 | } |
210 | 210 | ||
211 | extern irqreturn_t sparc_floppy_irq(int, void *, struct pt_regs *); | 211 | irqreturn_t sparc_floppy_irq(int irq, void *dev_cookie, struct pt_regs *regs) |
212 | { | ||
213 | if (likely(doing_pdma)) { | ||
214 | void __iomem *stat = (void __iomem *) fdc_status; | ||
215 | unsigned char *vaddr = pdma_vaddr; | ||
216 | unsigned long size = pdma_size; | ||
217 | u8 val; | ||
218 | |||
219 | while (size) { | ||
220 | val = readb(stat); | ||
221 | if (unlikely(!(val & 0x80))) { | ||
222 | pdma_vaddr = vaddr; | ||
223 | pdma_size = size; | ||
224 | return IRQ_HANDLED; | ||
225 | } | ||
226 | if (unlikely(!(val & 0x20))) { | ||
227 | pdma_vaddr = vaddr; | ||
228 | pdma_size = size; | ||
229 | doing_pdma = 0; | ||
230 | goto main_interrupt; | ||
231 | } | ||
232 | if (val & 0x40) { | ||
233 | /* read */ | ||
234 | *vaddr++ = readb(stat + 1); | ||
235 | } else { | ||
236 | unsigned char data = *vaddr++; | ||
237 | |||
238 | /* write */ | ||
239 | writeb(data, stat + 1); | ||
240 | } | ||
241 | size--; | ||
242 | } | ||
243 | |||
244 | pdma_vaddr = vaddr; | ||
245 | pdma_size = size; | ||
246 | |||
247 | /* Send Terminal Count pulse to floppy controller. */ | ||
248 | val = readb(auxio_register); | ||
249 | val |= AUXIO_AUX1_FTCNT; | ||
250 | writeb(val, auxio_register); | ||
251 | val &= ~AUXIO_AUX1_FTCNT; | ||
252 | writeb(val, auxio_register); | ||
253 | |||
254 | doing_pdma = 0; | ||
255 | } | ||
256 | |||
257 | main_interrupt: | ||
258 | return floppy_interrupt(irq, dev_cookie, regs); | ||
259 | } | ||
212 | 260 | ||
213 | static int sun_fd_request_irq(void) | 261 | static int sun_fd_request_irq(void) |
214 | { | 262 | { |
@@ -219,7 +267,7 @@ static int sun_fd_request_irq(void) | |||
219 | once = 1; | 267 | once = 1; |
220 | 268 | ||
221 | error = request_irq(FLOPPY_IRQ, sparc_floppy_irq, | 269 | error = request_irq(FLOPPY_IRQ, sparc_floppy_irq, |
222 | SA_INTERRUPT, "floppy", NULL); | 270 | IRQF_DISABLED, "floppy", NULL); |
223 | 271 | ||
224 | return ((error == 0) ? 0 : -1); | 272 | return ((error == 0) ? 0 : -1); |
225 | } | 273 | } |
@@ -498,15 +546,14 @@ static int sun_pci_fd_test_drive(unsigned long port, int drive) | |||
498 | #ifdef CONFIG_PCI | 546 | #ifdef CONFIG_PCI |
499 | static int __init ebus_fdthree_p(struct linux_ebus_device *edev) | 547 | static int __init ebus_fdthree_p(struct linux_ebus_device *edev) |
500 | { | 548 | { |
501 | if (!strcmp(edev->prom_name, "fdthree")) | 549 | if (!strcmp(edev->prom_node->name, "fdthree")) |
502 | return 1; | 550 | return 1; |
503 | if (!strcmp(edev->prom_name, "floppy")) { | 551 | if (!strcmp(edev->prom_node->name, "floppy")) { |
504 | char compat[16]; | 552 | char *compat; |
505 | prom_getstring(edev->prom_node, | 553 | |
506 | "compatible", | 554 | compat = of_get_property(edev->prom_node, |
507 | compat, sizeof(compat)); | 555 | "compatible", NULL); |
508 | compat[15] = '\0'; | 556 | if (compat && !strcmp(compat, "fdthree")) |
509 | if (!strcmp(compat, "fdthree")) | ||
510 | return 1; | 557 | return 1; |
511 | } | 558 | } |
512 | return 0; | 559 | return 0; |
@@ -524,12 +571,12 @@ static unsigned long __init isa_floppy_init(void) | |||
524 | 571 | ||
525 | for_each_isa(isa_br) { | 572 | for_each_isa(isa_br) { |
526 | for_each_isadev(isa_dev, isa_br) { | 573 | for_each_isadev(isa_dev, isa_br) { |
527 | if (!strcmp(isa_dev->prom_name, "dma")) { | 574 | if (!strcmp(isa_dev->prom_node->name, "dma")) { |
528 | struct sparc_isa_device *child = | 575 | struct sparc_isa_device *child = |
529 | isa_dev->child; | 576 | isa_dev->child; |
530 | 577 | ||
531 | while (child) { | 578 | while (child) { |
532 | if (!strcmp(child->prom_name, | 579 | if (!strcmp(child->prom_node->name, |
533 | "floppy")) { | 580 | "floppy")) { |
534 | isa_dev = child; | 581 | isa_dev = child; |
535 | goto isa_done; | 582 | goto isa_done; |
@@ -614,6 +661,7 @@ static unsigned long __init sun_floppy_init(void) | |||
614 | struct linux_ebus_device *edev = NULL; | 661 | struct linux_ebus_device *edev = NULL; |
615 | unsigned long config = 0; | 662 | unsigned long config = 0; |
616 | void __iomem *auxio_reg; | 663 | void __iomem *auxio_reg; |
664 | char *state_prop; | ||
617 | 665 | ||
618 | for_each_ebus(ebus) { | 666 | for_each_ebus(ebus) { |
619 | for_each_ebusdev(edev, ebus) { | 667 | for_each_ebusdev(edev, ebus) { |
@@ -630,9 +678,8 @@ static unsigned long __init sun_floppy_init(void) | |||
630 | #endif | 678 | #endif |
631 | } | 679 | } |
632 | 680 | ||
633 | prom_getproperty(edev->prom_node, "status", | 681 | state_prop = of_get_property(edev->prom_node, "status", NULL); |
634 | state, sizeof(state)); | 682 | if (state_prop && !strncmp(state_prop, "disabled", 8)) |
635 | if (!strncmp(state, "disabled", 8)) | ||
636 | return 0; | 683 | return 0; |
637 | 684 | ||
638 | FLOPPY_IRQ = edev->irqs[0]; | 685 | FLOPPY_IRQ = edev->irqs[0]; |
@@ -703,7 +750,7 @@ static unsigned long __init sun_floppy_init(void) | |||
703 | */ | 750 | */ |
704 | for_each_ebus(ebus) { | 751 | for_each_ebus(ebus) { |
705 | for_each_ebusdev(edev, ebus) { | 752 | for_each_ebusdev(edev, ebus) { |
706 | if (!strcmp(edev->prom_name, "ecpp")) { | 753 | if (!strcmp(edev->prom_node->name, "ecpp")) { |
707 | config = edev->resource[1].start; | 754 | config = edev->resource[1].start; |
708 | goto config_done; | 755 | goto config_done; |
709 | } | 756 | } |
diff --git a/include/asm-sparc64/hardirq.h b/include/asm-sparc64/hardirq.h index f0cf71376ec5..7c29fd1a87aa 100644 --- a/include/asm-sparc64/hardirq.h +++ b/include/asm-sparc64/hardirq.h | |||
@@ -12,6 +12,8 @@ | |||
12 | #define local_softirq_pending() \ | 12 | #define local_softirq_pending() \ |
13 | (local_cpu_data().__softirq_pending) | 13 | (local_cpu_data().__softirq_pending) |
14 | 14 | ||
15 | void ack_bad_irq(unsigned int irq); | ||
16 | |||
15 | #define HARDIRQ_BITS 8 | 17 | #define HARDIRQ_BITS 8 |
16 | 18 | ||
17 | #endif /* !(__SPARC64_HARDIRQ_H) */ | 19 | #endif /* !(__SPARC64_HARDIRQ_H) */ |
diff --git a/include/asm-sparc64/hw_irq.h b/include/asm-sparc64/hw_irq.h index 153cae2ddaee..599b3b073450 100644 --- a/include/asm-sparc64/hw_irq.h +++ b/include/asm-sparc64/hw_irq.h | |||
@@ -1,6 +1,6 @@ | |||
1 | #ifndef __ASM_SPARC64_HW_IRQ_H | 1 | #ifndef __ASM_SPARC64_HW_IRQ_H |
2 | #define __ASM_SPARC64_HW_IRQ_H | 2 | #define __ASM_SPARC64_HW_IRQ_H |
3 | 3 | ||
4 | /* Dummy include. */ | 4 | extern void hw_resend_irq(struct hw_interrupt_type *handler, unsigned int virt_irq); |
5 | 5 | ||
6 | #endif | 6 | #endif |
diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h index fa164d37ee3f..905e59b4a737 100644 --- a/include/asm-sparc64/irq.h +++ b/include/asm-sparc64/irq.h | |||
@@ -15,58 +15,6 @@ | |||
15 | #include <asm/pil.h> | 15 | #include <asm/pil.h> |
16 | #include <asm/ptrace.h> | 16 | #include <asm/ptrace.h> |
17 | 17 | ||
18 | struct ino_bucket; | ||
19 | |||
20 | #define MAX_IRQ_DESC_ACTION 4 | ||
21 | |||
22 | struct irq_desc { | ||
23 | void (*pre_handler)(struct ino_bucket *, void *, void *); | ||
24 | void *pre_handler_arg1; | ||
25 | void *pre_handler_arg2; | ||
26 | u32 action_active_mask; | ||
27 | struct irqaction action[MAX_IRQ_DESC_ACTION]; | ||
28 | }; | ||
29 | |||
30 | /* You should not mess with this directly. That's the job of irq.c. | ||
31 | * | ||
32 | * If you make changes here, please update hand coded assembler of | ||
33 | * the vectored interrupt trap handler in entry.S -DaveM | ||
34 | * | ||
35 | * This is currently one DCACHE line, two buckets per L2 cache | ||
36 | * line. Keep this in mind please. | ||
37 | */ | ||
38 | struct ino_bucket { | ||
39 | /* Next handler in per-CPU PIL worklist. We know that | ||
40 | * bucket pointers have the high 32-bits clear, so to | ||
41 | * save space we only store the bits we need. | ||
42 | */ | ||
43 | /*0x00*/unsigned int irq_chain; | ||
44 | |||
45 | /* PIL to schedule this IVEC at. */ | ||
46 | /*0x04*/unsigned char pil; | ||
47 | |||
48 | /* If an IVEC arrives while irq_info is NULL, we | ||
49 | * set this to notify request_irq() about the event. | ||
50 | */ | ||
51 | /*0x05*/unsigned char pending; | ||
52 | |||
53 | /* Miscellaneous flags. */ | ||
54 | /*0x06*/unsigned char flags; | ||
55 | |||
56 | /* Currently unused. */ | ||
57 | /*0x07*/unsigned char __pad; | ||
58 | |||
59 | /* Reference to IRQ descriptor for this bucket. */ | ||
60 | /*0x08*/struct irq_desc *irq_info; | ||
61 | |||
62 | /* Sun5 Interrupt Clear Register. */ | ||
63 | /*0x10*/unsigned long iclr; | ||
64 | |||
65 | /* Sun5 Interrupt Mapping Register. */ | ||
66 | /*0x18*/unsigned long imap; | ||
67 | |||
68 | }; | ||
69 | |||
70 | /* IMAP/ICLR register defines */ | 18 | /* IMAP/ICLR register defines */ |
71 | #define IMAP_VALID 0x80000000 /* IRQ Enabled */ | 19 | #define IMAP_VALID 0x80000000 /* IRQ Enabled */ |
72 | #define IMAP_TID_UPA 0x7c000000 /* UPA TargetID */ | 20 | #define IMAP_TID_UPA 0x7c000000 /* UPA TargetID */ |
@@ -84,36 +32,20 @@ struct ino_bucket { | |||
84 | #define ICLR_TRANSMIT 0x00000001 /* Transmit state */ | 32 | #define ICLR_TRANSMIT 0x00000001 /* Transmit state */ |
85 | #define ICLR_PENDING 0x00000003 /* Pending state */ | 33 | #define ICLR_PENDING 0x00000003 /* Pending state */ |
86 | 34 | ||
87 | /* Only 8-bits are available, be careful. -DaveM */ | 35 | /* The largest number of unique interrupt sources we support. |
88 | #define IBF_PCI 0x02 /* PSYCHO/SABRE/SCHIZO PCI interrupt. */ | 36 | * If this needs to ever be larger than 255, you need to change |
89 | #define IBF_ACTIVE 0x04 /* Interrupt is active and has a handler.*/ | 37 | * the type of ino_bucket->virt_irq as appropriate. |
90 | #define IBF_INPROGRESS 0x10 /* IRQ is being serviced. */ | 38 | * |
91 | 39 | * ino_bucket->virt_irq allocation is made during {sun4v_,}build_irq(). | |
92 | #define NUM_IVECS (IMAP_INR + 1) | 40 | */ |
93 | extern struct ino_bucket ivector_table[NUM_IVECS]; | 41 | #define NR_IRQS 255 |
94 | |||
95 | #define __irq_ino(irq) \ | ||
96 | (((struct ino_bucket *)(unsigned long)(irq)) - &ivector_table[0]) | ||
97 | #define __irq_pil(irq) ((struct ino_bucket *)(unsigned long)(irq))->pil | ||
98 | #define __bucket(irq) ((struct ino_bucket *)(unsigned long)(irq)) | ||
99 | #define __irq(bucket) ((unsigned int)(unsigned long)(bucket)) | ||
100 | |||
101 | static __inline__ char *__irq_itoa(unsigned int irq) | ||
102 | { | ||
103 | static char buff[16]; | ||
104 | |||
105 | sprintf(buff, "%d,%x", __irq_pil(irq), (unsigned int)__irq_ino(irq)); | ||
106 | return buff; | ||
107 | } | ||
108 | |||
109 | #define NR_IRQS 16 | ||
110 | 42 | ||
43 | extern void irq_install_pre_handler(int virt_irq, | ||
44 | void (*func)(unsigned int, void *, void *), | ||
45 | void *arg1, void *arg2); | ||
111 | #define irq_canonicalize(irq) (irq) | 46 | #define irq_canonicalize(irq) (irq) |
112 | extern void disable_irq(unsigned int); | 47 | extern unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap); |
113 | #define disable_irq_nosync disable_irq | 48 | extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino); |
114 | extern void enable_irq(unsigned int); | ||
115 | extern unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigned long imap); | ||
116 | extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino, int pil, unsigned char flags); | ||
117 | extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); | 49 | extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); |
118 | 50 | ||
119 | static __inline__ void set_softint(unsigned long bits) | 51 | static __inline__ void set_softint(unsigned long bits) |
@@ -139,8 +71,4 @@ static __inline__ unsigned long get_softint(void) | |||
139 | return retval; | 71 | return retval; |
140 | } | 72 | } |
141 | 73 | ||
142 | struct irqaction; | ||
143 | struct pt_regs; | ||
144 | int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); | ||
145 | |||
146 | #endif | 74 | #endif |
diff --git a/include/asm-sparc64/isa.h b/include/asm-sparc64/isa.h index 4601bbfc3e7b..d9728b9031fc 100644 --- a/include/asm-sparc64/isa.h +++ b/include/asm-sparc64/isa.h | |||
@@ -9,37 +9,32 @@ | |||
9 | 9 | ||
10 | #include <asm/pbm.h> | 10 | #include <asm/pbm.h> |
11 | #include <asm/oplib.h> | 11 | #include <asm/oplib.h> |
12 | #include <asm/prom.h> | ||
13 | #include <asm/of_device.h> | ||
12 | 14 | ||
13 | struct sparc_isa_bridge; | 15 | struct sparc_isa_bridge; |
14 | 16 | ||
15 | struct sparc_isa_device { | 17 | struct sparc_isa_device { |
18 | struct of_device ofdev; | ||
16 | struct sparc_isa_device *next; | 19 | struct sparc_isa_device *next; |
17 | struct sparc_isa_device *child; | 20 | struct sparc_isa_device *child; |
18 | struct sparc_isa_bridge *bus; | 21 | struct sparc_isa_bridge *bus; |
19 | int prom_node; | 22 | struct device_node *prom_node; |
20 | char prom_name[64]; | ||
21 | char compatible[64]; | ||
22 | struct resource resource; | 23 | struct resource resource; |
23 | unsigned int irq; | 24 | unsigned int irq; |
24 | }; | 25 | }; |
26 | #define to_isa_device(d) container_of(d, struct sparc_isa_device, ofdev.dev) | ||
25 | 27 | ||
26 | struct sparc_isa_bridge { | 28 | struct sparc_isa_bridge { |
29 | struct of_device ofdev; | ||
27 | struct sparc_isa_bridge *next; | 30 | struct sparc_isa_bridge *next; |
28 | struct sparc_isa_device *devices; | 31 | struct sparc_isa_device *devices; |
29 | struct pci_pbm_info *parent; | 32 | struct pci_pbm_info *parent; |
30 | struct pci_dev *self; | 33 | struct pci_dev *self; |
31 | int index; | 34 | int index; |
32 | int prom_node; | 35 | struct device_node *prom_node; |
33 | char prom_name[64]; | ||
34 | #define linux_prom_isa_ranges linux_prom_ebus_ranges | ||
35 | struct linux_prom_isa_ranges isa_ranges[PROMREG_MAX]; | ||
36 | int num_isa_ranges; | ||
37 | #define linux_prom_isa_intmap linux_prom_ebus_intmap | ||
38 | struct linux_prom_isa_intmap isa_intmap[PROMREG_MAX]; | ||
39 | int num_isa_intmap; | ||
40 | #define linux_prom_isa_intmask linux_prom_ebus_intmask | ||
41 | struct linux_prom_isa_intmap isa_intmask; | ||
42 | }; | 36 | }; |
37 | #define to_isa_bridge(d) container_of(d, struct sparc_isa_bridge, ofdev.dev) | ||
43 | 38 | ||
44 | extern struct sparc_isa_bridge *isa_chain; | 39 | extern struct sparc_isa_bridge *isa_chain; |
45 | 40 | ||
diff --git a/include/asm-sparc64/kdebug.h b/include/asm-sparc64/kdebug.h index 4040d127ac3e..11251bdd00cb 100644 --- a/include/asm-sparc64/kdebug.h +++ b/include/asm-sparc64/kdebug.h | |||
@@ -17,6 +17,8 @@ struct die_args { | |||
17 | 17 | ||
18 | extern int register_die_notifier(struct notifier_block *); | 18 | extern int register_die_notifier(struct notifier_block *); |
19 | extern int unregister_die_notifier(struct notifier_block *); | 19 | extern int unregister_die_notifier(struct notifier_block *); |
20 | extern int register_page_fault_notifier(struct notifier_block *); | ||
21 | extern int unregister_page_fault_notifier(struct notifier_block *); | ||
20 | extern struct atomic_notifier_head sparc64die_chain; | 22 | extern struct atomic_notifier_head sparc64die_chain; |
21 | 23 | ||
22 | extern void bad_trap(struct pt_regs *, long); | 24 | extern void bad_trap(struct pt_regs *, long); |
diff --git a/include/asm-sparc64/kprobes.h b/include/asm-sparc64/kprobes.h index e9bb26f770ed..15065af566c2 100644 --- a/include/asm-sparc64/kprobes.h +++ b/include/asm-sparc64/kprobes.h | |||
@@ -12,6 +12,7 @@ typedef u32 kprobe_opcode_t; | |||
12 | 12 | ||
13 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry | 13 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry |
14 | #define arch_remove_kprobe(p) do {} while (0) | 14 | #define arch_remove_kprobe(p) do {} while (0) |
15 | #define ARCH_INACTIVE_KPROBE_COUNT 0 | ||
15 | 16 | ||
16 | /* Architecture specific copy of original instruction*/ | 17 | /* Architecture specific copy of original instruction*/ |
17 | struct arch_specific_insn { | 18 | struct arch_specific_insn { |
diff --git a/include/asm-sparc64/of_device.h b/include/asm-sparc64/of_device.h new file mode 100644 index 000000000000..a62c7b997d66 --- /dev/null +++ b/include/asm-sparc64/of_device.h | |||
@@ -0,0 +1,80 @@ | |||
1 | #ifndef _ASM_SPARC64_OF_DEVICE_H | ||
2 | #define _ASM_SPARC64_OF_DEVICE_H | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | #include <linux/device.h> | ||
6 | #include <linux/mod_devicetable.h> | ||
7 | #include <asm/openprom.h> | ||
8 | #include <asm/prom.h> | ||
9 | |||
10 | extern struct bus_type isa_bus_type; | ||
11 | extern struct bus_type ebus_bus_type; | ||
12 | extern struct bus_type sbus_bus_type; | ||
13 | extern struct bus_type of_bus_type; | ||
14 | |||
15 | /* | ||
16 | * The of_device is a kind of "base class" that is a superset of | ||
17 | * struct device for use by devices attached to an OF node and | ||
18 | * probed using OF properties. | ||
19 | */ | ||
20 | struct of_device | ||
21 | { | ||
22 | struct device_node *node; | ||
23 | struct device dev; | ||
24 | struct resource resource[PROMREG_MAX]; | ||
25 | unsigned int irqs[PROMINTR_MAX]; | ||
26 | int num_irqs; | ||
27 | |||
28 | void *sysdata; | ||
29 | |||
30 | int slot; | ||
31 | int portid; | ||
32 | int clock_freq; | ||
33 | }; | ||
34 | #define to_of_device(d) container_of(d, struct of_device, dev) | ||
35 | |||
36 | extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); | ||
37 | extern void of_iounmap(void __iomem *base, unsigned long size); | ||
38 | |||
39 | extern struct of_device *of_find_device_by_node(struct device_node *); | ||
40 | |||
41 | extern const struct of_device_id *of_match_device( | ||
42 | const struct of_device_id *matches, const struct of_device *dev); | ||
43 | |||
44 | extern struct of_device *of_dev_get(struct of_device *dev); | ||
45 | extern void of_dev_put(struct of_device *dev); | ||
46 | |||
47 | /* | ||
48 | * An of_platform_driver driver is attached to a basic of_device on | ||
49 | * the ISA, EBUS, and SBUS busses on sparc64. | ||
50 | */ | ||
51 | struct of_platform_driver | ||
52 | { | ||
53 | char *name; | ||
54 | struct of_device_id *match_table; | ||
55 | struct module *owner; | ||
56 | |||
57 | int (*probe)(struct of_device* dev, const struct of_device_id *match); | ||
58 | int (*remove)(struct of_device* dev); | ||
59 | |||
60 | int (*suspend)(struct of_device* dev, pm_message_t state); | ||
61 | int (*resume)(struct of_device* dev); | ||
62 | int (*shutdown)(struct of_device* dev); | ||
63 | |||
64 | struct device_driver driver; | ||
65 | }; | ||
66 | #define to_of_platform_driver(drv) container_of(drv,struct of_platform_driver, driver) | ||
67 | |||
68 | extern int of_register_driver(struct of_platform_driver *drv, | ||
69 | struct bus_type *bus); | ||
70 | extern void of_unregister_driver(struct of_platform_driver *drv); | ||
71 | extern int of_device_register(struct of_device *ofdev); | ||
72 | extern void of_device_unregister(struct of_device *ofdev); | ||
73 | extern struct of_device *of_platform_device_create(struct device_node *np, | ||
74 | const char *bus_id, | ||
75 | struct device *parent, | ||
76 | struct bus_type *bus); | ||
77 | extern void of_release_dev(struct device *dev); | ||
78 | |||
79 | #endif /* __KERNEL__ */ | ||
80 | #endif /* _ASM_SPARC64_OF_DEVICE_H */ | ||
diff --git a/include/asm-sparc64/oplib.h b/include/asm-sparc64/oplib.h index dea3e73f0955..a68b0bb05958 100644 --- a/include/asm-sparc64/oplib.h +++ b/include/asm-sparc64/oplib.h | |||
@@ -323,8 +323,9 @@ extern int prom_pathtoinode(const char *path); | |||
323 | extern int prom_inst2pkg(int); | 323 | extern int prom_inst2pkg(int); |
324 | 324 | ||
325 | /* CPU probing helpers. */ | 325 | /* CPU probing helpers. */ |
326 | int cpu_find_by_instance(int instance, int *prom_node, int *mid); | 326 | struct device_node; |
327 | int cpu_find_by_mid(int mid, int *prom_node); | 327 | int cpu_find_by_instance(int instance, struct device_node **dev_node, int *mid); |
328 | int cpu_find_by_mid(int mid, struct device_node **prom_node); | ||
328 | 329 | ||
329 | /* Client interface level routines. */ | 330 | /* Client interface level routines. */ |
330 | extern void prom_set_trap_table(unsigned long tba); | 331 | extern void prom_set_trap_table(unsigned long tba); |
diff --git a/include/asm-sparc64/parport.h b/include/asm-sparc64/parport.h index 56b5197d7898..d3895873e4c7 100644 --- a/include/asm-sparc64/parport.h +++ b/include/asm-sparc64/parport.h | |||
@@ -67,18 +67,17 @@ static __inline__ unsigned int get_dma_residue(unsigned int dmanr) | |||
67 | 67 | ||
68 | static int ebus_ecpp_p(struct linux_ebus_device *edev) | 68 | static int ebus_ecpp_p(struct linux_ebus_device *edev) |
69 | { | 69 | { |
70 | if (!strcmp(edev->prom_name, "ecpp")) | 70 | if (!strcmp(edev->prom_node->name, "ecpp")) |
71 | return 1; | 71 | return 1; |
72 | if (!strcmp(edev->prom_name, "parallel")) { | 72 | if (!strcmp(edev->prom_node->name, "parallel")) { |
73 | char compat[19]; | 73 | char *compat; |
74 | prom_getstring(edev->prom_node, | 74 | |
75 | "compatible", | 75 | compat = of_get_property(edev->prom_node, |
76 | compat, sizeof(compat)); | 76 | "compatible", NULL); |
77 | compat[18] = '\0'; | 77 | if (compat && |
78 | if (!strcmp(compat, "ecpp")) | 78 | (!strcmp(compat, "ecpp") || |
79 | return 1; | 79 | !strcmp(compat, "ns87317-ecpp") || |
80 | if (!strcmp(compat, "ns87317-ecpp") && | 80 | !strcmp(compat + 13, "ecpp"))) |
81 | !strcmp(compat + 13, "ecpp")) | ||
82 | return 1; | 81 | return 1; |
83 | } | 82 | } |
84 | return 0; | 83 | return 0; |
@@ -94,12 +93,12 @@ static int parport_isa_probe(int count) | |||
94 | struct sparc_isa_device *child; | 93 | struct sparc_isa_device *child; |
95 | unsigned long base; | 94 | unsigned long base; |
96 | 95 | ||
97 | if (strcmp(isa_dev->prom_name, "dma")) | 96 | if (strcmp(isa_dev->prom_node->name, "dma")) |
98 | continue; | 97 | continue; |
99 | 98 | ||
100 | child = isa_dev->child; | 99 | child = isa_dev->child; |
101 | while (child) { | 100 | while (child) { |
102 | if (!strcmp(child->prom_name, "parallel")) | 101 | if (!strcmp(child->prom_node->name, "parallel")) |
103 | break; | 102 | break; |
104 | child = child->next; | 103 | child = child->next; |
105 | } | 104 | } |
diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h index 1396f110939a..dcfa7629358c 100644 --- a/include/asm-sparc64/pbm.h +++ b/include/asm-sparc64/pbm.h | |||
@@ -15,6 +15,8 @@ | |||
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <asm/page.h> | 16 | #include <asm/page.h> |
17 | #include <asm/oplib.h> | 17 | #include <asm/oplib.h> |
18 | #include <asm/prom.h> | ||
19 | #include <asm/of_device.h> | ||
18 | #include <asm/iommu.h> | 20 | #include <asm/iommu.h> |
19 | 21 | ||
20 | /* The abstraction used here is that there are PCI controllers, | 22 | /* The abstraction used here is that there are PCI controllers, |
@@ -153,16 +155,15 @@ struct pci_pbm_info { | |||
153 | int chip_revision; | 155 | int chip_revision; |
154 | 156 | ||
155 | /* Name used for top-level resources. */ | 157 | /* Name used for top-level resources. */ |
156 | char name[64]; | 158 | char *name; |
157 | 159 | ||
158 | /* OBP specific information. */ | 160 | /* OBP specific information. */ |
159 | int prom_node; | 161 | struct device_node *prom_node; |
160 | char prom_name[64]; | 162 | struct linux_prom_pci_ranges *pbm_ranges; |
161 | struct linux_prom_pci_ranges pbm_ranges[PROM_PCIRNG_MAX]; | ||
162 | int num_pbm_ranges; | 163 | int num_pbm_ranges; |
163 | struct linux_prom_pci_intmap pbm_intmap[PROM_PCIIMAP_MAX]; | 164 | struct linux_prom_pci_intmap *pbm_intmap; |
164 | int num_pbm_intmap; | 165 | int num_pbm_intmap; |
165 | struct linux_prom_pci_intmask pbm_intmask; | 166 | struct linux_prom_pci_intmask *pbm_intmask; |
166 | u64 ino_bitmap; | 167 | u64 ino_bitmap; |
167 | 168 | ||
168 | /* PBM I/O and Memory space resources. */ | 169 | /* PBM I/O and Memory space resources. */ |
@@ -209,7 +210,6 @@ struct pci_controller_info { | |||
209 | 210 | ||
210 | /* Operations which are controller specific. */ | 211 | /* Operations which are controller specific. */ |
211 | void (*scan_bus)(struct pci_controller_info *); | 212 | void (*scan_bus)(struct pci_controller_info *); |
212 | unsigned int (*irq_build)(struct pci_pbm_info *, struct pci_dev *, unsigned int); | ||
213 | void (*base_address_update)(struct pci_dev *, int); | 213 | void (*base_address_update)(struct pci_dev *, int); |
214 | void (*resource_adjust)(struct pci_dev *, struct resource *, struct resource *); | 214 | void (*resource_adjust)(struct pci_dev *, struct resource *, struct resource *); |
215 | 215 | ||
@@ -217,8 +217,6 @@ struct pci_controller_info { | |||
217 | struct pci_ops *pci_ops; | 217 | struct pci_ops *pci_ops; |
218 | unsigned int pci_first_busno; | 218 | unsigned int pci_first_busno; |
219 | unsigned int pci_last_busno; | 219 | unsigned int pci_last_busno; |
220 | |||
221 | void *starfire_cookie; | ||
222 | }; | 220 | }; |
223 | 221 | ||
224 | /* PCI devices which are not bridges have this placed in their pci_dev | 222 | /* PCI devices which are not bridges have this placed in their pci_dev |
@@ -227,8 +225,8 @@ struct pci_controller_info { | |||
227 | */ | 225 | */ |
228 | struct pcidev_cookie { | 226 | struct pcidev_cookie { |
229 | struct pci_pbm_info *pbm; | 227 | struct pci_pbm_info *pbm; |
230 | char prom_name[64]; | 228 | struct device_node *prom_node; |
231 | int prom_node; | 229 | struct of_device *op; |
232 | struct linux_prom_pci_registers prom_regs[PROMREG_MAX]; | 230 | struct linux_prom_pci_registers prom_regs[PROMREG_MAX]; |
233 | int num_prom_regs; | 231 | int num_prom_regs; |
234 | struct linux_prom_pci_registers prom_assignments[PROMREG_MAX]; | 232 | struct linux_prom_pci_registers prom_assignments[PROMREG_MAX]; |
diff --git a/include/asm-sparc64/percpu.h b/include/asm-sparc64/percpu.h index baef13b58952..ced8cbde046d 100644 --- a/include/asm-sparc64/percpu.h +++ b/include/asm-sparc64/percpu.h | |||
@@ -11,6 +11,7 @@ extern unsigned long __per_cpu_base; | |||
11 | extern unsigned long __per_cpu_shift; | 11 | extern unsigned long __per_cpu_shift; |
12 | #define __per_cpu_offset(__cpu) \ | 12 | #define __per_cpu_offset(__cpu) \ |
13 | (__per_cpu_base + ((unsigned long)(__cpu) << __per_cpu_shift)) | 13 | (__per_cpu_base + ((unsigned long)(__cpu) << __per_cpu_shift)) |
14 | #define per_cpu_offset(x) (__per_cpu_offset(x)) | ||
14 | 15 | ||
15 | /* Separate out the type, so (int[3], foo) works. */ | 16 | /* Separate out the type, so (int[3], foo) works. */ |
16 | #define DEFINE_PER_CPU(type, name) \ | 17 | #define DEFINE_PER_CPU(type, name) \ |
@@ -21,6 +22,7 @@ register unsigned long __local_per_cpu_offset asm("g5"); | |||
21 | /* var is in discarded region: offset to particular copy we want */ | 22 | /* var is in discarded region: offset to particular copy we want */ |
22 | #define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) | 23 | #define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) |
23 | #define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __local_per_cpu_offset)) | 24 | #define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __local_per_cpu_offset)) |
25 | #define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __local_per_cpu_offset)) | ||
24 | 26 | ||
25 | /* A macro to avoid #include hell... */ | 27 | /* A macro to avoid #include hell... */ |
26 | #define percpu_modcopy(pcpudst, src, size) \ | 28 | #define percpu_modcopy(pcpudst, src, size) \ |
@@ -37,6 +39,7 @@ do { \ | |||
37 | 39 | ||
38 | #define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) | 40 | #define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) |
39 | #define __get_cpu_var(var) per_cpu__##var | 41 | #define __get_cpu_var(var) per_cpu__##var |
42 | #define __raw_get_cpu_var(var) per_cpu__##var | ||
40 | 43 | ||
41 | #endif /* SMP */ | 44 | #endif /* SMP */ |
42 | 45 | ||
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index 72f9a524dc67..03f5bc9b6bec 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h | |||
@@ -688,6 +688,23 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *p | |||
688 | #define pte_clear(mm,addr,ptep) \ | 688 | #define pte_clear(mm,addr,ptep) \ |
689 | set_pte_at((mm), (addr), (ptep), __pte(0UL)) | 689 | set_pte_at((mm), (addr), (ptep), __pte(0UL)) |
690 | 690 | ||
691 | #ifdef DCACHE_ALIASING_POSSIBLE | ||
692 | #define __HAVE_ARCH_MOVE_PTE | ||
693 | #define move_pte(pte, prot, old_addr, new_addr) \ | ||
694 | ({ \ | ||
695 | pte_t newpte = (pte); \ | ||
696 | if (tlb_type != hypervisor && pte_present(pte)) { \ | ||
697 | unsigned long this_pfn = pte_pfn(pte); \ | ||
698 | \ | ||
699 | if (pfn_valid(this_pfn) && \ | ||
700 | (((old_addr) ^ (new_addr)) & (1 << 13))) \ | ||
701 | flush_dcache_page_all(current->mm, \ | ||
702 | pfn_to_page(this_pfn)); \ | ||
703 | } \ | ||
704 | newpte; \ | ||
705 | }) | ||
706 | #endif | ||
707 | |||
691 | extern pgd_t swapper_pg_dir[2048]; | 708 | extern pgd_t swapper_pg_dir[2048]; |
692 | extern pmd_t swapper_low_pmd_dir[2048]; | 709 | extern pmd_t swapper_low_pmd_dir[2048]; |
693 | 710 | ||
@@ -739,6 +756,8 @@ extern unsigned long *sparc64_valid_addr_bitmap; | |||
739 | #define kern_addr_valid(addr) \ | 756 | #define kern_addr_valid(addr) \ |
740 | (test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap)) | 757 | (test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap)) |
741 | 758 | ||
759 | extern int page_in_phys_avail(unsigned long paddr); | ||
760 | |||
742 | extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, | 761 | extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, |
743 | unsigned long pfn, | 762 | unsigned long pfn, |
744 | unsigned long size, pgprot_t prot); | 763 | unsigned long size, pgprot_t prot); |
diff --git a/include/asm-sparc64/pil.h b/include/asm-sparc64/pil.h index 79f827eb3f5d..72927749aebf 100644 --- a/include/asm-sparc64/pil.h +++ b/include/asm-sparc64/pil.h | |||
@@ -5,9 +5,9 @@ | |||
5 | /* To avoid some locking problems, we hard allocate certain PILs | 5 | /* To avoid some locking problems, we hard allocate certain PILs |
6 | * for SMP cross call messages that must do a etrap/rtrap. | 6 | * for SMP cross call messages that must do a etrap/rtrap. |
7 | * | 7 | * |
8 | * A cli() does not block the cross call delivery, so when SMP | 8 | * A local_irq_disable() does not block the cross call delivery, so |
9 | * locking is an issue we reschedule the event into a PIL interrupt | 9 | * when SMP locking is an issue we reschedule the event into a PIL |
10 | * which is blocked by cli(). | 10 | * interrupt which is blocked by local_irq_disable(). |
11 | * | 11 | * |
12 | * In fact any XCALL which has to etrap/rtrap has a problem because | 12 | * In fact any XCALL which has to etrap/rtrap has a problem because |
13 | * it is difficult to prevent rtrap from running BH's, and that would | 13 | * it is difficult to prevent rtrap from running BH's, and that would |
@@ -17,6 +17,7 @@ | |||
17 | #define PIL_SMP_RECEIVE_SIGNAL 2 | 17 | #define PIL_SMP_RECEIVE_SIGNAL 2 |
18 | #define PIL_SMP_CAPTURE 3 | 18 | #define PIL_SMP_CAPTURE 3 |
19 | #define PIL_SMP_CTX_NEW_VERSION 4 | 19 | #define PIL_SMP_CTX_NEW_VERSION 4 |
20 | #define PIL_DEVICE_IRQ 5 | ||
20 | 21 | ||
21 | #ifndef __ASSEMBLY__ | 22 | #ifndef __ASSEMBLY__ |
22 | #define PIL_RESERVED(PIL) ((PIL) == PIL_SMP_CALL_FUNC || \ | 23 | #define PIL_RESERVED(PIL) ((PIL) == PIL_SMP_CALL_FUNC || \ |
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h new file mode 100644 index 000000000000..99671ed6625d --- /dev/null +++ b/include/asm-sparc64/prom.h | |||
@@ -0,0 +1,112 @@ | |||
1 | #ifndef _SPARC64_PROM_H | ||
2 | #define _SPARC64_PROM_H | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | |||
6 | /* | ||
7 | * Definitions for talking to the Open Firmware PROM on | ||
8 | * Power Macintosh computers. | ||
9 | * | ||
10 | * Copyright (C) 1996-2005 Paul Mackerras. | ||
11 | * | ||
12 | * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp. | ||
13 | * Updates for SPARC64 by David S. Miller | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or | ||
16 | * modify it under the terms of the GNU General Public License | ||
17 | * as published by the Free Software Foundation; either version | ||
18 | * 2 of the License, or (at your option) any later version. | ||
19 | */ | ||
20 | |||
21 | #include <linux/types.h> | ||
22 | #include <linux/proc_fs.h> | ||
23 | #include <asm/atomic.h> | ||
24 | |||
25 | typedef u32 phandle; | ||
26 | typedef u32 ihandle; | ||
27 | |||
28 | struct property { | ||
29 | char *name; | ||
30 | int length; | ||
31 | void *value; | ||
32 | struct property *next; | ||
33 | unsigned long _flags; | ||
34 | unsigned int unique_id; | ||
35 | }; | ||
36 | |||
37 | struct of_irq_controller; | ||
38 | struct device_node { | ||
39 | char *name; | ||
40 | char *type; | ||
41 | phandle node; | ||
42 | char *path_component_name; | ||
43 | char *full_name; | ||
44 | |||
45 | struct property *properties; | ||
46 | struct property *deadprops; /* removed properties */ | ||
47 | struct device_node *parent; | ||
48 | struct device_node *child; | ||
49 | struct device_node *sibling; | ||
50 | struct device_node *next; /* next device of same type */ | ||
51 | struct device_node *allnext; /* next in list of all nodes */ | ||
52 | struct proc_dir_entry *pde; /* this node's proc directory */ | ||
53 | struct kref kref; | ||
54 | unsigned long _flags; | ||
55 | void *data; | ||
56 | unsigned int unique_id; | ||
57 | |||
58 | struct of_irq_controller *irq_trans; | ||
59 | }; | ||
60 | |||
61 | struct of_irq_controller { | ||
62 | unsigned int (*irq_build)(struct device_node *, unsigned int, void *); | ||
63 | void *data; | ||
64 | }; | ||
65 | |||
66 | /* flag descriptions */ | ||
67 | #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ | ||
68 | |||
69 | #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) | ||
70 | #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) | ||
71 | |||
72 | #define OF_BAD_ADDR ((u64)-1) | ||
73 | |||
74 | static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) | ||
75 | { | ||
76 | dn->pde = de; | ||
77 | } | ||
78 | |||
79 | extern struct device_node *of_find_node_by_name(struct device_node *from, | ||
80 | const char *name); | ||
81 | #define for_each_node_by_name(dn, name) \ | ||
82 | for (dn = of_find_node_by_name(NULL, name); dn; \ | ||
83 | dn = of_find_node_by_name(dn, name)) | ||
84 | extern struct device_node *of_find_node_by_type(struct device_node *from, | ||
85 | const char *type); | ||
86 | #define for_each_node_by_type(dn, type) \ | ||
87 | for (dn = of_find_node_by_type(NULL, type); dn; \ | ||
88 | dn = of_find_node_by_type(dn, type)) | ||
89 | extern struct device_node *of_find_compatible_node(struct device_node *from, | ||
90 | const char *type, const char *compat); | ||
91 | extern struct device_node *of_find_node_by_path(const char *path); | ||
92 | extern struct device_node *of_find_node_by_phandle(phandle handle); | ||
93 | extern struct device_node *of_get_parent(const struct device_node *node); | ||
94 | extern struct device_node *of_get_next_child(const struct device_node *node, | ||
95 | struct device_node *prev); | ||
96 | extern struct property *of_find_property(struct device_node *np, | ||
97 | const char *name, | ||
98 | int *lenp); | ||
99 | extern int of_device_is_compatible(struct device_node *device, const char *); | ||
100 | extern void *of_get_property(struct device_node *node, const char *name, | ||
101 | int *lenp); | ||
102 | extern int of_set_property(struct device_node *node, const char *name, void *val, int len); | ||
103 | extern int of_getintprop_default(struct device_node *np, | ||
104 | const char *name, | ||
105 | int def); | ||
106 | extern int of_n_addr_cells(struct device_node *np); | ||
107 | extern int of_n_size_cells(struct device_node *np); | ||
108 | |||
109 | extern void prom_build_devicetree(void); | ||
110 | |||
111 | #endif /* __KERNEL__ */ | ||
112 | #endif /* _SPARC64_PROM_H */ | ||
diff --git a/include/asm-sparc64/sbus.h b/include/asm-sparc64/sbus.h index 48279e10f385..7efd49d31bb8 100644 --- a/include/asm-sparc64/sbus.h +++ b/include/asm-sparc64/sbus.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #include <linux/ioport.h> | 11 | #include <linux/ioport.h> |
12 | 12 | ||
13 | #include <asm/oplib.h> | 13 | #include <asm/oplib.h> |
14 | #include <asm/prom.h> | ||
15 | #include <asm/of_device.h> | ||
14 | #include <asm/iommu.h> | 16 | #include <asm/iommu.h> |
15 | #include <asm/scatterlist.h> | 17 | #include <asm/scatterlist.h> |
16 | 18 | ||
@@ -42,18 +44,19 @@ struct sbus_bus; | |||
42 | 44 | ||
43 | /* Linux SBUS device tables */ | 45 | /* Linux SBUS device tables */ |
44 | struct sbus_dev { | 46 | struct sbus_dev { |
45 | struct sbus_bus *bus; /* Our toplevel parent SBUS */ | 47 | struct of_device ofdev; |
46 | struct sbus_dev *next; /* Chain of siblings */ | 48 | struct sbus_bus *bus; |
47 | struct sbus_dev *child; /* Chain of children */ | 49 | struct sbus_dev *next; |
48 | struct sbus_dev *parent;/* Parent device if not toplevel*/ | 50 | struct sbus_dev *child; |
49 | int prom_node; /* OBP node of this device */ | 51 | struct sbus_dev *parent; |
50 | char prom_name[64]; /* OBP device name property */ | 52 | int prom_node; |
51 | int slot; /* SBUS slot number */ | 53 | char prom_name[64]; |
54 | int slot; | ||
52 | 55 | ||
53 | struct resource resource[PROMREG_MAX]; | 56 | struct resource resource[PROMREG_MAX]; |
54 | 57 | ||
55 | struct linux_prom_registers reg_addrs[PROMREG_MAX]; | 58 | struct linux_prom_registers reg_addrs[PROMREG_MAX]; |
56 | int num_registers, ranges_applied; | 59 | int num_registers; |
57 | 60 | ||
58 | struct linux_prom_ranges device_ranges[PROMREG_MAX]; | 61 | struct linux_prom_ranges device_ranges[PROMREG_MAX]; |
59 | int num_device_ranges; | 62 | int num_device_ranges; |
@@ -61,9 +64,11 @@ struct sbus_dev { | |||
61 | unsigned int irqs[4]; | 64 | unsigned int irqs[4]; |
62 | int num_irqs; | 65 | int num_irqs; |
63 | }; | 66 | }; |
67 | #define to_sbus_device(d) container_of(d, struct sbus_dev, ofdev.dev) | ||
64 | 68 | ||
65 | /* This struct describes the SBus(s) found on this machine. */ | 69 | /* This struct describes the SBus(s) found on this machine. */ |
66 | struct sbus_bus { | 70 | struct sbus_bus { |
71 | struct of_device ofdev; | ||
67 | void *iommu; /* Opaque IOMMU cookie */ | 72 | void *iommu; /* Opaque IOMMU cookie */ |
68 | struct sbus_dev *devices; /* Tree of SBUS devices */ | 73 | struct sbus_dev *devices; /* Tree of SBUS devices */ |
69 | struct sbus_bus *next; /* Next SBUS in system */ | 74 | struct sbus_bus *next; /* Next SBUS in system */ |
@@ -75,8 +80,8 @@ struct sbus_bus { | |||
75 | int num_sbus_ranges; | 80 | int num_sbus_ranges; |
76 | 81 | ||
77 | int portid; | 82 | int portid; |
78 | void *starfire_cookie; | ||
79 | }; | 83 | }; |
84 | #define to_sbus(d) container_of(d, struct sbus_bus, ofdev.dev) | ||
80 | 85 | ||
81 | extern struct sbus_bus *sbus_root; | 86 | extern struct sbus_bus *sbus_root; |
82 | 87 | ||
@@ -95,6 +100,7 @@ extern struct sbus_bus *sbus_root; | |||
95 | #define sbus_can_dma_64bit(sdev) (1) | 100 | #define sbus_can_dma_64bit(sdev) (1) |
96 | #define sbus_can_burst64(sdev) (1) | 101 | #define sbus_can_burst64(sdev) (1) |
97 | extern void sbus_set_sbus64(struct sbus_dev *, int); | 102 | extern void sbus_set_sbus64(struct sbus_dev *, int); |
103 | extern void sbus_fill_device_irq(struct sbus_dev *); | ||
98 | 104 | ||
99 | /* These yield IOMMU mappings in consistent mode. */ | 105 | /* These yield IOMMU mappings in consistent mode. */ |
100 | extern void *sbus_alloc_consistent(struct sbus_dev *, size_t, dma_addr_t *dma_addrp); | 106 | extern void *sbus_alloc_consistent(struct sbus_dev *, size_t, dma_addr_t *dma_addrp); |
@@ -119,4 +125,10 @@ extern void sbus_dma_sync_sg_for_cpu(struct sbus_dev *, struct scatterlist *, in | |||
119 | #define sbus_dma_sync_sg sbus_dma_sync_sg_for_cpu | 125 | #define sbus_dma_sync_sg sbus_dma_sync_sg_for_cpu |
120 | extern void sbus_dma_sync_sg_for_device(struct sbus_dev *, struct scatterlist *, int, int); | 126 | extern void sbus_dma_sync_sg_for_device(struct sbus_dev *, struct scatterlist *, int, int); |
121 | 127 | ||
128 | extern void sbus_arch_bus_ranges_init(struct device_node *, struct sbus_bus *); | ||
129 | extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *); | ||
130 | extern void sbus_setup_arch_props(struct sbus_bus *, struct device_node *); | ||
131 | extern int sbus_arch_preinit(void); | ||
132 | extern void sbus_arch_postinit(void); | ||
133 | |||
122 | #endif /* !(_SPARC64_SBUS_H) */ | 134 | #endif /* !(_SPARC64_SBUS_H) */ |
diff --git a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h index fdc42a14d4e6..9968871103bc 100644 --- a/include/asm-sparc64/signal.h +++ b/include/asm-sparc64/signal.h | |||
@@ -133,16 +133,13 @@ struct sigstack { | |||
133 | * usage of signal stacks by using the (now obsolete) sa_restorer field in | 133 | * usage of signal stacks by using the (now obsolete) sa_restorer field in |
134 | * the sigaction structure as a stack pointer. This is now possible due to | 134 | * the sigaction structure as a stack pointer. This is now possible due to |
135 | * the changes in signal handling. LBT 010493. | 135 | * the changes in signal handling. LBT 010493. |
136 | * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the | ||
137 | * SA_RESTART flag to get restarting signals (which were the default long ago) | 136 | * SA_RESTART flag to get restarting signals (which were the default long ago) |
138 | * SA_SHIRQ flag is for shared interrupt support on PCI and EISA. | ||
139 | */ | 137 | */ |
140 | #define SA_NOCLDSTOP _SV_IGNCHILD | 138 | #define SA_NOCLDSTOP _SV_IGNCHILD |
141 | #define SA_STACK _SV_SSTACK | 139 | #define SA_STACK _SV_SSTACK |
142 | #define SA_ONSTACK _SV_SSTACK | 140 | #define SA_ONSTACK _SV_SSTACK |
143 | #define SA_RESTART _SV_INTR | 141 | #define SA_RESTART _SV_INTR |
144 | #define SA_ONESHOT _SV_RESET | 142 | #define SA_ONESHOT _SV_RESET |
145 | #define SA_INTERRUPT 0x10u | ||
146 | #define SA_NOMASK 0x20u | 143 | #define SA_NOMASK 0x20u |
147 | #define SA_NOCLDWAIT 0x100u | 144 | #define SA_NOCLDWAIT 0x100u |
148 | #define SA_SIGINFO 0x200u | 145 | #define SA_SIGINFO 0x200u |
diff --git a/include/asm-sparc64/socket.h b/include/asm-sparc64/socket.h index 59987dad3359..754d46a50af3 100644 --- a/include/asm-sparc64/socket.h +++ b/include/asm-sparc64/socket.h | |||
@@ -48,6 +48,7 @@ | |||
48 | #define SCM_TIMESTAMP SO_TIMESTAMP | 48 | #define SCM_TIMESTAMP SO_TIMESTAMP |
49 | 49 | ||
50 | #define SO_PEERSEC 0x001e | 50 | #define SO_PEERSEC 0x001e |
51 | #define SO_PASSSEC 0x001f | ||
51 | 52 | ||
52 | /* Security levels - as per NRL IPv6 - don't actually do anything */ | 53 | /* Security levels - as per NRL IPv6 - don't actually do anything */ |
53 | #define SO_SECURITY_AUTHENTICATION 0x5001 | 54 | #define SO_SECURITY_AUTHENTICATION 0x5001 |
diff --git a/include/asm-sparc64/starfire.h b/include/asm-sparc64/starfire.h index b606cb2b32a8..48b50b5e35b0 100644 --- a/include/asm-sparc64/starfire.h +++ b/include/asm-sparc64/starfire.h | |||
@@ -14,7 +14,7 @@ extern int this_is_starfire; | |||
14 | extern void check_if_starfire(void); | 14 | extern void check_if_starfire(void); |
15 | extern void starfire_cpu_setup(void); | 15 | extern void starfire_cpu_setup(void); |
16 | extern int starfire_hard_smp_processor_id(void); | 16 | extern int starfire_hard_smp_processor_id(void); |
17 | extern void *starfire_hookup(int); | 17 | extern void starfire_hookup(int); |
18 | extern unsigned int starfire_translate(unsigned long imap, unsigned int upaid); | 18 | extern unsigned int starfire_translate(unsigned long imap, unsigned int upaid); |
19 | 19 | ||
20 | #endif | 20 | #endif |
diff --git a/include/asm-sparc64/topology.h b/include/asm-sparc64/topology.h index 0e234e201bd6..98a6c613589d 100644 --- a/include/asm-sparc64/topology.h +++ b/include/asm-sparc64/topology.h | |||
@@ -1,6 +1,9 @@ | |||
1 | #ifndef _ASM_SPARC64_TOPOLOGY_H | 1 | #ifndef _ASM_SPARC64_TOPOLOGY_H |
2 | #define _ASM_SPARC64_TOPOLOGY_H | 2 | #define _ASM_SPARC64_TOPOLOGY_H |
3 | 3 | ||
4 | #include <asm/spitfire.h> | ||
5 | #define smt_capable() (tlb_type == hypervisor) | ||
6 | |||
4 | #include <asm-generic/topology.h> | 7 | #include <asm-generic/topology.h> |
5 | 8 | ||
6 | #endif /* _ASM_SPARC64_TOPOLOGY_H */ | 9 | #endif /* _ASM_SPARC64_TOPOLOGY_H */ |
diff --git a/include/asm-sparc64/vdev.h b/include/asm-sparc64/vdev.h deleted file mode 100644 index 996e6be7b976..000000000000 --- a/include/asm-sparc64/vdev.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* vdev.h: SUN4V virtual device interfaces and defines. | ||
2 | * | ||
3 | * Copyright (C) 2006 David S. Miller <davem@davemloft.net> | ||
4 | */ | ||
5 | |||
6 | #ifndef _SPARC64_VDEV_H | ||
7 | #define _SPARC64_VDEV_H | ||
8 | |||
9 | #include <linux/types.h> | ||
10 | |||
11 | extern u32 sun4v_vdev_devhandle; | ||
12 | extern int sun4v_vdev_root; | ||
13 | |||
14 | extern unsigned int sun4v_vdev_device_interrupt(unsigned int); | ||
15 | |||
16 | #endif /* !(_SPARC64_VDEV_H) */ | ||
diff --git a/include/asm-sparc64/vga.h b/include/asm-sparc64/vga.h index 9c57eb363b40..c69d5b2ba19a 100644 --- a/include/asm-sparc64/vga.h +++ b/include/asm-sparc64/vga.h | |||
@@ -28,6 +28,6 @@ static inline u16 scr_readw(const u16 *addr) | |||
28 | return *addr; | 28 | return *addr; |
29 | } | 29 | } |
30 | 30 | ||
31 | #define VGA_MAP_MEM(x) (x) | 31 | #define VGA_MAP_MEM(x,s) (x) |
32 | 32 | ||
33 | #endif | 33 | #endif |