2 * SH-2007 board support.
4 * Copyright (C) 2003, 2004 SUGIOKA Toshinobu
7 #include <linux/init.h>
9 #include <linux/regulator/fixed.h>
10 #include <linux/regulator/machine.h>
11 #include <linux/smsc911x.h>
12 #include <linux/platform_device.h>
13 #include <linux/ata_platform.h>
15 #include <asm/machvec.h>
16 #include <mach/sh2007.h>
18 /* Dummy supplies, where voltage doesn't matter */
19 static struct regulator_consumer_supply dummy_supplies[] = {
20 REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
21 REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
22 REGULATOR_SUPPLY("vddvario", "smsc911x.1"),
23 REGULATOR_SUPPLY("vdd33a", "smsc911x.1"),
26 struct smsc911x_platform_config smc911x_info = {
27 .flags = SMSC911X_USE_32BIT,
28 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
29 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
32 static struct resource smsc9118_0_resources[] = {
35 .end = SMC0_BASE + 0xff,
36 .flags = IORESOURCE_MEM,
39 .start = evt2irq(0x240),
40 .end = evt2irq(0x240),
41 .flags = IORESOURCE_IRQ,
45 static struct resource smsc9118_1_resources[] = {
48 .end = SMC1_BASE + 0xff,
49 .flags = IORESOURCE_MEM,
52 .start = evt2irq(0x280),
53 .end = evt2irq(0x280),
54 .flags = IORESOURCE_IRQ,
58 static struct platform_device smsc9118_0_device = {
61 .num_resources = ARRAY_SIZE(smsc9118_0_resources),
62 .resource = smsc9118_0_resources,
64 .platform_data = &smc911x_info,
68 static struct platform_device smsc9118_1_device = {
71 .num_resources = ARRAY_SIZE(smsc9118_1_resources),
72 .resource = smsc9118_1_resources,
74 .platform_data = &smc911x_info,
78 static struct resource cf_resources[] = {
80 .start = CF_BASE + CF_OFFSET,
81 .end = CF_BASE + CF_OFFSET + 0x0f,
82 .flags = IORESOURCE_MEM,
85 .start = CF_BASE + CF_OFFSET + 0x206,
86 .end = CF_BASE + CF_OFFSET + 0x20f,
87 .flags = IORESOURCE_MEM,
90 .start = evt2irq(0x2c0),
91 .end = evt2irq(0x2c0),
92 .flags = IORESOURCE_IRQ,
96 static struct platform_device cf_device = {
97 .name = "pata_platform",
99 .num_resources = ARRAY_SIZE(cf_resources),
100 .resource = cf_resources,
103 static struct platform_device *sh2007_devices[] __initdata = {
109 static int __init sh2007_io_init(void)
111 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
113 platform_add_devices(sh2007_devices, ARRAY_SIZE(sh2007_devices));
116 subsys_initcall(sh2007_io_init);
118 static void __init sh2007_init_irq(void)
120 plat_irq_setup_pins(IRQ_MODE_IRQ);
124 * Initialize the board
126 static void __init sh2007_setup(char **cmdline_p)
128 printk(KERN_INFO "SH-2007 Setup...");
130 /* setup wait control registers for area 5 */
131 __raw_writel(CS5BCR_D, CS5BCR);
132 __raw_writel(CS5WCR_D, CS5WCR);
133 __raw_writel(CS5PCR_D, CS5PCR);
135 printk(KERN_INFO " done.\n");
141 struct sh_machine_vector mv_sh2007 __initmv = {
142 .mv_setup = sh2007_setup,
144 .mv_init_irq = sh2007_init_irq,