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> |
Eric Miao | 01215e3 | 2009-03-20 13:33:49 +0800 | [diff] [blame] | 17 | |
| 18 | #include <asm/mach-types.h> |
| 19 | #include <asm/mach/arch.h> |
Haojian Zhuang | d6587c3 | 2009-09-23 01:57:35 +0800 | [diff] [blame] | 20 | #include <asm/mach/flash.h> |
Eric Miao | 01215e3 | 2009-03-20 13:33:49 +0800 | [diff] [blame] | 21 | #include <mach/addr-map.h> |
| 22 | #include <mach/mfp-pxa910.h> |
| 23 | #include <mach/pxa910.h> |
| 24 | |
| 25 | #include "common.h" |
| 26 | |
Eric Miao | 01215e3 | 2009-03-20 13:33:49 +0800 | [diff] [blame] | 27 | static unsigned long ttc_dkb_pin_config[] __initdata = { |
| 28 | /* UART2 */ |
| 29 | GPIO47_UART2_RXD, |
| 30 | GPIO48_UART2_TXD, |
Haojian Zhuang | d6587c3 | 2009-09-23 01:57:35 +0800 | [diff] [blame] | 31 | |
| 32 | /* DFI */ |
| 33 | DF_IO0_ND_IO0, |
| 34 | DF_IO1_ND_IO1, |
| 35 | DF_IO2_ND_IO2, |
| 36 | DF_IO3_ND_IO3, |
| 37 | DF_IO4_ND_IO4, |
| 38 | DF_IO5_ND_IO5, |
| 39 | DF_IO6_ND_IO6, |
| 40 | DF_IO7_ND_IO7, |
| 41 | DF_IO8_ND_IO8, |
| 42 | DF_IO9_ND_IO9, |
| 43 | DF_IO10_ND_IO10, |
| 44 | DF_IO11_ND_IO11, |
| 45 | DF_IO12_ND_IO12, |
| 46 | DF_IO13_ND_IO13, |
| 47 | DF_IO14_ND_IO14, |
| 48 | DF_IO15_ND_IO15, |
| 49 | DF_nCS0_SM_nCS2_nCS0, |
| 50 | DF_ALE_SM_WEn_ND_ALE, |
| 51 | DF_CLE_SM_OEn_ND_CLE, |
| 52 | DF_WEn_DF_WEn, |
| 53 | DF_REn_DF_REn, |
| 54 | DF_RDY0_DF_RDY0, |
| 55 | }; |
| 56 | |
| 57 | static struct mtd_partition ttc_dkb_onenand_partitions[] = { |
| 58 | { |
| 59 | .name = "bootloader", |
| 60 | .offset = 0, |
| 61 | .size = SZ_1M, |
| 62 | .mask_flags = MTD_WRITEABLE, |
| 63 | }, { |
| 64 | .name = "reserved", |
| 65 | .offset = MTDPART_OFS_APPEND, |
| 66 | .size = SZ_128K, |
| 67 | .mask_flags = MTD_WRITEABLE, |
| 68 | }, { |
| 69 | .name = "reserved", |
| 70 | .offset = MTDPART_OFS_APPEND, |
| 71 | .size = SZ_8M, |
| 72 | .mask_flags = MTD_WRITEABLE, |
| 73 | }, { |
| 74 | .name = "kernel", |
| 75 | .offset = MTDPART_OFS_APPEND, |
| 76 | .size = (SZ_2M + SZ_1M), |
| 77 | .mask_flags = 0, |
| 78 | }, { |
| 79 | .name = "filesystem", |
| 80 | .offset = MTDPART_OFS_APPEND, |
| 81 | .size = SZ_48M, |
| 82 | .mask_flags = 0, |
| 83 | } |
| 84 | }; |
| 85 | |
Haojian Zhuang | d622387 | 2009-11-20 10:57:16 -0500 | [diff] [blame] | 86 | static struct onenand_platform_data ttc_dkb_onenand_info = { |
Haojian Zhuang | d6587c3 | 2009-09-23 01:57:35 +0800 | [diff] [blame] | 87 | .parts = ttc_dkb_onenand_partitions, |
| 88 | .nr_parts = ARRAY_SIZE(ttc_dkb_onenand_partitions), |
| 89 | }; |
| 90 | |
| 91 | static struct resource ttc_dkb_resource_onenand[] = { |
| 92 | [0] = { |
| 93 | .start = SMC_CS0_PHYS_BASE, |
| 94 | .end = SMC_CS0_PHYS_BASE + SZ_1M, |
| 95 | .flags = IORESOURCE_MEM, |
| 96 | }, |
| 97 | }; |
| 98 | |
| 99 | static struct platform_device ttc_dkb_device_onenand = { |
| 100 | .name = "onenand-flash", |
| 101 | .id = -1, |
| 102 | .resource = ttc_dkb_resource_onenand, |
| 103 | .num_resources = ARRAY_SIZE(ttc_dkb_resource_onenand), |
| 104 | .dev = { |
| 105 | .platform_data = &ttc_dkb_onenand_info, |
| 106 | }, |
| 107 | }; |
| 108 | |
| 109 | static struct platform_device *ttc_dkb_devices[] = { |
| 110 | &ttc_dkb_device_onenand, |
Eric Miao | 01215e3 | 2009-03-20 13:33:49 +0800 | [diff] [blame] | 111 | }; |
| 112 | |
| 113 | static void __init ttc_dkb_init(void) |
| 114 | { |
| 115 | mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config)); |
| 116 | |
| 117 | /* on-chip devices */ |
| 118 | pxa910_add_uart(1); |
Haojian Zhuang | d6587c3 | 2009-09-23 01:57:35 +0800 | [diff] [blame] | 119 | |
| 120 | /* off-chip devices */ |
| 121 | platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices)); |
Eric Miao | 01215e3 | 2009-03-20 13:33:49 +0800 | [diff] [blame] | 122 | } |
| 123 | |
| 124 | MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform") |
| 125 | .phys_io = APB_PHYS_BASE, |
| 126 | .boot_params = 0x00000100, |
| 127 | .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, |
| 128 | .map_io = pxa_map_io, |
| 129 | .init_irq = pxa910_init_irq, |
| 130 | .timer = &pxa910_timer, |
| 131 | .init_machine = ttc_dkb_init, |
| 132 | MACHINE_END |