aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut@gmail.com>2010-05-21 18:29:33 -0400
committerEric Miao <eric.y.miao@gmail.com>2010-06-18 03:07:33 -0400
commitf95bb54016ae2465a74f5eeb04b539ef213ce6c9 (patch)
tree33b4d6fe9f1b7354591d54508393cb83b6bbdc8d /arch/arm/mach-pxa
parent97dbc5164adb9e3f9c3a49183f616763fe43ea26 (diff)
[ARM] pxa/colibri270: Refactor board definition file
This patch just moves code around and polishes it. Also, compile in only selected pieces of hardware. Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270.c69
-rw-r--r--arch/arm/mach-pxa/include/mach/colibri.h9
2 files changed, 43 insertions, 35 deletions
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index 061c45316de8..f8b3bfba3d91 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -3,6 +3,7 @@
3 * 3 *
4 * Support for Toradex PXA270 based Colibri module 4 * Support for Toradex PXA270 based Colibri module
5 * Daniel Mack <daniel@caiaq.de> 5 * Daniel Mack <daniel@caiaq.de>
6 * Marek Vasut <marek.vasut@gmail.com>
6 * 7 *
7 * This program is free software; you can redistribute it and/or modify 8 * 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 * it under the terms of the GNU General Public License version 2 as
@@ -36,23 +37,25 @@
36#include "generic.h" 37#include "generic.h"
37#include "devices.h" 38#include "devices.h"
38 39
39/* 40/******************************************************************************
40 * GPIO configuration 41 * Pin configuration
41 */ 42 ******************************************************************************/
42static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = { 43static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = {
44 /* Ethernet */
43 GPIO78_nCS_2, /* Ethernet CS */ 45 GPIO78_nCS_2, /* Ethernet CS */
44 GPIO114_GPIO, /* Ethernet IRQ */ 46 GPIO114_GPIO, /* Ethernet IRQ */
45}; 47};
46 48
47/* 49/******************************************************************************
48 * NOR flash 50 * NOR Flash
49 */ 51 ******************************************************************************/
52#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
50static struct mtd_partition colibri_partitions[] = { 53static struct mtd_partition colibri_partitions[] = {
51 { 54 {
52 .name = "Bootloader", 55 .name = "Bootloader",
53 .offset = 0x00000000, 56 .offset = 0x00000000,
54 .size = 0x00040000, 57 .size = 0x00040000,
55 .mask_flags = MTD_WRITEABLE /* force read-only */ 58 .mask_flags = MTD_WRITEABLE /* force read-only */
56 }, { 59 }, {
57 .name = "Kernel", 60 .name = "Kernel",
58 .offset = 0x00040000, 61 .offset = 0x00040000,
@@ -90,42 +93,50 @@ static struct platform_device colibri_pxa270_flash_device = {
90 .num_resources = 1, 93 .num_resources = 1,
91}; 94};
92 95
93/* 96static void __init colibri_pxa270_nor_init(void)
94 * DM9000 Ethernet 97{
95 */ 98 platform_device_register(&colibri_pxa270_flash_device);
96#if defined(CONFIG_DM9000) 99}
97static struct resource dm9000_resources[] = { 100#else
101static inline void colibri_pxa270_nor_init(void) {}
102#endif
103
104/******************************************************************************
105 * Ethernet
106 ******************************************************************************/
107#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
108static struct resource colibri_pxa270_dm9000_resources[] = {
98 [0] = { 109 [0] = {
99 .start = COLIBRI_PXA270_ETH_PHYS, 110 .start = PXA_CS2_PHYS,
100 .end = COLIBRI_PXA270_ETH_PHYS + 3, 111 .end = PXA_CS2_PHYS + 3,
101 .flags = IORESOURCE_MEM, 112 .flags = IORESOURCE_MEM,
102 }, 113 },
103 [1] = { 114 [1] = {
104 .start = COLIBRI_PXA270_ETH_PHYS + 4, 115 .start = PXA_CS2_PHYS + 4,
105 .end = COLIBRI_PXA270_ETH_PHYS + 4 + 500, 116 .end = PXA_CS2_PHYS + 4 + 500,
106 .flags = IORESOURCE_MEM, 117 .flags = IORESOURCE_MEM,
107 }, 118 },
108 [2] = { 119 [2] = {
109 .start = COLIBRI_PXA270_ETH_IRQ, 120 .start = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
110 .end = COLIBRI_PXA270_ETH_IRQ, 121 .end = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
111 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING, 122 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
112 }, 123 },
113}; 124};
114 125
115static struct platform_device dm9000_device = { 126static struct platform_device colibri_pxa270_dm9000_device = {
116 .name = "dm9000", 127 .name = "dm9000",
117 .id = -1, 128 .id = -1,
118 .num_resources = ARRAY_SIZE(dm9000_resources), 129 .num_resources = ARRAY_SIZE(colibri_pxa270_dm9000_resources),
119 .resource = dm9000_resources, 130 .resource = colibri_pxa270_dm9000_resources,
120}; 131};
121#endif /* CONFIG_DM9000 */
122 132
123static struct platform_device *colibri_pxa270_devices[] __initdata = { 133static void __init colibri_pxa270_eth_init(void)
124 &colibri_pxa270_flash_device, 134{
125#if defined(CONFIG_DM9000) 135 platform_device_register(&colibri_pxa270_dm9000_device);
126 &dm9000_device, 136}
137#else
138static inline void colibri_pxa270_eth_init(void) {}
127#endif 139#endif
128};
129 140
130static void __init colibri_pxa270_init(void) 141static void __init colibri_pxa270_init(void)
131{ 142{
@@ -133,7 +144,9 @@ static void __init colibri_pxa270_init(void)
133 pxa_set_ffuart_info(NULL); 144 pxa_set_ffuart_info(NULL);
134 pxa_set_btuart_info(NULL); 145 pxa_set_btuart_info(NULL);
135 pxa_set_stuart_info(NULL); 146 pxa_set_stuart_info(NULL);
136 platform_add_devices(ARRAY_AND_SIZE(colibri_pxa270_devices)); 147
148 colibri_pxa270_nor_init();
149 colibri_pxa270_eth_init();
137} 150}
138 151
139MACHINE_START(COLIBRI, "Toradex Colibri PXA270") 152MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h
index 5f2ba8d9015c..9e47e1fb1f04 100644
--- a/arch/arm/mach-pxa/include/mach/colibri.h
+++ b/arch/arm/mach-pxa/include/mach/colibri.h
@@ -33,13 +33,8 @@ static inline void colibri_pxa3xx_init_nand(void) {}
33/* physical memory regions */ 33/* physical memory regions */
34#define COLIBRI_SDRAM_BASE 0xa0000000 /* SDRAM region */ 34#define COLIBRI_SDRAM_BASE 0xa0000000 /* SDRAM region */
35 35
36/* definitions for Colibri PXA270 */ 36/* GPIO definitions for Colibri PXA270 */
37 37#define GPIO114_COLIBRI_PXA270_ETH_IRQ 114
38#define COLIBRI_PXA270_FLASH_PHYS (PXA_CS0_PHYS) /* Flash region */
39#define COLIBRI_PXA270_ETH_PHYS (PXA_CS2_PHYS) /* Ethernet */
40#define COLIBRI_PXA270_ETH_IRQ_GPIO 114
41#define COLIBRI_PXA270_ETH_IRQ \
42 gpio_to_irq(mfp_to_gpio(COLIBRI_PXA270_ETH_IRQ_GPIO))
43 38
44#endif /* _COLIBRI_H_ */ 39#endif /* _COLIBRI_H_ */
45 40