diff options
Diffstat (limited to 'arch/sh/boards/se/7343/setup.c')
-rw-r--r-- | arch/sh/boards/se/7343/setup.c | 70 |
1 files changed, 64 insertions, 6 deletions
diff --git a/arch/sh/boards/se/7343/setup.c b/arch/sh/boards/se/7343/setup.c index c9431b3a051b..8ae718d6c710 100644 --- a/arch/sh/boards/se/7343/setup.c +++ b/arch/sh/boards/se/7343/setup.c | |||
@@ -1,10 +1,11 @@ | |||
1 | #include <linux/init.h> | 1 | #include <linux/init.h> |
2 | #include <linux/platform_device.h> | 2 | #include <linux/platform_device.h> |
3 | #include <linux/mtd/physmap.h> | ||
3 | #include <asm/machvec.h> | 4 | #include <asm/machvec.h> |
4 | #include <asm/mach/se7343.h> | 5 | #include <asm/mach/se7343.h> |
6 | #include <asm/heartbeat.h> | ||
5 | #include <asm/irq.h> | 7 | #include <asm/irq.h> |
6 | 8 | #include <asm/io.h> | |
7 | void init_7343se_IRQ(void); | ||
8 | 9 | ||
9 | static struct resource smc91x_resources[] = { | 10 | static struct resource smc91x_resources[] = { |
10 | [0] = { | 11 | [0] = { |
@@ -17,8 +18,8 @@ static struct resource smc91x_resources[] = { | |||
17 | * shared with other devices via externel | 18 | * shared with other devices via externel |
18 | * interrupt controller in FPGA... | 19 | * interrupt controller in FPGA... |
19 | */ | 20 | */ |
20 | .start = EXT_IRQ2, | 21 | .start = SMC_IRQ, |
21 | .end = EXT_IRQ2, | 22 | .end = SMC_IRQ, |
22 | .flags = IORESOURCE_IRQ, | 23 | .flags = IORESOURCE_IRQ, |
23 | }, | 24 | }, |
24 | }; | 25 | }; |
@@ -38,16 +39,65 @@ static struct resource heartbeat_resources[] = { | |||
38 | }, | 39 | }, |
39 | }; | 40 | }; |
40 | 41 | ||
42 | static struct heartbeat_data heartbeat_data = { | ||
43 | .regsize = 16, | ||
44 | }; | ||
45 | |||
41 | static struct platform_device heartbeat_device = { | 46 | static struct platform_device heartbeat_device = { |
42 | .name = "heartbeat", | 47 | .name = "heartbeat", |
43 | .id = -1, | 48 | .id = -1, |
49 | .dev = { | ||
50 | .platform_data = &heartbeat_data, | ||
51 | }, | ||
44 | .num_resources = ARRAY_SIZE(heartbeat_resources), | 52 | .num_resources = ARRAY_SIZE(heartbeat_resources), |
45 | .resource = heartbeat_resources, | 53 | .resource = heartbeat_resources, |
46 | }; | 54 | }; |
47 | 55 | ||
56 | static struct mtd_partition nor_flash_partitions[] = { | ||
57 | { | ||
58 | .name = "loader", | ||
59 | .offset = 0x00000000, | ||
60 | .size = 128 * 1024, | ||
61 | }, | ||
62 | { | ||
63 | .name = "rootfs", | ||
64 | .offset = MTDPART_OFS_APPEND, | ||
65 | .size = 31 * 1024 * 1024, | ||
66 | }, | ||
67 | { | ||
68 | .name = "data", | ||
69 | .offset = MTDPART_OFS_APPEND, | ||
70 | .size = MTDPART_SIZ_FULL, | ||
71 | }, | ||
72 | }; | ||
73 | |||
74 | static struct physmap_flash_data nor_flash_data = { | ||
75 | .width = 2, | ||
76 | .parts = nor_flash_partitions, | ||
77 | .nr_parts = ARRAY_SIZE(nor_flash_partitions), | ||
78 | }; | ||
79 | |||
80 | static struct resource nor_flash_resources[] = { | ||
81 | [0] = { | ||
82 | .start = 0x00000000, | ||
83 | .end = 0x01ffffff, | ||
84 | .flags = IORESOURCE_MEM, | ||
85 | } | ||
86 | }; | ||
87 | |||
88 | static struct platform_device nor_flash_device = { | ||
89 | .name = "physmap-flash", | ||
90 | .dev = { | ||
91 | .platform_data = &nor_flash_data, | ||
92 | }, | ||
93 | .num_resources = ARRAY_SIZE(nor_flash_resources), | ||
94 | .resource = nor_flash_resources, | ||
95 | }; | ||
96 | |||
48 | static struct platform_device *sh7343se_platform_devices[] __initdata = { | 97 | static struct platform_device *sh7343se_platform_devices[] __initdata = { |
49 | &smc91x_device, | 98 | &smc91x_device, |
50 | &heartbeat_device, | 99 | &heartbeat_device, |
100 | &nor_flash_device, | ||
51 | }; | 101 | }; |
52 | 102 | ||
53 | static int __init sh7343se_devices_setup(void) | 103 | static int __init sh7343se_devices_setup(void) |
@@ -55,10 +105,19 @@ static int __init sh7343se_devices_setup(void) | |||
55 | return platform_add_devices(sh7343se_platform_devices, | 105 | return platform_add_devices(sh7343se_platform_devices, |
56 | ARRAY_SIZE(sh7343se_platform_devices)); | 106 | ARRAY_SIZE(sh7343se_platform_devices)); |
57 | } | 107 | } |
108 | device_initcall(sh7343se_devices_setup); | ||
58 | 109 | ||
110 | /* | ||
111 | * Initialize the board | ||
112 | */ | ||
59 | static void __init sh7343se_setup(char **cmdline_p) | 113 | static void __init sh7343se_setup(char **cmdline_p) |
60 | { | 114 | { |
61 | device_initcall(sh7343se_devices_setup); | 115 | ctrl_outw(0xf900, FPGA_OUT); /* FPGA */ |
116 | |||
117 | ctrl_outw(0x0002, PORT_PECR); /* PORT E 1 = IRQ5 */ | ||
118 | ctrl_outw(0x0020, PORT_PSELD); | ||
119 | |||
120 | printk(KERN_INFO "MS7343CP01 Setup...done\n"); | ||
62 | } | 121 | } |
63 | 122 | ||
64 | /* | 123 | /* |
@@ -90,5 +149,4 @@ static struct sh_machine_vector mv_7343se __initmv = { | |||
90 | .mv_outsl = sh7343se_outsl, | 149 | .mv_outsl = sh7343se_outsl, |
91 | 150 | ||
92 | .mv_init_irq = init_7343se_IRQ, | 151 | .mv_init_irq = init_7343se_IRQ, |
93 | .mv_irq_demux = shmse_irq_demux, | ||
94 | }; | 152 | }; |