]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/karo/tx51/tx51.c
Merge branch 'tx51-devel' into uboot-merge
[karo-tx-uboot.git] / board / karo / tx51 / tx51.c
index be75cb9589ee6dafd924c364d6d36db1fce1e069..eff52076dd6957f684f922027bddaef0fb4b86c3 100644 (file)
@@ -386,9 +386,6 @@ int board_mmc_init(bd_t *bis)
                struct tx51_esdhc_cfg *cfg = &tx51_esdhc_cfg[i];
                int ret;
 
-               if (i >= CONFIG_SYS_FSL_ESDHC_NUM)
-                       break;
-
                imx_iomux_v3_setup_multiple_pads(cfg->pads,
                                                cfg->num_pads);
                cfg->cfg.sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
@@ -689,6 +686,12 @@ static struct fb_videomode tx51_fb_modes[] = {
 };
 
 static int lcd_enabled = 1;
+static int lcd_bl_polarity;
+
+static int lcd_backlight_polarity(void)
+{
+       return lcd_bl_polarity;
+}
 
 void lcd_enable(void)
 {
@@ -707,7 +710,8 @@ void lcd_enable(void)
                udelay(100);
                gpio_set_value(TX51_LCD_RST_GPIO, 1);
                udelay(300000);
-               gpio_set_value(TX51_LCD_BACKLIGHT_GPIO, 0);
+               gpio_set_value(TX51_LCD_BACKLIGHT_GPIO,
+                       lcd_backlight_polarity());
        }
 }
 
@@ -723,7 +727,8 @@ void lcd_panel_disable(void)
 {
        if (lcd_enabled) {
                debug("Switching LCD off\n");
-               gpio_set_value(TX51_LCD_BACKLIGHT_GPIO, 1);
+               gpio_set_value(TX51_LCD_BACKLIGHT_GPIO,
+                       !lcd_backlight_polarity());
                gpio_set_value(TX51_LCD_RST_GPIO, 0);
                gpio_set_value(TX51_LCD_PWR_GPIO, 0);
        }
@@ -800,6 +805,7 @@ void lcd_ctrl_init(void *lcdbase)
        }
 
        karo_fdt_move_fdt();
+       lcd_bl_polarity = karo_fdt_get_backlight_polarity(working_fdt);
 
        if (video_mode == NULL) {
                debug("Disabling LCD\n");
@@ -1002,7 +1008,6 @@ static void stk5v3_board_init(void)
 static void tx51_set_cpu_clock(void)
 {
        unsigned long cpu_clk = getenv_ulong("cpu_clk", 10, 0);
-       int ret;
 
        if (had_ctrlc() || (wrsr & WRSR_TOUT))
                return;
@@ -1103,13 +1108,18 @@ static const char *tx51_touchpanels[] = {
 void ft_board_setup(void *blob, bd_t *bd)
 {
        const char *video_mode = karo_get_vmode(getenv("video_mode"));
+       int ret;
+
+       ret = fdt_increase_size(blob, 4096);
+       if (ret)
+               printf("Failed to increase FDT size: %s\n", fdt_strerror(ret));
 
        fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
        fdt_fixup_ethernet(blob);
 
        karo_fdt_fixup_touchpanel(blob, tx51_touchpanels,
                                ARRAY_SIZE(tx51_touchpanels));
-       karo_fdt_fixup_usb_otg(blob, "fsl,imx-otg", "fsl,usbphy");
+       karo_fdt_fixup_usb_otg(blob, "usbotg", "fsl,usbphy");
        karo_fdt_update_fb_mode(blob, video_mode);
 }
 #endif /* CONFIG_OF_BOARD_SETUP */