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
22 +++ b/arch/mips/lantiq/falcon/Kconfig
28 +config LANTIQ_MACH_EASY98000
35 --- a/arch/mips/lantiq/falcon/Makefile
36 +++ b/arch/mips/lantiq/falcon/Makefile
38 obj-y := clk.o prom.o reset.o sysctrl.o devices.o gpio.o
39 +obj-$(CONFIG_LANTIQ_MACH_EASY98000) += mach-easy98000.o
41 +++ b/arch/mips/lantiq/falcon/mach-easy98000.c
44 + * This program is free software; you can redistribute it and/or modify it
45 + * under the terms of the GNU General Public License version 2 as published
46 + * by the Free Software Foundation.
48 + * Copyright (C) 2011 Thomas Langer <thomas.langer@lantiq.com>
49 + * Copyright (C) 2011 John Crispin <blogic@openwrt.org>
52 +#include <linux/platform_device.h>
53 +#include <linux/mtd/partitions.h>
54 +#include <linux/spi/spi.h>
55 +#include <linux/spi/spi_gpio.h>
56 +#include <linux/spi/eeprom.h>
58 +#include "../machtypes.h"
62 +static struct mtd_partition easy98000_nor_partitions[] = {
69 + .name = "uboot_env",
71 + .size = 0x40000, /* 2 sectors for redundant env. */
76 + .size = 0xF80000, /* map only 16 MiB */
80 +struct physmap_flash_data easy98000_nor_flash_data = {
81 + .nr_parts = ARRAY_SIZE(easy98000_nor_partitions),
82 + .parts = easy98000_nor_partitions,
85 +/* setup gpio based spi bus/device for access to the eeprom on the board */
86 +#define SPI_GPIO_MRST 102
87 +#define SPI_GPIO_MTSR 103
88 +#define SPI_GPIO_CLK 104
89 +#define SPI_GPIO_CS0 105
90 +#define SPI_GPIO_CS1 106
91 +#define SPI_GPIO_BUS_NUM 1
93 +static struct spi_gpio_platform_data easy98000_spi_gpio_data = {
94 + .sck = SPI_GPIO_CLK,
95 + .mosi = SPI_GPIO_MTSR,
96 + .miso = SPI_GPIO_MRST,
97 + .num_chipselect = 2,
100 +static struct platform_device easy98000_spi_gpio_device = {
101 + .name = "spi_gpio",
102 + .id = SPI_GPIO_BUS_NUM,
103 + .dev.platform_data = &easy98000_spi_gpio_data,
106 +static struct spi_eeprom at25160n = {
107 + .byte_len = 16 * 1024 / 8,
108 + .name = "at25160n",
113 +static struct spi_board_info easy98000_spi_gpio_devices __initdata = {
114 + .modalias = "at25",
115 + .bus_num = SPI_GPIO_BUS_NUM,
116 + .max_speed_hz = 1000 * 1000,
117 + .mode = SPI_MODE_3,
119 + .controller_data = (void *) SPI_GPIO_CS1,
120 + .platform_data = &at25160n,
124 +easy98000_init_common(void)
126 + spi_register_board_info(&easy98000_spi_gpio_devices, 1);
127 + platform_device_register(&easy98000_spi_gpio_device);
131 +easy98000_init(void)
133 + easy98000_init_common();
134 + ltq_register_nor(&easy98000_nor_flash_data);
138 +easy98000nand_init(void)
140 + easy98000_init_common();
141 + falcon_register_nand();
144 +MIPS_MACHINE(LANTIQ_MACH_EASY98000,
146 + "EASY98000 Eval Board",
149 +MIPS_MACHINE(LANTIQ_MACH_EASY98000NAND,
151 + "EASY98000 Eval Board (NAND Flash)",
152 + easy98000nand_init);
153 --- a/arch/mips/lantiq/machtypes.h
154 +++ b/arch/mips/lantiq/machtypes.h
155 @@ -15,6 +15,11 @@ enum lantiq_mach_type {
156 LTQ_MACH_GENERIC = 0,
157 LTQ_MACH_EASY50712, /* Danube evaluation board */
158 LTQ_MACH_EASY50601, /* Amazon SE evaluation board */
161 + LANTIQ_MACH_EASY98000, /* Falcon Eval Board, NOR Flash */
162 + LANTIQ_MACH_EASY98000SF, /* Falcon Eval Board, Serial Flash */
163 + LANTIQ_MACH_EASY98000NAND, /* Falcon Eval Board, NAND Flash */