package/dropbear: fix segfault with remote port forwarding (closes: #10339)
[openwrt.git] / target / linux / lantiq / patches-2.6.39 / 0007-MIPS-Lantiq-Add-machtypes-for-lantiq-eval-kits.patch
1 From ab2182fc419548455d03979683eb0e92c372ed79 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Wed, 30 Mar 2011 09:27:55 +0200
4 Subject: [PATCH 07/13] MIPS: Lantiq: Add machtypes for lantiq eval kits
5
6 This patch adds mach specific code for the Lantiq EASY50712/50601 evaluation
7 boards
8
9 Signed-off-by: John Crispin <blogic@openwrt.org>
10 Signed-off-by: Ralph Hempel <ralph.hempel@lantiq.com>
11 Cc: linux-mips@linux-mips.org
12 Patchwork: https://patchwork.linux-mips.org/patch/2255/
13 Patchwork: https://patchwork.linux-mips.org/patch/2361/
14 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 ---
16  arch/mips/lantiq/Kconfig               |    2 +
17  arch/mips/lantiq/machtypes.h           |    2 +
18  arch/mips/lantiq/xway/Kconfig          |   23 +++++++++++
19  arch/mips/lantiq/xway/Makefile         |    3 +
20  arch/mips/lantiq/xway/mach-easy50601.c |   57 ++++++++++++++++++++++++++
21  arch/mips/lantiq/xway/mach-easy50712.c |   68 ++++++++++++++++++++++++++++++++
22  6 files changed, 155 insertions(+), 0 deletions(-)
23  create mode 100644 arch/mips/lantiq/xway/Kconfig
24  create mode 100644 arch/mips/lantiq/xway/mach-easy50601.c
25  create mode 100644 arch/mips/lantiq/xway/mach-easy50712.c
26
27 --- a/arch/mips/lantiq/Kconfig
28 +++ b/arch/mips/lantiq/Kconfig
29 @@ -18,4 +18,6 @@ config SOC_XWAY
30         select HW_HAS_PCI
31  endchoice
32  
33 +source "arch/mips/lantiq/xway/Kconfig"
34 +
35  endif
36 --- a/arch/mips/lantiq/machtypes.h
37 +++ b/arch/mips/lantiq/machtypes.h
38 @@ -13,6 +13,8 @@
39  
40  enum lantiq_mach_type {
41         LTQ_MACH_GENERIC = 0,
42 +       LTQ_MACH_EASY50712,     /* Danube evaluation board */
43 +       LTQ_MACH_EASY50601,     /* Amazon SE evaluation board */
44  };
45  
46  #endif
47 --- /dev/null
48 +++ b/arch/mips/lantiq/xway/Kconfig
49 @@ -0,0 +1,23 @@
50 +if SOC_XWAY
51 +
52 +menu "MIPS Machine"
53 +
54 +config LANTIQ_MACH_EASY50712
55 +       bool "Easy50712 - Danube"
56 +       default y
57 +
58 +endmenu
59 +
60 +endif
61 +
62 +if SOC_AMAZON_SE
63 +
64 +menu "MIPS Machine"
65 +
66 +config LANTIQ_MACH_EASY50601
67 +       bool "Easy50601 - Amazon SE"
68 +       default y
69 +
70 +endmenu
71 +
72 +endif
73 --- a/arch/mips/lantiq/xway/Makefile
74 +++ b/arch/mips/lantiq/xway/Makefile
75 @@ -2,3 +2,6 @@ obj-y := pmu.o ebu.o reset.o gpio.o devi
76  
77  obj-$(CONFIG_SOC_XWAY) += clk-xway.o prom-xway.o setup-xway.o
78  obj-$(CONFIG_SOC_AMAZON_SE) += clk-ase.o prom-ase.o setup-ase.o
79 +
80 +obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
81 +obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o
82 --- /dev/null
83 +++ b/arch/mips/lantiq/xway/mach-easy50601.c
84 @@ -0,0 +1,57 @@
85 +/*
86 + *  This program is free software; you can redistribute it and/or modify it
87 + *  under the terms of the GNU General Public License version 2 as published
88 + *  by the Free Software Foundation.
89 + *
90 + *  Copyright (C) 2010 John Crispin <blogic@openwrt.org>
91 + */
92 +
93 +#include <linux/init.h>
94 +#include <linux/platform_device.h>
95 +#include <linux/mtd/mtd.h>
96 +#include <linux/mtd/partitions.h>
97 +#include <linux/mtd/physmap.h>
98 +#include <linux/input.h>
99 +
100 +#include <lantiq.h>
101 +
102 +#include "../machtypes.h"
103 +#include "devices.h"
104 +
105 +static struct mtd_partition easy50601_partitions[] = {
106 +       {
107 +               .name   = "uboot",
108 +               .offset = 0x0,
109 +               .size   = 0x10000,
110 +       },
111 +       {
112 +               .name   = "uboot_env",
113 +               .offset = 0x10000,
114 +               .size   = 0x10000,
115 +       },
116 +       {
117 +               .name   = "linux",
118 +               .offset = 0x20000,
119 +               .size   = 0xE0000,
120 +       },
121 +       {
122 +               .name   = "rootfs",
123 +               .offset = 0x100000,
124 +               .size   = 0x300000,
125 +       },
126 +};
127 +
128 +static struct physmap_flash_data easy50601_flash_data = {
129 +       .nr_parts       = ARRAY_SIZE(easy50601_partitions),
130 +       .parts          = easy50601_partitions,
131 +};
132 +
133 +static void __init easy50601_init(void)
134 +{
135 +       ltq_register_nor(&easy50601_flash_data);
136 +}
137 +
138 +MIPS_MACHINE(LTQ_MACH_EASY50601,
139 +                       "EASY50601",
140 +                       "EASY50601 Eval Board",
141 +                       easy50601_init);
142 --- /dev/null
143 +++ b/arch/mips/lantiq/xway/mach-easy50712.c
144 @@ -0,0 +1,68 @@
145 +/*
146 + *  This program is free software; you can redistribute it and/or modify it
147 + *  under the terms of the GNU General Public License version 2 as published
148 + *  by the Free Software Foundation.
149 + *
150 + *  Copyright (C) 2010 John Crispin <blogic@openwrt.org>
151 + */
152 +
153 +#include <linux/init.h>
154 +#include <linux/platform_device.h>
155 +#include <linux/mtd/mtd.h>
156 +#include <linux/mtd/partitions.h>
157 +#include <linux/mtd/physmap.h>
158 +#include <linux/input.h>
159 +
160 +#include <lantiq_soc.h>
161 +#include <irq.h>
162 +
163 +#include "../machtypes.h"
164 +#include "devices.h"
165 +
166 +static struct mtd_partition easy50712_partitions[] = {
167 +       {
168 +               .name   = "uboot",
169 +               .offset = 0x0,
170 +               .size   = 0x10000,
171 +       },
172 +       {
173 +               .name   = "uboot_env",
174 +               .offset = 0x10000,
175 +               .size   = 0x10000,
176 +       },
177 +       {
178 +               .name   = "linux",
179 +               .offset = 0x20000,
180 +               .size   = 0xe0000,
181 +       },
182 +       {
183 +               .name   = "rootfs",
184 +               .offset = 0x100000,
185 +               .size   = 0x300000,
186 +       },
187 +};
188 +
189 +static struct physmap_flash_data easy50712_flash_data = {
190 +       .nr_parts       = ARRAY_SIZE(easy50712_partitions),
191 +       .parts          = easy50712_partitions,
192 +};
193 +
194 +static struct ltq_pci_data ltq_pci_data = {
195 +       .clock  = PCI_CLOCK_INT,
196 +       .gpio   = PCI_GNT1 | PCI_REQ1,
197 +       .irq    = {
198 +               [14] = INT_NUM_IM0_IRL0 + 22,
199 +       },
200 +};
201 +
202 +static void __init easy50712_init(void)
203 +{
204 +       ltq_register_gpio_stp();
205 +       ltq_register_nor(&easy50712_flash_data);
206 +       ltq_register_pci(&ltq_pci_data);
207 +}
208 +
209 +MIPS_MACHINE(LTQ_MACH_EASY50712,
210 +            "EASY50712",
211 +            "EASY50712 Eval Board",
212 +             easy50712_init);