dns320l-setup.c
changeset 4 1b9d05c730cb
parent 3 f2f1be1cc4ba
child 5 bca986acd412
--- a/dns320l-setup.c	Fri Sep 06 15:28:49 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,258 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/dns320l-setup.c
- *
- * D-Link DNS-320L Setup File
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/gpio.h>
-#include <linux/leds.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <mach/kirkwood.h>
-#include "common.h"
-#include "mpp.h"
-#include <linux/sysfs.h>
-#include <linux/kobject.h>
-#include <linux/mtd/nand.h>
-#include <linux/i2c.h>
-#include <linux/gpio_keys.h>
-#include <linux/gpio-fan.h>
-#include <linux/input.h>
-
-#define DNS320L_GPIO_LED_SATA1_BLUE     20
-#define DNS320L_GPIO_LED_SATA0_BLUE     21
-#define DNS320L_GPIO_LED_SATA1_RED      22
-#define DNS320L_GPIO_LED_SATA0_RED      23
-#define DNS320L_GPIO_POWER_SATA         24
-#define DNS320L_GPIO_LED_USB_BLUE       25
-#define DNS320L_GPIO_LED_USB_ORANGE     26
-#define DNS320L_GPIO_BUTTON_USB         27
-#define DNS320L_GPIO_BUTTON_RESET       28
-#define DNS320L_GPIO_BUTTON_POWER       29
-
-static struct mtd_partition dns320l_nand_parts[] = {
-	{
-		.name = "u-boot",
-		.offset = 0,
-		.size = SZ_1M
-	}, {
-		.name = "uImage",
-		.offset = MTDPART_OFS_NXTBLK,
-		.size = 5 * SZ_1M
-	}, {
-		.name = "ramdisk",
-		.offset = MTDPART_OFS_NXTBLK,
-		.size = 5 * SZ_1M
-	}, {
-		.name = "image",
-		.offset = MTDPART_OFS_NXTBLK,
-		.size = 100 * SZ_1M
-	}, {
-	    .name = "rescue firmware",
-	    .offset = MTDPART_OFS_NXTBLK,
-	    .size = 10 * SZ_1M
-	}, {
-	    .name = "config",
-	    .offset = MTDPART_OFS_NXTBLK,
-	    .size = 5 * SZ_1M
-	}, {
-	    .name = "my-dlink",
-	    .offset = MTDPART_OFS_NXTBLK,
-	    .size = 2 * SZ_1M
-	},
-};
-
-
-static struct mv643xx_eth_platform_data dns320l_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct mv_sata_platform_data dns320l_sata_data = {
-	.n_ports	= 2,
-};
-
-static void __init dns320l_gpio_register(unsigned gpio, char *name, int def)
-{
-	if (gpio_request(gpio, name) == 0 &&
-	    gpio_direction_output(gpio, 0) == 0) {
-		gpio_set_value(gpio, def);
-		if (gpio_export(gpio, 0) != 0)
-			pr_err("dns320l: Failed to export GPIO %s\n", name);
-	} else
-		pr_err("dns320l: Failed to register %s\n", name);
-}
-
-/*****************************************************************************
- * Buttons
- ****************************************************************************/
-
-static struct gpio_keys_button dns320l_button_pins[] = {
-	{
-		.code		= KEY_COPY,
-		.type       = EV_KEY,
-		.gpio		= DNS320L_GPIO_BUTTON_USB,
-		.desc		= "USB Copy button",
-		.active_low	= 1,
-		.debounce_interval = 1000,
-	},
-	{ // This button does not (yet) work...
-	    .code       = KEY_POWER,
-        .type       = EV_KEY,
-	    .gpio       = DNS320L_GPIO_BUTTON_POWER,
-	    .desc       = "Power Button",
-        .active_low = 1,
-        .debounce_interval = 1000,
-	},
-	{
-	    .code       = KEY_OPTION,
-	    .type       = EV_KEY,
-	    .gpio       = DNS320L_GPIO_BUTTON_RESET,
-	    .desc       = "Reset Button",
-	    .active_low = 1,
-	    .debounce_interval = 1000,
-	},
-};
-
-static struct gpio_keys_platform_data dns320l_button_data = {
-	.buttons	= dns320l_button_pins,
-	.nbuttons	= ARRAY_SIZE(dns320l_button_pins),
-};
-
-static struct platform_device dns320l_button_device = {
-	.name		= "gpio-keys",
-	.id		= -1,
-	.dev		= {
-		.platform_data	= &dns320l_button_data,
-	}
-};
-
-/*****************************************************************************
- * LEDs
- ****************************************************************************/
-
-static struct gpio_led dns320l_led_pins[] = {
-	{
-		.name	= "dns320l:blue:usb",
-		.gpio	= DNS320L_GPIO_LED_USB_BLUE,
-		.default_trigger = "default-on",
-	},
-	{
-		.name	= "dns320l:orange:usb",
-		.gpio	= DNS320L_GPIO_LED_USB_ORANGE,
-	},
-	{
-	    .name   = "dns320l:blue:sata0",
-	    .gpio   = DNS320L_GPIO_LED_SATA0_BLUE,
-	    .default_trigger = "ide-disk"
-	},
-	{
-	    .name   = "dns320l:blue:sata1",
-	    .gpio   = DNS320L_GPIO_LED_SATA1_BLUE,
-	    .default_trigger = "ide-disk"
-	},
-	{
-	    .name   = "dns320l:red:sata0",
-	    .gpio   = DNS320L_GPIO_LED_SATA0_RED,
-	},
-	{
-	    .name   = "dns320l:red:sata1",
-	    .gpio   = DNS320L_GPIO_LED_SATA1_RED,
-	},
-};
-
-static struct gpio_led_platform_data dns320l_led_data = {
-	.num_leds	= ARRAY_SIZE(dns320l_led_pins),
-	.leds		= dns320l_led_pins,
-};
-
-static struct platform_device dns320l_led_device = {
-	.name		= "leds-gpio",
-	.id		= -1,
-	.dev		= {
-		.platform_data	= &dns320l_led_data,
-	},
-};
-
-/*****************************************************************************
- * Fan
- ****************************************************************************/
-
-static unsigned int dns320l_mpp_config[] __initdata = {
-    MPP13_UART1_TXD,
-	MPP14_UART1_RXD,
-	MPP20_GPIO,    // SATA LED BLUE
-	MPP21_GPIO,    // SATA LED BLUE
-	MPP22_GPIO,    // SATA LED RED
-	MPP23_GPIO,    // SATA LED RED
-	MPP24_GPIO,    // SATA Power
-	MPP25_GPIO,    // USB LED Blue
-	MPP26_GPIO,	   // USB LED Orange
-	MPP27_GPIO,	   // Button USB Copy
-	MPP28_GPIO,	   // Button Reset
-	MPP29_GPIO,	   // Button Power
-	MPP30_GPIO,
-	MPP31_GPIO,
-	MPP32_GPIO,
-	MPP33_GPO,
-	MPP34_GPIO,	
-	MPP35_GPIO,	
-	MPP36_GPIO,	
-	MPP37_GPIO,	
-	MPP38_GPIO,
-	MPP39_GPIO,	
-	MPP40_GPIO,	
-	MPP41_GPIO,
-	MPP42_GPIO,
-	MPP43_GPIO,	
-	MPP44_GPIO,	
-	MPP45_GPIO,	
-	MPP46_GPIO,	
-	MPP47_GPIO,	
-	MPP48_GPIO,	
-	MPP49_GPIO,
-	0
-};
-
-static void __init dns320l_init(void)
-{
-    /*
-     * Basic setup. Needs to be called early.
-     */
-    
-    kirkwood_init();
-    /* setup gpio pin select */
-    kirkwood_mpp_conf(dns320l_mpp_config);
-    kirkwood_uart0_init();
-    kirkwood_uart1_init();
-    kirkwood_nand_init(ARRAY_AND_SIZE(dns320l_nand_parts), 40);
-
-    kirkwood_ehci_init();
-    kirkwood_i2c_init();
-    kirkwood_ge00_init(&dns320l_ge00_data);
-    platform_device_register(&dns320l_led_device);
-	dns320l_gpio_register(DNS320L_GPIO_POWER_SATA, "dns320l:power:sata", 1);
-    kirkwood_sata_init(&dns320l_sata_data);
-    
-    platform_device_register(&dns320l_button_device);
-}
-
-MACHINE_START(DNS320L, "DNS-320L")
-	/* Maintainer: Andreas Boehler <andreas@aboehler.at> */
-	.boot_params	= 0x00000100,
-	.init_machine	= dns320l_init,
-	.map_io		= kirkwood_map_io,
-	.init_early	= kirkwood_init_early,
-	.init_irq	= kirkwood_init_irq,
-	.timer		= &kirkwood_timer,
-MACHINE_END
-