2 * Netgear WNDR3700 board support
4 * Copyright (C) 2009 Marco Porsch
5 * Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
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.
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>
18 #include <asm/mips_machine.h>
19 #include <asm/mach-ar71xx/ar71xx.h>
20 #include <asm/mach-ar71xx/pci.h>
24 #ifdef CONFIG_MTD_PARTITIONS
25 static struct mtd_partition wndr3700_partitions[] = {
30 .mask_flags = MTD_WRITEABLE,
35 .mask_flags = MTD_WRITEABLE,
44 .mask_flags = MTD_WRITEABLE,
49 .mask_flags = MTD_WRITEABLE,
54 .mask_flags = MTD_WRITEABLE,
56 .name = "traffic_meter",
59 .mask_flags = MTD_WRITEABLE,
64 .mask_flags = MTD_WRITEABLE,
69 .mask_flags = MTD_WRITEABLE,
72 #endif /* CONFIG_MTD_PARTITIONS */
74 static struct flash_platform_data wndr3700_flash_data = {
75 #ifdef CONFIG_MTD_PARTITIONS
76 .parts = wndr3700_partitions,
77 .nr_parts = ARRAY_SIZE(wndr3700_partitions),
81 static struct ar71xx_pci_irq wndr3700_pci_irqs[] __initdata = {
85 .irq = AR71XX_PCI_IRQ_DEV0,
89 .irq = AR71XX_PCI_IRQ_DEV1,
93 static struct spi_board_info wndr3700_spi_info[] = {
97 .max_speed_hz = 25000000,
99 .platform_data = &wndr3700_flash_data,
103 static void __init wndr3700_setup(void)
105 u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000);
107 ar71xx_set_mac_base(mac);
108 ar71xx_add_device_mdio(0x0);
110 ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
111 ar71xx_eth0_data.phy_mask = 0xf;
112 ar71xx_eth0_data.speed = SPEED_1000;
113 ar71xx_eth0_data.duplex = DUPLEX_FULL;
115 ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
116 ar71xx_eth1_data.phy_mask = 0x10;
118 ar71xx_add_device_eth(0);
119 ar71xx_add_device_eth(1);
121 ar71xx_add_device_usb();
123 ar71xx_pci_init(ARRAY_SIZE(wndr3700_pci_irqs), wndr3700_pci_irqs);
125 ar71xx_add_device_spi(NULL, wndr3700_spi_info,
126 ARRAY_SIZE(wndr3700_spi_info));
128 /* TODO: LEDs, buttons support */
131 MIPS_MACHINE(AR71XX_MACH_WNDR3700, "NETGEAR WNDR3700", wndr3700_setup);