summaryrefslogtreecommitdiffstats
path: root/target/linux/ifxmips/files-2.6.33/arch/mips/ifxmips/danube/mach-easy50712.c
blob: 9a38377a924d34d4dd4416ca6d246bfc5e8bd543 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/leds.h>
#include <linux/gpio.h>
#include <linux/gpio_buttons.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h>
#include <linux/input.h>

#include <machine.h>
#include <ifxmips_prom.h>

#include "devices.h"

extern unsigned char ifxmips_ethaddr[6];

#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition easy50712_partitions[] =
{
	{
		.name	= "uboot",
		.offset	= 0x0,
		.size	= 0x40000,
	},
	{
		.name	= "uboot_env",
		.offset	= 0x40000,
		.size	= 0x10000,
	},
	{
		.name	= "kernel",
		.offset	= 0x0,
		.size	= 0x0,
	},
	{
		.name	= "rootfs",
		.offset	= 0x0,
		.size	= 0x0,
	}
};
#endif

static struct physmap_flash_data easy50712_flash_data = {
#ifdef CONFIG_MTD_PARTITIONS
	.nr_parts	= ARRAY_SIZE(easy50712_partitions),
	.parts		= easy50712_partitions,
#endif
};

static struct gpio_led easy50712_leds[] = {
	{ .name = "ifx:green:test0", .gpio = 0,},
	{ .name = "ifx:green:test1", .gpio = 1,},
	{ .name = "ifx:green:test2", .gpio = 2,},
	{ .name = "ifx:green:test3", .gpio = 3,},
};

static void __init
easy50712_init(void)
{
	ifxmips_register_gpio();

	//printk("ifxmips_register_gpio_dev\n");
	//ifxmips_register_gpio_dev();

	ifxmips_register_mtd(&easy50712_flash_data);

	ifxmips_register_leds(easy50712_leds, ARRAY_SIZE(easy50712_leds));

	ifxmips_register_wdt();

	danube_register_ethernet(ifxmips_ethaddr);

	danube_register_usb();
}

MIPS_MACHINE(IFXMIPS_MACH_EASY50712,
			"EASY50712",
			"Lantiq Eval Board",
			easy50712_init);