1 From ec6ba0f79c010a878d679c057fb6306b50a201b0 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Thu, 11 Aug 2011 14:09:35 +0200
4 Subject: [PATCH 08/24] MIPS: lantiq: add support for the EASY98000 evaluation
7 This patch adds the machine code for the EASY9800 evaluation board.
9 Signed-off-by: Thomas Langer <thomas.langer@lantiq.com>
10 Signed-off-by: John Crispin <blogic@openwrt.org>
11 Cc: linux-mips@linux-mips.org
13 arch/mips/lantiq/falcon/Kconfig | 11 +++
14 arch/mips/lantiq/falcon/Makefile | 1 +
15 arch/mips/lantiq/falcon/mach-easy98000.c | 110 ++++++++++++++++++++++++++++++
16 arch/mips/lantiq/machtypes.h | 5 ++
17 4 files changed, 127 insertions(+), 0 deletions(-)
18 create mode 100644 arch/mips/lantiq/falcon/Kconfig
19 create mode 100644 arch/mips/lantiq/falcon/mach-easy98000.c
21 diff --git a/arch/mips/lantiq/falcon/Kconfig b/arch/mips/lantiq/falcon/Kconfig
23 index 0000000..03e999d
25 +++ b/arch/mips/lantiq/falcon/Kconfig
31 +config LANTIQ_MACH_EASY98000
38 diff --git a/arch/mips/lantiq/falcon/Makefile b/arch/mips/lantiq/falcon/Makefile
39 index de72209..56b22eb 100644
40 --- a/arch/mips/lantiq/falcon/Makefile
41 +++ b/arch/mips/lantiq/falcon/Makefile
43 obj-y := clk.o prom.o reset.o sysctrl.o devices.o gpio.o
44 +obj-$(CONFIG_LANTIQ_MACH_EASY98000) += mach-easy98000.o
45 diff --git a/arch/mips/lantiq/falcon/mach-easy98000.c b/arch/mips/lantiq/falcon/mach-easy98000.c
47 index 0000000..361b8f0
49 +++ b/arch/mips/lantiq/falcon/mach-easy98000.c
52 + * This program is free software; you can redistribute it and/or modify it
53 + * under the terms of the GNU General Public License version 2 as published
54 + * by the Free Software Foundation.
56 + * Copyright (C) 2011 Thomas Langer <thomas.langer@lantiq.com>
57 + * Copyright (C) 2011 John Crispin <blogic@openwrt.org>
60 +#include <linux/platform_device.h>
61 +#include <linux/mtd/partitions.h>
62 +#include <linux/spi/spi.h>
63 +#include <linux/spi/spi_gpio.h>
64 +#include <linux/spi/eeprom.h>
66 +#include "../machtypes.h"
70 +static struct mtd_partition easy98000_nor_partitions[] = {
77 + .name = "uboot_env",
79 + .size = 0x40000, /* 2 sectors for redundant env. */
84 + .size = 0xF80000, /* map only 16 MiB */
88 +struct physmap_flash_data easy98000_nor_flash_data = {
89 + .nr_parts = ARRAY_SIZE(easy98000_nor_partitions),
90 + .parts = easy98000_nor_partitions,
93 +/* setup gpio based spi bus/device for access to the eeprom on the board */
94 +#define SPI_GPIO_MRST 102
95 +#define SPI_GPIO_MTSR 103
96 +#define SPI_GPIO_CLK 104
97 +#define SPI_GPIO_CS0 105
98 +#define SPI_GPIO_CS1 106
99 +#define SPI_GPIO_BUS_NUM 1
101 +static struct spi_gpio_platform_data easy98000_spi_gpio_data = {
102 + .sck = SPI_GPIO_CLK,
103 + .mosi = SPI_GPIO_MTSR,
104 + .miso = SPI_GPIO_MRST,
105 + .num_chipselect = 2,
108 +static struct platform_device easy98000_spi_gpio_device = {
109 + .name = "spi_gpio",
110 + .id = SPI_GPIO_BUS_NUM,
111 + .dev.platform_data = &easy98000_spi_gpio_data,
114 +static struct spi_eeprom at25160n = {
115 + .byte_len = 16 * 1024 / 8,
116 + .name = "at25160n",
121 +static struct spi_board_info easy98000_spi_gpio_devices __initdata = {
122 + .modalias = "at25",
123 + .bus_num = SPI_GPIO_BUS_NUM,
124 + .max_speed_hz = 1000 * 1000,
125 + .mode = SPI_MODE_3,
127 + .controller_data = (void *) SPI_GPIO_CS1,
128 + .platform_data = &at25160n,
132 +easy98000_init_common(void)
134 + spi_register_board_info(&easy98000_spi_gpio_devices, 1);
135 + platform_device_register(&easy98000_spi_gpio_device);
139 +easy98000_init(void)
141 + easy98000_init_common();
142 + ltq_register_nor(&easy98000_nor_flash_data);
146 +easy98000nand_init(void)
148 + easy98000_init_common();
149 + falcon_register_nand();
152 +MIPS_MACHINE(LANTIQ_MACH_EASY98000,
154 + "EASY98000 Eval Board",
157 +MIPS_MACHINE(LANTIQ_MACH_EASY98000NAND,
159 + "EASY98000 Eval Board (NAND Flash)",
160 + easy98000nand_init);
161 diff --git a/arch/mips/lantiq/machtypes.h b/arch/mips/lantiq/machtypes.h
162 index 7e01b8c..dfc6af7 100644
163 --- a/arch/mips/lantiq/machtypes.h
164 +++ b/arch/mips/lantiq/machtypes.h
165 @@ -15,6 +15,11 @@ enum lantiq_mach_type {
166 LTQ_MACH_GENERIC = 0,
167 LTQ_MACH_EASY50712, /* Danube evaluation board */
168 LTQ_MACH_EASY50601, /* Amazon SE evaluation board */
171 + LANTIQ_MACH_EASY98000, /* Falcon Eval Board, NOR Flash */
172 + LANTIQ_MACH_EASY98000SF, /* Falcon Eval Board, Serial Flash */
173 + LANTIQ_MACH_EASY98000NAND, /* Falcon Eval Board, NAND Flash */