~ubuntu-branches/ubuntu/trusty/linux-armadaxp/trusty

« back to all changes in this revision

Viewing changes to arch/arm/mach-mx5/board-mx53_loco.c

  • Committer: Package Import Robot
  • Author(s): Michael Casadevall, Bryan Wu, Dann Frazier, Michael Casadeall
  • Date: 2012-03-10 15:00:54 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120310150054-flugb39zon8vvgwe
Tags: 3.2.0-1600.1
[ Bryan Wu ]
* UBUNTU: import debian/debian.env and debian.armadaxp

[ Dann Frazier ]
* ARM: Armada XP: remove trailing '/' in dirnames in mvRules.mk

[ Michael Casadeall ]
* tools: add some tools for Marvell Armada XP processor
* kernel: timer tick hacking from Marvell
* kernel: Sheeva Errata: add delay on Sheeva when powering down
* net: add Marvell NFP netfilter
* net: socket and skb modifications made by Marvell
* miscdevice: add minor IDs for some Marvell Armada drivers
* fs: introduce memory pool for splice()
* video: EDID detection updates from Marvell Armada XP patchset
* video: backlight: add Marvell Dove LCD backlight driver
* video: display: add THS8200 display driver
* video: framebuffer: add Marvell Dove and Armada XP processor onchip LCD controller driver
* usbtest: add Interrupt transfer testing by Marvell Armada XP code
* usb: ehci: add support for Marvell EHCI controler
* tty/serial: 8250: add support for Marvell Armada XP processor and DeviceTree work
* rtc: add support for Marvell Armada XP onchip RTC controller
* net: pppoe: add Marvell ethernet NFP hook in PPPoE networking driver
* mtd: nand: add support for Marvell Armada XP Nand Flash Controller
* mtd: maps: add Marvell Armada XP specific map driver
* mmc: add support for Marvell Armada XP MMC/SD host controller
* i2c: add support for Marvell Armada XP onchip i2c bus controller
* hwmon: add Kconfig option for Armada XP onchip thermal sensor driver
* dmaengine: add Net DMA support for splice and update Marvell XOR DMA engine driver
* ata: add support for Marvell Armada XP SATA controller and update some quirks
* ARM: add Marvell Armada XP machine to mach-types
* ARM: oprofile: add support for Marvell PJ4B core
* ARM: mm: more ARMv6 switches for Marvell Armada XP
* ARM: remove static declaration to allow compilation
* ARM: alignment access fault trick
* ARM: mm: skip some fault fixing when run on NONE SMP ARMv6 mode during early abort event
* ARM: mm: add Marvell Sheeva CPU Architecture for PJ4B
* ARM: introduce optimized copy operation for Marvell Armada XP
* ARM: SAUCE: hardware breakpoint trick for Marvell Armada XP
* ARM: big endian and little endian tricks for Marvell Armada XP
* ARM: SAUCE: Add Marvell Armada XP build rules to arch/arm/kernel/Makefile
* ARM: vfp: add special handling for Marvell Armada XP
* ARM: add support for Marvell U-Boot
* ARM: add mv_controller_num for ARM PCI drivers
* ARM: add support for local PMUs, general SMP tweaks and cache flushing
* ARM: add Marvell device identifies in glue-proc.h
* ARM: add IPC driver support for Marvell platforms
* ARM: add DMA mapping for Marvell platforms
* ARM: add Sheeva errata and PJ4B code for booting
* ARM: update Kconfig and Makefile to include Marvell Armada XP platforms
* ARM: Armada XP: import LSP from Marvell for Armada XP 3.2 kernel enablement

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include <linux/clk.h>
23
23
#include <linux/delay.h>
24
24
#include <linux/gpio.h>
 
25
#include <linux/i2c.h>
25
26
 
26
27
#include <mach/common.h>
27
28
#include <mach/hardware.h>
38
39
#define MX53_LOCO_UI1                   IMX_GPIO_NR(2, 14)
39
40
#define MX53_LOCO_UI2                   IMX_GPIO_NR(2, 15)
40
41
#define LOCO_FEC_PHY_RST                IMX_GPIO_NR(7, 6)
 
42
#define LOCO_LED                        IMX_GPIO_NR(7, 7)
 
43
#define LOCO_SD3_CD                     IMX_GPIO_NR(3, 11)
 
44
#define LOCO_SD3_WP                     IMX_GPIO_NR(3, 12)
 
45
#define LOCO_SD1_CD                     IMX_GPIO_NR(3, 13)
 
46
#define LOCO_ACCEL_EN                   IMX_GPIO_NR(6, 14)
41
47
 
