2 * arch/arm/mach-kirkwood/sheevaplug-setup.c
4 * Marvell SheevaPlug Reference Board Setup
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.
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/platform_device.h>
14 #include <linux/mtd/nand.h>
15 #include <linux/mtd/partitions.h>
16 #include <linux/mv643xx_eth.h>
17 #include <linux/gpio.h>
18 #include <linux/leds.h>
19 #include <asm/mach-types.h>
20 #include <asm/mach/arch.h>
21 #include <mach/kirkwood.h>
22 #include <plat/mvsdio.h>
23 #include <plat/orion_nand.h>
27 static struct mtd_partition sheevaplug_nand_parts
[] = {
34 .offset
= MTDPART_OFS_NXTBLK
,
38 .offset
= MTDPART_OFS_NXTBLK
,
39 .size
= MTDPART_SIZ_FULL
43 static struct resource sheevaplug_nand_resource
= {
44 .flags
= IORESOURCE_MEM
,
45 .start
= KIRKWOOD_NAND_MEM_PHYS_BASE
,
46 .end
= KIRKWOOD_NAND_MEM_PHYS_BASE
+
47 KIRKWOOD_NAND_MEM_SIZE
- 1,
50 static struct orion_nand_data sheevaplug_nand_data
= {
51 .parts
= sheevaplug_nand_parts
,
52 .nr_parts
= ARRAY_SIZE(sheevaplug_nand_parts
),
59 static struct platform_device sheevaplug_nand_flash
= {
63 .platform_data
= &sheevaplug_nand_data
,
65 .resource
= &sheevaplug_nand_resource
,
69 static struct mv643xx_eth_platform_data sheevaplug_ge00_data
= {
70 .phy_addr
= MV643XX_ETH_PHY_ADDR(0),
73 static struct mvsdio_platform_data sheevaplug_mvsdio_data
= {
74 // unfortunately the CD signal has not been connected */
77 static struct gpio_led sheevaplug_led_pins
[] = {
79 .name
= "plug:green:health",
80 .default_trigger
= "default-on",
86 static struct gpio_led_platform_data sheevaplug_led_data
= {
87 .leds
= sheevaplug_led_pins
,
88 .num_leds
= ARRAY_SIZE(sheevaplug_led_pins
),
91 static struct platform_device sheevaplug_leds
= {
95 .platform_data
= &sheevaplug_led_data
,
99 static unsigned int sheevaplug_mpp_config
[] __initdata
= {
100 MPP29_GPIO
, /* USB Power Enable */
101 MPP49_GPIO
, /* LED */
105 static void __init
sheevaplug_init(void)
108 * Basic setup. Needs to be called early.
111 kirkwood_mpp_conf(sheevaplug_mpp_config
);
113 kirkwood_uart0_init();
115 if (gpio_request(29, "USB Power Enable") != 0 ||
116 gpio_direction_output(29, 1) != 0)
117 printk(KERN_ERR
"can't set up GPIO 29 (USB Power Enable)\n");
118 kirkwood_ehci_init();
120 kirkwood_ge00_init(&sheevaplug_ge00_data
);
121 kirkwood_sdio_init(&sheevaplug_mvsdio_data
);
123 platform_device_register(&sheevaplug_nand_flash
);
124 platform_device_register(&sheevaplug_leds
);
127 MACHINE_START(SHEEVAPLUG
, "Marvell SheevaPlug Reference Board")
128 /* Maintainer: shadi Ammouri <shadi@marvell.com> */
129 .phys_io
= KIRKWOOD_REGS_PHYS_BASE
,
130 .io_pg_offst
= ((KIRKWOOD_REGS_VIRT_BASE
) >> 18) & 0xfffc,
131 .boot_params
= 0x00000100,
132 .init_machine
= sheevaplug_init
,
133 .map_io
= kirkwood_map_io
,
134 .init_irq
= kirkwood_init_irq
,
135 .timer
= &kirkwood_timer
,