Lennert Buytenhek | 91af7bb | 2008-10-19 02:38:25 +0200 | [diff] [blame^] | 1 | /* |
| 2 | * arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c |
| 3 | * |
| 4 | * Marvell 88F6281 GTW GE Board Setup |
| 5 | * |
| 6 | * This file is licensed under the terms of the GNU General Public |
| 7 | * License version 2. This program is licensed "as is" without any |
| 8 | * warranty of any kind, whether express or implied. |
| 9 | */ |
| 10 | |
| 11 | #include <linux/kernel.h> |
| 12 | #include <linux/init.h> |
| 13 | #include <linux/platform_device.h> |
| 14 | #include <linux/pci.h> |
| 15 | #include <linux/irq.h> |
| 16 | #include <linux/mtd/physmap.h> |
| 17 | #include <linux/timer.h> |
| 18 | #include <linux/mv643xx_eth.h> |
| 19 | #include <linux/ethtool.h> |
| 20 | #include <linux/spi/flash.h> |
| 21 | #include <linux/spi/spi.h> |
| 22 | #include <linux/spi/orion_spi.h> |
| 23 | #include <net/dsa.h> |
| 24 | #include <asm/mach-types.h> |
| 25 | #include <asm/mach/arch.h> |
| 26 | #include <asm/mach/pci.h> |
| 27 | #include <mach/kirkwood.h> |
| 28 | #include "common.h" |
| 29 | |
| 30 | static struct mv643xx_eth_platform_data mv88f6281gtw_ge_ge00_data = { |
| 31 | .phy_addr = MV643XX_ETH_PHY_NONE, |
| 32 | .speed = SPEED_1000, |
| 33 | .duplex = DUPLEX_FULL, |
| 34 | }; |
| 35 | |
| 36 | static struct dsa_chip_data mv88f6281gtw_ge_switch_chip_data = { |
| 37 | .port_names[0] = "lan1", |
| 38 | .port_names[1] = "lan2", |
| 39 | .port_names[2] = "lan3", |
| 40 | .port_names[3] = "lan4", |
| 41 | .port_names[4] = "wan", |
| 42 | .port_names[5] = "cpu", |
| 43 | }; |
| 44 | |
| 45 | static struct dsa_platform_data mv88f6281gtw_ge_switch_plat_data = { |
| 46 | .nr_chips = 1, |
| 47 | .chip = &mv88f6281gtw_ge_switch_chip_data, |
| 48 | }; |
| 49 | |
| 50 | static const struct flash_platform_data mv88f6281gtw_ge_spi_slave_data = { |
| 51 | .type = "mx25l12805d", |
| 52 | }; |
| 53 | |
| 54 | static struct spi_board_info __initdata mv88f6281gtw_ge_spi_slave_info[] = { |
| 55 | { |
| 56 | .modalias = "m25p80", |
| 57 | .platform_data = &mv88f6281gtw_ge_spi_slave_data, |
| 58 | .irq = -1, |
| 59 | .max_speed_hz = 50000000, |
| 60 | .bus_num = 0, |
| 61 | .chip_select = 0, |
| 62 | }, |
| 63 | }; |
| 64 | |
| 65 | static void __init mv88f6281gtw_ge_init(void) |
| 66 | { |
| 67 | /* |
| 68 | * Basic setup. Needs to be called early. |
| 69 | */ |
| 70 | kirkwood_init(); |
| 71 | |
| 72 | kirkwood_ehci_init(); |
| 73 | kirkwood_ge00_init(&mv88f6281gtw_ge_ge00_data); |
| 74 | kirkwood_ge00_switch_init(&mv88f6281gtw_ge_switch_plat_data, NO_IRQ); |
| 75 | spi_register_board_info(mv88f6281gtw_ge_spi_slave_info, |
| 76 | ARRAY_SIZE(mv88f6281gtw_ge_spi_slave_info)); |
| 77 | kirkwood_spi_init(); |
| 78 | kirkwood_uart0_init(); |
| 79 | } |
| 80 | |
| 81 | static int __init mv88f6281gtw_ge_pci_init(void) |
| 82 | { |
| 83 | if (machine_is_mv88f6281gtw_ge()) |
| 84 | kirkwood_pcie_init(); |
| 85 | |
| 86 | return 0; |
| 87 | } |
| 88 | subsys_initcall(mv88f6281gtw_ge_pci_init); |
| 89 | |
| 90 | MACHINE_START(MV88F6281GTW_GE, "Marvell 88F6281 GTW GE Board") |
| 91 | /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */ |
| 92 | .phys_io = KIRKWOOD_REGS_PHYS_BASE, |
| 93 | .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc, |
| 94 | .boot_params = 0x00000100, |
| 95 | .init_machine = mv88f6281gtw_ge_init, |
| 96 | .map_io = kirkwood_map_io, |
| 97 | .init_irq = kirkwood_init_irq, |
| 98 | .timer = &kirkwood_timer, |
| 99 | MACHINE_END |