diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-02 10:44:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-02 10:44:16 -0500 |
commit | aebb2afd5420c860b7fbc3882a323ef1247fbf16 (patch) | |
tree | 05ee0efcebca5ec421de44de7a6d6271088c64a8 /arch/mips/lantiq | |
parent | 8eae508b7c6ff502a71d0293b69e97c5505d5840 (diff) | |
parent | edb15d83a875a1f4b1576188844db5c330c3267d (diff) |
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle:
o Add basic support for the Mediatek/Ralink Wireless SoC family.
o The Qualcomm Atheros platform is extended by support for the new
QCA955X SoC series as well as a bunch of patches that get the code
ready for OF support.
o Lantiq and BCM47XX platform have a few improvements and bug fixes.
o MIPS has sent a few patches that get the kernel ready for the
upcoming microMIPS support.
o The rest of the series is made up of small bug fixes and cleanups
that relate to various parts of the MIPS code. The biggy in there is
a whitespace cleanup. After I was sent another set of whitespace
cleanup patches I decided it was the time to clean the whitespace
"issues" for once and and that touches many files below arch/mips/.
Fix up silly conflicts, mostly due to whitespace cleanups.
* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (105 commits)
MIPS: Quit exporting kernel internel break codes to uapi/asm/break.h
MIPS: remove broken conditional inside vpe loader code
MIPS: SMTC: fix implicit declaration of set_vi_handler
MIPS: early_printk: drop __init annotations
MIPS: Probe for and report hardware virtualization support.
MIPS: ath79: add support for the Qualcomm Atheros AP136-010 board
MIPS: ath79: add USB controller registration code for the QCA955X SoCs
MIPS: ath79: add PCI controller registration code for the QCA955X SoCs
MIPS: ath79: add WMAC registration code for the QCA955X SoCs
MIPS: ath79: register UART for the QCA955X SoCs
MIPS: ath79: add QCA955X specific glue to ath79_device_reset_{set, clear}
MIPS: ath79: add GPIO setup code for the QCA955X SoCs
MIPS: ath79: add IRQ handling code for the QCA955X SoCs
MIPS: ath79: add clock setup code for the QCA955X SoCs
MIPS: ath79: add SoC detection code for the QCA955X SoCs
MIPS: ath79: add early printk support for the QCA955X SoCs
MIPS: ath79: fix WMAC IRQ resource assignment
mips: reserve elfcorehdr
mips: Make sure kernel memory is in iomem
MIPS: ath79: use dynamically allocated USB platform devices
...
Diffstat (limited to 'arch/mips/lantiq')
-rw-r--r-- | arch/mips/lantiq/clk.c | 18 | ||||
-rw-r--r-- | arch/mips/lantiq/clk.h | 7 | ||||
-rw-r--r-- | arch/mips/lantiq/dts/danube.dtsi | 2 | ||||
-rw-r--r-- | arch/mips/lantiq/dts/easy50712.dts | 2 | ||||
-rw-r--r-- | arch/mips/lantiq/falcon/sysctrl.c | 4 | ||||
-rw-r--r-- | arch/mips/lantiq/irq.c | 105 | ||||
-rw-r--r-- | arch/mips/lantiq/prom.h | 2 | ||||
-rw-r--r-- | arch/mips/lantiq/xway/clk.c | 43 | ||||
-rw-r--r-- | arch/mips/lantiq/xway/reset.c | 9 | ||||
-rw-r--r-- | arch/mips/lantiq/xway/sysctrl.c | 15 |
10 files changed, 158 insertions, 49 deletions
diff --git a/arch/mips/lantiq/clk.c b/arch/mips/lantiq/clk.c index ce2f129b081f..3fc2e6d70c77 100644 --- a/arch/mips/lantiq/clk.c +++ b/arch/mips/lantiq/clk.c | |||
@@ -26,13 +26,15 @@ | |||
26 | #include "prom.h" | 26 | #include "prom.h" |
27 | 27 | ||
28 | /* lantiq socs have 3 static clocks */ | 28 | /* lantiq socs have 3 static clocks */ |
29 | static struct clk cpu_clk_generic[3]; | 29 | static struct clk cpu_clk_generic[4]; |
30 | 30 | ||
31 | void clkdev_add_static(unsigned long cpu, unsigned long fpi, unsigned long io) | 31 | void clkdev_add_static(unsigned long cpu, unsigned long fpi, |
32 | unsigned long io, unsigned long ppe) | ||
32 | { | 33 | { |
33 | cpu_clk_generic[0].rate = cpu; | 34 | cpu_clk_generic[0].rate = cpu; |
34 | cpu_clk_generic[1].rate = fpi; | 35 | cpu_clk_generic[1].rate = fpi; |
35 | cpu_clk_generic[2].rate = io; | 36 | cpu_clk_generic[2].rate = io; |
37 | cpu_clk_generic[3].rate = ppe; | ||
36 | } | 38 | } |
37 | 39 | ||
38 | struct clk *clk_get_cpu(void) | 40 | struct clk *clk_get_cpu(void) |
@@ -51,6 +53,12 @@ struct clk *clk_get_io(void) | |||
51 | return &cpu_clk_generic[2]; | 53 | return &cpu_clk_generic[2]; |
52 | } | 54 | } |
53 | 55 | ||
56 | struct clk *clk_get_ppe(void) | ||
57 | { | ||
58 | return &cpu_clk_generic[3]; | ||
59 | } | ||
60 | EXPORT_SYMBOL_GPL(clk_get_ppe); | ||
61 | |||
54 | static inline int clk_good(struct clk *clk) | 62 | static inline int clk_good(struct clk *clk) |
55 | { | 63 | { |
56 | return clk && !IS_ERR(clk); | 64 | return clk && !IS_ERR(clk); |
@@ -145,9 +153,9 @@ static inline u32 get_counter_resolution(void) | |||
145 | u32 res; | 153 | u32 res; |
146 | 154 | ||
147 | __asm__ __volatile__( | 155 | __asm__ __volatile__( |
148 | ".set push\n" | 156 | ".set push\n" |
149 | ".set mips32r2\n" | 157 | ".set mips32r2\n" |
150 | "rdhwr %0, $3\n" | 158 | "rdhwr %0, $3\n" |
151 | ".set pop\n" | 159 | ".set pop\n" |
152 | : "=&r" (res) | 160 | : "=&r" (res) |
153 | : /* no input */ | 161 | : /* no input */ |
diff --git a/arch/mips/lantiq/clk.h b/arch/mips/lantiq/clk.h index fa670602b91b..77e4bdb1fe8c 100644 --- a/arch/mips/lantiq/clk.h +++ b/arch/mips/lantiq/clk.h | |||
@@ -27,12 +27,15 @@ | |||
27 | #define CLOCK_167M 166666667 | 27 | #define CLOCK_167M 166666667 |
28 | #define CLOCK_196_608M 196608000 | 28 | #define CLOCK_196_608M 196608000 |
29 | #define CLOCK_200M 200000000 | 29 | #define CLOCK_200M 200000000 |
30 | #define CLOCK_222M 222000000 | ||
31 | #define CLOCK_240M 240000000 | ||
30 | #define CLOCK_250M 250000000 | 32 | #define CLOCK_250M 250000000 |
31 | #define CLOCK_266M 266666666 | 33 | #define CLOCK_266M 266666666 |
32 | #define CLOCK_300M 300000000 | 34 | #define CLOCK_300M 300000000 |
33 | #define CLOCK_333M 333333333 | 35 | #define CLOCK_333M 333333333 |
34 | #define CLOCK_393M 393215332 | 36 | #define CLOCK_393M 393215332 |
35 | #define CLOCK_400M 400000000 | 37 | #define CLOCK_400M 400000000 |
38 | #define CLOCK_450M 450000000 | ||
36 | #define CLOCK_500M 500000000 | 39 | #define CLOCK_500M 500000000 |
37 | #define CLOCK_600M 600000000 | 40 | #define CLOCK_600M 600000000 |
38 | 41 | ||
@@ -64,15 +67,17 @@ struct clk { | |||
64 | }; | 67 | }; |
65 | 68 | ||
66 | extern void clkdev_add_static(unsigned long cpu, unsigned long fpi, | 69 | extern void clkdev_add_static(unsigned long cpu, unsigned long fpi, |
67 | unsigned long io); | 70 | unsigned long io, unsigned long ppe); |
68 | 71 | ||
69 | extern unsigned long ltq_danube_cpu_hz(void); | 72 | extern unsigned long ltq_danube_cpu_hz(void); |
70 | extern unsigned long ltq_danube_fpi_hz(void); | 73 | extern unsigned long ltq_danube_fpi_hz(void); |
74 | extern unsigned long ltq_danube_pp32_hz(void); | ||
71 | 75 | ||
72 | extern unsigned long ltq_ar9_cpu_hz(void); | 76 | extern unsigned long ltq_ar9_cpu_hz(void); |
73 | extern unsigned long ltq_ar9_fpi_hz(void); | 77 | extern unsigned long ltq_ar9_fpi_hz(void); |
74 | 78 | ||
75 | extern unsigned long ltq_vr9_cpu_hz(void); | 79 | extern unsigned long ltq_vr9_cpu_hz(void); |
76 | extern unsigned long ltq_vr9_fpi_hz(void); | 80 | extern unsigned long ltq_vr9_fpi_hz(void); |
81 | extern unsigned long ltq_vr9_pp32_hz(void); | ||
77 | 82 | ||
78 | #endif | 83 | #endif |
diff --git a/arch/mips/lantiq/dts/danube.dtsi b/arch/mips/lantiq/dts/danube.dtsi index 3a4520f009cf..d4c59e003708 100644 --- a/arch/mips/lantiq/dts/danube.dtsi +++ b/arch/mips/lantiq/dts/danube.dtsi | |||
@@ -97,7 +97,7 @@ | |||
97 | compatible = "lantiq,pci-xway"; | 97 | compatible = "lantiq,pci-xway"; |
98 | bus-range = <0x0 0x0>; | 98 | bus-range = <0x0 0x0>; |
99 | ranges = <0x2000000 0 0x8000000 0x8000000 0 0x2000000 /* pci memory */ | 99 | ranges = <0x2000000 0 0x8000000 0x8000000 0 0x2000000 /* pci memory */ |
100 | 0x1000000 0 0x00000000 0xAE00000 0 0x200000>; /* io space */ | 100 | 0x1000000 0 0x00000000 0xAE00000 0 0x200000>; /* io space */ |
101 | reg = <0x7000000 0x8000 /* config space */ | 101 | reg = <0x7000000 0x8000 /* config space */ |
102 | 0xE105400 0x400>; /* pci bridge */ | 102 | 0xE105400 0x400>; /* pci bridge */ |
103 | }; | 103 | }; |
diff --git a/arch/mips/lantiq/dts/easy50712.dts b/arch/mips/lantiq/dts/easy50712.dts index 68c17310bc82..fac1f5b178eb 100644 --- a/arch/mips/lantiq/dts/easy50712.dts +++ b/arch/mips/lantiq/dts/easy50712.dts | |||
@@ -103,7 +103,7 @@ | |||
103 | lantiq,bus-clock = <33333333>; | 103 | lantiq,bus-clock = <33333333>; |
104 | interrupt-map-mask = <0xf800 0x0 0x0 0x7>; | 104 | interrupt-map-mask = <0xf800 0x0 0x0 0x7>; |
105 | interrupt-map = < | 105 | interrupt-map = < |
106 | 0x7000 0 0 1 &icu0 29 1 // slot 14, irq 29 | 106 | 0x7000 0 0 1 &icu0 29 1 // slot 14, irq 29 |
107 | >; | 107 | >; |
108 | gpios-reset = <&gpio 21 0>; | 108 | gpios-reset = <&gpio 21 0>; |
109 | req-mask = <0x1>; /* GNT1 */ | 109 | req-mask = <0x1>; /* GNT1 */ |
diff --git a/arch/mips/lantiq/falcon/sysctrl.c b/arch/mips/lantiq/falcon/sysctrl.c index 2d4ced332b37..ff4894a833ee 100644 --- a/arch/mips/lantiq/falcon/sysctrl.c +++ b/arch/mips/lantiq/falcon/sysctrl.c | |||
@@ -241,9 +241,9 @@ void __init ltq_soc_init(void) | |||
241 | 241 | ||
242 | /* get our 3 static rates for cpu, fpi and io clocks */ | 242 | /* get our 3 static rates for cpu, fpi and io clocks */ |
243 | if (ltq_sys1_r32(SYS1_CPU0CC) & CPU0CC_CPUDIV) | 243 | if (ltq_sys1_r32(SYS1_CPU0CC) & CPU0CC_CPUDIV) |
244 | clkdev_add_static(CLOCK_200M, CLOCK_100M, CLOCK_200M); | 244 | clkdev_add_static(CLOCK_200M, CLOCK_100M, CLOCK_200M, 0); |
245 | else | 245 | else |
246 | clkdev_add_static(CLOCK_400M, CLOCK_100M, CLOCK_200M); | 246 | clkdev_add_static(CLOCK_400M, CLOCK_100M, CLOCK_200M, 0); |
247 | 247 | ||
248 | /* add our clock domains */ | 248 | /* add our clock domains */ |
249 | clkdev_add_sys("1d810000.gpio", SYSCTL_SYSETH, ACTS_P0); | 249 | clkdev_add_sys("1d810000.gpio", SYSCTL_SYSETH, ACTS_P0); |
diff --git a/arch/mips/lantiq/irq.c b/arch/mips/lantiq/irq.c index a7935bf0fecb..51194875f158 100644 --- a/arch/mips/lantiq/irq.c +++ b/arch/mips/lantiq/irq.c | |||
@@ -33,17 +33,10 @@ | |||
33 | /* register definitions - external irqs */ | 33 | /* register definitions - external irqs */ |
34 | #define LTQ_EIU_EXIN_C 0x0000 | 34 | #define LTQ_EIU_EXIN_C 0x0000 |
35 | #define LTQ_EIU_EXIN_INIC 0x0004 | 35 | #define LTQ_EIU_EXIN_INIC 0x0004 |
36 | #define LTQ_EIU_EXIN_INC 0x0008 | ||
36 | #define LTQ_EIU_EXIN_INEN 0x000C | 37 | #define LTQ_EIU_EXIN_INEN 0x000C |
37 | 38 | ||
38 | /* irq numbers used by the external interrupt unit (EIU) */ | 39 | /* number of external interrupts */ |
39 | #define LTQ_EIU_IR0 (INT_NUM_IM4_IRL0 + 30) | ||
40 | #define LTQ_EIU_IR1 (INT_NUM_IM3_IRL0 + 31) | ||
41 | #define LTQ_EIU_IR2 (INT_NUM_IM1_IRL0 + 26) | ||
42 | #define LTQ_EIU_IR3 INT_NUM_IM1_IRL0 | ||
43 | #define LTQ_EIU_IR4 (INT_NUM_IM1_IRL0 + 1) | ||
44 | #define LTQ_EIU_IR5 (INT_NUM_IM1_IRL0 + 2) | ||
45 | #define LTQ_EIU_IR6 (INT_NUM_IM2_IRL0 + 30) | ||
46 | #define XWAY_EXIN_COUNT 3 | ||
47 | #define MAX_EIU 6 | 40 | #define MAX_EIU 6 |
48 | 41 | ||
49 | /* the performance counter */ | 42 | /* the performance counter */ |
@@ -72,20 +65,19 @@ | |||
72 | int gic_present; | 65 | int gic_present; |
73 | #endif | 66 | #endif |
74 | 67 | ||
75 | static unsigned short ltq_eiu_irq[MAX_EIU] = { | ||
76 | LTQ_EIU_IR0, | ||
77 | LTQ_EIU_IR1, | ||
78 | LTQ_EIU_IR2, | ||
79 | LTQ_EIU_IR3, | ||
80 | LTQ_EIU_IR4, | ||
81 | LTQ_EIU_IR5, | ||
82 | }; | ||
83 | |||
84 | static int exin_avail; | 68 | static int exin_avail; |
69 | static struct resource ltq_eiu_irq[MAX_EIU]; | ||
85 | static void __iomem *ltq_icu_membase[MAX_IM]; | 70 | static void __iomem *ltq_icu_membase[MAX_IM]; |
86 | static void __iomem *ltq_eiu_membase; | 71 | static void __iomem *ltq_eiu_membase; |
87 | static struct irq_domain *ltq_domain; | 72 | static struct irq_domain *ltq_domain; |
88 | 73 | ||
74 | int ltq_eiu_get_irq(int exin) | ||
75 | { | ||
76 | if (exin < exin_avail) | ||
77 | return ltq_eiu_irq[exin].start; | ||
78 | return -1; | ||
79 | } | ||
80 | |||
89 | void ltq_disable_irq(struct irq_data *d) | 81 | void ltq_disable_irq(struct irq_data *d) |
90 | { | 82 | { |
91 | u32 ier = LTQ_ICU_IM0_IER; | 83 | u32 ier = LTQ_ICU_IM0_IER; |
@@ -128,19 +120,65 @@ void ltq_enable_irq(struct irq_data *d) | |||
128 | ltq_icu_w32(im, ltq_icu_r32(im, ier) | BIT(offset), ier); | 120 | ltq_icu_w32(im, ltq_icu_r32(im, ier) | BIT(offset), ier); |
129 | } | 121 | } |
130 | 122 | ||
123 | static int ltq_eiu_settype(struct irq_data *d, unsigned int type) | ||
124 | { | ||
125 | int i; | ||
126 | |||
127 | for (i = 0; i < MAX_EIU; i++) { | ||
128 | if (d->hwirq == ltq_eiu_irq[i].start) { | ||
129 | int val = 0; | ||
130 | int edge = 0; | ||
131 | |||
132 | switch (type) { | ||
133 | case IRQF_TRIGGER_NONE: | ||
134 | break; | ||
135 | case IRQF_TRIGGER_RISING: | ||
136 | val = 1; | ||
137 | edge = 1; | ||
138 | break; | ||
139 | case IRQF_TRIGGER_FALLING: | ||
140 | val = 2; | ||
141 | edge = 1; | ||
142 | break; | ||
143 | case IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING: | ||
144 | val = 3; | ||
145 | edge = 1; | ||
146 | break; | ||
147 | case IRQF_TRIGGER_HIGH: | ||
148 | val = 5; | ||
149 | break; | ||
150 | case IRQF_TRIGGER_LOW: | ||
151 | val = 6; | ||
152 | break; | ||
153 | default: | ||
154 | pr_err("invalid type %d for irq %ld\n", | ||
155 | type, d->hwirq); | ||
156 | return -EINVAL; | ||
157 | } | ||
158 | |||
159 | if (edge) | ||
160 | irq_set_handler(d->hwirq, handle_edge_irq); | ||
161 | |||
162 | ltq_eiu_w32(ltq_eiu_r32(LTQ_EIU_EXIN_C) | | ||
163 | (val << (i * 4)), LTQ_EIU_EXIN_C); | ||
164 | } | ||
165 | } | ||
166 | |||
167 | return 0; | ||
168 | } | ||
169 | |||
131 | static unsigned int ltq_startup_eiu_irq(struct irq_data *d) | 170 | static unsigned int ltq_startup_eiu_irq(struct irq_data *d) |
132 | { | 171 | { |
133 | int i; | 172 | int i; |
134 | 173 | ||
135 | ltq_enable_irq(d); | 174 | ltq_enable_irq(d); |
136 | for (i = 0; i < MAX_EIU; i++) { | 175 | for (i = 0; i < MAX_EIU; i++) { |
137 | if (d->hwirq == ltq_eiu_irq[i]) { | 176 | if (d->hwirq == ltq_eiu_irq[i].start) { |
138 | /* low level - we should really handle set_type */ | 177 | /* by default we are low level triggered */ |
139 | ltq_eiu_w32(ltq_eiu_r32(LTQ_EIU_EXIN_C) | | 178 | ltq_eiu_settype(d, IRQF_TRIGGER_LOW); |
140 | (0x6 << (i * 4)), LTQ_EIU_EXIN_C); | ||
141 | /* clear all pending */ | 179 | /* clear all pending */ |
142 | ltq_eiu_w32(ltq_eiu_r32(LTQ_EIU_EXIN_INIC) & ~BIT(i), | 180 | ltq_eiu_w32(ltq_eiu_r32(LTQ_EIU_EXIN_INC) & ~BIT(i), |
143 | LTQ_EIU_EXIN_INIC); | 181 | LTQ_EIU_EXIN_INC); |
144 | /* enable */ | 182 | /* enable */ |
145 | ltq_eiu_w32(ltq_eiu_r32(LTQ_EIU_EXIN_INEN) | BIT(i), | 183 | ltq_eiu_w32(ltq_eiu_r32(LTQ_EIU_EXIN_INEN) | BIT(i), |
146 | LTQ_EIU_EXIN_INEN); | 184 | LTQ_EIU_EXIN_INEN); |
@@ -157,7 +195,7 @@ static void ltq_shutdown_eiu_irq(struct irq_data *d) | |||
157 | 195 | ||
158 | ltq_disable_irq(d); | 196 | ltq_disable_irq(d); |
159 | for (i = 0; i < MAX_EIU; i++) { | 197 | for (i = 0; i < MAX_EIU; i++) { |
160 | if (d->hwirq == ltq_eiu_irq[i]) { | 198 | if (d->hwirq == ltq_eiu_irq[i].start) { |
161 | /* disable */ | 199 | /* disable */ |
162 | ltq_eiu_w32(ltq_eiu_r32(LTQ_EIU_EXIN_INEN) & ~BIT(i), | 200 | ltq_eiu_w32(ltq_eiu_r32(LTQ_EIU_EXIN_INEN) & ~BIT(i), |
163 | LTQ_EIU_EXIN_INEN); | 201 | LTQ_EIU_EXIN_INEN); |
@@ -186,6 +224,7 @@ static struct irq_chip ltq_eiu_type = { | |||
186 | .irq_ack = ltq_ack_irq, | 224 | .irq_ack = ltq_ack_irq, |
187 | .irq_mask = ltq_disable_irq, | 225 | .irq_mask = ltq_disable_irq, |
188 | .irq_mask_ack = ltq_mask_and_ack_irq, | 226 | .irq_mask_ack = ltq_mask_and_ack_irq, |
227 | .irq_set_type = ltq_eiu_settype, | ||
189 | }; | 228 | }; |
190 | 229 | ||
191 | static void ltq_hw_irqdispatch(int module) | 230 | static void ltq_hw_irqdispatch(int module) |
@@ -301,7 +340,7 @@ static int icu_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw) | |||
301 | return 0; | 340 | return 0; |
302 | 341 | ||
303 | for (i = 0; i < exin_avail; i++) | 342 | for (i = 0; i < exin_avail; i++) |
304 | if (hw == ltq_eiu_irq[i]) | 343 | if (hw == ltq_eiu_irq[i].start) |
305 | chip = <q_eiu_type; | 344 | chip = <q_eiu_type; |
306 | 345 | ||
307 | irq_set_chip_and_handler(hw, chip, handle_level_irq); | 346 | irq_set_chip_and_handler(hw, chip, handle_level_irq); |
@@ -323,7 +362,7 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent) | |||
323 | { | 362 | { |
324 | struct device_node *eiu_node; | 363 | struct device_node *eiu_node; |
325 | struct resource res; | 364 | struct resource res; |
326 | int i; | 365 | int i, ret; |
327 | 366 | ||
328 | for (i = 0; i < MAX_IM; i++) { | 367 | for (i = 0; i < MAX_IM; i++) { |
329 | if (of_address_to_resource(node, i, &res)) | 368 | if (of_address_to_resource(node, i, &res)) |
@@ -340,17 +379,19 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent) | |||
340 | } | 379 | } |
341 | 380 | ||
342 | /* the external interrupts are optional and xway only */ | 381 | /* the external interrupts are optional and xway only */ |
343 | eiu_node = of_find_compatible_node(NULL, NULL, "lantiq,eiu"); | 382 | eiu_node = of_find_compatible_node(NULL, NULL, "lantiq,eiu-xway"); |
344 | if (eiu_node && !of_address_to_resource(eiu_node, 0, &res)) { | 383 | if (eiu_node && !of_address_to_resource(eiu_node, 0, &res)) { |
345 | /* find out how many external irq sources we have */ | 384 | /* find out how many external irq sources we have */ |
346 | const __be32 *count = of_get_property(node, | 385 | exin_avail = of_irq_count(eiu_node); |
347 | "lantiq,count", NULL); | ||
348 | 386 | ||
349 | if (count) | ||
350 | exin_avail = *count; | ||
351 | if (exin_avail > MAX_EIU) | 387 | if (exin_avail > MAX_EIU) |
352 | exin_avail = MAX_EIU; | 388 | exin_avail = MAX_EIU; |
353 | 389 | ||
390 | ret = of_irq_to_resource_table(eiu_node, | ||
391 | ltq_eiu_irq, exin_avail); | ||
392 | if (ret != exin_avail) | ||
393 | panic("failed to load external irq resources\n"); | ||
394 | |||
354 | if (request_mem_region(res.start, resource_size(&res), | 395 | if (request_mem_region(res.start, resource_size(&res), |
355 | res.name) < 0) | 396 | res.name) < 0) |
356 | pr_err("Failed to request eiu memory"); | 397 | pr_err("Failed to request eiu memory"); |
diff --git a/arch/mips/lantiq/prom.h b/arch/mips/lantiq/prom.h index a3fa1a2bfaae..8e07b5f28ef1 100644 --- a/arch/mips/lantiq/prom.h +++ b/arch/mips/lantiq/prom.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #define _LTQ_PROM_H__ | 10 | #define _LTQ_PROM_H__ |
11 | 11 | ||
12 | #define LTQ_SYS_TYPE_LEN 0x100 | 12 | #define LTQ_SYS_TYPE_LEN 0x100 |
13 | #define LTQ_SYS_REV_LEN 0x10 | 13 | #define LTQ_SYS_REV_LEN 0x10 |
14 | 14 | ||
15 | struct ltq_soc_info { | 15 | struct ltq_soc_info { |
16 | unsigned char *name; | 16 | unsigned char *name; |
diff --git a/arch/mips/lantiq/xway/clk.c b/arch/mips/lantiq/xway/clk.c index 9aa17f79a742..1ab576dc9bd1 100644 --- a/arch/mips/lantiq/xway/clk.c +++ b/arch/mips/lantiq/xway/clk.c | |||
@@ -53,6 +53,29 @@ unsigned long ltq_danube_cpu_hz(void) | |||
53 | } | 53 | } |
54 | } | 54 | } |
55 | 55 | ||
56 | unsigned long ltq_danube_pp32_hz(void) | ||
57 | { | ||
58 | unsigned int clksys = (ltq_cgu_r32(CGU_SYS) >> 7) & 3; | ||
59 | unsigned long clk; | ||
60 | |||
61 | switch (clksys) { | ||
62 | case 1: | ||
63 | clk = CLOCK_240M; | ||
64 | break; | ||
65 | case 2: | ||
66 | clk = CLOCK_222M; | ||
67 | break; | ||
68 | case 3: | ||
69 | clk = CLOCK_133M; | ||
70 | break; | ||
71 | default: | ||
72 | clk = CLOCK_266M; | ||
73 | break; | ||
74 | } | ||
75 | |||
76 | return clk; | ||
77 | } | ||
78 | |||
56 | unsigned long ltq_ar9_sys_hz(void) | 79 | unsigned long ltq_ar9_sys_hz(void) |
57 | { | 80 | { |
58 | if (((ltq_cgu_r32(CGU_SYS) >> 3) & 0x3) == 0x2) | 81 | if (((ltq_cgu_r32(CGU_SYS) >> 3) & 0x3) == 0x2) |
@@ -149,3 +172,23 @@ unsigned long ltq_vr9_fpi_hz(void) | |||
149 | 172 | ||
150 | return clk; | 173 | return clk; |
151 | } | 174 | } |
175 | |||
176 | unsigned long ltq_vr9_pp32_hz(void) | ||
177 | { | ||
178 | unsigned int clksys = (ltq_cgu_r32(CGU_SYS) >> 16) & 3; | ||
179 | unsigned long clk; | ||
180 | |||
181 | switch (clksys) { | ||
182 | case 1: | ||
183 | clk = CLOCK_450M; | ||
184 | break; | ||
185 | case 2: | ||
186 | clk = CLOCK_300M; | ||
187 | break; | ||
188 | default: | ||
189 | clk = CLOCK_500M; | ||
190 | break; | ||
191 | } | ||
192 | |||
193 | return clk; | ||
194 | } | ||
diff --git a/arch/mips/lantiq/xway/reset.c b/arch/mips/lantiq/xway/reset.c index 544dbb7fb421..1fa0f175357e 100644 --- a/arch/mips/lantiq/xway/reset.c +++ b/arch/mips/lantiq/xway/reset.c | |||
@@ -78,10 +78,19 @@ static struct ltq_xrx200_gphy_reset { | |||
78 | /* reset and boot a gphy. these phys only exist on xrx200 SoC */ | 78 | /* reset and boot a gphy. these phys only exist on xrx200 SoC */ |
79 | int xrx200_gphy_boot(struct device *dev, unsigned int id, dma_addr_t dev_addr) | 79 | int xrx200_gphy_boot(struct device *dev, unsigned int id, dma_addr_t dev_addr) |
80 | { | 80 | { |
81 | struct clk *clk; | ||
82 | |||
81 | if (!of_device_is_compatible(ltq_rcu_np, "lantiq,rcu-xrx200")) { | 83 | if (!of_device_is_compatible(ltq_rcu_np, "lantiq,rcu-xrx200")) { |
82 | dev_err(dev, "this SoC has no GPHY\n"); | 84 | dev_err(dev, "this SoC has no GPHY\n"); |
83 | return -EINVAL; | 85 | return -EINVAL; |
84 | } | 86 | } |
87 | |||
88 | clk = clk_get_sys("1f203000.rcu", "gphy"); | ||
89 | if (IS_ERR(clk)) | ||
90 | return PTR_ERR(clk); | ||
91 | |||
92 | clk_enable(clk); | ||
93 | |||
85 | if (id > 1) { | 94 | if (id > 1) { |
86 | dev_err(dev, "%u is an invalid gphy id\n", id); | 95 | dev_err(dev, "%u is an invalid gphy id\n", id); |
87 | return -EINVAL; | 96 | return -EINVAL; |
diff --git a/arch/mips/lantiq/xway/sysctrl.c b/arch/mips/lantiq/xway/sysctrl.c index 3925e6609acc..c24924fe087d 100644 --- a/arch/mips/lantiq/xway/sysctrl.c +++ b/arch/mips/lantiq/xway/sysctrl.c | |||
@@ -305,7 +305,7 @@ void __init ltq_soc_init(void) | |||
305 | 305 | ||
306 | /* check if all the core register ranges are available */ | 306 | /* check if all the core register ranges are available */ |
307 | if (!np_pmu || !np_cgu || !np_ebu) | 307 | if (!np_pmu || !np_cgu || !np_ebu) |
308 | panic("Failed to load core nodess from devicetree"); | 308 | panic("Failed to load core nodes from devicetree"); |
309 | 309 | ||
310 | if (of_address_to_resource(np_pmu, 0, &res_pmu) || | 310 | if (of_address_to_resource(np_pmu, 0, &res_pmu) || |
311 | of_address_to_resource(np_cgu, 0, &res_cgu) || | 311 | of_address_to_resource(np_cgu, 0, &res_cgu) || |
@@ -356,14 +356,16 @@ void __init ltq_soc_init(void) | |||
356 | 356 | ||
357 | if (of_machine_is_compatible("lantiq,ase")) { | 357 | if (of_machine_is_compatible("lantiq,ase")) { |
358 | if (ltq_cgu_r32(CGU_SYS) & (1 << 5)) | 358 | if (ltq_cgu_r32(CGU_SYS) & (1 << 5)) |
359 | clkdev_add_static(CLOCK_266M, CLOCK_133M, CLOCK_133M); | 359 | clkdev_add_static(CLOCK_266M, CLOCK_133M, |
360 | CLOCK_133M, CLOCK_266M); | ||
360 | else | 361 | else |
361 | clkdev_add_static(CLOCK_133M, CLOCK_133M, CLOCK_133M); | 362 | clkdev_add_static(CLOCK_133M, CLOCK_133M, |
363 | CLOCK_133M, CLOCK_133M); | ||
362 | clkdev_add_cgu("1e180000.etop", "ephycgu", CGU_EPHY), | 364 | clkdev_add_cgu("1e180000.etop", "ephycgu", CGU_EPHY), |
363 | clkdev_add_pmu("1e180000.etop", "ephy", 0, PMU_EPHY); | 365 | clkdev_add_pmu("1e180000.etop", "ephy", 0, PMU_EPHY); |
364 | } else if (of_machine_is_compatible("lantiq,vr9")) { | 366 | } else if (of_machine_is_compatible("lantiq,vr9")) { |
365 | clkdev_add_static(ltq_vr9_cpu_hz(), ltq_vr9_fpi_hz(), | 367 | clkdev_add_static(ltq_vr9_cpu_hz(), ltq_vr9_fpi_hz(), |
366 | ltq_vr9_fpi_hz()); | 368 | ltq_vr9_fpi_hz(), ltq_vr9_pp32_hz()); |
367 | clkdev_add_pmu("1d900000.pcie", "phy", 1, PMU1_PCIE_PHY); | 369 | clkdev_add_pmu("1d900000.pcie", "phy", 1, PMU1_PCIE_PHY); |
368 | clkdev_add_pmu("1d900000.pcie", "bus", 0, PMU_PCIE_CLK); | 370 | clkdev_add_pmu("1d900000.pcie", "bus", 0, PMU_PCIE_CLK); |
369 | clkdev_add_pmu("1d900000.pcie", "msi", 1, PMU1_PCIE_MSI); | 371 | clkdev_add_pmu("1d900000.pcie", "msi", 1, PMU1_PCIE_MSI); |
@@ -374,12 +376,13 @@ void __init ltq_soc_init(void) | |||
374 | PMU_SWITCH | PMU_PPE_DPLUS | PMU_PPE_DPLUM | | 376 | PMU_SWITCH | PMU_PPE_DPLUS | PMU_PPE_DPLUM | |
375 | PMU_PPE_EMA | PMU_PPE_TC | PMU_PPE_SLL01 | | 377 | PMU_PPE_EMA | PMU_PPE_TC | PMU_PPE_SLL01 | |
376 | PMU_PPE_QSB | PMU_PPE_TOP); | 378 | PMU_PPE_QSB | PMU_PPE_TOP); |
379 | clkdev_add_pmu("1f203000.rcu", "gphy", 0, PMU_GPHY); | ||
377 | } else if (of_machine_is_compatible("lantiq,ar9")) { | 380 | } else if (of_machine_is_compatible("lantiq,ar9")) { |
378 | clkdev_add_static(ltq_ar9_cpu_hz(), ltq_ar9_fpi_hz(), | 381 | clkdev_add_static(ltq_ar9_cpu_hz(), ltq_ar9_fpi_hz(), |
379 | ltq_ar9_fpi_hz()); | 382 | ltq_ar9_fpi_hz(), CLOCK_250M); |
380 | clkdev_add_pmu("1e180000.etop", "switch", 0, PMU_SWITCH); | 383 | clkdev_add_pmu("1e180000.etop", "switch", 0, PMU_SWITCH); |
381 | } else { | 384 | } else { |
382 | clkdev_add_static(ltq_danube_cpu_hz(), ltq_danube_fpi_hz(), | 385 | clkdev_add_static(ltq_danube_cpu_hz(), ltq_danube_fpi_hz(), |
383 | ltq_danube_fpi_hz()); | 386 | ltq_danube_fpi_hz(), ltq_danube_pp32_hz()); |
384 | } | 387 | } |
385 | } | 388 | } |