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,
152 .enabled_at_boot = 1,
153 .init_data = &brownstone_v_5vp_data,
156 static struct platform_device brownstone_v_5vp_device = {
157 .name = "reg-fixed-voltage",
160 .platform_data = &brownstone_v_5vp,
164 static struct gpiod_lookup_table brownstone_v_5vp_gpiod_table = {
165 .dev_id = "reg-fixed-voltage.1", /* .id set to 1 above */
167 GPIO_LOOKUP("gpio-pxa", GPIO_5V_ENABLE,
168 NULL, GPIO_ACTIVE_HIGH),
173 static struct max8925_platform_data brownstone_max8925_info = {
174 .irq_base = MMP_NR_IRQS,
177 static struct i2c_board_info brownstone_twsi1_info[] = {
181 .platform_data = &brownstone_max8649_info,
186 .irq = IRQ_MMP2_PMIC,
187 .platform_data = &brownstone_max8925_info,
191 static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = {
192 .clk_delay_cycles = 0x1f,
195 static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = {
196 .clk_delay_cycles = 0x1f,
197 .flags = PXA_FLAG_CARD_PERMANENT
198 | PXA_FLAG_SD_8_BIT_CAPABLE_SLOT,
201 static struct sram_platdata mmp2_asram_platdata = {
202 .pool_name = "asram",
203 .granularity = SRAM_GRANULARITY,
206 static struct sram_platdata mmp2_isram_platdata = {
207 .pool_name = "isram",
208 .granularity = SRAM_GRANULARITY,
211 static void __init brownstone_init(void)
213 mfp_config(ARRAY_AND_SIZE(brownstone_pin_config));
215 /* on-chip devices */
218 platform_device_add_data(&mmp2_device_gpio, &mmp2_gpio_pdata,
219 sizeof(struct pxa_gpio_platform_data));
220 platform_device_register(&mmp2_device_gpio);
221 mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info));
222 mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */
223 mmp2_add_sdhost(2, &mmp2_sdh_platdata_mmc2); /* eMMC */
224 mmp2_add_asram(&mmp2_asram_platdata);
225 mmp2_add_isram(&mmp2_isram_platdata);
227 /* enable 5v regulator */
228 gpiod_add_lookup_table(&brownstone_v_5vp_gpiod_table);
229 platform_device_register(&brownstone_v_5vp_device);
232 MACHINE_START(BROWNSTONE, "Brownstone Development Platform")
233 /* Maintainer: Haojian Zhuang <haojian.zhuang@marvell.com> */
234 .map_io = mmp_map_io,
235 .nr_irqs = BROWNSTONE_NR_IRQS,
236 .init_irq = mmp2_init_irq,
237 .init_time = mmp2_timer_init,
238 .init_machine = brownstone_init,
239 .restart = mmp_restart,