| 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 | diff --git a/arch/mips/lantiq/Kconfig b/arch/mips/lantiq/Kconfig |
| 28 | index 2780461..3fccf21 100644 |
| 29 | --- a/arch/mips/lantiq/Kconfig |
| 30 | +++ b/arch/mips/lantiq/Kconfig |
| 31 | @@ -18,4 +18,6 @@ config SOC_XWAY |
| 32 | select HW_HAS_PCI |
| 33 | endchoice |
| 34 | |
| 35 | +source "arch/mips/lantiq/xway/Kconfig" |
| 36 | + |
| 37 | endif |
| 38 | diff --git a/arch/mips/lantiq/machtypes.h b/arch/mips/lantiq/machtypes.h |
| 39 | index ffcacfc..7e01b8c 100644 |
| 40 | --- a/arch/mips/lantiq/machtypes.h |
| 41 | +++ b/arch/mips/lantiq/machtypes.h |
| 42 | @@ -13,6 +13,8 @@ |
| 43 | |
| 44 | enum lantiq_mach_type { |
| 45 | LTQ_MACH_GENERIC = 0, |
| 46 | + LTQ_MACH_EASY50712, /* Danube evaluation board */ |
| 47 | + LTQ_MACH_EASY50601, /* Amazon SE evaluation board */ |
| 48 | }; |
| 49 | |
| 50 | #endif |
| 51 | diff --git a/arch/mips/lantiq/xway/Kconfig b/arch/mips/lantiq/xway/Kconfig |
| 52 | new file mode 100644 |
| 53 | index 0000000..2b857de |
| 54 | --- /dev/null |
| 55 | +++ b/arch/mips/lantiq/xway/Kconfig |
| 56 | @@ -0,0 +1,23 @@ |
| 57 | +if SOC_XWAY |
| 58 | + |
| 59 | +menu "MIPS Machine" |
| 60 | + |
| 61 | +config LANTIQ_MACH_EASY50712 |
| 62 | + bool "Easy50712 - Danube" |
| 63 | + default y |
| 64 | + |
| 65 | +endmenu |
| 66 | + |
| 67 | +endif |
| 68 | + |
| 69 | +if SOC_AMAZON_SE |
| 70 | + |
| 71 | +menu "MIPS Machine" |
| 72 | + |
| 73 | +config LANTIQ_MACH_EASY50601 |
| 74 | + bool "Easy50601 - Amazon SE" |
| 75 | + default y |
| 76 | + |
| 77 | +endmenu |
| 78 | + |
| 79 | +endif |
| 80 | diff --git a/arch/mips/lantiq/xway/Makefile b/arch/mips/lantiq/xway/Makefile |
| 81 | index 8c06a97..b1d3640 100644 |
| 82 | --- a/arch/mips/lantiq/xway/Makefile |
| 83 | +++ b/arch/mips/lantiq/xway/Makefile |
| 84 | @@ -2,3 +2,6 @@ obj-y := pmu.o ebu.o reset.o gpio.o devices.o |
| 85 | |
| 86 | obj-$(CONFIG_SOC_XWAY) += clk-xway.o prom-xway.o setup-xway.o |
| 87 | obj-$(CONFIG_SOC_AMAZON_SE) += clk-ase.o prom-ase.o setup-ase.o |
| 88 | + |
| 89 | +obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o |
| 90 | +obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o |
| 91 | diff --git a/arch/mips/lantiq/xway/mach-easy50601.c b/arch/mips/lantiq/xway/mach-easy50601.c |
| 92 | new file mode 100644 |
| 93 | index 0000000..d5aaf63 |
| 94 | --- /dev/null |
| 95 | +++ b/arch/mips/lantiq/xway/mach-easy50601.c |
| 96 | @@ -0,0 +1,57 @@ |
| 97 | +/* |
| 98 | + * This program is free software; you can redistribute it and/or modify it |
| 99 | + * under the terms of the GNU General Public License version 2 as published |
| 100 | + * by the Free Software Foundation. |
| 101 | + * |
| 102 | + * Copyright (C) 2010 John Crispin <blogic@openwrt.org> |
| 103 | + */ |
| 104 | + |
| 105 | +#include <linux/init.h> |
| 106 | +#include <linux/platform_device.h> |
| 107 | +#include <linux/mtd/mtd.h> |
| 108 | +#include <linux/mtd/partitions.h> |
| 109 | +#include <linux/mtd/physmap.h> |
| 110 | +#include <linux/input.h> |
| 111 | + |
| 112 | +#include <lantiq.h> |
| 113 | + |
| 114 | +#include "../machtypes.h" |
| 115 | +#include "devices.h" |
| 116 | + |
| 117 | +static struct mtd_partition easy50601_partitions[] = { |
| 118 | + { |
| 119 | + .name = "uboot", |
| 120 | + .offset = 0x0, |
| 121 | + .size = 0x10000, |
| 122 | + }, |
| 123 | + { |
| 124 | + .name = "uboot_env", |
| 125 | + .offset = 0x10000, |
| 126 | + .size = 0x10000, |
| 127 | + }, |
| 128 | + { |
| 129 | + .name = "linux", |
| 130 | + .offset = 0x20000, |
| 131 | + .size = 0xE0000, |
| 132 | + }, |
| 133 | + { |
| 134 | + .name = "rootfs", |
| 135 | + .offset = 0x100000, |
| 136 | + .size = 0x300000, |
| 137 | + }, |
| 138 | +}; |
| 139 | + |
| 140 | +static struct physmap_flash_data easy50601_flash_data = { |
| 141 | + .nr_parts = ARRAY_SIZE(easy50601_partitions), |
| 142 | + .parts = easy50601_partitions, |
| 143 | +}; |
| 144 | + |
| 145 | +static void __init easy50601_init(void) |
| 146 | +{ |
| 147 | + ltq_register_nor(&easy50601_flash_data); |
| 148 | +} |
| 149 | + |
| 150 | +MIPS_MACHINE(LTQ_MACH_EASY50601, |
| 151 | + "EASY50601", |
| 152 | + "EASY50601 Eval Board", |
| 153 | + easy50601_init); |
| 154 | diff --git a/arch/mips/lantiq/xway/mach-easy50712.c b/arch/mips/lantiq/xway/mach-easy50712.c |
| 155 | new file mode 100644 |
| 156 | index 0000000..e5e7e09 |
| 157 | --- /dev/null |
| 158 | +++ b/arch/mips/lantiq/xway/mach-easy50712.c |
| 159 | @@ -0,0 +1,68 @@ |
| 160 | +/* |
| 161 | + * This program is free software; you can redistribute it and/or modify it |
| 162 | + * under the terms of the GNU General Public License version 2 as published |
| 163 | + * by the Free Software Foundation. |
| 164 | + * |
| 165 | + * Copyright (C) 2010 John Crispin <blogic@openwrt.org> |
| 166 | + */ |
| 167 | + |
| 168 | +#include <linux/init.h> |
| 169 | +#include <linux/platform_device.h> |
| 170 | +#include <linux/mtd/mtd.h> |
| 171 | +#include <linux/mtd/partitions.h> |
| 172 | +#include <linux/mtd/physmap.h> |
| 173 | +#include <linux/input.h> |
| 174 | + |
| 175 | +#include <lantiq_soc.h> |
| 176 | +#include <irq.h> |
| 177 | + |
| 178 | +#include "../machtypes.h" |
| 179 | +#include "devices.h" |
| 180 | + |
| 181 | +static struct mtd_partition easy50712_partitions[] = { |
| 182 | + { |
| 183 | + .name = "uboot", |
| 184 | + .offset = 0x0, |
| 185 | + .size = 0x10000, |
| 186 | + }, |
| 187 | + { |
| 188 | + .name = "uboot_env", |
| 189 | + .offset = 0x10000, |
| 190 | + .size = 0x10000, |
| 191 | + }, |
| 192 | + { |
| 193 | + .name = "linux", |
| 194 | + .offset = 0x20000, |
| 195 | + .size = 0xe0000, |
| 196 | + }, |
| 197 | + { |
| 198 | + .name = "rootfs", |
| 199 | + .offset = 0x100000, |
| 200 | + .size = 0x300000, |
| 201 | + }, |
| 202 | +}; |
| 203 | + |
| 204 | +static struct physmap_flash_data easy50712_flash_data = { |
| 205 | + .nr_parts = ARRAY_SIZE(easy50712_partitions), |
| 206 | + .parts = easy50712_partitions, |
| 207 | +}; |
| 208 | + |
| 209 | +static struct ltq_pci_data ltq_pci_data = { |
| 210 | + .clock = PCI_CLOCK_INT, |
| 211 | + .gpio = PCI_GNT1 | PCI_REQ1, |
| 212 | + .irq = { |
| 213 | + [14] = INT_NUM_IM0_IRL0 + 22, |
| 214 | + }, |
| 215 | +}; |
| 216 | + |
| 217 | +static void __init easy50712_init(void) |
| 218 | +{ |
| 219 | + ltq_register_gpio_stp(); |
| 220 | + ltq_register_nor(&easy50712_flash_data); |
| 221 | + ltq_register_pci(<q_pci_data); |
| 222 | +} |
| 223 | + |
| 224 | +MIPS_MACHINE(LTQ_MACH_EASY50712, |
| 225 | + "EASY50712", |
| 226 | + "EASY50712 Eval Board", |
| 227 | + easy50712_init); |
| 228 | -- |
| 229 | 1.7.2.3 |
| 230 | |
| 231 | |