blob: 1d00df9ad4642eb7ce9661621fd3b8f5abe38365 [file] [log] [blame]
Lennert Buytenhek0b0740c2008-08-29 06:59:34 +02001/*
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 */
Russell King2f8163b2011-07-26 10:53:52 +010010#include <linux/gpio.h>
Lennert Buytenhek0b0740c2008-08-29 06:59:34 +020011#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 Buytenhekdcf1cec2008-09-25 16:23:48 +020022#include <net/dsa.h>
Lennert Buytenhek0b0740c2008-08-29 06:59:34 +020023#include <asm/mach-types.h>
Lennert Buytenhek0b0740c2008-08-29 06:59:34 +020024#include <asm/leds.h>
25#include <asm/mach/arch.h>
26#include <asm/mach/pci.h>
27#include <mach/orion5x.h>
28#include "common.h"
Lennert Buytenhek0b0740c2008-08-29 06:59:34 +020029
30static struct mv643xx_eth_platform_data rd88f6183ap_ge_eth_data = {
31 .phy_addr = -1,
32 .speed = SPEED_1000,
33 .duplex = DUPLEX_FULL,
34};
35
Lennert Buytenheke84665c2009-03-20 09:52:09 +000036static struct dsa_chip_data rd88f6183ap_ge_switch_chip_data = {
Lennert Buytenhekdcf1cec2008-09-25 16:23:48 +020037 .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
Lennert Buytenheke84665c2009-03-20 09:52:09 +000045static struct dsa_platform_data rd88f6183ap_ge_switch_plat_data = {
46 .nr_chips = 1,
47 .chip = &rd88f6183ap_ge_switch_chip_data,
48};
49
Lennert Buytenhek0b0740c2008-08-29 06:59:34 +020050static struct mtd_partition rd88f6183ap_ge_partitions[] = {
51 {
52 .name = "kernel",
53 .offset = 0x00000000,
54 .size = 0x00200000,
55 }, {
56 .name = "rootfs",
57 .offset = 0x00200000,
58 .size = 0x00500000,
59 }, {
60 .name = "nvram",
61 .offset = 0x00700000,
62 .size = 0x00080000,
63 },
64};
65
66static struct flash_platform_data rd88f6183ap_ge_spi_slave_data = {
67 .type = "m25p64",
68 .nr_parts = ARRAY_SIZE(rd88f6183ap_ge_partitions),
69 .parts = rd88f6183ap_ge_partitions,
70};
71
72static struct spi_board_info __initdata rd88f6183ap_ge_spi_slave_info[] = {
73 {
74 .modalias = "m25p80",
75 .platform_data = &rd88f6183ap_ge_spi_slave_data,
76 .irq = NO_IRQ,
77 .max_speed_hz = 20000000,
78 .bus_num = 0,
79 .chip_select = 0,
80 },
81};
82
83static void __init rd88f6183ap_ge_init(void)
84{
85 /*
86 * Setup basic Orion functions. Need to be called early.
87 */
88 orion5x_init();
89
90 /*
91 * Configure peripherals.
92 */
93 orion5x_ehci0_init();
94 orion5x_eth_init(&rd88f6183ap_ge_eth_data);
Lennert Buytenheke84665c2009-03-20 09:52:09 +000095 orion5x_eth_switch_init(&rd88f6183ap_ge_switch_plat_data,
96 gpio_to_irq(3));
Lennert Buytenhek0b0740c2008-08-29 06:59:34 +020097 spi_register_board_info(rd88f6183ap_ge_spi_slave_info,
98 ARRAY_SIZE(rd88f6183ap_ge_spi_slave_info));
99 orion5x_spi_init();
100 orion5x_uart0_init();
101}
102
103static struct hw_pci rd88f6183ap_ge_pci __initdata = {
104 .nr_controllers = 2,
105 .swizzle = pci_std_swizzle,
106 .setup = orion5x_pci_sys_setup,
107 .scan = orion5x_pci_sys_scan_bus,
108 .map_irq = orion5x_pci_map_irq,
109};
110
111static int __init rd88f6183ap_ge_pci_init(void)
112{
113 if (machine_is_rd88f6183ap_ge()) {
114 orion5x_pci_disable();
115 pci_common_init(&rd88f6183ap_ge_pci);
116 }
117
118 return 0;
119}
120subsys_initcall(rd88f6183ap_ge_pci_init);
121
122MACHINE_START(RD88F6183AP_GE, "Marvell Orion-1-90 AP GE Reference Design")
123 /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
Lennert Buytenhek0b0740c2008-08-29 06:59:34 +0200124 .boot_params = 0x00000100,
125 .init_machine = rd88f6183ap_ge_init,
126 .map_io = orion5x_map_io,
Lennert Buytenhek4ee1f6b2010-10-15 16:50:26 +0200127 .init_early = orion5x_init_early,
Lennert Buytenhek0b0740c2008-08-29 06:59:34 +0200128 .init_irq = orion5x_init_irq,
129 .timer = &orion5x_timer,
130 .fixup = tag_fixup_mem32,
131MACHINE_END