]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/karo/tx53/tx53.c
Merge branch 'tx53-update-2016-02-03' into karo-tx6
[karo-tx-uboot.git] / board / karo / tx53 / tx53.c
index 26caf9d6e1a58199d6ed723c5b554a6a3df1db4d..49cc641fc6b265d04d83af88360419ae6b901f1f 100644 (file)
@@ -33,6 +33,7 @@
 #include <asm/gpio.h>
 #include <asm/arch/iomux-mx53.h>
 #include <asm/arch/clock.h>
+#include <asm/arch/hab.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/crm_regs.h>
 #include <asm/arch/sys_proto.h>
@@ -59,6 +60,7 @@ DECLARE_GLOBAL_DATA_PTR;
                                PAD_CTL_SRE_FAST | PAD_CTL_PUS_47K_UP)
 
 char __uboot_img_end[0] __attribute__((section(".__uboot_img_end")));
+char __csf_data[0] __attribute__((section(".__csf_data")));
 
 static iomux_v3_cfg_t tx53_pads[] = {
        /* NAND flash pads are set up in lowlevel_init.S */
@@ -444,9 +446,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 +474,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 +483,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;
 
@@ -490,7 +496,7 @@ int board_init(void)
                        printf("WDOG RESET detected; Skipping PMIC setup\n");
                else
                        printf("<CTRL-C> detected; safeboot enabled\n");
-               return 1;
+               return 0;
        }
 
        ret = setup_pmic_voltages();
@@ -756,14 +762,12 @@ static const struct gpio stk5_gpios[] = {
 };
 
 #ifdef CONFIG_LCD
-static u16 tx53_cmap[256];
 vidinfo_t panel_info = {
        /* set to max. size supported by SoC */
        .vl_col = 1600,
        .vl_row = 1200,
 
        .vl_bpix = LCD_COLOR32,    /* Bits per pixel, 0: 1bpp, 1: 2bpp, 2: 4bpp, 3: 8bpp ... */
-       .cmap = tx53_cmap,
 };
 
 static struct fb_videomode tx53_fb_modes[] = {
@@ -833,7 +837,6 @@ static struct fb_videomode tx53_fb_modes[] = {
                .upper_margin   = 2,
                .vsync_len      = 10,
                .lower_margin   = 2,
-               .sync           = FB_SYNC_CLK_LAT_FALL,
        },
        {
                /* Emerging ET0500G0DH6 800 x 480 display.
@@ -1055,13 +1058,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;
@@ -1315,7 +1319,7 @@ static void tx53_init_mac(void)
        u8 mac[ETH_ALEN];
 
        imx_get_mac_from_fuse(0, mac);
-       if (!is_valid_ether_addr(mac)) {
+       if (!is_valid_ethaddr(mac)) {
                printf("No valid MAC address programmed\n");
                return;
        }
@@ -1326,7 +1330,6 @@ static void tx53_init_mac(void)
 
 int board_late_init(void)
 {
-       int ret = 0;
        const char *baseboard;
 
        env_cleanup();
@@ -1366,7 +1369,8 @@ int board_late_init(void)
        } else {
                printf("WARNING: Unsupported baseboard: '%s'\n",
                        baseboard);
-               ret = -EINVAL;
+               if (!had_ctrlc())
+                       return -EINVAL;
        }
 
 exit:
@@ -1374,7 +1378,10 @@ exit:
 
        gpio_set_value(TX53_RESET_OUT_GPIO, 1);
        clear_ctrlc();
-       return ret;
+
+       get_hab_status();
+
+       return 0;
 }
 
 int checkboard(void)
@@ -1438,7 +1445,6 @@ int ft_board_setup(void *blob, bd_t *bd)
                karo_fdt_enable_node(blob, "stk5led", 0);
 
        fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
-       fdt_fixup_ethernet(blob);
 
        karo_fdt_fixup_touchpanel(blob, tx53_touchpanels,
                                ARRAY_SIZE(tx53_touchpanels));