1 From 9397aa9584bade07ae667ecd5135653f9c04e236 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 10/70] 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>
12 arch/mips/lantiq/falcon/Kconfig | 11 +++
13 arch/mips/lantiq/falcon/Makefile | 1 +
14 arch/mips/lantiq/falcon/mach-easy98000.c | 110 ++++++++++++++++++++++++++++++
15 arch/mips/lantiq/machtypes.h | 5 ++
16 4 files changed, 127 insertions(+), 0 deletions(-)
17 create mode 100644 arch/mips/lantiq/falcon/Kconfig
18 create mode 100644 arch/mips/lantiq/falcon/mach-easy98000.c
21 +++ b/arch/mips/lantiq/falcon/Kconfig
27 +config LANTIQ_MACH_EASY98000
34 --- a/arch/mips/lantiq/falcon/Makefile
35 +++ b/arch/mips/lantiq/falcon/Makefile
37 obj-y := clk.o prom.o reset.o sysctrl.o devices.o gpio.o
38 +obj-$(CONFIG_LANTIQ_MACH_EASY98000) += mach-easy98000.o
40 +++ b/arch/mips/lantiq/falcon/mach-easy98000.c
43 + * This program is free software; you can redistribute it and/or modify it
44 + * under the terms of the GNU General Public License version 2 as published
45 + * by the Free Software Foundation.
47 + * Copyright (C) 2011 Thomas Langer <thomas.langer@lantiq.com>
48 + * Copyright (C) 2011 John Crispin <blogic@openwrt.org>
51 +#include <linux/platform_device.h>
52 +#include <linux/mtd/partitions.h>
53 +#include <linux/spi/spi.h>
54 +#include <linux/spi/spi_gpio.h>
55 +#include <linux/spi/eeprom.h>
57 +#include "../machtypes.h"
61 +static struct mtd_partition easy98000_nor_partitions[] = {
68 + .name = "uboot_env",
70 + .size = 0x40000, /* 2 sectors for redundant env. */
75 + .size = 0xF80000, /* map only 16 MiB */
79 +struct physmap_flash_data easy98000_nor_flash_data = {
80 + .nr_parts = ARRAY_SIZE(easy98000_nor_partitions),
81 + .parts = easy98000_nor_partitions,
84 +/* setup gpio based spi bus/device for access to the eeprom on the board */
85 +#define SPI_GPIO_MRST 102
86 +#define SPI_GPIO_MTSR 103
87 +#define SPI_GPIO_CLK 104
88 +#define SPI_GPIO_CS0 105
89 +#define SPI_GPIO_CS1 106
90 +#define SPI_GPIO_BUS_NUM 1
92 +static struct spi_gpio_platform_data easy98000_spi_gpio_data = {
93 + .sck = SPI_GPIO_CLK,
94 + .mosi = SPI_GPIO_MTSR,
95 + .miso = SPI_GPIO_MRST,
96 + .num_chipselect = 2,
99 +static struct platform_device easy98000_spi_gpio_device = {
100 + .name = "spi_gpio",
101 + .id = SPI_GPIO_BUS_NUM,
102 + .dev.platform_data = &easy98000_spi_gpio_data,
105 +static struct spi_eeprom at25160n = {
106 + .byte_len = 16 * 1024 / 8,
107 + .name = "at25160n",
112 +static struct spi_board_info easy98000_spi_gpio_devices __initdata = {
113 + .modalias = "at25",
114 + .bus_num = SPI_GPIO_BUS_NUM,
115 + .max_speed_hz = 1000 * 1000,
116 + .mode = SPI_MODE_3,
118 + .controller_data = (void *) SPI_GPIO_CS1,
119 + .platform_data = &at25160n,
123 +easy98000_init_common(void)
125 + spi_register_board_info(&easy98000_spi_gpio_devices, 1);
126 + platform_device_register(&easy98000_spi_gpio_device);
130 +easy98000_init(void)
132 + easy98000_init_common();
133 + ltq_register_nor(&easy98000_nor_flash_data);
137 +easy98000nand_init(void)
139 + easy98000_init_common();
140 + falcon_register_nand();
143 +MIPS_MACHINE(LANTIQ_MACH_EASY98000,
145 + "EASY98000 Eval Board",
148 +MIPS_MACHINE(LANTIQ_MACH_EASY98000NAND,
150 + "EASY98000 Eval Board (NAND Flash)",
151 + easy98000nand_init);
152 --- a/arch/mips/lantiq/machtypes.h
153 +++ b/arch/mips/lantiq/machtypes.h
154 @@ -15,6 +15,11 @@ enum lantiq_mach_type {
155 LTQ_MACH_GENERIC = 0,
156 LTQ_MACH_EASY50712, /* Danube evaluation board */
157 LTQ_MACH_EASY50601, /* Amazon SE evaluation board */
160 + LANTIQ_MACH_EASY98000, /* Falcon Eval Board, NOR Flash */
161 + LANTIQ_MACH_EASY98000SF, /* Falcon Eval Board, Serial Flash */
162 + LANTIQ_MACH_EASY98000NAND, /* Falcon Eval Board, NAND Flash */