aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/mach-highlander/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/boards/mach-highlander/setup.c')
-rw-r--r--arch/sh/boards/mach-highlander/setup.c64
1 files changed, 60 insertions, 4 deletions
diff --git a/arch/sh/boards/mach-highlander/setup.c b/arch/sh/boards/mach-highlander/setup.c
index 20fe72c515d5..1639f8915000 100644
--- a/arch/sh/boards/mach-highlander/setup.c
+++ b/arch/sh/boards/mach-highlander/setup.c
@@ -17,8 +17,11 @@
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/ata_platform.h> 18#include <linux/ata_platform.h>
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/mtd/physmap.h>
20#include <linux/i2c.h> 21#include <linux/i2c.h>
21#include <linux/irq.h> 22#include <linux/irq.h>
23#include <linux/interrupt.h>
24#include <linux/usb/r8a66597.h>
22#include <net/ax88796.h> 25#include <net/ax88796.h>
23#include <asm/machvec.h> 26#include <asm/machvec.h>
24#include <mach/highlander.h> 27#include <mach/highlander.h>
@@ -27,18 +30,21 @@
27#include <asm/io.h> 30#include <asm/io.h>
28#include <asm/io_trapped.h> 31#include <asm/io_trapped.h>
29 32
33static struct r8a66597_platdata r8a66597_data = {
34 .xtal = R8A66597_PLATDATA_XTAL_12MHZ,
35 .vif = 1,
36};
37
30static struct resource r8a66597_usb_host_resources[] = { 38static struct resource r8a66597_usb_host_resources[] = {
31 [0] = { 39 [0] = {
32 .name = "r8a66597_hcd",
33 .start = 0xA4200000, 40 .start = 0xA4200000,
34 .end = 0xA42000FF, 41 .end = 0xA42000FF,
35 .flags = IORESOURCE_MEM, 42 .flags = IORESOURCE_MEM,
36 }, 43 },
37 [1] = { 44 [1] = {
38 .name = "r8a66597_hcd",
39 .start = IRQ_EXT1, /* irq number */ 45 .start = IRQ_EXT1, /* irq number */
40 .end = IRQ_EXT1, 46 .end = IRQ_EXT1,
41 .flags = IORESOURCE_IRQ, 47 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
42 }, 48 },
43}; 49};
44 50
@@ -48,6 +54,7 @@ static struct platform_device r8a66597_usb_host_device = {
48 .dev = { 54 .dev = {
49 .dma_mask = NULL, /* don't use dma */ 55 .dma_mask = NULL, /* don't use dma */
50 .coherent_dma_mask = 0xffffffff, 56 .coherent_dma_mask = 0xffffffff,
57 .platform_data = &r8a66597_data,
51 }, 58 },
52 .num_resources = ARRAY_SIZE(r8a66597_usb_host_resources), 59 .num_resources = ARRAY_SIZE(r8a66597_usb_host_resources),
53 .resource = r8a66597_usb_host_resources, 60 .resource = r8a66597_usb_host_resources,
@@ -178,6 +185,53 @@ static struct platform_device ax88796_device = {
178 .resource = ax88796_resources, 185 .resource = ax88796_resources,
179}; 186};
180 187
188static struct mtd_partition nor_flash_partitions[] = {
189 {
190 .name = "loader",
191 .offset = 0x00000000,
192 .size = 512 * 1024,
193 },
194 {
195 .name = "bootenv",
196 .offset = MTDPART_OFS_APPEND,
197 .size = 512 * 1024,
198 },
199 {
200 .name = "kernel",
201 .offset = MTDPART_OFS_APPEND,
202 .size = 4 * 1024 * 1024,
203 },
204 {
205 .name = "data",
206 .offset = MTDPART_OFS_APPEND,
207 .size = MTDPART_SIZ_FULL,
208 },
209};
210
211static struct physmap_flash_data nor_flash_data = {
212 .width = 4,
213 .parts = nor_flash_partitions,
214 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
215};
216
217/* This config is flash board for mass production. */
218static struct resource nor_flash_resources[] = {
219 [0] = {
220 .start = PA_NORFLASH_ADDR,
221 .end = PA_NORFLASH_ADDR + PA_NORFLASH_SIZE - 1,
222 .flags = IORESOURCE_MEM,
223 }
224};
225
226static struct platform_device nor_flash_device = {
227 .name = "physmap-flash",
228 .dev = {
229 .platform_data = &nor_flash_data,
230 },
231 .num_resources = ARRAY_SIZE(nor_flash_resources),
232 .resource = nor_flash_resources,
233};
234
181static struct resource smbus_resources[] = { 235static struct resource smbus_resources[] = {
182 [0] = { 236 [0] = {
183 .start = PA_SMCR, 237 .start = PA_SMCR,
@@ -209,6 +263,7 @@ static struct platform_device *r7780rp_devices[] __initdata = {
209 &m66592_usb_peripheral_device, 263 &m66592_usb_peripheral_device,
210 &heartbeat_device, 264 &heartbeat_device,
211 &smbus_device, 265 &smbus_device,
266 &nor_flash_device,
212#ifndef CONFIG_SH_R7780RP 267#ifndef CONFIG_SH_R7780RP
213 &ax88796_device, 268 &ax88796_device,
214#endif 269#endif
@@ -247,9 +302,10 @@ device_initcall(r7780rp_devices_setup);
247/* 302/*
248 * Platform specific clocks 303 * Platform specific clocks
249 */ 304 */
250static void ivdr_clk_enable(struct clk *clk) 305static int ivdr_clk_enable(struct clk *clk)
251{ 306{
252 ctrl_outw(ctrl_inw(PA_IVDRCTL) | (1 << IVDR_CK_ON), PA_IVDRCTL); 307 ctrl_outw(ctrl_inw(PA_IVDRCTL) | (1 << IVDR_CK_ON), PA_IVDRCTL);
308 return 0;
253} 309}
254 310
255static void ivdr_clk_disable(struct clk *clk) 311static void ivdr_clk_disable(struct clk *clk)