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