| Eric Miao | 01215e3 | 2009-03-20 13:33:49 +0800 | [diff] [blame] | 1 | /* | 
 | 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 Zhuang | d6587c3 | 2009-09-23 01:57:35 +0800 | [diff] [blame] | 14 | #include <linux/mtd/mtd.h> | 
 | 15 | #include <linux/mtd/partitions.h> | 
 | 16 | #include <linux/mtd/onenand.h> | 
| Haojian Zhuang | 0bd8696 | 2010-09-08 09:42:42 -0400 | [diff] [blame] | 17 | #include <linux/interrupt.h> | 
| Eric Miao | 01215e3 | 2009-03-20 13:33:49 +0800 | [diff] [blame] | 18 |  | 
 | 19 | #include <asm/mach-types.h> | 
 | 20 | #include <asm/mach/arch.h> | 
| Haojian Zhuang | d6587c3 | 2009-09-23 01:57:35 +0800 | [diff] [blame] | 21 | #include <asm/mach/flash.h> | 
| Eric Miao | 01215e3 | 2009-03-20 13:33:49 +0800 | [diff] [blame] | 22 | #include <mach/addr-map.h> | 
 | 23 | #include <mach/mfp-pxa910.h> | 
 | 24 | #include <mach/pxa910.h> | 
 | 25 |  | 
 | 26 | #include "common.h" | 
 | 27 |  | 
| Haojian Zhuang | 0bd8696 | 2010-09-08 09:42:42 -0400 | [diff] [blame] | 28 | #define TTCDKB_NR_IRQS		(IRQ_BOARD_START + 24) | 
 | 29 |  | 
| Eric Miao | 01215e3 | 2009-03-20 13:33:49 +0800 | [diff] [blame] | 30 | static unsigned long ttc_dkb_pin_config[] __initdata = { | 
 | 31 | 	/* UART2 */ | 
 | 32 | 	GPIO47_UART2_RXD, | 
 | 33 | 	GPIO48_UART2_TXD, | 
| Haojian Zhuang | d6587c3 | 2009-09-23 01:57:35 +0800 | [diff] [blame] | 34 |  | 
 | 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 |  | 
 | 60 | static 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 Zhuang | d622387 | 2009-11-20 10:57:16 -0500 | [diff] [blame] | 89 | static struct onenand_platform_data ttc_dkb_onenand_info = { | 
| Haojian Zhuang | d6587c3 | 2009-09-23 01:57:35 +0800 | [diff] [blame] | 90 | 	.parts		= ttc_dkb_onenand_partitions, | 
 | 91 | 	.nr_parts	= ARRAY_SIZE(ttc_dkb_onenand_partitions), | 
 | 92 | }; | 
 | 93 |  | 
 | 94 | static 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 |  | 
 | 102 | static 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 |  | 
 | 112 | static struct platform_device *ttc_dkb_devices[] = { | 
 | 113 | 	&ttc_dkb_device_onenand, | 
| Eric Miao | 01215e3 | 2009-03-20 13:33:49 +0800 | [diff] [blame] | 114 | }; | 
 | 115 |  | 
 | 116 | static 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 Zhuang | d6587c3 | 2009-09-23 01:57:35 +0800 | [diff] [blame] | 122 |  | 
 | 123 | 	/* off-chip devices */ | 
 | 124 | 	platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices)); | 
| Eric Miao | 01215e3 | 2009-03-20 13:33:49 +0800 | [diff] [blame] | 125 | } | 
 | 126 |  | 
 | 127 | MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform") | 
| Eric Miao | 8022887 | 2010-07-15 17:50:13 +0800 | [diff] [blame] | 128 | 	.map_io		= mmp_map_io, | 
| Haojian Zhuang | 0bd8696 | 2010-09-08 09:42:42 -0400 | [diff] [blame] | 129 | 	.nr_irqs	= TTCDKB_NR_IRQS, | 
| Eric Miao | 01215e3 | 2009-03-20 13:33:49 +0800 | [diff] [blame] | 130 | 	.init_irq       = pxa910_init_irq, | 
 | 131 | 	.timer          = &pxa910_timer, | 
 | 132 | 	.init_machine   = ttc_dkb_init, | 
 | 133 | MACHINE_END |