Tim Nordell | d40f3f1 | 2010-09-27 16:05:47 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * linux/arch/arm/mach-omap2/board-omap3logic.c |
| 3 | * |
| 4 | * Copyright (C) 2010 Li-Pro.Net |
| 5 | * Stephan Linz <linz@li-pro.net> |
| 6 | * |
| 7 | * Copyright (C) 2010 Logic Product Development, Inc. |
| 8 | * Peter Barada <peter.barada@logicpd.com> |
| 9 | * |
| 10 | * Modified from Beagle, EVM, and RX51 |
| 11 | * |
| 12 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License version 2 as |
| 14 | * published by the Free Software Foundation. |
| 15 | */ |
| 16 | |
| 17 | #include <linux/kernel.h> |
| 18 | #include <linux/init.h> |
| 19 | #include <linux/platform_device.h> |
| 20 | #include <linux/delay.h> |
| 21 | #include <linux/err.h> |
| 22 | #include <linux/clk.h> |
| 23 | #include <linux/io.h> |
| 24 | #include <linux/gpio.h> |
| 25 | |
| 26 | #include <linux/regulator/machine.h> |
| 27 | |
| 28 | #include <linux/i2c/twl.h> |
| 29 | |
| 30 | #include <mach/hardware.h> |
| 31 | #include <asm/mach-types.h> |
| 32 | #include <asm/mach/arch.h> |
| 33 | #include <asm/mach/map.h> |
| 34 | |
| 35 | #include "mux.h" |
| 36 | |
| 37 | #include <plat/mux.h> |
| 38 | #include <plat/board.h> |
| 39 | #include <plat/common.h> |
| 40 | #include <plat/gpmc.h> |
| 41 | #include <plat/timer-gp.h> |
| 42 | #include <plat/sdrc.h> |
| 43 | #include <plat/control.h> |
| 44 | |
| 45 | #define OMAP3LOGIC_SMSC911X_CS 1 |
| 46 | |
| 47 | #define OMAP3530_LV_SOM_MMC_GPIO_CD 110 |
| 48 | #define OMAP3530_LV_SOM_MMC_GPIO_WP 126 |
| 49 | #define OMAP3530_LV_SOM_SMSC911X_GPIO_IRQ 152 |
| 50 | |
| 51 | #define OMAP3_TORPEDO_MMC_GPIO_CD 127 |
| 52 | #define OMAP3_TORPEDO_SMSC911X_GPIO_IRQ 129 |
| 53 | |
| 54 | static struct regulator_consumer_supply omap3logic_vmmc1_supply = { |
| 55 | .supply = "vmmc", |
| 56 | }; |
| 57 | |
| 58 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ |
| 59 | static struct regulator_init_data omap3logic_vmmc1 = { |
| 60 | .constraints = { |
| 61 | .name = "VMMC1", |
| 62 | .min_uV = 1850000, |
| 63 | .max_uV = 3150000, |
| 64 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 65 | | REGULATOR_MODE_STANDBY, |
| 66 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 67 | | REGULATOR_CHANGE_MODE |
| 68 | | REGULATOR_CHANGE_STATUS, |
| 69 | }, |
| 70 | .num_consumer_supplies = 1, |
| 71 | .consumer_supplies = &omap3logic_vmmc1_supply, |
| 72 | }; |
| 73 | |
| 74 | static struct twl4030_gpio_platform_data omap3logic_gpio_data = { |
| 75 | .gpio_base = OMAP_MAX_GPIO_LINES, |
| 76 | .irq_base = TWL4030_GPIO_IRQ_BASE, |
| 77 | .irq_end = TWL4030_GPIO_IRQ_END, |
| 78 | .use_leds = true, |
| 79 | .pullups = BIT(1), |
| 80 | .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8) |
| 81 | | BIT(13) | BIT(15) | BIT(16) | BIT(17), |
| 82 | }; |
| 83 | |
| 84 | static struct twl4030_platform_data omap3logic_twldata = { |
| 85 | .irq_base = TWL4030_IRQ_BASE, |
| 86 | .irq_end = TWL4030_IRQ_END, |
| 87 | |
| 88 | /* platform_data for children goes here */ |
| 89 | .gpio = &omap3logic_gpio_data, |
| 90 | }; |
| 91 | |
| 92 | static struct i2c_board_info __initdata omap3logic_i2c_boardinfo[] = { |
| 93 | { |
| 94 | I2C_BOARD_INFO("twl4030", 0x48), |
| 95 | .flags = I2C_CLIENT_WAKE, |
| 96 | .irq = INT_34XX_SYS_NIRQ, |
| 97 | .platform_data = &omap3logic_twldata, |
| 98 | }, |
| 99 | }; |
| 100 | |
| 101 | static int __init omap3logic_i2c_init(void) |
| 102 | { |
| 103 | omap_register_i2c_bus(1, 2600, omap3logic_i2c_boardinfo, |
| 104 | ARRAY_SIZE(omap3logic_i2c_boardinfo)); |
| 105 | return 0; |
| 106 | } |
| 107 | |
| 108 | static void __init omap3logic_init_irq(void) |
| 109 | { |
| 110 | omap2_init_common_hw(NULL, NULL); |
| 111 | omap_init_irq(); |
| 112 | omap_gpio_init(); |
| 113 | } |
| 114 | |
| 115 | static void __init omap3logic_init(void) |
| 116 | { |
| 117 | omap3logic_i2c_init(); |
| 118 | omap_serial_init(); |
| 119 | |
| 120 | /* Ensure SDRC pins are mux'd for self-refresh */ |
| 121 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |
| 122 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); |
| 123 | } |
| 124 | |
| 125 | MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board") |
| 126 | .phys_io = 0x48000000, |
| 127 | .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, |
| 128 | .boot_params = 0x80000100, |
| 129 | .map_io = omap3_map_io, |
| 130 | .init_irq = omap3logic_init_irq, |
| 131 | .init_machine = omap3logic_init, |
| 132 | .timer = &omap_timer, |
| 133 | MACHINE_END |
| 134 | |
| 135 | MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board") |
| 136 | .phys_io = 0x48000000, |
| 137 | .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, |
| 138 | .boot_params = 0x80000100, |
| 139 | .map_io = omap3_map_io, |
| 140 | .init_irq = omap3logic_init_irq, |
| 141 | .init_machine = omap3logic_init, |
| 142 | .timer = &omap_timer, |
| 143 | MACHINE_END |