blob: e411039ea59e3f2911513ca4353c8b9ce87312ac [file] [log] [blame]
Eric Miao01215e32009-03-20 13:33:49 +08001/*
2 * linux/arch/arm/mach-mmp/ttc_dkb.c
3 *
4 * Support for the Marvell PXA910-based TTC_DKB Development Platform.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * publishhed by the Free Software Foundation.
9 */
10
11#include <linux/init.h>
12#include <linux/kernel.h>
13#include <linux/platform_device.h>
Haojian Zhuangd6587c32009-09-23 01:57:35 +080014#include <linux/mtd/mtd.h>
15#include <linux/mtd/partitions.h>
16#include <linux/mtd/onenand.h>
Haojian Zhuang0bd86962010-09-08 09:42:42 -040017#include <linux/interrupt.h>
Eric Miao01215e32009-03-20 13:33:49 +080018
19#include <asm/mach-types.h>
20#include <asm/mach/arch.h>
Haojian Zhuangd6587c32009-09-23 01:57:35 +080021#include <asm/mach/flash.h>
Eric Miao01215e32009-03-20 13:33:49 +080022#include <mach/addr-map.h>
23#include <mach/mfp-pxa910.h>
24#include <mach/pxa910.h>
25
26#include "common.h"
27
Haojian Zhuang0bd86962010-09-08 09:42:42 -040028#define TTCDKB_NR_IRQS (IRQ_BOARD_START + 24)
29
Eric Miao01215e32009-03-20 13:33:49 +080030static unsigned long ttc_dkb_pin_config[] __initdata = {
31 /* UART2 */
32 GPIO47_UART2_RXD,
33 GPIO48_UART2_TXD,
Haojian Zhuangd6587c32009-09-23 01:57:35 +080034
35 /* DFI */
36 DF_IO0_ND_IO0,
37 DF_IO1_ND_IO1,
38 DF_IO2_ND_IO2,
39 DF_IO3_ND_IO3,
40 DF_IO4_ND_IO4,
41 DF_IO5_ND_IO5,
42 DF_IO6_ND_IO6,
43 DF_IO7_ND_IO7,
44 DF_IO8_ND_IO8,
45 DF_IO9_ND_IO9,
46 DF_IO10_ND_IO10,
47 DF_IO11_ND_IO11,
48 DF_IO12_ND_IO12,
49 DF_IO13_ND_IO13,
50 DF_IO14_ND_IO14,
51 DF_IO15_ND_IO15,
52 DF_nCS0_SM_nCS2_nCS0,
53 DF_ALE_SM_WEn_ND_ALE,
54 DF_CLE_SM_OEn_ND_CLE,
55 DF_WEn_DF_WEn,
56 DF_REn_DF_REn,
57 DF_RDY0_DF_RDY0,
58};
59
60static struct mtd_partition ttc_dkb_onenand_partitions[] = {
61 {
62 .name = "bootloader",
63 .offset = 0,
64 .size = SZ_1M,
65 .mask_flags = MTD_WRITEABLE,
66 }, {
67 .name = "reserved",
68 .offset = MTDPART_OFS_APPEND,
69 .size = SZ_128K,
70 .mask_flags = MTD_WRITEABLE,
71 }, {
72 .name = "reserved",
73 .offset = MTDPART_OFS_APPEND,
74 .size = SZ_8M,
75 .mask_flags = MTD_WRITEABLE,
76 }, {
77 .name = "kernel",
78 .offset = MTDPART_OFS_APPEND,
79 .size = (SZ_2M + SZ_1M),
80 .mask_flags = 0,
81 }, {
82 .name = "filesystem",
83 .offset = MTDPART_OFS_APPEND,
84 .size = SZ_48M,
85 .mask_flags = 0,
86 }
87};
88
Haojian Zhuangd6223872009-11-20 10:57:16 -050089static struct onenand_platform_data ttc_dkb_onenand_info = {
Haojian Zhuangd6587c32009-09-23 01:57:35 +080090 .parts = ttc_dkb_onenand_partitions,
91 .nr_parts = ARRAY_SIZE(ttc_dkb_onenand_partitions),
92};
93
94static struct resource ttc_dkb_resource_onenand[] = {
95 [0] = {
96 .start = SMC_CS0_PHYS_BASE,
97 .end = SMC_CS0_PHYS_BASE + SZ_1M,
98 .flags = IORESOURCE_MEM,
99 },
100};
101
102static struct platform_device ttc_dkb_device_onenand = {
103 .name = "onenand-flash",
104 .id = -1,
105 .resource = ttc_dkb_resource_onenand,
106 .num_resources = ARRAY_SIZE(ttc_dkb_resource_onenand),
107 .dev = {
108 .platform_data = &ttc_dkb_onenand_info,
109 },
110};
111
112static struct platform_device *ttc_dkb_devices[] = {
113 &ttc_dkb_device_onenand,
Eric Miao01215e32009-03-20 13:33:49 +0800114};
115
116static void __init ttc_dkb_init(void)
117{
118 mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config));
119
120 /* on-chip devices */
121 pxa910_add_uart(1);
Haojian Zhuangd6587c32009-09-23 01:57:35 +0800122
123 /* off-chip devices */
124 platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices));
Eric Miao01215e32009-03-20 13:33:49 +0800125}
126
127MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform")
Eric Miao80228872010-07-15 17:50:13 +0800128 .map_io = mmp_map_io,
Haojian Zhuang0bd86962010-09-08 09:42:42 -0400129 .nr_irqs = TTCDKB_NR_IRQS,
Eric Miao01215e32009-03-20 13:33:49 +0800130 .init_irq = pxa910_init_irq,
131 .timer = &pxa910_timer,
132 .init_machine = ttc_dkb_init,
133MACHINE_END