1 From 707d76cc9dc4ddfcea280b91df83bd726407518a 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 31/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 Index: linux-3.3.8/arch/mips/lantiq/xway/Makefile
22 ===================================================================
23 --- linux-3.3.8.orig/arch/mips/lantiq/xway/Makefile 2012-07-31 08:34:35.000000000 +0200
24 +++ linux-3.3.8/arch/mips/lantiq/xway/Makefile 2012-07-31 08:52:14.155414782 +0200
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 Index: linux-3.3.8/arch/mips/lantiq/xway/prom-ase.c
35 ===================================================================
36 --- linux-3.3.8.orig/arch/mips/lantiq/xway/prom-ase.c 2012-07-31 08:34:34.000000000 +0200
37 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000
40 - * This program is free software; you can redistribute it and/or modify it
41 - * under the terms of the GNU General Public License version 2 as published
42 - * by the Free Software Foundation.
44 - * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
47 -#include <linux/export.h>
48 -#include <linux/clk.h>
49 -#include <asm/bootinfo.h>
50 -#include <asm/time.h>
52 -#include <lantiq_soc.h>
57 -#define SOC_AMAZON_SE "Amazon_SE"
59 -#define PART_SHIFT 12
60 -#define PART_MASK 0x0FFFFFFF
62 -#define REV_MASK 0xF0000000
64 -void __init ltq_soc_detect(struct ltq_soc_info *i)
66 - i->partnum = (ltq_r32(LTQ_MPS_CHIPID) & PART_MASK) >> PART_SHIFT;
67 - i->rev = (ltq_r32(LTQ_MPS_CHIPID) & REV_MASK) >> REV_SHIFT;
68 - sprintf(i->rev_type, "1.%d", i->rev);
69 - switch (i->partnum) {
70 - case SOC_ID_AMAZON_SE:
71 - i->name = SOC_AMAZON_SE;
72 - i->type = SOC_TYPE_AMAZON_SE;
81 -void __init ltq_soc_setup(void)
83 - ltq_register_ase_asc();
84 - ltq_register_gpio();
87 Index: linux-3.3.8/arch/mips/lantiq/xway/prom-xway.c
88 ===================================================================
89 --- linux-3.3.8.orig/arch/mips/lantiq/xway/prom-xway.c 2012-07-31 08:34:34.000000000 +0200
90 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000
93 - * This program is free software; you can redistribute it and/or modify it
94 - * under the terms of the GNU General Public License version 2 as published
95 - * by the Free Software Foundation.
97 - * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
100 -#include <linux/export.h>
101 -#include <linux/clk.h>
102 -#include <asm/bootinfo.h>
103 -#include <asm/time.h>
105 -#include <lantiq_soc.h>
107 -#include "devices.h"
108 -#include "../prom.h"
110 -#define SOC_DANUBE "Danube"
111 -#define SOC_TWINPASS "Twinpass"
112 -#define SOC_AR9 "AR9"
114 -#define PART_SHIFT 12
115 -#define PART_MASK 0x0FFFFFFF
116 -#define REV_SHIFT 28
117 -#define REV_MASK 0xF0000000
119 -void __init ltq_soc_detect(struct ltq_soc_info *i)
121 - i->partnum = (ltq_r32(LTQ_MPS_CHIPID) & PART_MASK) >> PART_SHIFT;
122 - i->rev = (ltq_r32(LTQ_MPS_CHIPID) & REV_MASK) >> REV_SHIFT;
123 - sprintf(i->rev_type, "1.%d", i->rev);
124 - switch (i->partnum) {
125 - case SOC_ID_DANUBE1:
126 - case SOC_ID_DANUBE2:
127 - i->name = SOC_DANUBE;
128 - i->type = SOC_TYPE_DANUBE;
131 - case SOC_ID_TWINPASS:
132 - i->name = SOC_TWINPASS;
133 - i->type = SOC_TYPE_DANUBE;
136 - case SOC_ID_ARX188:
137 - case SOC_ID_ARX168:
138 - case SOC_ID_ARX182:
140 - i->type = SOC_TYPE_AR9;
149 -void __init ltq_soc_setup(void)
151 - ltq_register_asc(0);
152 - ltq_register_asc(1);
153 - ltq_register_gpio();
154 - ltq_register_wdt();
156 Index: linux-3.3.8/arch/mips/lantiq/xway/prom.c
157 ===================================================================
158 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
159 +++ linux-3.3.8/arch/mips/lantiq/xway/prom.c 2012-07-31 08:52:14.155414782 +0200
162 + * This program is free software; you can redistribute it and/or modify it
163 + * under the terms of the GNU General Public License version 2 as published
164 + * by the Free Software Foundation.
166 + * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
169 +#include <linux/export.h>
170 +#include <linux/clk.h>
171 +#include <asm/bootinfo.h>
172 +#include <asm/time.h>
174 +#include <lantiq_soc.h>
176 +#include "../prom.h"
177 +#include "devices.h"
179 +#define SOC_DANUBE "Danube"
180 +#define SOC_TWINPASS "Twinpass"
181 +#define SOC_AR9 "AR9"
182 +#define SOC_VR9 "VR9"
184 +#define PART_SHIFT 12
185 +#define PART_MASK 0x0FFFFFFF
186 +#define REV_SHIFT 28
187 +#define REV_MASK 0xF0000000
189 +#define SOC_AMAZON_SE "Amazon_SE"
191 +void __init ltq_soc_detect(struct ltq_soc_info *i)
193 + i->partnum = (ltq_r32(LTQ_MPS_CHIPID) & PART_MASK) >> PART_SHIFT;
194 + i->rev = (ltq_r32(LTQ_MPS_CHIPID) & REV_MASK) >> REV_SHIFT;
195 + sprintf(i->rev_type, "1.%d", i->rev);
196 + switch (i->partnum) {
197 + case SOC_ID_DANUBE1:
198 + case SOC_ID_DANUBE2:
199 + i->name = SOC_DANUBE;
200 + i->type = SOC_TYPE_DANUBE;
203 + case SOC_ID_TWINPASS:
204 + i->name = SOC_TWINPASS;
205 + i->type = SOC_TYPE_DANUBE;
208 + case SOC_ID_ARX188:
209 + case SOC_ID_ARX168:
210 + case SOC_ID_ARX182:
212 + i->type = SOC_TYPE_AR9;
215 + case SOC_ID_AMAZON_SE:
216 + i->name = SOC_AMAZON_SE;
217 + i->type = SOC_TYPE_AMAZON_SE;
219 + panic("ase is only supported for non pci kernels");
229 +void __init ltq_soc_setup(void)
231 + if (ltq_is_ase()) {
232 + ltq_register_ase_asc();
234 + ltq_register_asc(0);
235 + ltq_register_asc(1);
237 + ltq_register_gpio();
238 + ltq_register_wdt();