diff options
Diffstat (limited to 'arch/mips/dec')
-rw-r--r-- | arch/mips/dec/Makefile | 1 | ||||
-rw-r--r-- | arch/mips/dec/ioasic-irq.c | 4 | ||||
-rw-r--r-- | arch/mips/dec/kn02-irq.c | 2 | ||||
-rw-r--r-- | arch/mips/dec/prom/identify.c | 3 | ||||
-rw-r--r-- | arch/mips/dec/prom/memory.c | 17 | ||||
-rw-r--r-- | arch/mips/dec/setup.c | 14 | ||||
-rw-r--r-- | arch/mips/dec/tc.c | 95 |
7 files changed, 113 insertions, 23 deletions
diff --git a/arch/mips/dec/Makefile b/arch/mips/dec/Makefile index ed181fdc3ac9..8b790c2900d5 100644 --- a/arch/mips/dec/Makefile +++ b/arch/mips/dec/Makefile | |||
@@ -6,6 +6,7 @@ obj-y := ecc-berr.o int-handler.o ioasic-irq.o kn01-berr.o \ | |||
6 | kn02-irq.o kn02xa-berr.o reset.o setup.o time.o | 6 | kn02-irq.o kn02xa-berr.o reset.o setup.o time.o |
7 | 7 | ||
8 | obj-$(CONFIG_PROM_CONSOLE) += promcon.o | 8 | obj-$(CONFIG_PROM_CONSOLE) += promcon.o |
9 | obj-$(CONFIG_TC) += tc.o | ||
9 | obj-$(CONFIG_CPU_HAS_WB) += wbflush.o | 10 | obj-$(CONFIG_CPU_HAS_WB) += wbflush.o |
10 | 11 | ||
11 | EXTRA_AFLAGS := $(CFLAGS) | 12 | EXTRA_AFLAGS := $(CFLAGS) |
diff --git a/arch/mips/dec/ioasic-irq.c b/arch/mips/dec/ioasic-irq.c index 4c7cb4048d35..3acb133668dc 100644 --- a/arch/mips/dec/ioasic-irq.c +++ b/arch/mips/dec/ioasic-irq.c | |||
@@ -62,7 +62,7 @@ static inline void end_ioasic_irq(unsigned int irq) | |||
62 | } | 62 | } |
63 | 63 | ||
64 | static struct irq_chip ioasic_irq_type = { | 64 | static struct irq_chip ioasic_irq_type = { |
65 | .typename = "IO-ASIC", | 65 | .name = "IO-ASIC", |
66 | .ack = ack_ioasic_irq, | 66 | .ack = ack_ioasic_irq, |
67 | .mask = mask_ioasic_irq, | 67 | .mask = mask_ioasic_irq, |
68 | .mask_ack = ack_ioasic_irq, | 68 | .mask_ack = ack_ioasic_irq, |
@@ -84,7 +84,7 @@ static inline void end_ioasic_dma_irq(unsigned int irq) | |||
84 | } | 84 | } |
85 | 85 | ||
86 | static struct irq_chip ioasic_dma_irq_type = { | 86 | static struct irq_chip ioasic_dma_irq_type = { |
87 | .typename = "IO-ASIC-DMA", | 87 | .name = "IO-ASIC-DMA", |
88 | .ack = ack_ioasic_dma_irq, | 88 | .ack = ack_ioasic_dma_irq, |
89 | .mask = mask_ioasic_dma_irq, | 89 | .mask = mask_ioasic_dma_irq, |
90 | .mask_ack = ack_ioasic_dma_irq, | 90 | .mask_ack = ack_ioasic_dma_irq, |
diff --git a/arch/mips/dec/kn02-irq.c b/arch/mips/dec/kn02-irq.c index 916e46b8ccd8..02439dc0ba83 100644 --- a/arch/mips/dec/kn02-irq.c +++ b/arch/mips/dec/kn02-irq.c | |||
@@ -58,7 +58,7 @@ static void ack_kn02_irq(unsigned int irq) | |||
58 | } | 58 | } |
59 | 59 | ||
60 | static struct irq_chip kn02_irq_type = { | 60 | static struct irq_chip kn02_irq_type = { |
61 | .typename = "KN02-CSR", | 61 | .name = "KN02-CSR", |
62 | .ack = ack_kn02_irq, | 62 | .ack = ack_kn02_irq, |
63 | .mask = mask_kn02_irq, | 63 | .mask = mask_kn02_irq, |
64 | .mask_ack = ack_kn02_irq, | 64 | .mask_ack = ack_kn02_irq, |
diff --git a/arch/mips/dec/prom/identify.c b/arch/mips/dec/prom/identify.c index 81d5e878ddce..c4e3c1ea0d48 100644 --- a/arch/mips/dec/prom/identify.c +++ b/arch/mips/dec/prom/identify.c | |||
@@ -88,6 +88,7 @@ static inline void prom_init_kn02(void) | |||
88 | { | 88 | { |
89 | dec_kn_slot_base = KN02_SLOT_BASE; | 89 | dec_kn_slot_base = KN02_SLOT_BASE; |
90 | dec_kn_slot_size = KN02_SLOT_SIZE; | 90 | dec_kn_slot_size = KN02_SLOT_SIZE; |
91 | dec_tc_bus = 1; | ||
91 | 92 | ||
92 | dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + KN02_RTC); | 93 | dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + KN02_RTC); |
93 | } | 94 | } |
@@ -96,6 +97,7 @@ static inline void prom_init_kn02xa(void) | |||
96 | { | 97 | { |
97 | dec_kn_slot_base = KN02XA_SLOT_BASE; | 98 | dec_kn_slot_base = KN02XA_SLOT_BASE; |
98 | dec_kn_slot_size = IOASIC_SLOT_SIZE; | 99 | dec_kn_slot_size = IOASIC_SLOT_SIZE; |
100 | dec_tc_bus = 1; | ||
99 | 101 | ||
100 | ioasic_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_IOCTL); | 102 | ioasic_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_IOCTL); |
101 | dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_TOY); | 103 | dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_TOY); |
@@ -105,6 +107,7 @@ static inline void prom_init_kn03(void) | |||
105 | { | 107 | { |
106 | dec_kn_slot_base = KN03_SLOT_BASE; | 108 | dec_kn_slot_base = KN03_SLOT_BASE; |
107 | dec_kn_slot_size = IOASIC_SLOT_SIZE; | 109 | dec_kn_slot_size = IOASIC_SLOT_SIZE; |
110 | dec_tc_bus = 1; | ||
108 | 111 | ||
109 | ioasic_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_IOCTL); | 112 | ioasic_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_IOCTL); |
110 | dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_TOY); | 113 | dec_rtc_base = (void *)CKSEG1ADDR(dec_kn_slot_base + IOASIC_TOY); |
diff --git a/arch/mips/dec/prom/memory.c b/arch/mips/dec/prom/memory.c index 3aa01d268f2d..5a557e268f78 100644 --- a/arch/mips/dec/prom/memory.c +++ b/arch/mips/dec/prom/memory.c | |||
@@ -92,9 +92,9 @@ void __init prom_meminit(u32 magic) | |||
92 | rex_setup_memory_region(); | 92 | rex_setup_memory_region(); |
93 | } | 93 | } |
94 | 94 | ||
95 | unsigned long __init prom_free_prom_memory(void) | 95 | void __init prom_free_prom_memory(void) |
96 | { | 96 | { |
97 | unsigned long addr, end; | 97 | unsigned long end; |
98 | 98 | ||
99 | /* | 99 | /* |
100 | * Free everything below the kernel itself but leave | 100 | * Free everything below the kernel itself but leave |
@@ -114,16 +114,5 @@ unsigned long __init prom_free_prom_memory(void) | |||
114 | #endif | 114 | #endif |
115 | end = __pa(&_text); | 115 | end = __pa(&_text); |
116 | 116 | ||
117 | addr = PAGE_SIZE; | 117 | free_init_pages("unused PROM memory", PAGE_SIZE, end); |
118 | while (addr < end) { | ||
119 | ClearPageReserved(virt_to_page(__va(addr))); | ||
120 | init_page_count(virt_to_page(__va(addr))); | ||
121 | free_page((unsigned long)__va(addr)); | ||
122 | addr += PAGE_SIZE; | ||
123 | } | ||
124 | |||
125 | printk("Freeing unused PROM memory: %ldkb freed\n", | ||
126 | (end - PAGE_SIZE) >> 10); | ||
127 | |||
128 | return end - PAGE_SIZE; | ||
129 | } | 118 | } |
diff --git a/arch/mips/dec/setup.c b/arch/mips/dec/setup.c index d34032ac492a..b8a5e75ba0ab 100644 --- a/arch/mips/dec/setup.c +++ b/arch/mips/dec/setup.c | |||
@@ -53,6 +53,8 @@ unsigned long dec_kn_slot_base, dec_kn_slot_size; | |||
53 | EXPORT_SYMBOL(dec_kn_slot_base); | 53 | EXPORT_SYMBOL(dec_kn_slot_base); |
54 | EXPORT_SYMBOL(dec_kn_slot_size); | 54 | EXPORT_SYMBOL(dec_kn_slot_size); |
55 | 55 | ||
56 | int dec_tc_bus; | ||
57 | |||
56 | spinlock_t ioasic_ssr_lock; | 58 | spinlock_t ioasic_ssr_lock; |
57 | 59 | ||
58 | volatile u32 *ioasic_base; | 60 | volatile u32 *ioasic_base; |
@@ -234,7 +236,7 @@ static void __init dec_init_kn01(void) | |||
234 | memcpy(&cpu_mask_nr_tbl, &kn01_cpu_mask_nr_tbl, | 236 | memcpy(&cpu_mask_nr_tbl, &kn01_cpu_mask_nr_tbl, |
235 | sizeof(kn01_cpu_mask_nr_tbl)); | 237 | sizeof(kn01_cpu_mask_nr_tbl)); |
236 | 238 | ||
237 | mips_cpu_irq_init(DEC_CPU_IRQ_BASE); | 239 | mips_cpu_irq_init(); |
238 | 240 | ||
239 | } /* dec_init_kn01 */ | 241 | } /* dec_init_kn01 */ |
240 | 242 | ||
@@ -309,7 +311,7 @@ static void __init dec_init_kn230(void) | |||
309 | memcpy(&cpu_mask_nr_tbl, &kn230_cpu_mask_nr_tbl, | 311 | memcpy(&cpu_mask_nr_tbl, &kn230_cpu_mask_nr_tbl, |
310 | sizeof(kn230_cpu_mask_nr_tbl)); | 312 | sizeof(kn230_cpu_mask_nr_tbl)); |
311 | 313 | ||
312 | mips_cpu_irq_init(DEC_CPU_IRQ_BASE); | 314 | mips_cpu_irq_init(); |
313 | 315 | ||
314 | } /* dec_init_kn230 */ | 316 | } /* dec_init_kn230 */ |
315 | 317 | ||
@@ -403,7 +405,7 @@ static void __init dec_init_kn02(void) | |||
403 | memcpy(&asic_mask_nr_tbl, &kn02_asic_mask_nr_tbl, | 405 | memcpy(&asic_mask_nr_tbl, &kn02_asic_mask_nr_tbl, |
404 | sizeof(kn02_asic_mask_nr_tbl)); | 406 | sizeof(kn02_asic_mask_nr_tbl)); |
405 | 407 | ||
406 | mips_cpu_irq_init(DEC_CPU_IRQ_BASE); | 408 | mips_cpu_irq_init(); |
407 | init_kn02_irqs(KN02_IRQ_BASE); | 409 | init_kn02_irqs(KN02_IRQ_BASE); |
408 | 410 | ||
409 | } /* dec_init_kn02 */ | 411 | } /* dec_init_kn02 */ |
@@ -504,7 +506,7 @@ static void __init dec_init_kn02ba(void) | |||
504 | memcpy(&asic_mask_nr_tbl, &kn02ba_asic_mask_nr_tbl, | 506 | memcpy(&asic_mask_nr_tbl, &kn02ba_asic_mask_nr_tbl, |
505 | sizeof(kn02ba_asic_mask_nr_tbl)); | 507 | sizeof(kn02ba_asic_mask_nr_tbl)); |
506 | 508 | ||
507 | mips_cpu_irq_init(DEC_CPU_IRQ_BASE); | 509 | mips_cpu_irq_init(); |
508 | init_ioasic_irqs(IO_IRQ_BASE); | 510 | init_ioasic_irqs(IO_IRQ_BASE); |
509 | 511 | ||
510 | } /* dec_init_kn02ba */ | 512 | } /* dec_init_kn02ba */ |
@@ -601,7 +603,7 @@ static void __init dec_init_kn02ca(void) | |||
601 | memcpy(&asic_mask_nr_tbl, &kn02ca_asic_mask_nr_tbl, | 603 | memcpy(&asic_mask_nr_tbl, &kn02ca_asic_mask_nr_tbl, |
602 | sizeof(kn02ca_asic_mask_nr_tbl)); | 604 | sizeof(kn02ca_asic_mask_nr_tbl)); |
603 | 605 | ||
604 | mips_cpu_irq_init(DEC_CPU_IRQ_BASE); | 606 | mips_cpu_irq_init(); |
605 | init_ioasic_irqs(IO_IRQ_BASE); | 607 | init_ioasic_irqs(IO_IRQ_BASE); |
606 | 608 | ||
607 | } /* dec_init_kn02ca */ | 609 | } /* dec_init_kn02ca */ |
@@ -702,7 +704,7 @@ static void __init dec_init_kn03(void) | |||
702 | memcpy(&asic_mask_nr_tbl, &kn03_asic_mask_nr_tbl, | 704 | memcpy(&asic_mask_nr_tbl, &kn03_asic_mask_nr_tbl, |
703 | sizeof(kn03_asic_mask_nr_tbl)); | 705 | sizeof(kn03_asic_mask_nr_tbl)); |
704 | 706 | ||
705 | mips_cpu_irq_init(DEC_CPU_IRQ_BASE); | 707 | mips_cpu_irq_init(); |
706 | init_ioasic_irqs(IO_IRQ_BASE); | 708 | init_ioasic_irqs(IO_IRQ_BASE); |
707 | 709 | ||
708 | } /* dec_init_kn03 */ | 710 | } /* dec_init_kn03 */ |
diff --git a/arch/mips/dec/tc.c b/arch/mips/dec/tc.c new file mode 100644 index 000000000000..732027c79834 --- /dev/null +++ b/arch/mips/dec/tc.c | |||
@@ -0,0 +1,95 @@ | |||
1 | /* | ||
2 | * TURBOchannel architecture calls. | ||
3 | * | ||
4 | * Copyright (c) Harald Koerfgen, 1998 | ||
5 | * Copyright (c) 2001, 2003, 2005, 2006 Maciej W. Rozycki | ||
6 | * Copyright (c) 2005 James Simmons | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU | ||
9 | * General Public License. See the file "COPYING" in the main | ||
10 | * directory of this archive for more details. | ||
11 | */ | ||
12 | #include <linux/compiler.h> | ||
13 | #include <linux/errno.h> | ||
14 | #include <linux/init.h> | ||
15 | #include <linux/string.h> | ||
16 | #include <linux/tc.h> | ||
17 | #include <linux/types.h> | ||
18 | |||
19 | #include <asm/addrspace.h> | ||
20 | #include <asm/bootinfo.h> | ||
21 | #include <asm/paccess.h> | ||
22 | |||
23 | #include <asm/dec/interrupts.h> | ||
24 | #include <asm/dec/prom.h> | ||
25 | #include <asm/dec/system.h> | ||
26 | |||
27 | /* | ||
28 | * Protected read byte from TURBOchannel slot space. | ||
29 | */ | ||
30 | int tc_preadb(u8 *valp, void __iomem *addr) | ||
31 | { | ||
32 | return get_dbe(*valp, (u8 *)addr); | ||
33 | } | ||
34 | |||
35 | /* | ||
36 | * Get TURBOchannel bus information as specified by the spec, plus | ||
37 | * the slot space base address and the number of slots. | ||
38 | */ | ||
39 | int __init tc_bus_get_info(struct tc_bus *tbus) | ||
40 | { | ||
41 | if (!dec_tc_bus) | ||
42 | return -ENXIO; | ||
43 | |||
44 | memcpy(&tbus->info, rex_gettcinfo(), sizeof(tbus->info)); | ||
45 | tbus->slot_base = CPHYSADDR((long)rex_slot_address(0)); | ||
46 | |||
47 | switch (mips_machtype) { | ||
48 | case MACH_DS5000_200: | ||
49 | tbus->num_tcslots = 7; | ||
50 | break; | ||
51 | case MACH_DS5000_2X0: | ||
52 | case MACH_DS5900: | ||
53 | tbus->ext_slot_base = 0x20000000; | ||
54 | tbus->ext_slot_size = 0x20000000; | ||
55 | /* fall through */ | ||
56 | case MACH_DS5000_1XX: | ||
57 | tbus->num_tcslots = 3; | ||
58 | break; | ||
59 | case MACH_DS5000_XX: | ||
60 | tbus->num_tcslots = 2; | ||
61 | default: | ||
62 | break; | ||
63 | } | ||
64 | return 0; | ||
65 | } | ||
66 | |||
67 | /* | ||
68 | * Get the IRQ for the specified slot. | ||
69 | */ | ||
70 | void __init tc_device_get_irq(struct tc_dev *tdev) | ||
71 | { | ||
72 | switch (tdev->slot) { | ||
73 | case 0: | ||
74 | tdev->interrupt = dec_interrupt[DEC_IRQ_TC0]; | ||
75 | break; | ||
76 | case 1: | ||
77 | tdev->interrupt = dec_interrupt[DEC_IRQ_TC1]; | ||
78 | break; | ||
79 | case 2: | ||
80 | tdev->interrupt = dec_interrupt[DEC_IRQ_TC2]; | ||
81 | break; | ||
82 | /* | ||
83 | * Yuck! DS5000/200 onboard devices | ||
84 | */ | ||
85 | case 5: | ||
86 | tdev->interrupt = dec_interrupt[DEC_IRQ_TC5]; | ||
87 | break; | ||
88 | case 6: | ||
89 | tdev->interrupt = dec_interrupt[DEC_IRQ_TC6]; | ||
90 | break; | ||
91 | default: | ||
92 | tdev->interrupt = -1; | ||
93 | break; | ||
94 | } | ||
95 | } | ||