ed9098e7fc6e5516b1863ec61a8fdae1c4a34a3e
[openwrt.git] / target / linux / lantiq / files-3.2 / arch / mips / lantiq / xway / mach-netgear.c
1 /*
2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License version 2 as published
4 * by the Free Software Foundation.
5 *
6 * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
7 */
8
9 #include <linux/init.h>
10 #include <linux/platform_device.h>
11 #include <linux/mtd/mtd.h>
12 #include <linux/mtd/partitions.h>
13 #include <linux/mtd/physmap.h>
14 #include <linux/input.h>
15 #include <linux/phy.h>
16 #include <linux/spi/spi.h>
17 #include <linux/spi/flash.h>
18
19 #include <lantiq_soc.h>
20 #include <irq.h>
21
22 #include "../machtypes.h"
23 #include "devices.h"
24
25 static struct ltq_pci_data ltq_pci_data = {
26 .clock = PCI_CLOCK_INT,
27 .gpio = PCI_GNT1 | PCI_REQ1,
28 .irq = {
29 [14] = INT_NUM_IM0_IRL0 + 22,
30 },
31 };
32
33 static struct ltq_eth_data ltq_eth_data = {
34 .mii_mode = PHY_INTERFACE_MODE_MII,
35 };
36
37 static struct mtd_partition easy98000_nor_partitions[] =
38 {
39 {
40 .name = "uboot",
41 .offset = 0x0,
42 .size = 0x40000,
43 },
44 {
45 .name = "uboot_env",
46 .offset = 0x40000,
47 .size = 0x40000, /* 2 sectors for redundant env. */
48 },
49 {
50 .name = "linux",
51 .offset = 0x80000,
52 .size = 0xF80000, /* map only 16 MiB */
53 },
54 };
55
56 static struct flash_platform_data easy98000_spi_flash_platform_data = {
57 .name = "sflash",
58 .parts = easy98000_nor_partitions,
59 .nr_parts = ARRAY_SIZE(easy98000_nor_partitions)
60 };
61
62 static struct spi_board_info spi_info __initdata = {
63 .modalias = "m25p80",
64 .bus_num = 0,
65 .chip_select = 3,
66 .max_speed_hz = 10 * 1000 * 1000,
67 .mode = SPI_MODE_3,
68 .platform_data = &easy98000_spi_flash_platform_data
69 };
70
71 struct ltq_spi_platform_data ltq_spi_data = {
72 .num_chipselect = 4,
73 };
74
75 static void __init dgn3500_init(void)
76 {
77 ltq_register_pci(&ltq_pci_data);
78 ltq_register_etop(&ltq_eth_data);
79 ltq_register_spi(&ltq_spi_data, &spi_info, 1);
80 }
81
82 MIPS_MACHINE(LANTIQ_MACH_DGN3500B,
83 "DGN3500B",
84 "Netgear DGN3500B",
85 dgn3500_init);
This page took 0.04136 seconds and 3 git commands to generate.