Eric Miao | 49cbe78 | 2009-01-20 14:15:18 +0800 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-mmp/aspenite.c |
| 3 | * |
| 4 | * Support for the Marvell PXA168-based Aspenite and Zylonite2 |
| 5 | * Development Platform. |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as |
| 9 | * publishhed by the Free Software Foundation. |
| 10 | */ |
| 11 | |
| 12 | #include <linux/init.h> |
Eric Miao | 9c291f0 | 2009-02-10 10:35:25 +0800 | [diff] [blame] | 13 | #include <linux/kernel.h> |
Eric Miao | a6b993c | 2009-02-18 16:38:22 +0800 | [diff] [blame] | 14 | #include <linux/platform_device.h> |
| 15 | #include <linux/smc91x.h> |
Haojian Zhuang | ef559de | 2009-09-10 14:37:48 +0800 | [diff] [blame] | 16 | #include <linux/mtd/mtd.h> |
| 17 | #include <linux/mtd/partitions.h> |
| 18 | #include <linux/mtd/nand.h> |
Eric Miao | 49cbe78 | 2009-01-20 14:15:18 +0800 | [diff] [blame] | 19 | |
| 20 | #include <asm/mach-types.h> |
| 21 | #include <asm/mach/arch.h> |
| 22 | #include <mach/addr-map.h> |
Eric Miao | 9c291f0 | 2009-02-10 10:35:25 +0800 | [diff] [blame] | 23 | #include <mach/mfp-pxa168.h> |
| 24 | #include <mach/pxa168.h> |
Eric Miao | a6b993c | 2009-02-18 16:38:22 +0800 | [diff] [blame] | 25 | #include <mach/gpio.h> |
Eric Miao | 49cbe78 | 2009-01-20 14:15:18 +0800 | [diff] [blame] | 26 | |
| 27 | #include "common.h" |
| 28 | |
Eric Miao | 9c291f0 | 2009-02-10 10:35:25 +0800 | [diff] [blame] | 29 | static unsigned long common_pin_config[] __initdata = { |
Eric Miao | a6b993c | 2009-02-18 16:38:22 +0800 | [diff] [blame] | 30 | /* Data Flash Interface */ |
| 31 | GPIO0_DFI_D15, |
| 32 | GPIO1_DFI_D14, |
| 33 | GPIO2_DFI_D13, |
| 34 | GPIO3_DFI_D12, |
| 35 | GPIO4_DFI_D11, |
| 36 | GPIO5_DFI_D10, |
| 37 | GPIO6_DFI_D9, |
| 38 | GPIO7_DFI_D8, |
| 39 | GPIO8_DFI_D7, |
| 40 | GPIO9_DFI_D6, |
| 41 | GPIO10_DFI_D5, |
| 42 | GPIO11_DFI_D4, |
| 43 | GPIO12_DFI_D3, |
| 44 | GPIO13_DFI_D2, |
| 45 | GPIO14_DFI_D1, |
| 46 | GPIO15_DFI_D0, |
| 47 | |
| 48 | /* Static Memory Controller */ |
| 49 | GPIO18_SMC_nCS0, |
| 50 | GPIO34_SMC_nCS1, |
| 51 | GPIO23_SMC_nLUA, |
| 52 | GPIO25_SMC_nLLA, |
| 53 | GPIO28_SMC_RDY, |
| 54 | GPIO29_SMC_SCLK, |
| 55 | GPIO35_SMC_BE1, |
| 56 | GPIO36_SMC_BE2, |
| 57 | GPIO27_GPIO, /* Ethernet IRQ */ |
| 58 | |
Eric Miao | 9c291f0 | 2009-02-10 10:35:25 +0800 | [diff] [blame] | 59 | /* UART1 */ |
| 60 | GPIO107_UART1_RXD, |
| 61 | GPIO108_UART1_TXD, |
| 62 | }; |
| 63 | |
Eric Miao | a6b993c | 2009-02-18 16:38:22 +0800 | [diff] [blame] | 64 | static struct smc91x_platdata smc91x_info = { |
| 65 | .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, |
| 66 | }; |
| 67 | |
| 68 | static struct resource smc91x_resources[] = { |
| 69 | [0] = { |
| 70 | .start = SMC_CS1_PHYS_BASE + 0x300, |
| 71 | .end = SMC_CS1_PHYS_BASE + 0xfffff, |
| 72 | .flags = IORESOURCE_MEM, |
| 73 | }, |
| 74 | [1] = { |
| 75 | .start = gpio_to_irq(27), |
| 76 | .end = gpio_to_irq(27), |
| 77 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, |
| 78 | } |
| 79 | }; |
| 80 | |
| 81 | static struct platform_device smc91x_device = { |
| 82 | .name = "smc91x", |
| 83 | .id = 0, |
| 84 | .dev = { |
| 85 | .platform_data = &smc91x_info, |
| 86 | }, |
| 87 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 88 | .resource = smc91x_resources, |
| 89 | }; |
| 90 | |
Haojian Zhuang | ef559de | 2009-09-10 14:37:48 +0800 | [diff] [blame] | 91 | static struct mtd_partition aspenite_nand_partitions[] = { |
| 92 | { |
| 93 | .name = "bootloader", |
| 94 | .offset = 0, |
| 95 | .size = SZ_1M, |
| 96 | .mask_flags = MTD_WRITEABLE, |
| 97 | }, { |
| 98 | .name = "reserved", |
| 99 | .offset = MTDPART_OFS_APPEND, |
| 100 | .size = SZ_128K, |
| 101 | .mask_flags = MTD_WRITEABLE, |
| 102 | }, { |
| 103 | .name = "reserved", |
| 104 | .offset = MTDPART_OFS_APPEND, |
| 105 | .size = SZ_8M, |
| 106 | .mask_flags = MTD_WRITEABLE, |
| 107 | }, { |
| 108 | .name = "kernel", |
| 109 | .offset = MTDPART_OFS_APPEND, |
| 110 | .size = (SZ_2M + SZ_1M), |
| 111 | .mask_flags = 0, |
| 112 | }, { |
| 113 | .name = "filesystem", |
| 114 | .offset = MTDPART_OFS_APPEND, |
| 115 | .size = SZ_48M, |
| 116 | .mask_flags = 0, |
| 117 | } |
| 118 | }; |
| 119 | |
| 120 | static struct pxa3xx_nand_platform_data aspenite_nand_info = { |
| 121 | .enable_arbiter = 1, |
| 122 | .parts = aspenite_nand_partitions, |
| 123 | .nr_parts = ARRAY_SIZE(aspenite_nand_partitions), |
| 124 | }; |
| 125 | |
Eric Miao | 49cbe78 | 2009-01-20 14:15:18 +0800 | [diff] [blame] | 126 | static void __init common_init(void) |
| 127 | { |
Eric Miao | 9c291f0 | 2009-02-10 10:35:25 +0800 | [diff] [blame] | 128 | mfp_config(ARRAY_AND_SIZE(common_pin_config)); |
| 129 | |
Eric Miao | a6b993c | 2009-02-18 16:38:22 +0800 | [diff] [blame] | 130 | /* on-chip devices */ |
Eric Miao | 9c291f0 | 2009-02-10 10:35:25 +0800 | [diff] [blame] | 131 | pxa168_add_uart(1); |
Haojian Zhuang | ef559de | 2009-09-10 14:37:48 +0800 | [diff] [blame] | 132 | pxa168_add_nand(&aspenite_nand_info); |
Eric Miao | a6b993c | 2009-02-18 16:38:22 +0800 | [diff] [blame] | 133 | |
| 134 | /* off-chip devices */ |
| 135 | platform_device_register(&smc91x_device); |
Eric Miao | 49cbe78 | 2009-01-20 14:15:18 +0800 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform") |
| 139 | .phys_io = APB_PHYS_BASE, |
| 140 | .boot_params = 0x00000100, |
| 141 | .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, |
| 142 | .map_io = pxa_map_io, |
| 143 | .init_irq = pxa168_init_irq, |
| 144 | .timer = &pxa168_timer, |
| 145 | .init_machine = common_init, |
| 146 | MACHINE_END |
| 147 | |
| 148 | MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform") |
| 149 | .phys_io = APB_PHYS_BASE, |
| 150 | .boot_params = 0x00000100, |
| 151 | .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, |
| 152 | .map_io = pxa_map_io, |
| 153 | .init_irq = pxa168_init_irq, |
| 154 | .timer = &pxa168_timer, |
| 155 | .init_machine = common_init, |
| 156 | MACHINE_END |