2e9d3bc6e7dff1241fbfc153ae13c40ad3992464
[openwrt.git] / target / linux / ar71xx / files / arch / mips / ar71xx / mach-mzk-w300nh.c
1 /*
2 * Planex MZK-W300NH board support
3 *
4 * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
5 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published
9 * by the Free Software Foundation.
10 */
11
12 #include <linux/platform_device.h>
13 #include <linux/mtd/mtd.h>
14 #include <linux/mtd/partitions.h>
15 #include <linux/spi/spi.h>
16 #include <linux/spi/flash.h>
17
18 #include <asm/mips_machine.h>
19
20 #include <asm/mach-ar71xx/ar71xx.h>
21
22 #include "devices.h"
23
24 #ifdef CONFIG_MTD_PARTITIONS
25 static struct mtd_partition mzk_w300nh_partitions[] = {
26 {
27 .name = "u-boot",
28 .offset = 0,
29 .size = 0x040000,
30 .mask_flags = MTD_WRITEABLE,
31 } , {
32 .name = "u-boot-env",
33 .offset = 0x040000,
34 .size = 0x010000,
35 } , {
36 .name = "uImage",
37 .offset = 0x050000,
38 .size = 0x160000,
39 } , {
40 .name = "rootfs",
41 .offset = 0x1b0000,
42 .size = 0x610000,
43 } , {
44 .name = "config",
45 .offset = 0x7c0000,
46 .size = 0x020000,
47 } , {
48 .name = "art",
49 .offset = 0x7e0000,
50 .size = 0x020000,
51 .mask_flags = MTD_WRITEABLE,
52 }
53 };
54 #endif /* CONFIG_MTD_PARTITIONS */
55
56 static struct flash_platform_data mzk_w300nh_flash_data = {
57 #ifdef CONFIG_MTD_PARTITIONS
58 .parts = mzk_w300nh_partitions,
59 .nr_parts = ARRAY_SIZE(mzk_w300nh_partitions),
60 #endif
61 };
62
63 static struct spi_board_info mzk_w300nh_spi_info[] = {
64 {
65 .bus_num = 0,
66 .chip_select = 0,
67 .max_speed_hz = 25000000,
68 .modalias = "m25p80",
69 .platform_data = &mzk_w300nh_flash_data,
70 }
71 };
72
73 static void __init mzk_w300nh_setup(void)
74 {
75 ar71xx_add_device_spi(NULL, mzk_w300nh_spi_info,
76 ARRAY_SIZE(mzk_w300nh_spi_info));
77
78 ar91xx_add_device_wmac();
79 }
80
81 MIPS_MACHINE(AR71XX_MACH_MZK_W300NH, "Planex MZK-W300NH", mzk_w300nh_setup);
This page took 0.043137 seconds and 3 git commands to generate.