linux-3.1/dns320l-setup.c
author andy
Mon, 09 Sep 2013 20:39:42 +0200
changeset 4 1b9d05c730cb
permissions -rw-r--r--
Move Linux 3.1 specific patches to Linux 3.1 subdir
Add Linux 3.11 specific patches
4
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
     1
/*
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
     2
 * arch/arm/mach-kirkwood/dns320l-setup.c
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
     3
 *
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
     4
 * D-Link DNS-320L Setup File
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
     5
 *
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
     6
 * This file is licensed under the terms of the GNU General Public
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
     7
 * License version 2.  This program is licensed "as is" without any
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
     8
 * warranty of any kind, whether express or implied.
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
     9
 */
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    10
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    11
#include <linux/kernel.h>
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    12
#include <linux/init.h>
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    13
#include <linux/platform_device.h>
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    14
#include <linux/ata_platform.h>
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    15
#include <linux/mtd/partitions.h>
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    16
#include <linux/mv643xx_eth.h>
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    17
#include <linux/gpio.h>
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    18
#include <linux/leds.h>
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    19
#include <asm/mach-types.h>
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    20
#include <asm/mach/arch.h>
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    21
#include <mach/kirkwood.h>
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    22
#include "common.h"
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    23
#include "mpp.h"
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    24
#include <linux/sysfs.h>
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    25
#include <linux/kobject.h>
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    26
#include <linux/mtd/nand.h>
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    27
#include <linux/i2c.h>
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    28
#include <linux/gpio_keys.h>
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    29
#include <linux/gpio-fan.h>
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    30
#include <linux/input.h>
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    31
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    32
#define DNS320L_GPIO_LED_SATA1_BLUE     20
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    33
#define DNS320L_GPIO_LED_SATA0_BLUE     21
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    34
#define DNS320L_GPIO_LED_SATA1_RED      22
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    35
#define DNS320L_GPIO_LED_SATA0_RED      23
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    36
#define DNS320L_GPIO_POWER_SATA         24
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    37
#define DNS320L_GPIO_LED_USB_BLUE       25
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    38
#define DNS320L_GPIO_LED_USB_ORANGE     26
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    39
#define DNS320L_GPIO_BUTTON_USB         27
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    40
#define DNS320L_GPIO_BUTTON_RESET       28
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    41
#define DNS320L_GPIO_BUTTON_POWER       29
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    42
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    43
static struct mtd_partition dns320l_nand_parts[] = {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    44
	{
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    45
		.name = "u-boot",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    46
		.offset = 0,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    47
		.size = SZ_1M
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    48
	}, {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    49
		.name = "uImage",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    50
		.offset = MTDPART_OFS_NXTBLK,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    51
		.size = 5 * SZ_1M
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    52
	}, {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    53
		.name = "ramdisk",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    54
		.offset = MTDPART_OFS_NXTBLK,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    55
		.size = 5 * SZ_1M
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    56
	}, {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    57
		.name = "image",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    58
		.offset = MTDPART_OFS_NXTBLK,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    59
		.size = 100 * SZ_1M
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    60
	}, {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    61
	    .name = "rescue firmware",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    62
	    .offset = MTDPART_OFS_NXTBLK,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    63
	    .size = 10 * SZ_1M
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    64
	}, {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    65
	    .name = "config",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    66
	    .offset = MTDPART_OFS_NXTBLK,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    67
	    .size = 5 * SZ_1M
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    68
	}, {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    69
	    .name = "my-dlink",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    70
	    .offset = MTDPART_OFS_NXTBLK,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    71
	    .size = 2 * SZ_1M
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    72
	},
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    73
};
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    74
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    75
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    76
static struct mv643xx_eth_platform_data dns320l_ge00_data = {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    77
	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    78
};
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    79
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    80
static struct mv_sata_platform_data dns320l_sata_data = {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    81
	.n_ports	= 2,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    82
};
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    83
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    84
static void __init dns320l_gpio_register(unsigned gpio, char *name, int def)
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    85
{
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    86
	if (gpio_request(gpio, name) == 0 &&
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    87
	    gpio_direction_output(gpio, 0) == 0) {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    88
		gpio_set_value(gpio, def);
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    89
		if (gpio_export(gpio, 0) != 0)
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    90
			pr_err("dns320l: Failed to export GPIO %s\n", name);
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    91
	} else
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    92
		pr_err("dns320l: Failed to register %s\n", name);
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    93
}
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    94
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    95
/*****************************************************************************
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    96
 * Buttons
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    97
 ****************************************************************************/
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    98
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
    99
