]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/karo/tx53/tx53.c
karo: tx53: check 'video_mode' variable before calling karo_fdt_get_backlight_polarity()
[karo-tx-uboot.git] / board / karo / tx53 / tx53.c
index 26caf9d6e1a58199d6ed723c5b554a6a3df1db4d..d6107f31a34f6194ed8f8b17c2e7103006ebc17e 100644 (file)
@@ -444,9 +444,6 @@ int board_early_init_f(void)
 {
        struct mxc_ccm_reg *ccm_regs = (void *)CCM_BASE_ADDR;
 
-       gpio_request_array(tx53_gpios, ARRAY_SIZE(tx53_gpios));
-       imx_iomux_v3_setup_multiple_pads(tx53_pads, ARRAY_SIZE(tx53_pads));
-
        writel(0x77777777, AIPS1_BASE_ADDR + 0x00);
        writel(0x77777777, AIPS1_BASE_ADDR + 0x04);
 
@@ -475,6 +472,8 @@ int board_early_init_f(void)
        writel(0xfff00000, &ccm_regs->CCGR7);
        writel(0x00000000, &ccm_regs->cmeor);
 
+       imx_iomux_v3_setup_multiple_pads(tx53_pads, ARRAY_SIZE(tx53_pads));
+
        return 0;
 }
 
@@ -482,6 +481,11 @@ int board_init(void)
 {
        int ret;
 
+       ret = gpio_request_array(tx53_gpios, ARRAY_SIZE(tx53_gpios));
+       if (ret < 0) {
+               printf("Failed to request tx53_gpios: %d\n", ret);
+       }
+
        /* Address of boot parameters */
        gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x1000;
 
@@ -1055,13 +1059,14 @@ 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");
                lcd_enabled = 0;
                return;
        }
+
+       lcd_bl_polarity = karo_fdt_get_backlight_polarity(working_fdt);
        vm = video_mode;
        if (karo_fdt_get_fb_mode(working_fdt, video_mode, &fb_mode) == 0) {
                p = &fb_mode;