ARM: cpu topology: Add debugfs interface for cpu_power
[cmplus.git] / arch / arm / mach-omap2 / board-4430sdp.c
blob284e4cba23b81cc2d89d6f2b06e55e366834e0e1
1 /*
2 * Board support file for OMAP4430 SDP.
4 * Copyright (C) 2009 Texas Instruments
6 * Author: Santosh Shilimkar <santosh.shilimkar@ti.com>
8 * Based on mach-omap2/board-3430sdp.c
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/platform_device.h>
18 #include <linux/io.h>
19 #include <linux/gpio.h>
20 #include <linux/usb/otg.h>
21 #include <linux/spi/spi.h>
22 #include <linux/i2c/twl.h>
23 #include <linux/gpio_keys.h>
24 #include <linux/regulator/machine.h>
25 #include <linux/leds.h>
26 #include <linux/leds_pwm.h>
27 #include <linux/memblock.h>
29 #include <mach/hardware.h>
30 #include <mach/omap4-common.h>
31 #include <mach/emif.h>
32 #include <mach/lpddr2-elpida.h>
33 #include <mach/dmm.h>
35 #include <asm/mach-types.h>
36 #include <asm/mach/arch.h>
37 #include <asm/mach/map.h>
39 #include <plat/board.h>
40 #include <plat/common.h>
41 #include <plat/usb.h>
42 #include <plat/mmc.h>
43 #include <plat/omap4-keypad.h>
44 #include <plat/remoteproc.h>
45 #include <video/omapdss.h>
46 #include <video/omap-panel-nokia-dsi.h>
48 #include "mux.h"
49 #include "hsmmc.h"
50 #include "timer-gp.h"
51 #include "control.h"
52 #include "common-board-devices.h"
53 #include "pm.h"
55 #define ETH_KS8851_IRQ 34
56 #define ETH_KS8851_POWER_ON 48
57 #define ETH_KS8851_QUART 138
58 #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184
59 #define OMAP4_SFH7741_ENABLE_GPIO 188
60 #define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */
61 #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
62 #define LCD_BL_GPIO 27 /* LCD Backlight GPIO */
63 /* PWM2 and TOGGLE3 register offsets */
64 #define LED_PWM2ON 0x03
65 #define LED_PWM2OFF 0x04
66 #define TWL6030_TOGGLE3 0x92
68 #define TPS62361_GPIO 7
70 #define PHYS_ADDR_SMC_SIZE (SZ_1M * 3)
71 #define PHYS_ADDR_SMC_MEM (0x80000000 + SZ_1G - PHYS_ADDR_SMC_SIZE)
72 #define OMAP_ION_HEAP_SECURE_INPUT_SIZE (SZ_1M * 90)
73 #define PHYS_ADDR_DUCATI_SIZE (SZ_1M * 105)
74 #define PHYS_ADDR_DUCATI_MEM (PHYS_ADDR_SMC_MEM - PHYS_ADDR_DUCATI_SIZE - \
75 OMAP_ION_HEAP_SECURE_INPUT_SIZE)
77 static const int sdp4430_keymap[] = {
78 KEY(0, 0, KEY_E),
79 KEY(0, 1, KEY_R),
80 KEY(0, 2, KEY_T),
81 KEY(0, 3, KEY_HOME),
82 KEY(0, 4, KEY_F5),
83 KEY(0, 5, KEY_UNKNOWN),
84 KEY(0, 6, KEY_I),
85 KEY(0, 7, KEY_LEFTSHIFT),
87 KEY(1, 0, KEY_D),
88 KEY(1, 1, KEY_F),
89 KEY(1, 2, KEY_G),
90 KEY(1, 3, KEY_SEND),
91 KEY(1, 4, KEY_F6),
92 KEY(1, 5, KEY_UNKNOWN),
93 KEY(1, 6, KEY_K),
94 KEY(1, 7, KEY_ENTER),
96 KEY(2, 0, KEY_X),
97 KEY(2, 1, KEY_C),
98 KEY(2, 2, KEY_V),
99 KEY(2, 3, KEY_END),
100 KEY(2, 4, KEY_F7),
101 KEY(2, 5, KEY_UNKNOWN),
102 KEY(2, 6, KEY_DOT),
103 KEY(2, 7, KEY_CAPSLOCK),
105 KEY(3, 0, KEY_Z),
106 KEY(3, 1, KEY_KPPLUS),
107 KEY(3, 2, KEY_B),
108 KEY(3, 3, KEY_F1),
109 KEY(3, 4, KEY_F8),
110 KEY(3, 5, KEY_UNKNOWN),
111 KEY(3, 6, KEY_O),
112 KEY(3, 7, KEY_SPACE),
114 KEY(4, 0, KEY_W),
115 KEY(4, 1, KEY_Y),
116 KEY(4, 2, KEY_U),
117 KEY(4, 3, KEY_F2),
118 KEY(4, 4, KEY_VOLUMEUP),
119 KEY(4, 5, KEY_UNKNOWN),
120 KEY(4, 6, KEY_L),
121 KEY(4, 7, KEY_LEFT),
123 KEY(5, 0, KEY_S),
124 KEY(5, 1, KEY_H),
125 KEY(5, 2, KEY_J),
126 KEY(5, 3, KEY_F3),
127 KEY(5, 4, KEY_F9),
128 KEY(5, 5, KEY_VOLUMEDOWN),
129 KEY(5, 6, KEY_M),
130 KEY(5, 7, KEY_RIGHT),
132 KEY(6, 0, KEY_Q),
133 KEY(6, 1, KEY_A),
134 KEY(6, 2, KEY_N),
135 KEY(6, 3, KEY_BACK),
136 KEY(6, 4, KEY_BACKSPACE),
137 KEY(6, 5, KEY_UNKNOWN),
138 KEY(6, 6, KEY_P),
139 KEY(6, 7, KEY_UP),
141 KEY(7, 0, KEY_PROG1),
142 KEY(7, 1, KEY_PROG2),
143 KEY(7, 2, KEY_PROG3),
144 KEY(7, 3, KEY_PROG4),
145 KEY(7, 4, KEY_F4),
146 KEY(7, 5, KEY_UNKNOWN),
147 KEY(7, 6, KEY_OK),
148 KEY(7, 7, KEY_DOWN),
151 static struct matrix_keymap_data sdp4430_keymap_data = {
152 .keymap = sdp4430_keymap,
153 .keymap_size = ARRAY_SIZE(sdp4430_keymap),
156 static struct omap4_keypad_platform_data sdp4430_keypad_data = {
157 .keymap_data = &sdp4430_keymap_data,
158 .rows = 8,
159 .cols = 8,
161 static struct gpio_led sdp4430_gpio_leds[] = {
163 .name = "omap4:green:debug0",
164 .gpio = 61,
167 .name = "omap4:green:debug1",
168 .gpio = 30,
171 .name = "omap4:green:debug2",
172 .gpio = 7,
175 .name = "omap4:green:debug3",
176 .gpio = 8,
179 .name = "omap4:green:debug4",
180 .gpio = 50,
183 .name = "omap4:blue:user",
184 .gpio = 169,
187 .name = "omap4:red:user",
188 .gpio = 170,
191 .name = "omap4:green:user",
192 .gpio = 139,
197 static struct gpio_keys_button sdp4430_gpio_keys[] = {
199 .desc = "Proximity Sensor",
200 .type = EV_SW,
201 .code = SW_FRONT_PROXIMITY,
202 .gpio = OMAP4_SFH7741_SENSOR_OUTPUT_GPIO,
203 .active_low = 0,
207 static struct gpio_led_platform_data sdp4430_led_data = {
208 .leds = sdp4430_gpio_leds,
209 .num_leds = ARRAY_SIZE(sdp4430_gpio_leds),
212 static struct led_pwm sdp4430_pwm_leds[] = {
214 .name = "omap4:green:chrg",
215 .pwm_id = 1,
216 .max_brightness = 255,
217 .pwm_period_ns = 7812500,
221 static struct led_pwm_platform_data sdp4430_pwm_data = {
222 .num_leds = ARRAY_SIZE(sdp4430_pwm_leds),
223 .leds = sdp4430_pwm_leds,
226 static struct platform_device sdp4430_leds_pwm = {
227 .name = "leds_pwm",
228 .id = -1,
229 .dev = {
230 .platform_data = &sdp4430_pwm_data,
234 static int omap_prox_activate(struct device *dev)
236 gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1);
237 return 0;
240 static void omap_prox_deactivate(struct device *dev)
242 gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 0);
245 static struct gpio_keys_platform_data sdp4430_gpio_keys_data = {
246 .buttons = sdp4430_gpio_keys,
247 .nbuttons = ARRAY_SIZE(sdp4430_gpio_keys),
248 .enable = omap_prox_activate,
249 .disable = omap_prox_deactivate,
252 static struct platform_device sdp4430_gpio_keys_device = {
253 .name = "gpio-keys",
254 .id = -1,
255 .dev = {
256 .platform_data = &sdp4430_gpio_keys_data,
260 static struct platform_device sdp4430_leds_gpio = {
261 .name = "leds-gpio",
262 .id = -1,
263 .dev = {
264 .platform_data = &sdp4430_led_data,
267 static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
269 .modalias = "ks8851",
270 .bus_num = 1,
271 .chip_select = 0,
272 .max_speed_hz = 24000000,
273 .irq = ETH_KS8851_IRQ,
277 static struct gpio sdp4430_eth_gpios[] __initdata = {
278 { ETH_KS8851_POWER_ON, GPIOF_OUT_INIT_HIGH, "eth_power" },
279 { ETH_KS8851_QUART, GPIOF_OUT_INIT_HIGH, "quart" },
280 { ETH_KS8851_IRQ, GPIOF_IN, "eth_irq" },
283 static int __init omap_ethernet_init(void)
285 int status;
287 /* Request of GPIO lines */
288 status = gpio_request_array(sdp4430_eth_gpios,
289 ARRAY_SIZE(sdp4430_eth_gpios));
290 if (status)
291 pr_err("Cannot request ETH GPIOs\n");
293 return status;
296 static struct platform_device *sdp4430_devices[] __initdata = {
297 &sdp4430_gpio_keys_device,
298 &sdp4430_leds_gpio,
299 &sdp4430_leds_pwm,
302 static struct omap_board_config_kernel sdp4430_config[] __initdata = {
305 static void __init omap_4430sdp_init_early(void)
307 omap2_init_common_infrastructure();
308 omap2_init_common_devices(NULL, NULL);
309 #ifdef CONFIG_OMAP_32K_TIMER
310 omap2_gp_clockevent_set_gptimer(1);
311 #endif
314 static struct omap_musb_board_data musb_board_data = {
315 .interface_type = MUSB_INTERFACE_UTMI,
316 .mode = MUSB_OTG,
317 .power = 100,
320 static struct twl4030_usb_data omap4_usbphy_data = {
321 .phy_init = omap4430_phy_init,
322 .phy_exit = omap4430_phy_exit,
323 .phy_power = omap4430_phy_power,
324 .phy_set_clock = omap4430_phy_set_clk,
325 .phy_suspend = omap4430_phy_suspend,
328 static struct omap2_hsmmc_info mmc[] = {
330 .mmc = 2,
331 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
332 .gpio_cd = -EINVAL,
333 .gpio_wp = -EINVAL,
334 .nonremovable = true,
335 .ocr_mask = MMC_VDD_29_30,
336 .no_off_init = true,
339 .mmc = 1,
340 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
341 .gpio_wp = -EINVAL,
343 {} /* Terminator */
346 static struct regulator_consumer_supply sdp4430_vaux_supply[] = {
348 .supply = "vmmc",
349 .dev_name = "omap_hsmmc.1",
352 static struct regulator_consumer_supply sdp4430_vmmc_supply[] = {
354 .supply = "vmmc",
355 .dev_name = "omap_hsmmc.0",
358 static struct regulator_consumer_supply sdp4430_vcxio_supply[] = {
359 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dss"),
360 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
363 static int omap4_twl6030_hsmmc_late_init(struct device *dev)
365 int ret = 0;
366 struct platform_device *pdev = container_of(dev,
367 struct platform_device, dev);
368 struct omap_mmc_platform_data *pdata = dev->platform_data;
370 /* Setting MMC1 Card detect Irq */
371 if (pdev->id == 0) {
372 ret = twl6030_mmc_card_detect_config();
373 if (ret)
374 pr_err("Failed configuring MMC1 card detect\n");
375 pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE +
376 MMCDETECT_INTR_OFFSET;
377 pdata->slots[0].card_detect = twl6030_mmc_card_detect;
379 return ret;
382 static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
384 struct omap_mmc_platform_data *pdata;
386 /* dev can be null if CONFIG_MMC_OMAP_HS is not set */
387 if (!dev) {
388 pr_err("Failed %s\n", __func__);
389 return;
391 pdata = dev->platform_data;
392 pdata->init = omap4_twl6030_hsmmc_late_init;
395 static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
397 struct omap2_hsmmc_info *c;
399 omap2_hsmmc_init(controllers);
400 for (c = controllers; c->mmc; c++)
401 omap4_twl6030_hsmmc_set_late_init(c->dev);
403 return 0;
406 static struct regulator_init_data sdp4430_vaux1 = {
407 .constraints = {
408 .min_uV = 1000000,
409 .max_uV = 3000000,
410 .apply_uV = true,
411 .valid_modes_mask = REGULATOR_MODE_NORMAL
412 | REGULATOR_MODE_STANDBY,
413 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
414 | REGULATOR_CHANGE_MODE
415 | REGULATOR_CHANGE_STATUS,
417 .num_consumer_supplies = 1,
418 .consumer_supplies = sdp4430_vaux_supply,
421 static struct regulator_init_data sdp4430_vaux2 = {
422 .constraints = {
423 .min_uV = 1200000,
424 .max_uV = 2800000,
425 .apply_uV = true,
426 .valid_modes_mask = REGULATOR_MODE_NORMAL
427 | REGULATOR_MODE_STANDBY,
428 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
429 | REGULATOR_CHANGE_MODE
430 | REGULATOR_CHANGE_STATUS,
434 static struct regulator_init_data sdp4430_vaux3 = {
435 .constraints = {
436 .min_uV = 1000000,
437 .max_uV = 3000000,
438 .apply_uV = true,
439 .valid_modes_mask = REGULATOR_MODE_NORMAL
440 | REGULATOR_MODE_STANDBY,
441 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
442 | REGULATOR_CHANGE_MODE
443 | REGULATOR_CHANGE_STATUS,
447 /* VMMC1 for MMC1 card */
448 static struct regulator_init_data sdp4430_vmmc = {
449 .constraints = {
450 .min_uV = 1200000,
451 .max_uV = 3000000,
452 .apply_uV = true,
453 .valid_modes_mask = REGULATOR_MODE_NORMAL
454 | REGULATOR_MODE_STANDBY,
455 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
456 | REGULATOR_CHANGE_MODE
457 | REGULATOR_CHANGE_STATUS,
459 .num_consumer_supplies = 1,
460 .consumer_supplies = sdp4430_vmmc_supply,
463 static struct regulator_init_data sdp4430_vpp = {
464 .constraints = {
465 .min_uV = 1800000,
466 .max_uV = 2500000,
467 .apply_uV = true,
468 .valid_modes_mask = REGULATOR_MODE_NORMAL
469 | REGULATOR_MODE_STANDBY,
470 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
471 | REGULATOR_CHANGE_MODE
472 | REGULATOR_CHANGE_STATUS,
476 static struct regulator_init_data sdp4430_vusim = {
477 .constraints = {
478 .min_uV = 1200000,
479 .max_uV = 2900000,
480 .apply_uV = true,
481 .valid_modes_mask = REGULATOR_MODE_NORMAL
482 | REGULATOR_MODE_STANDBY,
483 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
484 | REGULATOR_CHANGE_MODE
485 | REGULATOR_CHANGE_STATUS,
489 static struct regulator_init_data sdp4430_vana = {
490 .constraints = {
491 .min_uV = 2100000,
492 .max_uV = 2100000,
493 .valid_modes_mask = REGULATOR_MODE_NORMAL
494 | REGULATOR_MODE_STANDBY,
495 .valid_ops_mask = REGULATOR_CHANGE_MODE
496 | REGULATOR_CHANGE_STATUS,
500 static struct regulator_init_data sdp4430_vcxio = {
501 .constraints = {
502 .min_uV = 1800000,
503 .max_uV = 1800000,
504 .valid_modes_mask = REGULATOR_MODE_NORMAL
505 | REGULATOR_MODE_STANDBY,
506 .valid_ops_mask = REGULATOR_CHANGE_MODE
507 | REGULATOR_CHANGE_STATUS,
508 .always_on = true,
510 .num_consumer_supplies = ARRAY_SIZE(sdp4430_vcxio_supply),
511 .consumer_supplies = sdp4430_vcxio_supply,
514 static struct regulator_init_data sdp4430_vdac = {
515 .constraints = {
516 .min_uV = 1800000,
517 .max_uV = 1800000,
518 .valid_modes_mask = REGULATOR_MODE_NORMAL
519 | REGULATOR_MODE_STANDBY,
520 .valid_ops_mask = REGULATOR_CHANGE_MODE
521 | REGULATOR_CHANGE_STATUS,
525 static struct regulator_init_data sdp4430_vusb = {
526 .constraints = {
527 .min_uV = 3300000,
528 .max_uV = 3300000,
529 .apply_uV = true,
530 .valid_modes_mask = REGULATOR_MODE_NORMAL
531 | REGULATOR_MODE_STANDBY,
532 .valid_ops_mask = REGULATOR_CHANGE_MODE
533 | REGULATOR_CHANGE_STATUS,
537 static struct regulator_init_data sdp4430_clk32kg = {
538 .constraints = {
539 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
543 static struct twl4030_platform_data sdp4430_twldata = {
544 .irq_base = TWL6030_IRQ_BASE,
545 .irq_end = TWL6030_IRQ_END,
547 /* Regulators */
548 .vmmc = &sdp4430_vmmc,
549 .vpp = &sdp4430_vpp,
550 .vusim = &sdp4430_vusim,
551 .vana = &sdp4430_vana,
552 .vcxio = &sdp4430_vcxio,
553 .vdac = &sdp4430_vdac,
554 .vusb = &sdp4430_vusb,
555 .vaux1 = &sdp4430_vaux1,
556 .vaux2 = &sdp4430_vaux2,
557 .vaux3 = &sdp4430_vaux3,
558 .clk32kg = &sdp4430_clk32kg,
559 .usb = &omap4_usbphy_data
562 static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = {
564 I2C_BOARD_INFO("tmp105", 0x48),
567 I2C_BOARD_INFO("bh1780", 0x29),
570 static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = {
572 I2C_BOARD_INFO("hmc5843", 0x1e),
575 static int __init omap4_i2c_init(void)
577 omap4_pmic_init("twl6030", &sdp4430_twldata);
578 omap_register_i2c_bus(2, 400, NULL, 0);
579 omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
580 ARRAY_SIZE(sdp4430_i2c_3_boardinfo));
581 omap_register_i2c_bus(4, 400, sdp4430_i2c_4_boardinfo,
582 ARRAY_SIZE(sdp4430_i2c_4_boardinfo));
583 return 0;
586 static void __init omap_sfh7741prox_init(void)
588 int error;
590 error = gpio_request_one(OMAP4_SFH7741_ENABLE_GPIO,
591 GPIOF_OUT_INIT_LOW, "sfh7741");
592 if (error < 0)
593 pr_err("%s:failed to request GPIO %d, error %d\n",
594 __func__, OMAP4_SFH7741_ENABLE_GPIO, error);
597 static int dsi1_panel_set_backlight(struct omap_dss_device *dssdev, int level)
599 int r;
601 r = twl_i2c_write_u8(TWL_MODULE_PWM, 0x7F, LED_PWM2OFF);
602 if (r)
603 return r;
605 if (level > 1) {
606 if (level == 255)
607 level = 0x7F;
608 else
609 level = (~(level/2)) & 0x7F;
611 r = twl_i2c_write_u8(TWL_MODULE_PWM, level, LED_PWM2ON);
612 if (r)
613 return r;
614 r = twl_i2c_write_u8(TWL6030_MODULE_ID1, 0x30, TWL6030_TOGGLE3);
615 if (r)
616 return r;
617 } else if (level <= 1) {
618 r = twl_i2c_write_u8(TWL6030_MODULE_ID1, 0x08, TWL6030_TOGGLE3);
619 if (r)
620 return r;
621 r = twl_i2c_write_u8(TWL6030_MODULE_ID1, 0x28, TWL6030_TOGGLE3);
622 if (r)
623 return r;
624 r = twl_i2c_write_u8(TWL6030_MODULE_ID1, 0x00, TWL6030_TOGGLE3);
625 if (r)
626 return r;
629 return 0;
632 static struct nokia_dsi_panel_data dsi1_panel;
634 static void sdp4430_lcd_init(void)
636 u32 reg;
637 int status;
639 /* Enable 3 lanes in DSI1 module, disable pull down */
640 reg = omap4_ctrl_pad_readl(OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY);
641 reg &= ~OMAP4_DSI1_LANEENABLE_MASK;
642 reg |= 0x7 << OMAP4_DSI1_LANEENABLE_SHIFT;
643 reg &= ~OMAP4_DSI1_PIPD_MASK;
644 reg |= 0x7 << OMAP4_DSI1_PIPD_SHIFT;
645 omap4_ctrl_pad_writel(reg, OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY);
647 /* Panel Taal reset and backlight GPIO init */
648 status = gpio_request_one(dsi1_panel.reset_gpio, GPIOF_DIR_OUT,
649 "lcd_reset_gpio");
650 if (status)
651 pr_err("%s: Could not get lcd_reset_gpio\n", __func__);
653 if (dsi1_panel.use_ext_te) {
654 status = omap_mux_init_signal("gpmc_ncs4.gpio_101",
655 OMAP_PIN_INPUT_PULLUP);
656 if (status)
657 pr_err("%s: Could not get ext_te gpio\n", __func__);
660 status = gpio_request_one(LCD_BL_GPIO, GPIOF_DIR_OUT, "lcd_bl_gpio");
661 if (status)
662 pr_err("%s: Could not get lcd_bl_gpio\n", __func__);
664 gpio_set_value(LCD_BL_GPIO, 0);
667 static void sdp4430_hdmi_mux_init(void)
669 /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */
670 omap_mux_init_signal("hdmi_hpd",
671 OMAP_PIN_INPUT_PULLUP);
672 omap_mux_init_signal("hdmi_cec",
673 OMAP_PIN_INPUT_PULLUP);
674 /* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */
675 omap_mux_init_signal("hdmi_ddc_scl",
676 OMAP_PIN_INPUT_PULLUP);
677 omap_mux_init_signal("hdmi_ddc_sda",
678 OMAP_PIN_INPUT_PULLUP);
681 static struct gpio sdp4430_hdmi_gpios[] = {
682 { HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_hpd" },
683 { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" },
686 static int sdp4430_panel_enable_hdmi(struct omap_dss_device *dssdev)
688 int status;
690 status = gpio_request_array(sdp4430_hdmi_gpios,
691 ARRAY_SIZE(sdp4430_hdmi_gpios));
692 if (status)
693 pr_err("%s: Cannot request HDMI GPIOs\n", __func__);
695 return status;
698 static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev)
700 gpio_free(HDMI_GPIO_LS_OE);
701 gpio_free(HDMI_GPIO_HPD);
704 static struct nokia_dsi_panel_data dsi1_panel = {
705 .name = "taal",
706 .reset_gpio = 102,
707 .use_ext_te = false,
708 .ext_te_gpio = 101,
709 .esd_interval = 0,
710 .set_backlight = dsi1_panel_set_backlight,
713 static struct omap_dss_device sdp4430_lcd_device = {
714 .name = "lcd",
715 .driver_name = "taal",
716 .type = OMAP_DISPLAY_TYPE_DSI,
717 .data = &dsi1_panel,
718 .phy.dsi = {
719 .clk_lane = 1,
720 .clk_pol = 0,
721 .data1_lane = 2,
722 .data1_pol = 0,
723 .data2_lane = 3,
724 .data2_pol = 0,
727 .clocks = {
728 .dispc = {
729 .channel = {
730 .lck_div = 1, /* Logic Clock = 172.8 MHz */
731 .pck_div = 5, /* Pixel Clock = 34.56 MHz */
732 .lcd_clk_src = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC,
734 .dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK,
737 .dsi = {
738 .regn = 16, /* Fint = 2.4 MHz */
739 .regm = 180, /* DDR Clock = 216 MHz */
740 .regm_dispc = 5, /* PLL1_CLK1 = 172.8 MHz */
741 .regm_dsi = 5, /* PLL1_CLK2 = 172.8 MHz */
743 .lp_clk_div = 10, /* LP Clock = 8.64 MHz */
744 .dsi_fclk_src = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI,
747 .channel = OMAP_DSS_CHANNEL_LCD,
750 static struct omap_dss_device sdp4430_hdmi_device = {
751 .name = "hdmi",
752 .driver_name = "hdmi_panel",
753 .type = OMAP_DISPLAY_TYPE_HDMI,
754 .clocks = {
755 .dispc = {
756 .dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK,
758 .hdmi = {
759 .regn = 15,
760 .regm2 = 1,
763 .platform_enable = sdp4430_panel_enable_hdmi,
764 .platform_disable = sdp4430_panel_disable_hdmi,
765 .channel = OMAP_DSS_CHANNEL_DIGIT,
768 static struct omap_dss_device *sdp4430_dss_devices[] = {
769 &sdp4430_lcd_device,
770 &sdp4430_hdmi_device,
773 static struct omap_dss_board_info sdp4430_dss_data = {
774 .num_devices = ARRAY_SIZE(sdp4430_dss_devices),
775 .devices = sdp4430_dss_devices,
776 .default_device = &sdp4430_lcd_device,
779 void omap_4430sdp_display_init(void)
781 sdp4430_lcd_init();
782 sdp4430_hdmi_mux_init();
783 omap_display_init(&sdp4430_dss_data);
786 #ifdef CONFIG_OMAP_MUX
787 static struct omap_board_mux board_mux[] __initdata = {
788 OMAP4_MUX(USBB2_ULPITLL_CLK, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
789 { .reg_offset = OMAP_MUX_TERMINATOR },
793 * LPDDR2 Configeration Data:
794 * The memory organisation is as below :
795 * EMIF1 - CS0 - 2 Gb
796 * CS1 - 2 Gb
797 * EMIF2 - CS0 - 2 Gb
798 * CS1 - 2 Gb
799 * --------------------
800 * TOTAL - 8 Gb
802 * Same devices installed on EMIF1 and EMIF2
804 static __initdata struct emif_device_details emif_devices = {
805 .cs0_device = &lpddr2_elpida_2G_S4_dev,
806 .cs1_device = &lpddr2_elpida_2G_S4_dev
809 static inline void __init board_serial_init(void)
811 omap_serial_init();
814 #else
815 #define board_mux NULL
817 static inline void board_serial_init(void)
819 omap_serial_init();
821 #endif
823 static void __init omap_4430sdp_init(void)
825 int status;
826 int package = OMAP_PACKAGE_CBS;
828 if (omap_rev() == OMAP4430_REV_ES1_0)
829 package = OMAP_PACKAGE_CBL;
830 omap4_mux_init(board_mux, NULL, package);
832 omap_emif_setup_device_details(&emif_devices, &emif_devices);
834 omap_board_config = sdp4430_config;
835 omap_board_config_size = ARRAY_SIZE(sdp4430_config);
837 omap4_i2c_init();
838 omap_sfh7741prox_init();
839 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
840 board_serial_init();
841 omap4_twl6030_hsmmc_init(mmc);
843 usb_musb_init(&musb_board_data);
845 status = omap_ethernet_init();
846 if (status) {
847 pr_err("Ethernet initialization failed: %d\n", status);
848 } else {
849 sdp4430_spi_board_info[0].irq = gpio_to_irq(ETH_KS8851_IRQ);
850 spi_register_board_info(sdp4430_spi_board_info,
851 ARRAY_SIZE(sdp4430_spi_board_info));
854 status = omap4_keyboard_init(&sdp4430_keypad_data);
855 if (status)
856 pr_err("Keypad initialization failed: %d\n", status);
858 omap_dmm_init();
859 omap_4430sdp_display_init();
861 if (cpu_is_omap446x()) {
862 /* Vsel0 = gpio, vsel1 = gnd */
863 status = omap_tps6236x_board_setup(true, TPS62361_GPIO, -1,
864 OMAP_PIN_OFF_OUTPUT_HIGH, -1);
865 if (status)
866 pr_err("TPS62361 initialization failed: %d\n", status);
870 static void __init omap_4430sdp_map_io(void)
872 omap2_set_globals_443x();
873 omap44xx_map_common_io();
876 static void __init omap_4430sdp_reserve(void)
878 /* do the static reservations first */
879 memblock_remove(PHYS_ADDR_SMC_MEM, PHYS_ADDR_SMC_SIZE);
880 memblock_remove(PHYS_ADDR_DUCATI_MEM, PHYS_ADDR_DUCATI_SIZE);
881 /* ipu needs to recognize secure input buffer area as well */
882 omap_ipu_set_static_mempool(PHYS_ADDR_DUCATI_MEM, PHYS_ADDR_DUCATI_SIZE +
883 OMAP_ION_HEAP_SECURE_INPUT_SIZE);
885 omap_reserve();
888 MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
889 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
890 .boot_params = 0x80000100,
891 .reserve = omap_4430sdp_reserve,
892 .map_io = omap_4430sdp_map_io,
893 .init_early = omap_4430sdp_init_early,
894 .init_irq = gic_init_irq,
895 .init_machine = omap_4430sdp_init,
896 .timer = &omap_timer,
897 MACHINE_END