1 From cab49331fac138102493dea8f1b1d8c28cae6db5 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 35/70] MIPS: lantiq: unify xway prom code
6 The xway prom-ase.c and prom-xway.c files are redundant. Unify the 2 files.
8 Signed-off-by: John Crispin <blogic@openwrt.org>
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
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
26 -obj-y := sysctrl.o reset.o gpio.o gpio_stp.o gpio_ebu.o devices.o dma.o clk.o
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
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
40 ---- arch/mips/lantiq/xway/Makefile
41 -+++ arch/mips/lantiq/xway/Makefile
43 --obj-y := sysctrl.o reset.o gpio.o gpio_stp.o gpio_ebu.o devices.o dma.o clk.o
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
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
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.
62 - * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
65 -#include <linux/export.h>
66 -#include <linux/clk.h>
67 -#include <asm/bootinfo.h>
68 -#include <asm/time.h>
70 -#include <lantiq_soc.h>
75 -#define SOC_AMAZON_SE "Amazon_SE"
77 -#define PART_SHIFT 12
78 -#define PART_MASK 0x0FFFFFFF
80 -#define REV_MASK 0xF0000000
82 -void __init ltq_soc_detect(struct ltq_soc_info *i)
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;
99 -void __init ltq_soc_setup(void)
101 - ltq_register_ase_asc();
102 - ltq_register_gpio();
103 - ltq_register_wdt();
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
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.
116 - * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
119 -#include <linux/export.h>
120 -#include <linux/clk.h>
121 -#include <asm/bootinfo.h>
122 -#include <asm/time.h>
124 -#include <lantiq_soc.h>
126 -#include "devices.h"
127 -#include "../prom.h"
129 -#define SOC_DANUBE "Danube"
130 -#define SOC_TWINPASS "Twinpass"
131 -#define SOC_AR9 "AR9"
133 -#define PART_SHIFT 12
134 -#define PART_MASK 0x0FFFFFFF
135 -#define REV_SHIFT 28
136 -#define REV_MASK 0xF0000000
138 -void __init ltq_soc_detect(struct ltq_soc_info *i)
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;
150 - case SOC_ID_TWINPASS:
151 - i->name = SOC_TWINPASS;
152 - i->type = SOC_TYPE_DANUBE;
155 - case SOC_ID_ARX188:
156 - case SOC_ID_ARX168:
157 - case SOC_ID_ARX182:
159 - i->type = SOC_TYPE_AR9;
168 -void __init ltq_soc_setup(void)
170 - ltq_register_asc(0);
171 - ltq_register_asc(1);
172 - ltq_register_gpio();
173 - ltq_register_wdt();
175 diff --git a/arch/mips/lantiq/xway/prom.c b/arch/mips/lantiq/xway/prom.c
177 index 0000000..0929acb
179 +++ b/arch/mips/lantiq/xway/prom.c
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.
186 + * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
189 +#include <linux/export.h>
190 +#include <linux/clk.h>
191 +#include <asm/bootinfo.h>
192 +#include <asm/time.h>
194 +#include <lantiq_soc.h>
196 +#include "../prom.h"
197 +#include "devices.h"
199 +#define SOC_DANUBE "Danube"
200 +#define SOC_TWINPASS "Twinpass"
201 +#define SOC_AR9 "AR9"
202 +#define SOC_VR9 "VR9"
204 +#define PART_SHIFT 12
205 +#define PART_MASK 0x0FFFFFFF
206 +#define REV_SHIFT 28
207 +#define REV_MASK 0xF0000000
209 +#define SOC_AMAZON_SE "Amazon_SE"
211 +void __init ltq_soc_detect(struct ltq_soc_info *i)
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;
223 + case SOC_ID_TWINPASS:
224 + i->name = SOC_TWINPASS;
225 + i->type = SOC_TYPE_DANUBE;
228 + case SOC_ID_ARX188:
229 + case SOC_ID_ARX168:
230 + case SOC_ID_ARX182:
232 + i->type = SOC_TYPE_AR9;
235 + case SOC_ID_AMAZON_SE:
236 + i->name = SOC_AMAZON_SE;
237 + i->type = SOC_TYPE_AMAZON_SE;
239 + panic("ase is only supported for non pci kernels");
249 +void __init ltq_soc_setup(void)
251 + if (ltq_is_ase()) {
252 + ltq_register_ase_asc();
254 + ltq_register_asc(0);
255 + ltq_register_asc(1);
257 + ltq_register_gpio();
258 + ltq_register_wdt();