Lennert Buytenhek | 0b0740c | 2008-08-29 06:59:34 +0200 | [diff] [blame] | 1 | /* |
| 2 | * arch/arm/mach-orion5x/rd88f6183-ap-ge-setup.c |
| 3 | * |
| 4 | * Marvell Orion-1-90 AP GE Reference Design 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/mv643xx_eth.h> |
| 18 | #include <linux/spi/spi.h> |
| 19 | #include <linux/spi/orion_spi.h> |
| 20 | #include <linux/spi/flash.h> |
| 21 | #include <linux/ethtool.h> |
Lennert Buytenhek | dcf1cec | 2008-09-25 16:23:48 +0200 | [diff] [blame] | 22 | #include <net/dsa.h> |
Lennert Buytenhek | 0b0740c | 2008-08-29 06:59:34 +0200 | [diff] [blame] | 23 | #include <asm/mach-types.h> |
| 24 | #include <asm/gpio.h> |
| 25 | #include <asm/leds.h> |
| 26 | #include <asm/mach/arch.h> |
| 27 | #include <asm/mach/pci.h> |
| 28 | #include <mach/orion5x.h> |
| 29 | #include "common.h" |
Lennert Buytenhek | 0b0740c | 2008-08-29 06:59:34 +0200 | [diff] [blame] | 30 | |
| 31 | static struct mv643xx_eth_platform_data rd88f6183ap_ge_eth_data = { |
| 32 | .phy_addr = -1, |
| 33 | .speed = SPEED_1000, |
| 34 | .duplex = DUPLEX_FULL, |
| 35 | }; |
| 36 | |
Lennert Buytenhek | e84665c | 2009-03-20 09:52:09 +0000 | [diff] [blame] | 37 | static struct dsa_chip_data rd88f6183ap_ge_switch_chip_data = { |
Lennert Buytenhek | dcf1cec | 2008-09-25 16:23:48 +0200 | [diff] [blame] | 38 | .port_names[0] = "lan1", |
| 39 | .port_names[1] = "lan2", |
| 40 | .port_names[2] = "lan3", |
| 41 | .port_names[3] = "lan4", |
| 42 | .port_names[4] = "wan", |
| 43 | .port_names[5] = "cpu", |
| 44 | }; |
| 45 | |
Lennert Buytenhek | e84665c | 2009-03-20 09:52:09 +0000 | [diff] [blame] | 46 | static struct dsa_platform_data rd88f6183ap_ge_switch_plat_data = { |
| 47 | .nr_chips = 1, |
| 48 | .chip = &rd88f6183ap_ge_switch_chip_data, |
| 49 | }; |
| 50 | |
Lennert Buytenhek | 0b0740c | 2008-08-29 06:59:34 +0200 | [diff] [blame] | 51 | static struct mtd_partition rd88f6183ap_ge_partitions[] = { |
| 52 | { |
| 53 | .name = "kernel", |
| 54 | .offset = 0x00000000, |
| 55 | .size = 0x00200000, |
| 56 | }, { |
| 57 | .name = "rootfs", |
| 58 | .offset = 0x00200000, |
| 59 | .size = 0x00500000, |
| 60 | }, { |
| 61 | .name = "nvram", |
| 62 | .offset = 0x00700000, |
| 63 | .size = 0x00080000, |
| 64 | }, |
| 65 | }; |
| 66 | |
| 67 | static struct flash_platform_data rd88f6183ap_ge_spi_slave_data = { |
| 68 | .type = "m25p64", |
| 69 | .nr_parts = ARRAY_SIZE(rd88f6183ap_ge_partitions), |
| 70 | .parts = rd88f6183ap_ge_partitions, |
| 71 | }; |
| 72 | |
| 73 | static struct spi_board_info __initdata rd88f6183ap_ge_spi_slave_info[] = { |
| 74 | { |
| 75 | .modalias = "m25p80", |
| 76 | .platform_data = &rd88f6183ap_ge_spi_slave_data, |
| 77 | .irq = NO_IRQ, |
| 78 | .max_speed_hz = 20000000, |
| 79 | .bus_num = 0, |
| 80 | .chip_select = 0, |
| 81 | }, |
| 82 | }; |
| 83 | |
| 84 | static void __init rd88f6183ap_ge_init(void) |
| 85 | { |
| 86 | /* |
| 87 | * Setup basic Orion functions. Need to be called early. |
| 88 | */ |
| 89 | orion5x_init(); |
| 90 | |
| 91 | /* |
| 92 | * Configure peripherals. |
| 93 | */ |
| 94 | orion5x_ehci0_init(); |
| 95 | orion5x_eth_init(&rd88f6183ap_ge_eth_data); |
Lennert Buytenhek | e84665c | 2009-03-20 09:52:09 +0000 | [diff] [blame] | 96 | orion5x_eth_switch_init(&rd88f6183ap_ge_switch_plat_data, |
| 97 | gpio_to_irq(3)); |
Lennert Buytenhek | 0b0740c | 2008-08-29 06:59:34 +0200 | [diff] [blame] | 98 | spi_register_board_info(rd88f6183ap_ge_spi_slave_info, |
| 99 | ARRAY_SIZE(rd88f6183ap_ge_spi_slave_info)); |
| 100 | orion5x_spi_init(); |
| 101 | orion5x_uart0_init(); |
| 102 | } |
| 103 | |
| 104 | static struct hw_pci rd88f6183ap_ge_pci __initdata = { |
| 105 | .nr_controllers = 2, |
| 106 | .swizzle = pci_std_swizzle, |
| 107 | .setup = orion5x_pci_sys_setup, |
| 108 | .scan = orion5x_pci_sys_scan_bus, |
| 109 | .map_irq = orion5x_pci_map_irq, |
| 110 | }; |
| 111 | |
| 112 | static int __init rd88f6183ap_ge_pci_init(void) |
| 113 | { |
| 114 | if (machine_is_rd88f6183ap_ge()) { |
| 115 | orion5x_pci_disable(); |
| 116 | pci_common_init(&rd88f6183ap_ge_pci); |
| 117 | } |
| 118 | |
| 119 | return 0; |
| 120 | } |
| 121 | subsys_initcall(rd88f6183ap_ge_pci_init); |
| 122 | |
| 123 | MACHINE_START(RD88F6183AP_GE, "Marvell Orion-1-90 AP GE Reference Design") |
| 124 | /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */ |
Nicolas Pitre | 65aa1b1 | 2011-07-05 22:38:15 -0400 | [diff] [blame] | 125 | .atag_offset = 0x100, |
Lennert Buytenhek | 0b0740c | 2008-08-29 06:59:34 +0200 | [diff] [blame] | 126 | .init_machine = rd88f6183ap_ge_init, |
| 127 | .map_io = orion5x_map_io, |
Lennert Buytenhek | 4ee1f6b | 2010-10-15 16:50:26 +0200 | [diff] [blame] | 128 | .init_early = orion5x_init_early, |
Lennert Buytenhek | 0b0740c | 2008-08-29 06:59:34 +0200 | [diff] [blame] | 129 | .init_irq = orion5x_init_irq, |
| 130 | .timer = &orion5x_timer, |
| 131 | .fixup = tag_fixup_mem32, |
| 132 | MACHINE_END |