1 --- a/arch/arm/mach-cns21xx/Kconfig
2 +++ b/arch/arm/mach-cns21xx/Kconfig
3 @@ -2,6 +2,15 @@ if ARCH_CNS21XX
5 menu "Cavium Networks CNS21xx based machines"
8 + bool "AGESTAR NSB3AST support"
9 + select CNS21XX_DEV_GEC
10 + select CNS21XX_DEV_SPI_MASTER
11 + select CNS21XX_DEV_USB
13 + Say Y here if you intend to run this kernel on the
14 + AGESTAR NSB3AST board.
18 select CNS21XX_DEV_GEC
20 +++ b/arch/arm/mach-cns21xx/mach-nsb3ast.c
23 + * AGESTAR NSB3AST board support
25 + * Copyright (c) 2010 Gabor Juhos <juhosg@openwrt.org>
27 + * This file is free software; you can redistribute it and/or modify
28 + * it under the terms of the GNU General Public License, Version 2, as
29 + * published by the Free Software Foundation.
32 +#include <linux/kernel.h>
33 +#include <linux/init.h>
34 +#include <linux/mtd/mtd.h>
35 +#include <linux/mtd/map.h>
36 +#include <linux/mtd/partitions.h>
37 +#include <linux/spi/spi.h>
38 +#include <linux/spi/flash.h>
39 +#include <linux/platform_device.h>
40 +#include <linux/gpio.h>
41 +#include <linux/leds.h>
42 +#include <linux/gpio_keys.h>
43 +#include <linux/input.h>
45 +#include <asm/setup.h>
46 +#include <asm/mach-types.h>
47 +#include <asm/mach/arch.h>
48 +#include <asm/mach/time.h>
49 +#include <mach/hardware.h>
50 +#include <mach/cns21xx.h>
51 +#include <mach/cns21xx_misc.h>
56 +static struct mtd_partition nsb3ast_partitions[] = {
61 + .mask_flags = MTD_WRITEABLE,
75 + .name = "wholeflash",
78 + .mask_flags = MTD_WRITEABLE,
82 +static struct flash_platform_data nsb3ast_flash_data = {
83 + .parts = nsb3ast_partitions,
84 + .nr_parts = ARRAY_SIZE(nsb3ast_partitions),
87 +static struct spi_board_info nsb3ast_spi_board_info[] = {
91 + .max_speed_hz = 25000000,
92 + .modalias = "m25p80",
93 + .platform_data = &nsb3ast_flash_data,
97 +static struct gpio_led nsb3ast_gpio_leds[] = {
99 + .name = "nsb3ast:red:d1",
103 + .name = "nsb3ast:amber:eth",
109 +static struct gpio_led_platform_data nsb3ast_gpio_leds_data = {
110 + .num_leds = ARRAY_SIZE(nsb3ast_gpio_leds),
111 + .leds = nsb3ast_gpio_leds,
114 +static struct platform_device nsb3ast_gpio_leds_device = {
115 + .name = "leds-gpio",
117 + .dev.platform_data = &nsb3ast_gpio_leds_data,
120 +static struct gpio_keys_button nsb3ast_gpio_keys[] = {
122 + .code = KEY_RESTART,
124 + .desc = "Reset Button",
130 + .desc = "USB Button",
135 +static struct gpio_keys_platform_data nsb3ast_gpio_keys_data = {
136 + .buttons = nsb3ast_gpio_keys,
137 + .nbuttons = ARRAY_SIZE(nsb3ast_gpio_keys),
140 +static struct platform_device nsb3ast_gpio_keys_device = {
141 + .name = "gpio-keys",
143 + .num_resources = 0,
145 + .platform_data = &nsb3ast_gpio_keys_data,
149 +static void __init nsb3ast_fixup(struct tag *tags, char **cmdline,
150 + struct meminfo *mi)
154 + /* The board has 32MB of RAM mapped at 0. */
156 + mi->bank[0].start = 0;
157 + mi->bank[0].size = SZ_32M;
159 + for (t = tags; t->hdr.size; t = tag_next(t)) {
160 + switch (t->hdr.tag) {
162 + if (t->u.core.rootdev == 255)
163 + t->u.core.rootdev = 0;
169 +static void __init nsb3ast_init(void)
171 + cns21xx_gpio_init();
172 + cns21xx_register_uart0();
173 + cns21xx_register_uart1();
174 + cns21xx_register_wdt();
175 + cns21xx_register_usb();
176 + cns21xx_register_spi_master(-1, nsb3ast_spi_board_info,
177 + ARRAY_SIZE(nsb3ast_spi_board_info));
179 + cns21xx_gec_data.phy_type = CNS21XX_GEC_PHY_TYPE_INTERNAL;
180 + cns21xx_register_gec();
182 + HAL_MISC_DISABLE_LED012_PINS();
183 + platform_device_register(&nsb3ast_gpio_leds_device);
184 + platform_device_register(&nsb3ast_gpio_keys_device);
187 +MACHINE_START(NSB3AST, "AGESTAR NSB3AST")
188 + .fixup = nsb3ast_fixup,
189 + .map_io = cns21xx_map_io,
190 + .init_irq = cns21xx_init_irq,
191 + .timer = &cns21xx_timer,
192 + .init_machine = nsb3ast_init,
194 --- a/arch/arm/mach-cns21xx/Makefile
195 +++ b/arch/arm/mach-cns21xx/Makefile
196 @@ -13,3 +13,4 @@ obj-$(CONFIG_CNS21XX_DEV_SPI_MASTER) +=
198 # machine specific files
199 obj-$(CONFIG_MACH_NS_K330) += mach-ns-k330.o
200 +obj-$(CONFIG_MACH_NSB3AST) += mach-nsb3ast.o