76
96
static struct platform_device *panda_devices[] __initdata = {
81
#define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
83
static int panda_enable_dvi(struct omap_dss_device *dssdev)
85
gpio_set_value(dssdev->reset_gpio, 1);
89
static void panda_disable_dvi(struct omap_dss_device *dssdev)
91
gpio_set_value(dssdev->reset_gpio, 0);
94
/* Using generic display panel */
95
static struct panel_generic_dpi_data dvi_panel = {
97
.platform_enable = panda_enable_dvi,
98
.platform_disable = panda_disable_dvi,
101
struct omap_dss_device panda_dvi_device = {
102
.type = OMAP_DISPLAY_TYPE_DPI,
104
.driver_name = "generic_dpi_panel",
106
.phy.dpi.data_lines = 24,
107
.reset_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
108
.channel = OMAP_DSS_CHANNEL_LCD2,
111
int __init panda_dvi_init(void)
115
/* Requesting TFP410 DVI GPIO and disabling it, at bootup */
116
r = gpio_request_one(panda_dvi_device.reset_gpio,
117
GPIOF_OUT_INIT_LOW, "DVI PD");
119
pr_err("Failed to get DVI powerdown GPIO\n");
124
static struct omap_dss_device *panda_dss_devices[] = {
128
static struct omap_dss_board_info panda_dss_data = {
129
.num_devices = ARRAY_SIZE(panda_dss_devices),
130
.devices = panda_dss_devices,
131
.default_device = &panda_dvi_device,
134
static void __init omap4_panda_init_irq(void)
101
static void __init omap4_panda_init_early(void)
136
103
omap2_init_common_infrastructure();
137
104
omap2_init_common_devices(NULL, NULL);
141
static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
142
.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
143
.port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
144
.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
107
static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
108
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
109
.port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
110
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
145
111
.phy_reset = false,
146
112
.reset_gpio_port[0] = -EINVAL,
147
113
.reset_gpio_port[1] = -EINVAL,
217
184
.gpio_wp = -EINVAL,
218
185
.gpio_cd = -EINVAL,
190
.caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
193
.ocr_mask = MMC_VDD_165_195,
194
.nonremovable = true,
220
196
{} /* Terminator */
223
199
static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = {
225
201
.supply = "vmmc",
226
.dev_name = "mmci-omap-hs.0",
202
.dev_name = "omap_hsmmc.0",
206
static struct regulator_consumer_supply omap4_panda_vmmc5_supply = {
208
.dev_name = "omap_hsmmc.4",
211
static struct regulator_init_data panda_vmmc5 = {
213
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
215
.num_consumer_supplies = 1,
216
.consumer_supplies = &omap4_panda_vmmc5_supply,
219
static struct fixed_voltage_config panda_vwlan = {
220
.supply_name = "vwl1271",
221
.microvolts = 1800000, /* 1.8V */
222
.gpio = GPIO_WIFI_PMENA,
223
.startup_delay = 70000, /* 70msec */
225
.enabled_at_boot = 0,
226
.init_data = &panda_vmmc5,
229
static struct platform_device omap_vwlan_device = {
230
.name = "reg-fixed-voltage",
233
.platform_data = &panda_vwlan,
237
struct wl12xx_platform_data omap_panda_wlan_data __initdata = {
238
.irq = OMAP_GPIO_IRQ(GPIO_WIFI_IRQ),
239
/* PANDA ref clock is 38.4 MHz */
240
.board_ref_clock = 2,
230
243
static int omap4_twl6030_hsmmc_late_init(struct device *dev)
491
524
OMAP4_MUX(DPM_EMU19, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
492
525
{ .reg_offset = OMAP_MUX_TERMINATOR },
528
static struct omap_device_pad serial2_pads[] __initdata = {
529
OMAP_MUX_STATIC("uart2_cts.uart2_cts",
530
OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
531
OMAP_MUX_STATIC("uart2_rts.uart2_rts",
532
OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
533
OMAP_MUX_STATIC("uart2_rx.uart2_rx",
534
OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
535
OMAP_MUX_STATIC("uart2_tx.uart2_tx",
536
OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
539
static struct omap_device_pad serial3_pads[] __initdata = {
540
OMAP_MUX_STATIC("uart3_cts_rctx.uart3_cts_rctx",
541
OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
542
OMAP_MUX_STATIC("uart3_rts_sd.uart3_rts_sd",
543
OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
544
OMAP_MUX_STATIC("uart3_rx_irrx.uart3_rx_irrx",
545
OMAP_PIN_INPUT | OMAP_MUX_MODE0),
546
OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx",
547
OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
550
static struct omap_device_pad serial4_pads[] __initdata = {
551
OMAP_MUX_STATIC("uart4_rx.uart4_rx",
552
OMAP_PIN_INPUT | OMAP_MUX_MODE0),
553
OMAP_MUX_STATIC("uart4_tx.uart4_tx",
554
OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
557
static struct omap_board_data serial2_data = {
559
.pads = serial2_pads,
560
.pads_cnt = ARRAY_SIZE(serial2_pads),
563
static struct omap_board_data serial3_data = {
565
.pads = serial3_pads,
566
.pads_cnt = ARRAY_SIZE(serial3_pads),
569
static struct omap_board_data serial4_data = {
571
.pads = serial4_pads,
572
.pads_cnt = ARRAY_SIZE(serial4_pads),
575
static inline void board_serial_init(void)
577
struct omap_board_data bdata;
582
/* pass dummy data for UART1 */
583
omap_serial_init_port(&bdata);
585
omap_serial_init_port(&serial2_data);
586
omap_serial_init_port(&serial3_data);
587
omap_serial_init_port(&serial4_data);
495
590
#define board_mux NULL
592
static inline void board_serial_init(void)
599
#define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
601
static int omap4_panda_enable_dvi(struct omap_dss_device *dssdev)
603
gpio_set_value(dssdev->reset_gpio, 1);
607
static void omap4_panda_disable_dvi(struct omap_dss_device *dssdev)
609
gpio_set_value(dssdev->reset_gpio, 0);
612
/* Using generic display panel */
613
static struct panel_generic_dpi_data omap4_dvi_panel = {
615
.platform_enable = omap4_panda_enable_dvi,
616
.platform_disable = omap4_panda_disable_dvi,
619
struct omap_dss_device omap4_panda_dvi_device = {
620
.type = OMAP_DISPLAY_TYPE_DPI,
622
.driver_name = "generic_dpi_panel",
623
.data = &omap4_dvi_panel,
624
.phy.dpi.data_lines = 24,
625
.reset_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
626
.channel = OMAP_DSS_CHANNEL_LCD2,
629
int __init omap4_panda_dvi_init(void)
633
/* Requesting TFP410 DVI GPIO and disabling it, at bootup */
634
r = gpio_request_one(omap4_panda_dvi_device.reset_gpio,
635
GPIOF_OUT_INIT_LOW, "DVI PD");
637
pr_err("Failed to get DVI powerdown GPIO\n");
643
static void omap4_panda_hdmi_mux_init(void)
645
/* PAD0_HDMI_HPD_PAD1_HDMI_CEC */
646
omap_mux_init_signal("hdmi_hpd",
647
OMAP_PIN_INPUT_PULLUP);
648
omap_mux_init_signal("hdmi_cec",
649
OMAP_PIN_INPUT_PULLUP);
650
/* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */
651
omap_mux_init_signal("hdmi_ddc_scl",
652
OMAP_PIN_INPUT_PULLUP);
653
omap_mux_init_signal("hdmi_ddc_sda",
654
OMAP_PIN_INPUT_PULLUP);
657
static int omap4_panda_panel_enable_hdmi(struct omap_dss_device *dssdev)
661
status = gpio_request_one(HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH,
664
pr_err("Cannot request GPIO %d\n", HDMI_GPIO_HPD);
667
status = gpio_request_one(HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH,
670
pr_err("Cannot request GPIO %d\n", HDMI_GPIO_LS_OE);
677
gpio_free(HDMI_GPIO_HPD);
682
static void omap4_panda_panel_disable_hdmi(struct omap_dss_device *dssdev)
684
gpio_free(HDMI_GPIO_LS_OE);
685
gpio_free(HDMI_GPIO_HPD);
688
static struct omap_dss_device omap4_panda_hdmi_device = {
690
.driver_name = "hdmi_panel",
691
.type = OMAP_DISPLAY_TYPE_HDMI,
692
.platform_enable = omap4_panda_panel_enable_hdmi,
693
.platform_disable = omap4_panda_panel_disable_hdmi,
694
.channel = OMAP_DSS_CHANNEL_DIGIT,
697
static struct omap_dss_device *omap4_panda_dss_devices[] = {
698
&omap4_panda_dvi_device,
699
&omap4_panda_hdmi_device,
702
static struct omap_dss_board_info omap4_panda_dss_data = {
703
.num_devices = ARRAY_SIZE(omap4_panda_dss_devices),
704
.devices = omap4_panda_dss_devices,
705
.default_device = &omap4_panda_dvi_device,
708
void omap4_panda_display_init(void)
712
r = omap4_panda_dvi_init();
714
pr_err("error initializing panda DVI\n");
716
omap4_panda_hdmi_mux_init();
717
omap_display_init(&omap4_panda_dss_data);
721
* These device paths represent the onboard USB <-> Ethernet bridge, and
722
* the WLAN module on Panda, both of which need their random or all-zeros
723
* mac address replacing with a per-cpu stable generated one
725
static const char * const panda_fixup_mac_device_paths[] = {
726
"usb1/1-1/1-1.1/1-1.1:1.0",
730
static int panda_device_path_need_mac(struct device *dev)
732
const char **try = panda_fixup_mac_device_paths;
734
int count = ARRAY_SIZE(panda_fixup_mac_device_paths);
741
p = *try + strlen(*try);
746
path = dev_name(devn);
749
if ((p - *try) < len) {
756
if (strncmp(path, p, len)) {
765
if (devn != NULL && (p - *try) < 2)
769
if (devn != NULL && *p != '/')
779
static int omap_panda_netdev_event(struct notifier_block *this,
780
unsigned long event, void *ptr)
782
struct net_device *dev = ptr;
786
if (event != NETDEV_REGISTER)
789
n = panda_device_path_need_mac(dev->dev.parent);
791
sa.sa_family = dev->type;
792
omap2_die_id_to_ethernet_mac(sa.sa_data, n);
793
dev->netdev_ops->ndo_set_mac_address(dev, &sa);
799
static struct notifier_block omap_panda_netdev_notifier = {
800
.notifier_call = omap_panda_netdev_event,
498
804
static void __init omap4_panda_init(void)
500
806
int package = OMAP_PACKAGE_CBS;
503
808
if (omap_rev() == OMAP4430_REV_ES1_0)
504
809
package = OMAP_PACKAGE_CBL;
505
810
omap4_mux_init(board_mux, package);
812
if (wl12xx_set_platform_data(&omap_panda_wlan_data))
813
pr_err("error setting wl12xx data\n");
815
register_netdevice_notifier(&omap_panda_netdev_notifier);
507
817
omap4_panda_i2c_init();
508
818
platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
819
platform_device_register(&omap_vwlan_device);
510
821
omap4_twl6030_hsmmc_init(mmc);
511
822
omap4_ehci_init();
512
823
usb_musb_init(&musb_board_data);
514
/* Enabling DVI Display */
515
err = panda_dvi_init();
517
omap_display_init(&panda_dss_data);
824
omap4_panda_display_init();
520
827
static void __init omap4_panda_map_io(void)