Path: blob/master/arch/arm/mach-kirkwood/dockstar-setup.c
10817 views
/*1* arch/arm/mach-kirkwood/dockstar-setup.c2*3* Seagate FreeAgent DockStar 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 dockstar_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 dockstar_ge00_data = {42.phy_addr = MV643XX_ETH_PHY_ADDR(0),43};4445static struct gpio_led dockstar_led_pins[] = {46{47.name = "dockstar:green:health",48.default_trigger = "default-on",49.gpio = 46,50.active_low = 1,51},52{53.name = "dockstar:orange:misc",54.default_trigger = "none",55.gpio = 47,56.active_low = 1,57},58};5960static struct gpio_led_platform_data dockstar_led_data = {61.leds = dockstar_led_pins,62.num_leds = ARRAY_SIZE(dockstar_led_pins),63};6465static struct platform_device dockstar_leds = {66.name = "leds-gpio",67.id = -1,68.dev = {69.platform_data = &dockstar_led_data,70}71};7273static unsigned int dockstar_mpp_config[] __initdata = {74MPP29_GPIO, /* USB Power Enable */75MPP46_GPIO, /* LED green */76MPP47_GPIO, /* LED orange */77078};7980static void __init dockstar_init(void)81{82/*83* Basic setup. Needs to be called early.84*/85kirkwood_init();8687/* setup gpio pin select */88kirkwood_mpp_conf(dockstar_mpp_config);8990kirkwood_uart0_init();91kirkwood_nand_init(ARRAY_AND_SIZE(dockstar_nand_parts), 25);9293if (gpio_request(29, "USB Power Enable") != 0 ||94gpio_direction_output(29, 1) != 0)95printk(KERN_ERR "can't set up GPIO 29 (USB Power Enable)\n");96kirkwood_ehci_init();9798kirkwood_ge00_init(&dockstar_ge00_data);99100platform_device_register(&dockstar_leds);101}102103MACHINE_START(DOCKSTAR, "Seagate FreeAgent DockStar")104.boot_params = 0x00000100,105.init_machine = dockstar_init,106.map_io = kirkwood_map_io,107.init_early = kirkwood_init_early,108.init_irq = kirkwood_init_irq,109.timer = &kirkwood_timer,110MACHINE_END111112113