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.h>
18 #include <linux/regulator/machine.h>
19 #include <linux/regulator/max8649.h>
20 #include <linux/regulator/fixed.h>
21 #include <linux/mfd/max8925.h>
23 #include <asm/mach-types.h>
24 #include <asm/mach/arch.h>
25 #include <mach/addr-map.h>
26 #include <mach/mfp-mmp2.h>
27 #include <mach/mmp2.h>
28 #include <mach/irqs.h>
32 #define BROWNSTONE_NR_IRQS (IRQ_BOARD_START + 40)
34 #define GPIO_5V_ENABLE (89)
36 static unsigned long brownstone_pin_config
[] __initdata
= {
72 PMIC_PMIC_INT
| MFP_LPM_EDGE_FALL
,
75 GPIO131_MMC1_DAT3
| MFP_PULL_HIGH
,
76 GPIO132_MMC1_DAT2
| MFP_PULL_HIGH
,
77 GPIO133_MMC1_DAT1
| MFP_PULL_HIGH
,
78 GPIO134_MMC1_DAT0
| MFP_PULL_HIGH
,
79 GPIO136_MMC1_CMD
| MFP_PULL_HIGH
,
81 GPIO140_MMC1_CD
| MFP_PULL_LOW
,
82 GPIO141_MMC1_WP
| MFP_PULL_LOW
,
85 GPIO37_MMC2_DAT3
| MFP_PULL_HIGH
,
86 GPIO38_MMC2_DAT2
| MFP_PULL_HIGH
,
87 GPIO39_MMC2_DAT1
| MFP_PULL_HIGH
,
88 GPIO40_MMC2_DAT0
| MFP_PULL_HIGH
,
89 GPIO41_MMC2_CMD
| MFP_PULL_HIGH
,
93 GPIO165_MMC3_DAT7
| MFP_PULL_HIGH
,
94 GPIO162_MMC3_DAT6
| MFP_PULL_HIGH
,
95 GPIO166_MMC3_DAT5
| MFP_PULL_HIGH
,
96 GPIO163_MMC3_DAT4
| MFP_PULL_HIGH
,
97 GPIO167_MMC3_DAT3
| MFP_PULL_HIGH
,
98 GPIO164_MMC3_DAT2
| MFP_PULL_HIGH
,
99 GPIO168_MMC3_DAT1
| MFP_PULL_HIGH
,
100 GPIO111_MMC3_DAT0
| MFP_PULL_HIGH
,
101 GPIO112_MMC3_CMD
| MFP_PULL_HIGH
,
108 static struct regulator_consumer_supply max8649_supply
[] = {
109 REGULATOR_SUPPLY("vcc_core", NULL
),
112 static struct regulator_init_data max8649_init_data
= {
114 .name
= "vcc_core range",
119 .valid_ops_mask
= REGULATOR_CHANGE_VOLTAGE
,
121 .num_consumer_supplies
= 1,
122 .consumer_supplies
= &max8649_supply
[0],
125 static struct max8649_platform_data brownstone_max8649_info
= {
126 .mode
= 2, /* VID1 = 1, VID0 = 0 */
128 .ramp_timing
= MAX8649_RAMP_32MV
,
129 .regulator
= &max8649_init_data
,
132 static struct regulator_consumer_supply brownstone_v_5vp_supplies
[] = {
133 REGULATOR_SUPPLY("v_5vp", NULL
),
136 static struct regulator_init_data brownstone_v_5vp_data
= {
138 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
140 .num_consumer_supplies
= ARRAY_SIZE(brownstone_v_5vp_supplies
),
141 .consumer_supplies
= brownstone_v_5vp_supplies
,
144 static struct fixed_voltage_config brownstone_v_5vp
= {
145 .supply_name
= "v_5vp",
146 .microvolts
= 5000000,
147 .gpio
= GPIO_5V_ENABLE
,
149 .enabled_at_boot
= 1,
150 .init_data
= &brownstone_v_5vp_data
,
153 static struct platform_device brownstone_v_5vp_device
= {
154 .name
= "reg-fixed-voltage",
157 .platform_data
= &brownstone_v_5vp
,
161 static struct max8925_platform_data brownstone_max8925_info
= {
162 .irq_base
= IRQ_BOARD_START
,
165 static struct i2c_board_info brownstone_twsi1_info
[] = {
169 .platform_data
= &brownstone_max8649_info
,
174 .irq
= IRQ_MMP2_PMIC
,
175 .platform_data
= &brownstone_max8925_info
,
179 static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0
= {
180 .max_speed
= 25000000,
183 static void __init
brownstone_init(void)
185 mfp_config(ARRAY_AND_SIZE(brownstone_pin_config
));
187 /* on-chip devices */
190 mmp2_add_twsi(1, NULL
, ARRAY_AND_SIZE(brownstone_twsi1_info
));
191 mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0
); /* SD/MMC */
193 /* enable 5v regulator */
194 platform_device_register(&brownstone_v_5vp_device
);
197 MACHINE_START(BROWNSTONE
, "Brownstone Development Platform")
198 /* Maintainer: Haojian Zhuang <haojian.zhuang@marvell.com> */
199 .map_io
= mmp_map_io
,
200 .nr_irqs
= BROWNSTONE_NR_IRQS
,
201 .init_irq
= mmp2_init_irq
,
202 .timer
= &mmp2_timer
,
203 .init_machine
= brownstone_init
,