1 From 52a5369d1067d4feddbfa7ff4486a77ac9a2971e Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Wed, 30 Mar 2011 09:27:54 +0200
4 Subject: [PATCH 06/13] MIPS: Lantiq: Add mips_machine support
6 This patch adds support for Gabor's mips_machine patch.
8 Signed-off-by: John Crispin <blogic@openwrt.org>
9 Signed-off-by: Ralph Hempel <ralph.hempel@lantiq.com>
10 Cc: Gabor Juhos <juhosg@openwrt.org>
11 Cc: linux-mips@linux-mips.org
12 Patchwork: https://patchwork.linux-mips.org/patch/2251/
13 Patchwork: https://patchwork.linux-mips.org/patch/2358/
14 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 arch/mips/Kconfig | 1 +
17 arch/mips/lantiq/machtypes.h | 18 ++++++++++++++++++
18 arch/mips/lantiq/prom.h | 1 +
19 arch/mips/lantiq/setup.c | 25 +++++++++++++++++++++++++
20 arch/mips/lantiq/xway/Makefile | 4 ++--
21 arch/mips/lantiq/xway/setup-ase.c | 19 +++++++++++++++++++
22 arch/mips/lantiq/xway/setup-xway.c | 20 ++++++++++++++++++++
23 7 files changed, 86 insertions(+), 2 deletions(-)
24 create mode 100644 arch/mips/lantiq/machtypes.h
25 create mode 100644 arch/mips/lantiq/xway/setup-ase.c
26 create mode 100644 arch/mips/lantiq/xway/setup-xway.c
28 --- a/arch/mips/Kconfig
29 +++ b/arch/mips/Kconfig
37 bool "LASAT Networks platforms"
39 +++ b/arch/mips/lantiq/machtypes.h
42 + * This program is free software; you can redistribute it and/or modify it
43 + * under the terms of the GNU General Public License version 2 as published
44 + * by the Free Software Foundation.
46 + * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
49 +#ifndef _LANTIQ_MACH_H__
50 +#define _LANTIQ_MACH_H__
52 +#include <asm/mips_machine.h>
54 +enum lantiq_mach_type {
55 + LTQ_MACH_GENERIC = 0,
59 --- a/arch/mips/lantiq/prom.h
60 +++ b/arch/mips/lantiq/prom.h
64 extern void ltq_soc_detect(struct ltq_soc_info *i);
65 +extern void ltq_soc_setup(void);
68 --- a/arch/mips/lantiq/setup.c
69 +++ b/arch/mips/lantiq/setup.c
72 #include <lantiq_soc.h>
74 +#include "machtypes.h"
78 +unsigned long physical_memsize = 0L;
80 void __init plat_mem_setup(void)
82 /* assume 16M as default incase uboot fails to pass proper ramsize */
84 if (!strncmp(e, "memsize=", 8)) {
86 if (strict_strtoul(e, 0, &memsize))
87 - pr_warn("bad memsize specified\n");
88 + pr_warning("bad memsize specified\n");
92 memsize *= 1024 * 1024;
93 add_memory_region(0x00000000, memsize, BOOT_MEM_RAM);
94 + physical_memsize = memsize;
101 + mips_machine_setup();
105 +arch_initcall(lantiq_setup);
108 +lantiq_generic_init(void)
110 + /* Nothing to do */
113 +MIPS_MACHINE(LTQ_MACH_GENERIC,
115 + "Generic Lantiq based board",
116 + lantiq_generic_init);
117 --- a/arch/mips/lantiq/xway/Makefile
118 +++ b/arch/mips/lantiq/xway/Makefile
120 obj-y := pmu.o ebu.o reset.o gpio.o devices.o
122 -obj-$(CONFIG_SOC_XWAY) += clk-xway.o prom-xway.o
123 -obj-$(CONFIG_SOC_AMAZON_SE) += clk-ase.o prom-ase.o
124 +obj-$(CONFIG_SOC_XWAY) += clk-xway.o prom-xway.o setup-xway.o
125 +obj-$(CONFIG_SOC_AMAZON_SE) += clk-ase.o prom-ase.o setup-ase.o
127 +++ b/arch/mips/lantiq/xway/setup-ase.c
130 + * This program is free software; you can redistribute it and/or modify it
131 + * under the terms of the GNU General Public License version 2 as published
132 + * by the Free Software Foundation.
134 + * Copyright (C) 2011 John Crispin <blogic@openwrt.org>
137 +#include <lantiq_soc.h>
139 +#include "../prom.h"
140 +#include "devices.h"
142 +void __init ltq_soc_setup(void)
144 + ltq_register_ase_asc();
145 + ltq_register_gpio();
146 + ltq_register_wdt();
149 +++ b/arch/mips/lantiq/xway/setup-xway.c
152 + * This program is free software; you can redistribute it and/or modify it
153 + * under the terms of the GNU General Public License version 2 as published
154 + * by the Free Software Foundation.
156 + * Copyright (C) 2011 John Crispin <blogic@openwrt.org>
159 +#include <lantiq_soc.h>
161 +#include "../prom.h"
162 +#include "devices.h"
164 +void __init ltq_soc_setup(void)
166 + ltq_register_asc(0);
167 + ltq_register_asc(1);
168 + ltq_register_gpio();
169 + ltq_register_wdt();