static struct gpio_keys_button dns320l_button_pins[] = {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   100
	{
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   101
		.code		= KEY_COPY,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   102
		.type       = EV_KEY,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   103
		.gpio		= DNS320L_GPIO_BUTTON_USB,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   104
		.desc		= "USB Copy button",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   105
		.active_low	= 1,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   106
		.debounce_interval = 1000,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   107
	},
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   108
	{ // This button does not (yet) work...
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   109
	    .code       = KEY_POWER,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   110
        .type       = EV_KEY,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   111
	    .gpio       = DNS320L_GPIO_BUTTON_POWER,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   112
	    .desc       = "Power Button",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   113
        .active_low = 1,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   114
        .debounce_interval = 1000,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   115
	},
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   116
	{
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   117
	    .code       = KEY_OPTION,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   118
	    .type       = EV_KEY,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   119
	    .gpio       = DNS320L_GPIO_BUTTON_RESET,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   120
	    .desc       = "Reset Button",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   121
	    .active_low = 1,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   122
	    .debounce_interval = 1000,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   123
	},
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   124
};
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   125
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   126
static struct gpio_keys_platform_data dns320l_button_data = {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   127
	.buttons	= dns320l_button_pins,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   128
	.nbuttons	= ARRAY_SIZE(dns320l_button_pins),
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   129
};
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   130
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   131
static struct platform_device dns320l_button_device = {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   132
	.name		= "gpio-keys",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   133
	.id		= -1,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   134
	.dev		= {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   135
		.platform_data	= &dns320l_button_data,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   136
	}
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   137
};
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   138
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   139
/*****************************************************************************
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   140
 * LEDs
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   141
 ****************************************************************************/
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   142
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   143
static struct gpio_led dns320l_led_pins[] = {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   144
	{
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   145
		.name	= "dns320l:blue:usb",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   146
		.gpio	= DNS320L_GPIO_LED_USB_BLUE,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   147
		.default_trigger = "default-on",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   148
	},
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   149
	{
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   150
		.name	= "dns320l:orange:usb",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   151
		.gpio	= DNS320L_GPIO_LED_USB_ORANGE,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   152
	},
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   153
	{
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   154
	    .name   = "dns320l:blue:sata0",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   155
	    .gpio   = DNS320L_GPIO_LED_SATA0_BLUE,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   156
	    .default_trigger = "ide-disk"
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   157
	},
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   158
	{
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   159
	    .name   = "dns320l:blue:sata1",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   160
	    .gpio   = DNS320L_GPIO_LED_SATA1_BLUE,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   161
	    .default_trigger = "ide-disk"
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   162
	},
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   163
	{
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   164
	    .name   = "dns320l:red:sata0",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   165
	    .gpio   = DNS320L_GPIO_LED_SATA0_RED,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   166
	},
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   167
	{
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   168
	    .name   = "dns320l:red:sata1",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   169
	    .gpio   = DNS320L_GPIO_LED_SATA1_RED,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   170
	},
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   171
};
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   172
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   173
static struct gpio_led_platform_data dns320l_led_data = {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   174
	.num_leds	= ARRAY_SIZE(dns320l_led_pins),
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   175
	.leds		= dns320l_led_pins,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   176
};
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   177
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   178
static struct platform_device dns320l_led_device = {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   179
	.name		= "leds-gpio",
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   180
	.id		= -1,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   181
	.dev		= {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   182
		.platform_data	= &dns320l_led_data,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   183
	},
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   184
};
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   185
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   186
/*****************************************************************************
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   187
 * Fan
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   188
 ****************************************************************************/
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   189
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   190
static unsigned int dns320l_mpp_config[] __initdata = {
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   191
    MPP13_UART1_TXD,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   192
	MPP14_UART1_RXD,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   193
	MPP20_GPIO,    // SATA LED BLUE
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   194
	MPP21_GPIO,    // SATA LED BLUE
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   195
	MPP22_GPIO,    // SATA LED RED
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   196
	MPP23_GPIO,    // SATA LED RED
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   197
	MPP24_GPIO,    // SATA Power
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   198
	MPP25_GPIO,    // USB LED Blue
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   199
	MPP26_GPIO,	   // USB LED Orange
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   200
	MPP27_GPIO,	   // Button USB Copy
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   201
	MPP28_GPIO,	   // Button Reset
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   202
	MPP29_GPIO,	   // Button Power
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   203
	MPP30_GPIO,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   204
	MPP31_GPIO,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   205
	MPP32_GPIO,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   206
	MPP33_GPO,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   207
	MPP34_GPIO,	
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   208
	MPP35_GPIO,	
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   209
	MPP36_GPIO,	
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   210
	MPP37_GPIO,	
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   211
	MPP38_GPIO,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   212
	MPP39_GPIO,	
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   213
	MPP40_GPIO,	
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   214
	MPP41_GPIO,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   215
	MPP42_GPIO,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   216
	MPP43_GPIO,	
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   217
	MPP44_GPIO,	
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   218
	MPP45_GPIO,	
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   219
	MPP46_GPIO,	
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   220
	MPP47_GPIO,	
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   221
	MPP48_GPIO,	
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   222
	MPP49_GPIO,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   223
	0
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   224
};
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   225
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   226
static void __init dns320l_init(void)
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   227
{
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   228
    /*
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   229
     * Basic setup. Needs to be called early.
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   230
     */
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   231
    
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   232
    kirkwood_init();
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   233
    /* setup gpio pin select */
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   234
    kirkwood_mpp_conf(dns320l_mpp_config);
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   235
    kirkwood_uart0_init();
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   236
    kirkwood_uart1_init();
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   237
    kirkwood_nand_init(ARRAY_AND_SIZE(dns320l_nand_parts), 40);
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   238
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   239
    kirkwood_ehci_init();
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   240
    kirkwood_i2c_init();
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   241
    kirkwood_ge00_init(&dns320l_ge00_data);
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   242
    platform_device_register(&dns320l_led_device);
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   243
	dns320l_gpio_register(DNS320L_GPIO_POWER_SATA, "dns320l:power:sata", 1);
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   244
    kirkwood_sata_init(&dns320l_sata_data);
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   245
    
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   246
    platform_device_register(&dns320l_button_device);
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   247
}
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   248
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   249
MACHINE_START(DNS320L, "DNS-320L")
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   250
	/* Maintainer: Andreas Boehler <andreas@aboehler.at> */
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   251
	.boot_params	= 0x00000100,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   252
	.init_machine	= dns320l_init,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   253
	.map_io		= kirkwood_map_io,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   254
	.init_early	= kirkwood_init_early,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   255
	.init_irq	= kirkwood_init_irq,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   256
	.timer		= &kirkwood_timer,
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   257
MACHINE_END
1b9d05c730cb Move Linux 3.1 specific patches to Linux 3.1 subdir
andy
parents:
diff changeset
   258