Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
brownstone.c
Go to the documentation of this file.
1 /*
2  * linux/arch/arm/mach-mmp/brownstone.c
3  *
4  * Support for the Marvell Brownstone Development Platform.
5  *
6  * Copyright (C) 2009-2010 Marvell International Ltd.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * publishhed by the Free Software Foundation.
11  */
12 
13 #include <linux/init.h>
14 #include <linux/kernel.h>
15 #include <linux/platform_device.h>
16 #include <linux/io.h>
19 #include <linux/regulator/fixed.h>
20 #include <linux/mfd/max8925.h>
21 
22 #include <asm/mach-types.h>
23 #include <asm/mach/arch.h>
24 #include <mach/addr-map.h>
25 #include <mach/mfp-mmp2.h>
26 #include <mach/mmp2.h>
27 #include <mach/irqs.h>
28 
29 #include "common.h"
30 
31 #define BROWNSTONE_NR_IRQS (MMP_NR_IRQS + 40)
32 
33 #define GPIO_5V_ENABLE (89)
34 
35 static unsigned long brownstone_pin_config[] __initdata = {
36  /* UART1 */
39 
40  /* UART3 */
43 
44  /* DFI */
69 
70  /* PMIC */
72 
73  /* MMC0 */
82 
83  /* MMC1 */
90 
91  /* MMC2 */
102 
103  /* 5V regulator */
104  GPIO89_GPIO,
105 };
106 
107 static struct regulator_consumer_supply max8649_supply[] = {
108  REGULATOR_SUPPLY("vcc_core", NULL),
109 };
110 
111 static struct regulator_init_data max8649_init_data = {
112  .constraints = {
113  .name = "vcc_core range",
114  .min_uV = 1150000,
115  .max_uV = 1280000,
116  .always_on = 1,
117  .boot_on = 1,
118  .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
119  },
120  .num_consumer_supplies = 1,
121  .consumer_supplies = &max8649_supply[0],
122 };
123 
124 static struct max8649_platform_data brownstone_max8649_info = {
125  .mode = 2, /* VID1 = 1, VID0 = 0 */
126  .extclk = 0,
127  .ramp_timing = MAX8649_RAMP_32MV,
128  .regulator = &max8649_init_data,
129 };
130 
131 static struct regulator_consumer_supply brownstone_v_5vp_supplies[] = {
132  REGULATOR_SUPPLY("v_5vp", NULL),
133 };
134 
135 static struct regulator_init_data brownstone_v_5vp_data = {
136  .constraints = {
137  .valid_ops_mask = REGULATOR_CHANGE_STATUS,
138  },
139  .num_consumer_supplies = ARRAY_SIZE(brownstone_v_5vp_supplies),
140  .consumer_supplies = brownstone_v_5vp_supplies,
141 };
142 
143 static struct fixed_voltage_config brownstone_v_5vp = {
144  .supply_name = "v_5vp",
145  .microvolts = 5000000,
146  .gpio = GPIO_5V_ENABLE,
147  .enable_high = 1,
148  .enabled_at_boot = 1,
149  .init_data = &brownstone_v_5vp_data,
150 };
151 
152 static struct platform_device brownstone_v_5vp_device = {
153  .name = "reg-fixed-voltage",
154  .id = 1,
155  .dev = {
156  .platform_data = &brownstone_v_5vp,
157  },
158 };
159 
160 static struct max8925_platform_data brownstone_max8925_info = {
161  .irq_base = MMP_NR_IRQS,
162 };
163 
164 static struct i2c_board_info brownstone_twsi1_info[] = {
165  [0] = {
166  .type = "max8649",
167  .addr = 0x60,
168  .platform_data = &brownstone_max8649_info,
169  },
170  [1] = {
171  .type = "max8925",
172  .addr = 0x3c,
173  .irq = IRQ_MMP2_PMIC,
174  .platform_data = &brownstone_max8925_info,
175  },
176 };
177 
178 static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = {
179  .clk_delay_cycles = 0x1f,
180 };
181 
182 static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = {
183  .clk_delay_cycles = 0x1f,
184  .flags = PXA_FLAG_CARD_PERMANENT
186 };
187 
188 static struct sram_platdata mmp2_asram_platdata = {
189  .pool_name = "asram",
190  .granularity = SRAM_GRANULARITY,
191 };
192 
193 static struct sram_platdata mmp2_isram_platdata = {
194  .pool_name = "isram",
195  .granularity = SRAM_GRANULARITY,
196 };
197 
198 static void __init brownstone_init(void)
199 {
200  mfp_config(ARRAY_AND_SIZE(brownstone_pin_config));
201 
202  /* on-chip devices */
203  mmp2_add_uart(1);
204  mmp2_add_uart(3);
206  mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info));
207  mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */
208  mmp2_add_sdhost(2, &mmp2_sdh_platdata_mmc2); /* eMMC */
209  mmp2_add_asram(&mmp2_asram_platdata);
210  mmp2_add_isram(&mmp2_isram_platdata);
211 
212  /* enable 5v regulator */
213  platform_device_register(&brownstone_v_5vp_device);
214 }
215 
216 MACHINE_START(BROWNSTONE, "Brownstone Development Platform")
217  /* Maintainer: Haojian Zhuang <[email protected]> */
218  .map_io = mmp_map_io,
219  .nr_irqs = BROWNSTONE_NR_IRQS,
220  .init_irq = mmp2_init_irq,
221  .timer = &mmp2_timer,
222  .init_machine = brownstone_init,
223  .restart = mmp_restart,