aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-msm/board-msm7x30.c
diff options
context:
space:
mode:
authorDaniel Walker <dwalker@codeaurora.org>2010-05-12 17:24:15 -0400
committerDaniel Walker <dwalker@codeaurora.org>2010-05-13 19:08:44 -0400
commit90e37c57bab2876c50fe479d26e228c9aa871556 (patch)
treea32326a12f1186bb51504f4d7b9b5e9bf9f2def9 /arch/arm/mach-msm/board-msm7x30.c
parent10932767d215d35acc7facd01b2bb3d77dbc0f4b (diff)
msm: update basic board layout for MSM7x30
Signed-off-by: Daniel Walker <dwalker@codeaurora.org> Signed-off-by: David Brown <davidb@codeaurora.org> Signed-off-by: Gregory Bean <gbean@codeaurora.org> Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org> Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
Diffstat (limited to 'arch/arm/mach-msm/board-msm7x30.c')
-rw-r--r--arch/arm/mach-msm/board-msm7x30.c116
1 files changed, 20 insertions, 96 deletions
diff --git a/arch/arm/mach-msm/board-msm7x30.c b/arch/arm/mach-msm/board-msm7x30.c
index af132ebd86c5..bac1f3c38a3b 100644
--- a/arch/arm/mach-msm/board-msm7x30.c
+++ b/arch/arm/mach-msm/board-msm7x30.c
@@ -30,96 +30,37 @@
30 30
31#include <mach/gpio.h> 31#include <mach/gpio.h>
32#include <mach/board.h> 32#include <mach/board.h>
33#include <mach/camera.h>
34#include <mach/memory.h> 33#include <mach/memory.h>
35#include <mach/msm_iomap.h> 34#include <mach/msm_iomap.h>
36#include <mach/msm_hsusb.h>
37#include <mach/dma.h> 35#include <mach/dma.h>
38 36
39#include <mach/vreg.h> 37#include <mach/vreg.h>
40
41#include "devices.h" 38#include "devices.h"
42#include "timer.h" 39#include "proc_comm.h"
43#include "socinfo.h"
44
45static struct resource smc91x_resources[] = {
46 [0] = {
47 .start = 0x8A000300,
48 .end = 0x8A0003ff,
49 .flags = IORESOURCE_MEM,
50 },
51 [1] = {
52 .start = MSM_GPIO_TO_INT(156),
53 .end = MSM_GPIO_TO_INT(156),
54 .flags = IORESOURCE_IRQ,
55 },
56};
57 40
58static struct platform_device smc91x_device = { 41extern struct sys_timer msm_timer;
59 .name = "smc91x",
60 .id = 0,
61 .num_resources = ARRAY_SIZE(smc91x_resources),
62 .resource = smc91x_resources,
63};
64
65static struct smsc911x_platform_config smsc911x_config = {
66 .phy_interface = PHY_INTERFACE_MODE_MII,
67 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
68 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
69 .flags = SMSC911X_USE_32BIT,
70};
71
72static struct resource smsc911x_resources[] = {
73 [0] = {
74 .start = 0x8D000000,
75 .end = 0x8D000100,
76 .flags = IORESOURCE_MEM,
77 },
78 [1] = {
79 .start = MSM_GPIO_TO_INT(88),
80 .end = MSM_GPIO_TO_INT(88),
81 .flags = IORESOURCE_IRQ,
82 },
83};
84
85static struct platform_device smsc911x_device = {
86 .name = "smsc911x",
87 .id = -1,
88 .num_resources = ARRAY_SIZE(smsc911x_resources),
89 .resource = smsc911x_resources,
90 .dev = {
91 .platform_data = &smsc911x_config,
92 },
93};
94 42
95static struct msm_gpio smsc911x_gpios[] = { 43#ifdef CONFIG_SERIAL_MSM_CONSOLE
96 { GPIO_CFG(172, 2, GPIO_OUTPUT, GPIO_PULL_DOWN, GPIO_2MA), "ebi2_addr6" }, 44static struct msm_gpio uart2_config_data[] = {
97 { GPIO_CFG(173, 2, GPIO_OUTPUT, GPIO_PULL_DOWN, GPIO_2MA), "ebi2_addr5" }, 45 { GPIO_CFG(49, 2, GPIO_OUTPUT, GPIO_PULL_DOWN, GPIO_2MA), "UART2_RFR"},
98 { GPIO_CFG(174, 2, GPIO_OUTPUT, GPIO_PULL_DOWN, GPIO_2MA), "ebi2_addr4" }, 46 { GPIO_CFG(50, 2, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_2MA), "UART2_CTS"},
99 { GPIO_CFG(175, 2, GPIO_OUTPUT, GPIO_PULL_DOWN, GPIO_2MA), "ebi2_addr3" }, 47 { GPIO_CFG(51, 2, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_2MA), "UART2_Rx"},
100 { GPIO_CFG(176, 2, GPIO_OUTPUT, GPIO_PULL_DOWN, GPIO_2MA), "ebi2_addr2" }, 48 { GPIO_CFG(52, 2, GPIO_OUTPUT, GPIO_PULL_DOWN, GPIO_2MA), "UART2_Tx"},
101 { GPIO_CFG(177, 2, GPIO_OUTPUT, GPIO_PULL_DOWN, GPIO_2MA), "ebi2_addr1" },
102 { GPIO_CFG(178, 2, GPIO_OUTPUT, GPIO_PULL_DOWN, GPIO_2MA), "ebi2_addr0" },
103 { GPIO_CFG(88, 2, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA), "smsc911x_irq" },
104}; 49};
105 50
106static void msm7x30_cfg_smsc911x(void) 51static void msm7x30_init_uart2(void)
107{ 52{
108 int rc; 53 msm_gpios_request_enable(uart2_config_data,
54 ARRAY_SIZE(uart2_config_data));
109 55
110 rc = msm_gpios_request_enable(smsc911x_gpios,
111 ARRAY_SIZE(smsc911x_gpios));
112 if (rc)
113 pr_err("%s: unable to enable gpios\n", __func__);
114} 56}
57#endif
115 58
116static struct platform_device *devices[] __initdata = { 59static struct platform_device *devices[] __initdata = {
117 &msm_device_smd, 60#if defined(CONFIG_SERIAL_MSM) || defined(CONFIG_MSM_SERIAL_DEBUGGER)
118 &msm_device_dmov, 61 &msm_device_uart2,
119 &smc91x_device, 62#endif
120 &smsc911x_device, 63
121 &msm_device_nand,
122 &msm_device_uart_dm1,
123}; 64};
124 65
125static void __init msm7x30_init_irq(void) 66static void __init msm7x30_init_irq(void)
@@ -127,35 +68,18 @@ static void __init msm7x30_init_irq(void)
127 msm_init_irq(); 68 msm_init_irq();
128} 69}
129 70
130static void __init msm_7x30_init_nand(void)
131{
132 int rc;
133 /* Enable GPIO 86 & 115 */
134 rc = msm_gpios_request_enable(msm_nand_ebi2_cfg_data,
135 ARRAY_SIZE(msm_nand_ebi2_cfg_data));
136 if (rc)
137 printk(KERN_ERR "%s: Failed to enable GPIO 86 & 115\n",
138 __func__);
139}
140
141static void __init msm7x30_init(void) 71static void __init msm7x30_init(void)
142{ 72{
143 if (socinfo_init() < 0)
144 printk(KERN_ERR "%s: socinfo_init() failed!\n",
145 __func__);
146 msm_acpu_clock_init(&msm7x30_clock_data);
147 if (machine_is_msm7x30_surf() || machine_is_msm7x30_fluid())
148 msm7x30_cfg_smsc911x();
149 platform_add_devices(devices, ARRAY_SIZE(devices)); 73 platform_add_devices(devices, ARRAY_SIZE(devices));
150 msm_7x30_init_nand(); 74#ifdef CONFIG_SERIAL_MSM_CONSOLE
151 buses_init(); 75 msm7x30_init_uart2();
76#endif
77
152} 78}
153 79
154static void __init msm7x30_map_io(void) 80static void __init msm7x30_map_io(void)
155{ 81{
156 msm_shared_ram_phys = 0x00000000;
157 msm_map_msm7x30_io(); 82 msm_map_msm7x30_io();
158 msm7x30_allocate_memory_regions();
159 msm_clock_init(msm_clocks_7x30, msm_num_clocks_7x30); 83 msm_clock_init(msm_clocks_7x30, msm_num_clocks_7x30);
160} 84}
161 85