diff options
Diffstat (limited to 'arch/sh/kernel/cpu')
| -rw-r--r-- | arch/sh/kernel/cpu/irq/Makefile | 1 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/irq/ipr.c | 2 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/irq/pint.c | 220 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh3/Makefile | 4 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh3/clock-sh7710.c (renamed from arch/sh/kernel/cpu/sh3/clock-sh7300.c) | 26 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh3/setup-sh7300.c | 43 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4/probe.c | 6 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4/sq.c | 18 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/Makefile | 2 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/clock-sh73180.c | 81 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh73180.c | 43 |
11 files changed, 27 insertions, 419 deletions
diff --git a/arch/sh/kernel/cpu/irq/Makefile b/arch/sh/kernel/cpu/irq/Makefile index 9ddb446ac9..60bfc05cf3 100644 --- a/arch/sh/kernel/cpu/irq/Makefile +++ b/arch/sh/kernel/cpu/irq/Makefile | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | obj-y += imask.o | 4 | obj-y += imask.o |
| 5 | 5 | ||
| 6 | obj-$(CONFIG_CPU_HAS_IPR_IRQ) += ipr.o | 6 | obj-$(CONFIG_CPU_HAS_IPR_IRQ) += ipr.o |
| 7 | obj-$(CONFIG_CPU_HAS_PINT_IRQ) += pint.o | ||
| 8 | obj-$(CONFIG_CPU_HAS_MASKREG_IRQ) += maskreg.o | 7 | obj-$(CONFIG_CPU_HAS_MASKREG_IRQ) += maskreg.o |
| 9 | obj-$(CONFIG_CPU_HAS_INTC_IRQ) += intc.o | 8 | obj-$(CONFIG_CPU_HAS_INTC_IRQ) += intc.o |
| 10 | obj-$(CONFIG_CPU_HAS_INTC2_IRQ) += intc2.o | 9 | obj-$(CONFIG_CPU_HAS_INTC2_IRQ) += intc2.o |
diff --git a/arch/sh/kernel/cpu/irq/ipr.c b/arch/sh/kernel/cpu/irq/ipr.c index 98e84f40c7..5da3254148 100644 --- a/arch/sh/kernel/cpu/irq/ipr.c +++ b/arch/sh/kernel/cpu/irq/ipr.c | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | * | 8 | * |
| 9 | * Supported system: | 9 | * Supported system: |
| 10 | * On-chip supporting modules (TMU, RTC, etc.). | 10 | * On-chip supporting modules (TMU, RTC, etc.). |
| 11 | * On-chip supporting modules for SH7709/SH7709A/SH7729/SH7300. | 11 | * On-chip supporting modules for SH7709/SH7709A/SH7729. |
| 12 | * Hitachi SolutionEngine external I/O: | 12 | * Hitachi SolutionEngine external I/O: |
| 13 | * MS7709SE01, MS7709ASE01, and MS7750SE01 | 13 | * MS7709SE01, MS7709ASE01, and MS7750SE01 |
| 14 | * | 14 | * |
diff --git a/arch/sh/kernel/cpu/irq/pint.c b/arch/sh/kernel/cpu/irq/pint.c deleted file mode 100644 index 67602685df..0000000000 --- a/arch/sh/kernel/cpu/irq/pint.c +++ /dev/null | |||
| @@ -1,220 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * arch/sh/kernel/cpu/irq/pint.c - Interrupt handling for PINT-based IRQs. | ||
| 3 | * | ||
| 4 | * Copyright (C) 1999 Niibe Yutaka & Takeshi Yaegashi | ||
| 5 | * Copyright (C) 2000 Kazumoto Kojima | ||
| 6 | * Copyright (C) 2003 Takashi Kusuda <kusuda-takashi@hitachi-ul.co.jp> | ||
| 7 | * | ||
| 8 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 9 | * License. See the file "COPYING" in the main directory of this archive | ||
| 10 | * for more details. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include <linux/init.h> | ||
| 14 | #include <linux/irq.h> | ||
| 15 | #include <linux/module.h> | ||
| 16 | |||
| 17 | #include <asm/system.h> | ||
| 18 | #include <asm/io.h> | ||
| 19 | #include <asm/machvec.h> | ||
| 20 | |||
| 21 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) | ||
| 22 | #define INTC_INTER 0xA4000014UL | ||
| 23 | #define INTC_IPRD 0xA4000018UL | ||
| 24 | #define INTC_ICR2 0xA4000012UL | ||
| 25 | |||
| 26 | /* PFC */ | ||
| 27 | #define PORT_PACR 0xA4000100UL | ||
| 28 | #define PORT_PBCR 0xA4000102UL | ||
| 29 | #define PORT_PCCR 0xA4000104UL | ||
| 30 | #define PORT_PDCR 0xA4000106UL | ||
| 31 | #define PORT_PECR 0xA4000108UL | ||
| 32 | #define PORT_PFCR 0xA400010AUL | ||
| 33 | #define PORT_PGCR 0xA400010CUL | ||
| 34 | #define PORT_PHCR 0xA400010EUL | ||
| 35 | #define PORT_PJCR 0xA4000110UL | ||
| 36 | #define PORT_PKCR 0xA4000112UL | ||
| 37 | #define PORT_PLCR 0xA4000114UL | ||
| 38 | #define PORT_PMCR 0xA4000118UL | ||
| 39 | #define PORT_PNCR 0xA400011AUL | ||
| 40 | #define PORT_PECR2 0xA4050148UL | ||
| 41 | #define PORT_PFCR2 0xA405014AUL | ||
| 42 | #define PORT_PNCR2 0xA405015AUL | ||
| 43 | |||
| 44 | /* I/O port */ | ||
| 45 | #define PORT_PADR 0xA4000120UL | ||
| 46 | #define PORT_PBDR 0xA4000122UL | ||
| 47 | #define PORT_PCDR 0xA4000124UL | ||
| 48 | #define PORT_PDDR 0xA4000126UL | ||
| 49 | #define PORT_PEDR 0xA4000128UL | ||
| 50 | #define PORT_PFDR 0xA400012AUL | ||
| 51 | #define PORT_PGDR 0xA400012CUL | ||
| 52 | #define PORT_PHDR 0xA400012EUL | ||
| 53 | #define PORT_PJDR 0xA4000130UL | ||
| 54 | #define PORT_PKDR 0xA4000132UL | ||
| 55 | #define PORT_PLDR 0xA4000134UL | ||
| 56 | #define PORT_PMDR 0xA4000138UL | ||
| 57 | #define PORT_PNDR 0xA400013AUL | ||
| 58 | |||
| 59 | #define PINT0_IRQ 40 | ||
| 60 | #define PINT8_IRQ 41 | ||
| 61 | #define PINT_IRQ_BASE 86 | ||
| 62 | |||
| 63 | #define PINT0_IPR_ADDR INTC_IPRD | ||
| 64 | #define PINT0_IPR_POS 3 | ||
| 65 | #define PINT0_PRIORITY 2 | ||
| 66 | |||
| 67 | #define PINT8_IPR_ADDR INTC_IPRD | ||
| 68 | #define PINT8_IPR_POS 2 | ||
| 69 | #define PINT8_PRIORITY 2 | ||
| 70 | |||
| 71 | #endif /* CONFIG_CPU_SUBTYPE_SH7705 */ | ||
| 72 | |||
| 73 | static unsigned char pint_map[256]; | ||
| 74 | static unsigned long portcr_mask; | ||
| 75 | |||
| 76 | static void enable_pint_irq(unsigned int irq); | ||
| 77 | static void disable_pint_irq(unsigned int irq); | ||
| 78 | |||
| 79 | /* shutdown is same as "disable" */ | ||
| 80 | #define shutdown_pint_irq disable_pint_irq | ||
| 81 | |||
| 82 | static void mask_and_ack_pint(unsigned int); | ||
| 83 | static void end_pint_irq(unsigned int irq); | ||
| 84 | |||
| 85 | static unsigned int startup_pint_irq(unsigned int irq) | ||
| 86 | { | ||
| 87 | enable_pint_irq(irq); | ||
| 88 | return 0; /* never anything pending */ | ||
| 89 | } | ||
| 90 | |||
| 91 | static struct hw_interrupt_type pint_irq_type = { | ||
| 92 | .typename = "PINT-IRQ", | ||
| 93 | .startup = startup_pint_irq, | ||
| 94 | .shutdown = shutdown_pint_irq, | ||
| 95 | .enable = enable_pint_irq, | ||
| 96 | .disable = disable_pint_irq, | ||
| 97 | .ack = mask_and_ack_pint, | ||
| 98 | .end = end_pint_irq | ||
| 99 | }; | ||
| 100 | |||
| 101 | static void disable_pint_irq(unsigned int irq) | ||
| 102 | { | ||
| 103 | unsigned long val; | ||
| 104 | |||
| 105 | val = ctrl_inw(INTC_INTER); | ||
| 106 | val &= ~(1 << (irq - PINT_IRQ_BASE)); | ||
| 107 | ctrl_outw(val, INTC_INTER); /* disable PINTn */ | ||
| 108 | portcr_mask &= ~(3 << (irq - PINT_IRQ_BASE)*2); | ||
| 109 | } | ||
| 110 | |||
| 111 | static void enable_pint_irq(unsigned int irq) | ||
| 112 | { | ||
| 113 | unsigned long val; | ||
| 114 | |||
| 115 | val = ctrl_inw(INTC_INTER); | ||
| 116 | val |= 1 << (irq - PINT_IRQ_BASE); | ||
| 117 | ctrl_outw(val, INTC_INTER); /* enable PINTn */ | ||
| 118 | portcr_mask |= 3 << (irq - PINT_IRQ_BASE)*2; | ||
| 119 | } | ||
| 120 | |||
| 121 | static void mask_and_ack_pint(unsigned int irq) | ||
| 122 | { | ||
| 123 | disable_pint_irq(irq); | ||
| 124 | } | ||
| 125 | |||
| 126 | static void end_pint_irq(unsigned int irq) | ||
| 127 | { | ||
| 128 | if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) | ||
| 129 | enable_pint_irq(irq); | ||
| 130 | } | ||
| 131 | |||
| 132 | void make_pint_irq(unsigned int irq) | ||
| 133 | { | ||
| 134 | disable_irq_nosync(irq); | ||
| 135 | irq_desc[irq].chip = &pint_irq_type; | ||
| 136 | disable_pint_irq(irq); | ||
| 137 | } | ||
| 138 | |||
| 139 | static struct ipr_data pint_ipr_map[] = { | ||
| 140 | { PINT0_IRQ, PINT0_IPR_ADDR, PINT0_IPR_POS, PINT0_PRIORITY }, | ||
| 141 | { PINT8_IRQ, PINT8_IPR_ADDR, PINT8_IPR_POS, PINT8_PRIORITY }, | ||
| 142 | }; | ||
| 143 | |||
| 144 | void __init init_IRQ_pint(void) | ||
| 145 | { | ||
| 146 | int i; | ||
| 147 | |||
| 148 | make_ipr_irq(pint_ipr_map, ARRAY_SIZE(pint_ipr_map)); | ||
| 149 | |||
| 150 | enable_irq(PINT0_IRQ); | ||
| 151 | enable_irq(PINT8_IRQ); | ||
| 152 | |||
| 153 | for(i = 0; i < 16; i++) | ||
| 154 | make_pint_irq(PINT_IRQ_BASE + i); | ||
| 155 | |||
| 156 | for(i = 0; i < 256; i++) { | ||
| 157 | if (i & 1) | ||
| 158 | pint_map[i] = 0; | ||
| 159 | else if (i & 2) | ||
| 160 | pint_map[i] = 1; | ||
| 161 | else if (i & 4) | ||
| 162 | pint_map[i] = 2; | ||
| 163 | else if (i & 8) | ||
| 164 | pint_map[i] = 3; | ||
| 165 | else if (i & 0x10) | ||
| 166 | pint_map[i] = 4; | ||
| 167 | else if (i & 0x20) | ||
| 168 | pint_map[i] = 5; | ||
| 169 | else if (i & 0x40) | ||
| 170 | pint_map[i] = 6; | ||
| 171 | else if (i & 0x80) | ||
| 172 | pint_map[i] = 7; | ||
| 173 | } | ||
| 174 | } | ||
| 175 | |||
| 176 | int ipr_irq_demux(int irq) | ||
| 177 | { | ||
| 178 | unsigned long creg, dreg, d, sav; | ||
| 179 | |||
| 180 | if (irq == PINT0_IRQ) { | ||
| 181 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) || defined(CONFIG_CPU_SUBTYPE_SH7707) | ||
| 182 | creg = PORT_PACR; | ||
| 183 | dreg = PORT_PADR; | ||
| 184 | #else | ||
| 185 | creg = PORT_PCCR; | ||
| 186 | dreg = PORT_PCDR; | ||
| 187 | #endif | ||
| 188 | sav = ctrl_inw(creg); | ||
| 189 | ctrl_outw(sav | portcr_mask, creg); | ||
| 190 | d = (~ctrl_inb(dreg) ^ ctrl_inw(INTC_ICR2)) & | ||
| 191 | ctrl_inw(INTC_INTER) & 0xff; | ||
| 192 | ctrl_outw(sav, creg); | ||
| 193 | |||
| 194 | if (d == 0) | ||
| 195 | return irq; | ||
| 196 | |||
| 197 | return PINT_IRQ_BASE + pint_map[d]; | ||
| 198 | } else if (irq == PINT8_IRQ) { | ||
| 199 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) || defined(CONFIG_CPU_SUBTYPE_SH7707) | ||
| 200 | creg = PORT_PBCR; | ||
| 201 | dreg = PORT_PBDR; | ||
| 202 | #else | ||
| 203 | creg = PORT_PFCR; | ||
| 204 | dreg = PORT_PFDR; | ||
| 205 | #endif | ||
| 206 | sav = ctrl_inw(creg); | ||
| 207 | ctrl_outw(sav | (portcr_mask >> 16), creg); | ||
| 208 | d = (~ctrl_inb(dreg) ^ (ctrl_inw(INTC_ICR2) >> 8)) & | ||
| 209 | (ctrl_inw(INTC_INTER) >> 8) & 0xff; | ||
| 210 | ctrl_outw(sav, creg); | ||
| 211 | |||
| 212 | if (d == 0) | ||
| 213 | return irq; | ||
| 214 | |||
| 215 | return PINT_IRQ_BASE + 8 + pint_map[d]; | ||
| 216 | } | ||
| 217 | |||
| 218 | return irq; | ||
| 219 | } | ||
| 220 | |||
diff --git a/arch/sh/kernel/cpu/sh3/Makefile b/arch/sh/kernel/cpu/sh3/Makefile index 09faa056cd..55b750763f 100644 --- a/arch/sh/kernel/cpu/sh3/Makefile +++ b/arch/sh/kernel/cpu/sh3/Makefile | |||
| @@ -10,16 +10,14 @@ obj-$(CONFIG_CPU_SUBTYPE_SH7706) += setup-sh7709.o | |||
| 10 | obj-$(CONFIG_CPU_SUBTYPE_SH7707) += setup-sh7709.o | 10 | obj-$(CONFIG_CPU_SUBTYPE_SH7707) += setup-sh7709.o |
| 11 | obj-$(CONFIG_CPU_SUBTYPE_SH7708) += setup-sh7708.o | 11 | obj-$(CONFIG_CPU_SUBTYPE_SH7708) += setup-sh7708.o |
| 12 | obj-$(CONFIG_CPU_SUBTYPE_SH7709) += setup-sh7709.o | 12 | obj-$(CONFIG_CPU_SUBTYPE_SH7709) += setup-sh7709.o |
| 13 | obj-$(CONFIG_CPU_SUBTYPE_SH7300) += setup-sh7300.o | ||
| 14 | obj-$(CONFIG_CPU_SUBTYPE_SH7710) += setup-sh7710.o | 13 | obj-$(CONFIG_CPU_SUBTYPE_SH7710) += setup-sh7710.o |
| 15 | obj-$(CONFIG_CPU_SUBTYPE_SH7712) += setup-sh7710.o | 14 | obj-$(CONFIG_CPU_SUBTYPE_SH7712) += setup-sh7710.o |
| 16 | 15 | ||
| 17 | # Primary on-chip clocks (common) | 16 | # Primary on-chip clocks (common) |
| 18 | clock-$(CONFIG_CPU_SH3) := clock-sh3.o | 17 | clock-$(CONFIG_CPU_SH3) := clock-sh3.o |
| 19 | clock-$(CONFIG_CPU_SUBTYPE_SH7300) := clock-sh7300.o | ||
| 20 | clock-$(CONFIG_CPU_SUBTYPE_SH7705) := clock-sh7705.o | 18 | clock-$(CONFIG_CPU_SUBTYPE_SH7705) := clock-sh7705.o |
| 21 | clock-$(CONFIG_CPU_SUBTYPE_SH7706) := clock-sh7706.o | 19 | clock-$(CONFIG_CPU_SUBTYPE_SH7706) := clock-sh7706.o |
| 22 | clock-$(CONFIG_CPU_SUBTYPE_SH7709) := clock-sh7709.o | 20 | clock-$(CONFIG_CPU_SUBTYPE_SH7709) := clock-sh7709.o |
| 23 | clock-$(CONFIG_CPU_SUBTYPE_SH7710) := clock-sh7300.o | 21 | clock-$(CONFIG_CPU_SUBTYPE_SH7710) := clock-sh7710.o |
| 24 | 22 | ||
| 25 | obj-y += $(clock-y) | 23 | obj-y += $(clock-y) |
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh7300.c b/arch/sh/kernel/cpu/sh3/clock-sh7710.c index e804174b96..4744c50ec4 100644 --- a/arch/sh/kernel/cpu/sh3/clock-sh7300.c +++ b/arch/sh/kernel/cpu/sh3/clock-sh7710.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * arch/sh/kernel/cpu/sh3/clock-sh7300.c | 2 | * arch/sh/kernel/cpu/sh3/clock-sh7710.c |
| 3 | * | 3 | * |
| 4 | * SH7300 support for the clock framework | 4 | * SH7710 support for the clock framework |
| 5 | * | 5 | * |
| 6 | * Copyright (C) 2005 Paul Mundt | 6 | * Copyright (C) 2005 Paul Mundt |
| 7 | * | 7 | * |
| @@ -29,7 +29,7 @@ static void master_clk_init(struct clk *clk) | |||
| 29 | clk->rate *= md_table[ctrl_inw(FRQCR) & 0x0007]; | 29 | clk->rate *= md_table[ctrl_inw(FRQCR) & 0x0007]; |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | static struct clk_ops sh7300_master_clk_ops = { | 32 | static struct clk_ops sh7710_master_clk_ops = { |
| 33 | .init = master_clk_init, | 33 | .init = master_clk_init, |
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| @@ -39,7 +39,7 @@ static void module_clk_recalc(struct clk *clk) | |||
| 39 | clk->rate = clk->parent->rate / md_table[idx]; | 39 | clk->rate = clk->parent->rate / md_table[idx]; |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | static struct clk_ops sh7300_module_clk_ops = { | 42 | static struct clk_ops sh7710_module_clk_ops = { |
| 43 | .recalc = module_clk_recalc, | 43 | .recalc = module_clk_recalc, |
| 44 | }; | 44 | }; |
| 45 | 45 | ||
| @@ -49,7 +49,7 @@ static void bus_clk_recalc(struct clk *clk) | |||
| 49 | clk->rate = clk->parent->rate / md_table[idx]; | 49 | clk->rate = clk->parent->rate / md_table[idx]; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | static struct clk_ops sh7300_bus_clk_ops = { | 52 | static struct clk_ops sh7710_bus_clk_ops = { |
| 53 | .recalc = bus_clk_recalc, | 53 | .recalc = bus_clk_recalc, |
| 54 | }; | 54 | }; |
| 55 | 55 | ||
| @@ -59,20 +59,20 @@ static void cpu_clk_recalc(struct clk *clk) | |||
| 59 | clk->rate = clk->parent->rate / md_table[idx]; | 59 | clk->rate = clk->parent->rate / md_table[idx]; |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | static struct clk_ops sh7300_cpu_clk_ops = { | 62 | static struct clk_ops sh7710_cpu_clk_ops = { |
| 63 | .recalc = cpu_clk_recalc, | 63 | .recalc = cpu_clk_recalc, |
| 64 | }; | 64 | }; |
| 65 | 65 | ||
| 66 | static struct clk_ops *sh7300_clk_ops[] = { | 66 | static struct clk_ops *sh7710_clk_ops[] = { |
| 67 | &sh7300_master_clk_ops, | 67 | &sh7710_master_clk_ops, |
| 68 | &sh7300_module_clk_ops, | 68 | &sh7710_module_clk_ops, |
| 69 | &sh7300_bus_clk_ops, | 69 | &sh7710_bus_clk_ops, |
| 70 | &sh7300_cpu_clk_ops, | 70 | &sh7710_cpu_clk_ops, |
| 71 | }; | 71 | }; |
| 72 | 72 | ||
| 73 | void __init arch_init_clk_ops(struct clk_ops **ops, int idx) | 73 | void __init arch_init_clk_ops(struct clk_ops **ops, int idx) |
| 74 | { | 74 | { |
| 75 | if (idx < ARRAY_SIZE(sh7300_clk_ops)) | 75 | if (idx < ARRAY_SIZE(sh7710_clk_ops)) |
| 76 | *ops = sh7300_clk_ops[idx]; | 76 | *ops = sh7710_clk_ops[idx]; |
| 77 | } | 77 | } |
| 78 | 78 | ||
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7300.c b/arch/sh/kernel/cpu/sh3/setup-sh7300.c deleted file mode 100644 index ab4d204bfb..0000000000 --- a/arch/sh/kernel/cpu/sh3/setup-sh7300.c +++ /dev/null | |||
| @@ -1,43 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * SH7300 Setup | ||
| 3 | * | ||
| 4 | * Copyright (C) 2006 Paul Mundt | ||
| 5 | * | ||
| 6 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 7 | * License. See the file "COPYING" in the main directory of this archive | ||
| 8 | * for more details. | ||
| 9 | */ | ||
| 10 | #include <linux/platform_device.h> | ||
| 11 | #include <linux/init.h> | ||
| 12 | #include <linux/serial.h> | ||
| 13 | #include <asm/sci.h> | ||
| 14 | |||
| 15 | static struct plat_sci_port sci_platform_data[] = { | ||
| 16 | { | ||
| 17 | .mapbase = 0xa4430000, | ||
| 18 | .flags = UPF_BOOT_AUTOCONF, | ||
| 19 | .type = PORT_SCI, | ||
| 20 | .irqs = { 80, 80, 80, 80 }, | ||
| 21 | }, { | ||
| 22 | .flags = 0, | ||
| 23 | } | ||
| 24 | }; | ||
| 25 | |||
| 26 | static struct platform_device sci_device = { | ||
| 27 | .name = "sh-sci", | ||
| 28 | .id = -1, | ||
| 29 | .dev = { | ||
| 30 | .platform_data = sci_platform_data, | ||
| 31 | }, | ||
| 32 | }; | ||
| 33 | |||
| 34 | static struct platform_device *sh7300_devices[] __initdata = { | ||
| 35 | &sci_device, | ||
| 36 | }; | ||
| 37 | |||
| 38 | static int __init sh7300_devices_setup(void) | ||
| 39 | { | ||
| 40 | return platform_add_devices(sh7300_devices, | ||
| 41 | ARRAY_SIZE(sh7300_devices)); | ||
| 42 | } | ||
| 43 | __initcall(sh7300_devices_setup); | ||
diff --git a/arch/sh/kernel/cpu/sh4/probe.c b/arch/sh/kernel/cpu/sh4/probe.c index 66c3f75647..98d28fb1ce 100644 --- a/arch/sh/kernel/cpu/sh4/probe.c +++ b/arch/sh/kernel/cpu/sh4/probe.c | |||
| @@ -90,12 +90,6 @@ int __init detect_cpu_and_cache_system(void) | |||
| 90 | current_cpu_data.type = CPU_SH7751; | 90 | current_cpu_data.type = CPU_SH7751; |
| 91 | current_cpu_data.flags |= CPU_HAS_FPU; | 91 | current_cpu_data.flags |= CPU_HAS_FPU; |
| 92 | break; | 92 | break; |
| 93 | case 0x2000: | ||
| 94 | current_cpu_data.type = CPU_SH73180; | ||
| 95 | current_cpu_data.icache.ways = 4; | ||
| 96 | current_cpu_data.dcache.ways = 4; | ||
| 97 | current_cpu_data.flags |= CPU_HAS_LLSC; | ||
| 98 | break; | ||
| 99 | case 0x2001: | 93 | case 0x2001: |
| 100 | case 0x2004: | 94 | case 0x2004: |
| 101 | current_cpu_data.type = CPU_SH7770; | 95 | current_cpu_data.type = CPU_SH7770; |
diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c index b98d6c3e6f..c21512c604 100644 --- a/arch/sh/kernel/cpu/sh4/sq.c +++ b/arch/sh/kernel/cpu/sh4/sq.c | |||
| @@ -208,7 +208,6 @@ EXPORT_SYMBOL(sq_remap); | |||
| 208 | void sq_unmap(unsigned long vaddr) | 208 | void sq_unmap(unsigned long vaddr) |
| 209 | { | 209 | { |
| 210 | struct sq_mapping **p, *map; | 210 | struct sq_mapping **p, *map; |
| 211 | struct vm_struct *vma; | ||
| 212 | int page; | 211 | int page; |
| 213 | 212 | ||
| 214 | for (p = &sq_mapping_list; (map = *p); p = &map->next) | 213 | for (p = &sq_mapping_list; (map = *p); p = &map->next) |
| @@ -225,11 +224,18 @@ void sq_unmap(unsigned long vaddr) | |||
| 225 | bitmap_release_region(sq_bitmap, page, get_order(map->size)); | 224 | bitmap_release_region(sq_bitmap, page, get_order(map->size)); |
| 226 | 225 | ||
| 227 | #ifdef CONFIG_MMU | 226 | #ifdef CONFIG_MMU |
| 228 | vma = remove_vm_area((void *)(map->sq_addr & PAGE_MASK)); | 227 | { |
| 229 | if (!vma) { | 228 | /* |
| 230 | printk(KERN_ERR "%s: bad address 0x%08lx\n", | 229 | * Tear down the VMA in the MMU case. |
| 231 | __FUNCTION__, map->sq_addr); | 230 | */ |
| 232 | return; | 231 | struct vm_struct *vma; |
| 232 | |||
| 233 | vma = remove_vm_area((void *)(map->sq_addr & PAGE_MASK)); | ||
| 234 | if (!vma) { | ||
| 235 | printk(KERN_ERR "%s: bad address 0x%08lx\n", | ||
| 236 | __FUNCTION__, map->sq_addr); | ||
| 237 | return; | ||
| 238 | } | ||
| 233 | } | 239 | } |
| 234 | #endif | 240 | #endif |
| 235 | 241 | ||
diff --git a/arch/sh/kernel/cpu/sh4a/Makefile b/arch/sh/kernel/cpu/sh4a/Makefile index 4006232864..e6a1fb5f84 100644 --- a/arch/sh/kernel/cpu/sh4a/Makefile +++ b/arch/sh/kernel/cpu/sh4a/Makefile | |||
| @@ -6,13 +6,11 @@ | |||
| 6 | obj-$(CONFIG_CPU_SUBTYPE_SH7770) += setup-sh7770.o | 6 | obj-$(CONFIG_CPU_SUBTYPE_SH7770) += setup-sh7770.o |
| 7 | obj-$(CONFIG_CPU_SUBTYPE_SH7780) += setup-sh7780.o | 7 | obj-$(CONFIG_CPU_SUBTYPE_SH7780) += setup-sh7780.o |
| 8 | obj-$(CONFIG_CPU_SUBTYPE_SH7785) += setup-sh7785.o | 8 | obj-$(CONFIG_CPU_SUBTYPE_SH7785) += setup-sh7785.o |
| 9 | obj-$(CONFIG_CPU_SUBTYPE_SH73180) += setup-sh73180.o | ||
| 10 | obj-$(CONFIG_CPU_SUBTYPE_SH7343) += setup-sh7343.o | 9 | obj-$(CONFIG_CPU_SUBTYPE_SH7343) += setup-sh7343.o |
| 11 | obj-$(CONFIG_CPU_SUBTYPE_SH7722) += setup-sh7722.o | 10 | obj-$(CONFIG_CPU_SUBTYPE_SH7722) += setup-sh7722.o |
| 12 | obj-$(CONFIG_CPU_SUBTYPE_SHX3) += setup-shx3.o | 11 | obj-$(CONFIG_CPU_SUBTYPE_SHX3) += setup-shx3.o |
| 13 | 12 | ||
| 14 | # Primary on-chip clocks (common) | 13 | # Primary on-chip clocks (common) |
| 15 | clock-$(CONFIG_CPU_SUBTYPE_SH73180) := clock-sh73180.o | ||
| 16 | clock-$(CONFIG_CPU_SUBTYPE_SH7770) := clock-sh7770.o | 14 | clock-$(CONFIG_CPU_SUBTYPE_SH7770) := clock-sh7770.o |
| 17 | clock-$(CONFIG_CPU_SUBTYPE_SH7780) := clock-sh7780.o | 15 | clock-$(CONFIG_CPU_SUBTYPE_SH7780) := clock-sh7780.o |
| 18 | clock-$(CONFIG_CPU_SUBTYPE_SH7785) := clock-sh7785.o | 16 | clock-$(CONFIG_CPU_SUBTYPE_SH7785) := clock-sh7785.o |
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh73180.c b/arch/sh/kernel/cpu/sh4a/clock-sh73180.c deleted file mode 100644 index 6d5ba373a7..0000000000 --- a/arch/sh/kernel/cpu/sh4a/clock-sh73180.c +++ /dev/null | |||
| @@ -1,81 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * arch/sh/kernel/cpu/sh4a/clock-sh73180.c | ||
| 3 | * | ||
| 4 | * SH73180 support for the clock framework | ||
| 5 | * | ||
| 6 | * Copyright (C) 2005 Paul Mundt | ||
| 7 | * | ||
| 8 | * FRQCR parsing hacked out of arch/sh/kernel/time.c | ||
| 9 | * | ||
| 10 | * Copyright (C) 1999 Tetsuya Okada & Niibe Yutaka | ||
| 11 | * Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org> | ||
| 12 | * Copyright (C) 2002, 2003, 2004 Paul Mundt | ||
| 13 | * Copyright (C) 2002 M. R. Brown <mrbrown@linux-sh.org> | ||
| 14 | * | ||
| 15 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 16 | * License. See the file "COPYING" in the main directory of this archive | ||
| 17 | * for more details. | ||
| 18 | */ | ||
| 19 | #include <linux/init.h> | ||
| 20 | #include <linux/kernel.h> | ||
| 21 | #include <asm/clock.h> | ||
| 22 | #include <asm/freq.h> | ||
| 23 | #include <asm/io.h> | ||
| 24 | |||
| 25 | /* | ||
| 26 | * SH73180 uses a common set of divisors, so this is quite simple.. | ||
| 27 | */ | ||
| 28 | static int divisors[] = { 1, 2, 3, 4, 6, 8, 12, 16 }; | ||
| 29 | |||
| 30 | static void master_clk_init(struct clk *clk) | ||
| 31 | { | ||
| 32 | clk->rate *= divisors[ctrl_inl(FRQCR) & 0x0007]; | ||
| 33 | } | ||
| 34 | |||
| 35 | static struct clk_ops sh73180_master_clk_ops = { | ||
| 36 | .init = master_clk_init, | ||
| 37 | }; | ||
| 38 | |||
| 39 | static void module_clk_recalc(struct clk *clk) | ||
| 40 | { | ||
| 41 | int idx = (ctrl_inl(FRQCR) & 0x0007); | ||
| 42 | clk->rate = clk->parent->rate / divisors[idx]; | ||
| 43 | } | ||
| 44 | |||
| 45 | static struct clk_ops sh73180_module_clk_ops = { | ||
| 46 | .recalc = module_clk_recalc, | ||
| 47 | }; | ||
| 48 | |||
| 49 | static void bus_clk_recalc(struct clk *clk) | ||
| 50 | { | ||
| 51 | int idx = (ctrl_inl(FRQCR) >> 12) & 0x0007; | ||
| 52 | clk->rate = clk->parent->rate / divisors[idx]; | ||
| 53 | } | ||
| 54 | |||
| 55 | static struct clk_ops sh73180_bus_clk_ops = { | ||
| 56 | .recalc = bus_clk_recalc, | ||
| 57 | }; | ||
| 58 | |||
| 59 | static void cpu_clk_recalc(struct clk *clk) | ||
| 60 | { | ||
| 61 | int idx = (ctrl_inl(FRQCR) >> 20) & 0x0007; | ||
| 62 | clk->rate = clk->parent->rate / divisors[idx]; | ||
| 63 | } | ||
| 64 | |||
| 65 | static struct clk_ops sh73180_cpu_clk_ops = { | ||
| 66 | .recalc = cpu_clk_recalc, | ||
| 67 | }; | ||
| 68 | |||
| 69 | static struct clk_ops *sh73180_clk_ops[] = { | ||
| 70 | &sh73180_master_clk_ops, | ||
| 71 | &sh73180_module_clk_ops, | ||
| 72 | &sh73180_bus_clk_ops, | ||
| 73 | &sh73180_cpu_clk_ops, | ||
| 74 | }; | ||
| 75 | |||
| 76 | void __init arch_init_clk_ops(struct clk_ops **ops, int idx) | ||
| 77 | { | ||
| 78 | if (idx < ARRAY_SIZE(sh73180_clk_ops)) | ||
| 79 | *ops = sh73180_clk_ops[idx]; | ||
| 80 | } | ||
| 81 | |||
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh73180.c b/arch/sh/kernel/cpu/sh4a/setup-sh73180.c deleted file mode 100644 index cc9ea1e2e5..0000000000 --- a/arch/sh/kernel/cpu/sh4a/setup-sh73180.c +++ /dev/null | |||
| @@ -1,43 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * SH73180 Setup | ||
| 3 | * | ||
| 4 | * Copyright (C) 2006 Paul Mundt | ||
| 5 | * | ||
| 6 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 7 | * License. See the file "COPYING" in the main directory of this archive | ||
| 8 | * for more details. | ||
| 9 | */ | ||
| 10 | #include <linux/platform_device.h> | ||
| 11 | #include <linux/init.h> | ||
| 12 | #include <linux/serial.h> | ||
| 13 | #include <asm/sci.h> | ||
| 14 | |||
| 15 | static struct plat_sci_port sci_platform_data[] = { | ||
| 16 | { | ||
| 17 | .mapbase = 0xffe80000, | ||
| 18 | .flags = UPF_BOOT_AUTOCONF, | ||
| 19 | .type = PORT_SCIF, | ||
| 20 | .irqs = { 80, 81, 83, 82 }, | ||
| 21 | }, { | ||
| 22 | .flags = 0, | ||
| 23 | } | ||
| 24 | }; | ||
| 25 | |||
| 26 | static struct platform_device sci_device = { | ||
| 27 | .name = "sh-sci", | ||
| 28 | .id = -1, | ||
| 29 | .dev = { | ||
| 30 | .platform_data = sci_platform_data, | ||
| 31 | }, | ||
| 32 | }; | ||
| 33 | |||
| 34 | static struct platform_device *sh73180_devices[] __initdata = { | ||
| 35 | &sci_device, | ||
| 36 | }; | ||
| 37 | |||
| 38 | static int __init sh73180_devices_setup(void) | ||
| 39 | { | ||
| 40 | return platform_add_devices(sh73180_devices, | ||
| 41 | ARRAY_SIZE(sh73180_devices)); | ||
| 42 | } | ||
| 43 | __initcall(sh73180_devices_setup); | ||
