Path: blob/master/arch/arm/mach-kirkwood/sheevaplug-setup.c
10817 views
/*1* arch/arm/mach-kirkwood/sheevaplug-setup.c2*3* Marvell SheevaPlug Reference Board Setup4*5* This file is licensed under the terms of the GNU General Public6* License version 2. This program is licensed "as is" without any7* warranty of any kind, whether express or implied.8*/910#include <linux/kernel.h>11#include <linux/init.h>12#include <linux/platform_device.h>13#include <linux/ata_platform.h>14#include <linux/mtd/partitions.h>15#include <linux/mv643xx_eth.h>16#include <linux/gpio.h>17#include <linux/leds.h>18#include <asm/mach-types.h>19#include <asm/mach/arch.h>20#include <mach/kirkwood.h>21#include <plat/mvsdio.h>22#include "common.h"23#include "mpp.h"2425static struct mtd_partition sheevaplug_nand_parts[] = {26{27.name = "u-boot",28.offset = 0,29.size = SZ_1M30}, {31.name = "uImage",32.offset = MTDPART_OFS_NXTBLK,33.size = SZ_4M34}, {35.name = "root",36.offset = MTDPART_OFS_NXTBLK,37.size = MTDPART_SIZ_FULL38},39};4041static struct mv643xx_eth_platform_data sheevaplug_ge00_data = {42.phy_addr = MV643XX_ETH_PHY_ADDR(0),43};4445static struct mv_sata_platform_data sheeva_esata_sata_data = {46.n_ports = 2,47};4849static struct mvsdio_platform_data sheevaplug_mvsdio_data = {50/* unfortunately the CD signal has not been connected */51};5253static struct mvsdio_platform_data sheeva_esata_mvsdio_data = {54.gpio_write_protect = 44, /* MPP44 used as SD write protect */55.gpio_card_detect = 47, /* MPP47 used as SD card detect */56};5758static struct gpio_led sheevaplug_led_pins[] = {59{60.name = "plug:red:misc",61.default_trigger = "none",62.gpio = 46,63.active_low = 1,64},65{66.name = "plug:green:health",67.default_trigger = "default-on",68.gpio = 49,69.active_low = 1,70},71};7273static struct gpio_led_platform_data sheevaplug_led_data = {74.leds = sheevaplug_led_pins,75.num_leds = ARRAY_SIZE(sheevaplug_led_pins),76};7778static struct platform_device sheevaplug_leds = {79.name = "leds-gpio",80.id = -1,81.dev = {82.platform_data = &sheevaplug_led_data,83}84};8586static unsigned int sheevaplug_mpp_config[] __initdata = {87MPP29_GPIO, /* USB Power Enable */88MPP46_GPIO, /* LED Red */89MPP49_GPIO, /* LED */90091};9293static unsigned int sheeva_esata_mpp_config[] __initdata = {94MPP29_GPIO, /* USB Power Enable */95MPP44_GPIO, /* SD Write Protect */96MPP47_GPIO, /* SD Card Detect */97MPP49_GPIO, /* LED Green */98099};100101static void __init sheevaplug_init(void)102{103/*104* Basic setup. Needs to be called early.105*/106kirkwood_init();107108/* setup gpio pin select */109if (machine_is_sheeva_esata())110kirkwood_mpp_conf(sheeva_esata_mpp_config);111else112kirkwood_mpp_conf(sheevaplug_mpp_config);113114kirkwood_uart0_init();115kirkwood_nand_init(ARRAY_AND_SIZE(sheevaplug_nand_parts), 25);116117if (gpio_request(29, "USB Power Enable") != 0 ||118gpio_direction_output(29, 1) != 0)119printk(KERN_ERR "can't set up GPIO 29 (USB Power Enable)\n");120kirkwood_ehci_init();121122kirkwood_ge00_init(&sheevaplug_ge00_data);123124/* honor lower power consumption for plugs with out eSATA */125if (machine_is_sheeva_esata())126kirkwood_sata_init(&sheeva_esata_sata_data);127128/* enable sd wp and sd cd on plugs with esata */129if (machine_is_sheeva_esata())130kirkwood_sdio_init(&sheeva_esata_mvsdio_data);131else132kirkwood_sdio_init(&sheevaplug_mvsdio_data);133134platform_device_register(&sheevaplug_leds);135}136137#ifdef CONFIG_MACH_SHEEVAPLUG138MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board")139/* Maintainer: shadi Ammouri <[email protected]> */140.boot_params = 0x00000100,141.init_machine = sheevaplug_init,142.map_io = kirkwood_map_io,143.init_early = kirkwood_init_early,144.init_irq = kirkwood_init_irq,145.timer = &kirkwood_timer,146MACHINE_END147#endif148149#ifdef CONFIG_MACH_ESATA_SHEEVAPLUG150MACHINE_START(ESATA_SHEEVAPLUG, "Marvell eSATA SheevaPlug Reference Board")151.boot_params = 0x00000100,152.init_machine = sheevaplug_init,153.map_io = kirkwood_map_io,154.init_early = kirkwood_init_early,155.init_irq = kirkwood_init_irq,156.timer = &kirkwood_timer,157MACHINE_END158#endif159160161