blob: 726ff6798a5630cee92197bab18bfde4202ee737 [file] [log] [blame]
wanzongshun7ec80dd2008-12-03 03:55:38 +01001/*
2 * linux/arch/arm/mach-w90x900/mach-w90p910evb.c
3 *
4 * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche
5 *
6 * Copyright (C) 2008 Nuvoton technology corporation
7 * All rights reserved.
8 *
9 * Wan ZongShun <mcuos.com@gmail.com>
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of
14 * the License, or (at your option) any later version.
15 *
16 */
17
18#include <linux/kernel.h>
19#include <linux/types.h>
20#include <linux/interrupt.h>
21#include <linux/list.h>
22#include <linux/timer.h>
23#include <linux/init.h>
24#include <linux/platform_device.h>
wanzongshuna12370f2009-02-12 02:57:21 +010025#include <linux/mtd/physmap.h>
wanzongshun7ec80dd2008-12-03 03:55:38 +010026
27#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29#include <asm/mach/irq.h>
30#include <asm/mach-types.h>
31
32#include <mach/regs-serial.h>
Russell Kingd672d2f2009-01-10 11:34:39 +000033#include <mach/map.h>
wanzongshun7ec80dd2008-12-03 03:55:38 +010034
35#include "cpu.h"
wanzongshuna12370f2009-02-12 02:57:21 +010036/*w90p910 evb norflash driver data */
37
38#define W90P910_FLASH_BASE 0xA0000000
39#define W90P910_FLASH_SIZE 0x400000
40
41static struct mtd_partition w90p910_flash_partitions[] = {
42 {
43 .name = "NOR Partition 1 for kernel (960K)",
44 .size = 0xF0000,
45 .offset = 0x10000,
46 },
47 {
48 .name = "NOR Partition 2 for image (1M)",
49 .size = 0x100000,
50 .offset = 0x100000,
51 },
52 {
53 .name = "NOR Partition 3 for user (2M)",
54 .size = 0x200000,
55 .offset = 0x00200000,
56 }
57};
58
59static struct physmap_flash_data w90p910_flash_data = {
60 .width = 2,
61 .parts = w90p910_flash_partitions,
62 .nr_parts = ARRAY_SIZE(w90p910_flash_partitions),
63};
64
65static struct resource w90p910_flash_resources[] = {
66 {
67 .start = W90P910_FLASH_BASE,
68 .end = W90P910_FLASH_BASE + W90P910_FLASH_SIZE - 1,
69 .flags = IORESOURCE_MEM,
70 }
71};
72
73static struct platform_device w90p910_flash_device = {
74 .name = "physmap-flash",
75 .id = 0,
76 .dev = {
77 .platform_data = &w90p910_flash_data,
78 },
79 .resource = w90p910_flash_resources,
80 .num_resources = ARRAY_SIZE(w90p910_flash_resources),
81};
wanzongshun7ec80dd2008-12-03 03:55:38 +010082
83static struct map_desc w90p910_iodesc[] __initdata = {
84};
85
wanzongshun7ec80dd2008-12-03 03:55:38 +010086/*Here should be your evb resourse,such as LCD*/
87
88static struct platform_device *w90p910evb_dev[] __initdata = {
wanzongshun17198f22009-02-04 05:01:38 +010089 &w90p910_serial_device,
wanzongshuna12370f2009-02-12 02:57:21 +010090 &w90p910_flash_device,
wanzongshun7ec80dd2008-12-03 03:55:38 +010091};
92
93static void __init w90p910evb_map_io(void)
94{
95 w90p910_map_io(w90p910_iodesc, ARRAY_SIZE(w90p910_iodesc));
96 w90p910_init_clocks(0);
wanzongshun7ec80dd2008-12-03 03:55:38 +010097}
98
99static void __init w90p910evb_init(void)
100{
101 platform_add_devices(w90p910evb_dev, ARRAY_SIZE(w90p910evb_dev));
102}
103
104MACHINE_START(W90P910EVB, "W90P910EVB")
105 /* Maintainer: Wan ZongShun */
106 .phys_io = W90X900_PA_UART,
107 .io_pg_offst = (((u32)W90X900_VA_UART) >> 18) & 0xfffc,
108 .boot_params = 0,
109 .map_io = w90p910evb_map_io,
110 .init_irq = w90x900_init_irq,
111 .init_machine = w90p910evb_init,
112 .timer = &w90x900_timer,
113MACHINE_END