42
48
static iomux_v3_cfg_t mx53_loco_pads[] = {
43
49
        /* FEC */
60
66
        MX53_PAD_KEY_ROW0__AUDMUX_AUD5_TXD,
61
67
        MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS,
62
68
        MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD,
 
69
        /* I2C1 */
 
70
        MX53_PAD_CSI0_DAT8__I2C1_SDA,
 
71
        MX53_PAD_CSI0_DAT9__I2C1_SCL,
 
72
        MX53_PAD_NANDF_CS1__GPIO6_14,   /* Accelerometer Enable */
63
73
        /* I2C2 */
64
74
        MX53_PAD_KEY_COL3__I2C2_SCL,
65
75
        MX53_PAD_KEY_ROW3__I2C2_SDA,
70
80
        MX53_PAD_SD1_DATA1__ESDHC1_DAT1,
71
81
        MX53_PAD_SD1_DATA2__ESDHC1_DAT2,
72
82
        MX53_PAD_SD1_DATA3__ESDHC1_DAT3,
 
83
        /* SD1_CD */
 
84
        MX53_PAD_EIM_DA13__GPIO3_13,
73
85
        /* SD3 */
74
86
        MX53_PAD_PATA_DATA8__ESDHC3_DAT0,
75
87
        MX53_PAD_PATA_DATA9__ESDHC3_DAT1,
163
175
        MX53_PAD_GPIO_7__SPDIF_PLOCK,
164
176
        MX53_PAD_GPIO_17__SPDIF_OUT1,
165
177
        /* GPIO */
166
 
        MX53_PAD_PATA_DA_1__GPIO7_7,
 
178
        MX53_PAD_PATA_DA_1__GPIO7_7,            /* LED */
167
179
        MX53_PAD_PATA_DA_2__GPIO7_8,
168
180
        MX53_PAD_PATA_DATA5__GPIO2_5,
169
181
        MX53_PAD_PATA_DATA6__GPIO2_6,
202
214
        .nbuttons       = ARRAY_SIZE(loco_buttons),
203
215
};
204
216
 
 
217
static const struct esdhc_platform_data mx53_loco_sd1_data __initconst = {
 
218
        .cd_gpio = LOCO_SD1_CD,
 
219
        .cd_type = ESDHC_CD_GPIO,
 
220
        .wp_type = ESDHC_WP_NONE,
 
221
};
 
222
 
 
223
static const struct esdhc_platform_data mx53_loco_sd3_data __initconst = {
 
224
        .cd_gpio = LOCO_SD3_CD,
 
225
        .wp_gpio = LOCO_SD3_WP,
 
226
        .cd_type = ESDHC_CD_GPIO,
 
227
        .wp_type = ESDHC_WP_GPIO,
 
228
};
 
229
 
205
230
static inline void mx53_loco_fec_reset(void)
206
231
{
207
232
        int ret;
217
242
        gpio_set_value(LOCO_FEC_PHY_RST, 1);
218
243
}
219
244
 
220
 
static struct fec_platform_data mx53_loco_fec_data = {
 
245
static const struct fec_platform_data mx53_loco_fec_data __initconst = {
221
246
        .phy = PHY_INTERFACE_MODE_RMII,
222
247
};
223
248
 
225
250
        .bitrate = 100000,
226
251
};
227
252
 
 
253
static const struct gpio_led mx53loco_leds[] __initconst = {
 
254
        {
 
255
                .name                   = "green",
 
256
                .default_trigger        = "heartbeat",
 
257
                .gpio                   = LOCO_LED,
 
258
        },
 
259
};
 
260
 
 
261
static const struct gpio_led_platform_data mx53loco_leds_data __initconst = {
 
262
        .leds           = mx53loco_leds,
 
263
        .num_leds       = ARRAY_SIZE(mx53loco_leds),
 
264
};
 
265
 
 
266
void __init imx53_qsb_common_init(void)
 
267
{
 
268
        mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads,
 
269
                                         ARRAY_SIZE(mx53_loco_pads));
 
270
}
 
271
 
 
272
static struct i2c_board_info mx53loco_i2c_devices[] = {
 
273
        {
 
274
                I2C_BOARD_INFO("mma8450", 0x1C),
 
275
        },
 
276
};
 
277
 
228
278
static void __init mx53_loco_board_init(void)
229
279
{
230
 
        mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads,
231
 
                                        ARRAY_SIZE(mx53_loco_pads));
 
280
        int ret;
 
281
        imx53_soc_init();
 
282
        imx53_qsb_common_init();
 
283
 
232
284
        imx53_add_imx_uart(0, NULL);
233
285
        mx53_loco_fec_reset();
234
286
        imx53_add_fec(&mx53_loco_fec_data);
235
287
        imx53_add_imx2_wdt(0, NULL);
 
288
 
 
289
        ret = gpio_request_one(LOCO_ACCEL_EN, GPIOF_OUT_INIT_HIGH, "accel_en");
 
290
        if (ret)
 
291
                pr_err("Cannot request ACCEL_EN pin: %d\n", ret);
 
292
 
 
293
        i2c_register_board_info(0, mx53loco_i2c_devices,
 
294
                                ARRAY_SIZE(mx53loco_i2c_devices));
236
295
        imx53_add_imx_i2c(0, &mx53_loco_i2c_data);
237
296
        imx53_add_imx_i2c(1, &mx53_loco_i2c_data);
238
 
        imx53_add_sdhci_esdhc_imx(0, NULL);
239
 
        imx53_add_sdhci_esdhc_imx(2, NULL);
 
297
        imx53_add_sdhci_esdhc_imx(0, &mx53_loco_sd1_data);
 
298
        imx53_add_sdhci_esdhc_imx(2, &mx53_loco_sd3_data);
240
299
        imx_add_gpio_keys(&loco_button_data);
 
300
        gpio_led_register_device(-1, &mx53loco_leds_data);
 
301
        imx53_add_ahci_imx();
241
302
}
242
303
 
243
304
static void __init mx53_loco_timer_init(void)
253
314
        .map_io = mx53_map_io,
254
315
        .init_early = imx53_init_early,
255
316
        .init_irq = mx53_init_irq,
 
317
        .handle_irq = imx53_handle_irq,
256
318
        .timer = &mx53_loco_timer,
257
319
        .init_machine = mx53_loco_board_init,
258
320
MACHINE_END