2 * linux/arch/arm/mach-mmp/brownstone.c
4 * Support for the Marvell Brownstone Development Platform.
6 * Copyright (C) 2009-2010 Marvell International Ltd.
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.
13 #include <linux/init.h>
14 #include <linux/kernel.h>
15 #include <linux/platform_device.h>
17 #include <linux/gpio-pxa.h>
18 #include <linux/gpio/machine.h>
19 #include <linux/regulator/machine.h>
20 #include <linux/regulator/max8649.h>
21 #include <linux/regulator/fixed.h>
22 #include <linux/mfd/max8925.h>
24 #include <asm/mach-types.h>
25 #include <asm/mach/arch.h>
33 #define BROWNSTONE_NR_IRQS (MMP_NR_IRQS + 40)
35 #define GPIO_5V_ENABLE (89)
37 static unsigned long brownstone_pin_config[] __initdata = {
73 PMIC_PMIC_INT | MFP_LPM_EDGE_FALL,
76 GPIO131_MMC1_DAT3 | MFP_PULL_HIGH,
77 GPIO132_MMC1_DAT2 | MFP_PULL_HIGH,
78 GPIO133_MMC1_DAT1 | MFP_PULL_HIGH,
79 GPIO134_MMC1_DAT0 | MFP_PULL_HIGH,
80 GPIO136_MMC1_CMD | MFP_PULL_HIGH,
82 GPIO140_MMC1_CD | MFP_PULL_LOW,
83 GPIO141_MMC1_WP | MFP_PULL_LOW,
86 GPIO37_MMC2_DAT3 | MFP_PULL_HIGH,
87 GPIO38_MMC2_DAT2 | MFP_PULL_HIGH,
88 GPIO39_MMC2_DAT1 | MFP_PULL_HIGH,
89 GPIO40_MMC2_DAT0 | MFP_PULL_HIGH,
90 GPIO41_MMC2_CMD | MFP_PULL_HIGH,
94 GPIO165_MMC3_DAT7 | MFP_PULL_HIGH,
95 GPIO162_MMC3_DAT6 | MFP_PULL_HIGH,
96 GPIO166_MMC3_DAT5 | MFP_PULL_HIGH,
97 GPIO163_MMC3_DAT4 | MFP_PULL_HIGH,
98 GPIO167_MMC3_DAT3 | MFP_PULL_HIGH,
99 GPIO164_MMC3_DAT2 | MFP_PULL_HIGH,
100 GPIO168_MMC3_DAT1 | MFP_PULL_HIGH,
101 GPIO111_MMC3_DAT0 | MFP_PULL_HIGH,
102 GPIO112_MMC3_CMD | MFP_PULL_HIGH,
109 static struct pxa_gpio_platform_data mmp2_gpio_pdata = {
110 .irq_base = MMP_GPIO_TO_IRQ(0),
113 static struct regulator_consumer_supply max8649_supply[] = {
114 REGULATOR_SUPPLY("vcc_core", NULL),
117 static struct regulator_init_data max8649_init_data = {
119 .name = "vcc_core range",
124 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
126 .num_consumer_supplies = 1,
127 .consumer_supplies = &max8649_supply[0],
130 static struct max8649_platform_data brownstone_max8649_info = {
131 .mode = 2, /* VID1 = 1, VID0 = 0 */
133 .ramp_timing = MAX8649_RAMP_32MV,
134 .regulator = &max8649_init_data,
137 static struct regulator_consumer_supply brownstone_v_5vp_supplies[] = {
138 REGULATOR_SUPPLY("v_5vp", NULL),
141 static struct regulator_init_data brownstone_v_5vp_data = {
143 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
145 .num_consumer_supplies = ARRAY_SIZE(brownstone_v_5vp_supplies),
146 .consumer_supplies = brownstone_v_5vp_supplies,
149 static struct fixed_voltage_config brownstone_v_5vp = {
150 .supply_name = "v_5vp",
151 .microvolts = 5000000,
153 .enabled_at_boot = 1,
154 .init_data = &brownstone_v_5vp_data,
157 static struct platform_device brownstone_v_5vp_device = {
158 .name = "reg-fixed-voltage",
161 .platform_data = &brownstone_v_5vp,
165 static struct gpiod_lookup_table brownstone_v_5vp_gpiod_table = {
166 .dev_id = "reg-fixed-voltage.1", /* .id set to 1 above */
168 GPIO_LOOKUP("gpio-pxa", GPIO_5V_ENABLE,
169 NULL, GPIO_ACTIVE_HIGH),
174 static struct max8925_platform_data brownstone_max8925_info = {
175 .irq_base = MMP_NR_IRQS,
178 static struct i2c_board_info brownstone_twsi1_info[] = {
182 .platform_data = &brownstone_max8649_info,
187 .irq = IRQ_MMP2_PMIC,
188 .platform_data = &brownstone_max8925_info,
192 static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = {
193 .clk_delay_cycles = 0x1f,
196 static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = {
197 .clk_delay_cycles = 0x1f,
198 .flags = PXA_FLAG_CARD_PERMANENT
199 | PXA_FLAG_SD_8_BIT_CAPABLE_SLOT,
202 static struct sram_platdata mmp2_asram_platdata = {
203 .pool_name = "asram",
204 .granularity = SRAM_GRANULARITY,
207 static struct sram_platdata mmp2_isram_platdata = {
208 .pool_name = "isram",
209 .granularity = SRAM_GRANULARITY,
212 static void __init brownstone_init(void)
214 mfp_config(ARRAY_AND_SIZE(brownstone_pin_config));
216 /* on-chip devices */
219 platform_device_add_data(&mmp2_device_gpio, &mmp2_gpio_pdata,
220 sizeof(struct pxa_gpio_platform_data));
221 platform_device_register(&mmp2_device_gpio);
222 mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info));
223 mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */
224 mmp2_add_sdhost(2, &mmp2_sdh_platdata_mmc2); /* eMMC */
225 mmp2_add_asram(&mmp2_asram_platdata);
226 mmp2_add_isram(&mmp2_isram_platdata);
228 /* enable 5v regulator */
229 gpiod_add_lookup_table(&brownstone_v_5vp_gpiod_table);
230 platform_device_register(&brownstone_v_5vp_device);
233 MACHINE_START(BROWNSTONE, "Brownstone Development Platform")
234 /* Maintainer: Haojian Zhuang <haojian.zhuang@marvell.com> */
235 .map_io = mmp_map_io,
236 .nr_irqs = BROWNSTONE_NR_IRQS,
237 .init_irq = mmp2_init_irq,
238 .init_time = mmp2_timer_init,
239 .init_machine = brownstone_init,
240 .restart = mmp_restart,