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> 14#include <linux/mtd/mtd.h> 15#include <linux/mtd/partitions.h> 16#include <linux/mtd/onenand.h> 17 18#include <asm/mach-types.h> 19#include <asm/mach/arch.h> 20#include <asm/mach/flash.h> 21#include <mach/addr-map.h> 22#include <mach/mfp-pxa910.h> 23#include <mach/pxa910.h> 24 25#include "common.h" 26 27static unsigned long ttc_dkb_pin_config[] __initdata = { 28 /* UART2 */ 29 GPIO47_UART2_RXD, 30 GPIO48_UART2_TXD, 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 57static 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 86static struct onenand_platform_data ttc_dkb_onenand_info = { 87 .parts = ttc_dkb_onenand_partitions, 88 .nr_parts = ARRAY_SIZE(ttc_dkb_onenand_partitions), 89}; 90 91static 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 99static 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 109static struct platform_device *ttc_dkb_devices[] = { 110 &ttc_dkb_device_onenand, 111}; 112 113static 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); 119 120 /* off-chip devices */ 121 platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices)); 122} 123 124MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform") 125 .phys_io = APB_PHYS_BASE, 126 .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, 127 .map_io = mmp_map_io, 128 .init_irq = pxa910_init_irq, 129 .timer = &pxa910_timer, 130 .init_machine = ttc_dkb_init, 131MACHINE_END 132