[lantiq] update 3.2 patches
[openwrt.git] / target / linux / lantiq / patches-3.2 / 0034-MIPS-lantiq-unify-xway-prom-code.patch
1 From f2c407ca7b975f979b0d73d2e52a73991de13dd9 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Thu, 8 Mar 2012 11:44:55 +0100
4 Subject: [PATCH 34/73] MIPS: lantiq: unify xway prom code
5
6 The xway prom-ase.c and prom-xway.c files are redundant. Unify the 2 files.
7
8 Signed-off-by: John Crispin <blogic@openwrt.org>
9 ---
10  arch/mips/lantiq/xway/Makefile     |    5 +--
11  arch/mips/lantiq/xway/Makefile.rej |   11 -----
12  arch/mips/lantiq/xway/prom-ase.c   |   48 ----------------------
13  arch/mips/lantiq/xway/prom-xway.c  |   64 -----------------------------
14  arch/mips/lantiq/xway/prom.c       |   79 ++++++++++++++++++++++++++++++++++++
15  5 files changed, 80 insertions(+), 127 deletions(-)
16  delete mode 100644 arch/mips/lantiq/xway/Makefile.rej
17  delete mode 100644 arch/mips/lantiq/xway/prom-ase.c
18  delete mode 100644 arch/mips/lantiq/xway/prom-xway.c
19  create mode 100644 arch/mips/lantiq/xway/prom.c
20
21 diff --git a/arch/mips/lantiq/xway/Makefile b/arch/mips/lantiq/xway/Makefile
22 index 4dcb96f..9d1a0a2 100644
23 --- a/arch/mips/lantiq/xway/Makefile
24 +++ b/arch/mips/lantiq/xway/Makefile
25 @@ -1,7 +1,4 @@
26 -obj-y := sysctrl.o reset.o gpio.o gpio_stp.o gpio_ebu.o devices.o dma.o clk.o
27 -
28 -obj-$(CONFIG_SOC_XWAY) += prom-xway.o
29 -obj-$(CONFIG_SOC_AMAZON_SE) += prom-ase.o
30 +obj-y := sysctrl.o reset.o gpio.o gpio_stp.o gpio_ebu.o devices.o dma.o clk.o prom.o
31  
32  obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
33  obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o
34 diff --git a/arch/mips/lantiq/xway/Makefile.rej b/arch/mips/lantiq/xway/Makefile.rej
35 deleted file mode 100644
36 index c0d5b52..0000000
37 --- a/arch/mips/lantiq/xway/Makefile.rej
38 +++ /dev/null
39 @@ -1,11 +0,0 @@
40 ---- arch/mips/lantiq/xway/Makefile
41 -+++ arch/mips/lantiq/xway/Makefile
42 -@@ -1,7 +1,4 @@
43 --obj-y := sysctrl.o reset.o gpio.o gpio_stp.o gpio_ebu.o devices.o dma.o clk.o
44 --
45 --obj-$(CONFIG_SOC_XWAY) += prom-xway.o
46 --obj-$(CONFIG_SOC_AMAZON_SE) += prom-ase.o
47 -+obj-y := prom.o sysctrl.o reset.o gpio.o gpio_stp.o gpio_ebu.o devices.o dma.o clk.o
48
49 - obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
50 - obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o
51 diff --git a/arch/mips/lantiq/xway/prom-ase.c b/arch/mips/lantiq/xway/prom-ase.c
52 deleted file mode 100644
53 index 3f86a3b..0000000
54 --- a/arch/mips/lantiq/xway/prom-ase.c
55 +++ /dev/null
56 @@ -1,48 +0,0 @@
57 -/*
58 - *  This program is free software; you can redistribute it and/or modify it
59 - *  under the terms of the GNU General Public License version 2 as published
60 - *  by the Free Software Foundation.
61 - *
62 - *  Copyright (C) 2010 John Crispin <blogic@openwrt.org>
63 - */
64 -
65 -#include <linux/export.h>
66 -#include <linux/clk.h>
67 -#include <asm/bootinfo.h>
68 -#include <asm/time.h>
69 -
70 -#include <lantiq_soc.h>
71 -
72 -#include "devices.h"
73 -#include "../prom.h"
74 -
75 -#define SOC_AMAZON_SE  "Amazon_SE"
76 -
77 -#define PART_SHIFT     12
78 -#define PART_MASK      0x0FFFFFFF
79 -#define REV_SHIFT      28
80 -#define REV_MASK       0xF0000000
81 -
82 -void __init ltq_soc_detect(struct ltq_soc_info *i)
83 -{
84 -       i->partnum = (ltq_r32(LTQ_MPS_CHIPID) & PART_MASK) >> PART_SHIFT;
85 -       i->rev = (ltq_r32(LTQ_MPS_CHIPID) & REV_MASK) >> REV_SHIFT;
86 -       sprintf(i->rev_type, "1.%d", i->rev);
87 -       switch (i->partnum) {
88 -       case SOC_ID_AMAZON_SE:
89 -               i->name = SOC_AMAZON_SE;
90 -               i->type = SOC_TYPE_AMAZON_SE;
91 -               break;
92 -
93 -       default:
94 -               unreachable();
95 -               break;
96 -       }
97 -}
98 -
99 -void __init ltq_soc_setup(void)
100 -{
101 -       ltq_register_ase_asc();
102 -       ltq_register_gpio();
103 -       ltq_register_wdt();
104 -}
105 diff --git a/arch/mips/lantiq/xway/prom-xway.c b/arch/mips/lantiq/xway/prom-xway.c
106 deleted file mode 100644
107 index d823a92..0000000
108 --- a/arch/mips/lantiq/xway/prom-xway.c
109 +++ /dev/null
110 @@ -1,64 +0,0 @@
111 -/*
112 - *  This program is free software; you can redistribute it and/or modify it
113 - *  under the terms of the GNU General Public License version 2 as published
114 - *  by the Free Software Foundation.
115 - *
116 - *  Copyright (C) 2010 John Crispin <blogic@openwrt.org>
117 - */
118 -
119 -#include <linux/export.h>
120 -#include <linux/clk.h>
121 -#include <asm/bootinfo.h>
122 -#include <asm/time.h>
123 -
124 -#include <lantiq_soc.h>
125 -
126 -#include "devices.h"
127 -#include "../prom.h"
128 -
129 -#define SOC_DANUBE     "Danube"
130 -#define SOC_TWINPASS   "Twinpass"
131 -#define SOC_AR9                "AR9"
132 -
133 -#define PART_SHIFT     12
134 -#define PART_MASK      0x0FFFFFFF
135 -#define REV_SHIFT      28
136 -#define REV_MASK       0xF0000000
137 -
138 -void __init ltq_soc_detect(struct ltq_soc_info *i)
139 -{
140 -       i->partnum = (ltq_r32(LTQ_MPS_CHIPID) & PART_MASK) >> PART_SHIFT;
141 -       i->rev = (ltq_r32(LTQ_MPS_CHIPID) & REV_MASK) >> REV_SHIFT;
142 -       sprintf(i->rev_type, "1.%d", i->rev);
143 -       switch (i->partnum) {
144 -       case SOC_ID_DANUBE1:
145 -       case SOC_ID_DANUBE2:
146 -               i->name = SOC_DANUBE;
147 -               i->type = SOC_TYPE_DANUBE;
148 -               break;
149 -
150 -       case SOC_ID_TWINPASS:
151 -               i->name = SOC_TWINPASS;
152 -               i->type = SOC_TYPE_DANUBE;
153 -               break;
154 -
155 -       case SOC_ID_ARX188:
156 -       case SOC_ID_ARX168:
157 -       case SOC_ID_ARX182:
158 -               i->name = SOC_AR9;
159 -               i->type = SOC_TYPE_AR9;
160 -               break;
161 -
162 -       default:
163 -               unreachable();
164 -               break;
165 -       }
166 -}
167 -
168 -void __init ltq_soc_setup(void)
169 -{
170 -       ltq_register_asc(0);
171 -       ltq_register_asc(1);
172 -       ltq_register_gpio();
173 -       ltq_register_wdt();
174 -}
175 diff --git a/arch/mips/lantiq/xway/prom.c b/arch/mips/lantiq/xway/prom.c
176 new file mode 100644
177 index 0000000..0929acb
178 --- /dev/null
179 +++ b/arch/mips/lantiq/xway/prom.c
180 @@ -0,0 +1,79 @@
181 +/*
182 + *  This program is free software; you can redistribute it and/or modify it
183 + *  under the terms of the GNU General Public License version 2 as published
184 + *  by the Free Software Foundation.
185 + *
186 + *  Copyright (C) 2010 John Crispin <blogic@openwrt.org>
187 + */
188 +
189 +#include <linux/export.h>
190 +#include <linux/clk.h>
191 +#include <asm/bootinfo.h>
192 +#include <asm/time.h>
193 +
194 +#include <lantiq_soc.h>
195 +
196 +#include "../prom.h"
197 +#include "devices.h"
198 +
199 +#define SOC_DANUBE     "Danube"
200 +#define SOC_TWINPASS   "Twinpass"
201 +#define SOC_AR9                "AR9"
202 +#define SOC_VR9                "VR9"
203 +
204 +#define PART_SHIFT     12
205 +#define PART_MASK      0x0FFFFFFF
206 +#define REV_SHIFT      28
207 +#define REV_MASK       0xF0000000
208 +
209 +#define SOC_AMAZON_SE  "Amazon_SE"
210 +
211 +void __init ltq_soc_detect(struct ltq_soc_info *i)
212 +{
213 +       i->partnum = (ltq_r32(LTQ_MPS_CHIPID) & PART_MASK) >> PART_SHIFT;
214 +       i->rev = (ltq_r32(LTQ_MPS_CHIPID) & REV_MASK) >> REV_SHIFT;
215 +       sprintf(i->rev_type, "1.%d", i->rev);
216 +       switch (i->partnum) {
217 +       case SOC_ID_DANUBE1:
218 +       case SOC_ID_DANUBE2:
219 +               i->name = SOC_DANUBE;
220 +               i->type = SOC_TYPE_DANUBE;
221 +               break;
222 +
223 +       case SOC_ID_TWINPASS:
224 +               i->name = SOC_TWINPASS;
225 +               i->type = SOC_TYPE_DANUBE;
226 +               break;
227 +
228 +       case SOC_ID_ARX188:
229 +       case SOC_ID_ARX168:
230 +       case SOC_ID_ARX182:
231 +               i->name = SOC_AR9;
232 +               i->type = SOC_TYPE_AR9;
233 +               break;
234 +
235 +       case SOC_ID_AMAZON_SE:
236 +               i->name = SOC_AMAZON_SE;
237 +               i->type = SOC_TYPE_AMAZON_SE;
238 +#ifdef CONFIG_PCI
239 +               panic("ase is only supported for non pci kernels");
240 +#endif
241 +               break;
242 +
243 +       default:
244 +               unreachable();
245 +               break;
246 +       }
247 +}
248 +
249 +void __init ltq_soc_setup(void)
250 +{
251 +       if (ltq_is_ase()) {
252 +               ltq_register_ase_asc();
253 +       } else {
254 +               ltq_register_asc(0);
255 +               ltq_register_asc(1);
256 +       }
257 +       ltq_register_gpio();
258 +       ltq_register_wdt();
259 +}
260 -- 
261 1.7.9.1
262