]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/ttcontrol/vision2/vision2.c
Merge branch 'master' of git://git.denx.de/u-boot into master
[karo-tx-uboot.git] / board / ttcontrol / vision2 / vision2.c
index d3815b2eed8a8bbe860e198a54ca6665b3c103ad..a471fec23dd791d2198495a4a3a5aff4afc3f57a 100644 (file)
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/mx5x_pins.h>
 #include <asm/arch/crm_regs.h>
+#include <asm/arch/clock.h>
 #include <asm/arch/iomux.h>
 #include <asm/gpio.h>
 #include <asm/arch/sys_proto.h>
-#include <asm/errno.h>
 #include <i2c.h>
 #include <mmc.h>
-#include <pmic.h>
+#include <power/pmic.h>
 #include <fsl_esdhc.h>
 #include <fsl_pmic.h>
 #include <mc13892.h>
@@ -44,9 +44,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static u32 system_rev;
-
-static struct fb_videomode nec_nl6448bc26_09c = {
+static struct fb_videomode const nec_nl6448bc26_09c = {
        "NEC_NL6448BC26-09C",
        60,     /* Refresh */
        640,    /* xres */
@@ -151,13 +149,6 @@ static void init_drive_strength(void)
                PAD_CTL_DRV_HIGH | PAD_CTL_SRE_FAST);
 }
 
-u32 get_board_rev(void)
-{
-       system_rev = get_cpu_rev();
-
-       return system_rev;
-}
-
 int dram_init(void)
 {
        gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1,
@@ -315,9 +306,15 @@ static void power_init_mx51(void)
 {
        unsigned int val;
        struct pmic *p;
+       int ret;
+
+       ret = pmic_init(I2C_PMIC);
+       if (ret)
+               return;
 
-       pmic_init();
-       p = get_pmic();
+       p = pmic_get("FSL_PMIC");
+       if (!p)
+               return;
 
        /* Write needed to Power Gate 2 register */
        pmic_reg_read(p, REG_POWER_MISC, &val);
@@ -438,9 +435,8 @@ static void setup_gpios(void)
        gpio_direction_output(4, 1);
 
        gpio_direction_output(7, 0);
-       for (i = 65; i < 71; i++) {
+       for (i = 65; i < 71; i++)
                gpio_direction_output(i, 0);
-       }
 
        gpio_direction_output(94, 0);
 
@@ -532,7 +528,7 @@ static void setup_fec(void)
 }
 
 struct fsl_esdhc_cfg esdhc_cfg[1] = {
-       {MMC_SDHC1_BASE_ADDR, 1},
+       {MMC_SDHC1_BASE_ADDR},
 };
 
 int get_mmc_getcd(u8 *cd, struct mmc *mmc)
@@ -601,6 +597,7 @@ int board_mmc_init(bd_t *bis)
        mxc_iomux_set_pad(MX51_PIN_GPIO1_1,
                PAD_CTL_HYS_ENABLE);
 
+       esdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
        return fsl_esdhc_initialize(bis, &esdhc_cfg[0]);
 }
 #endif
@@ -615,7 +612,7 @@ void lcd_enable(void)
        gpio_set_value(2, 1);
        mxc_request_iomux(MX51_PIN_GPIO1_2, IOMUX_CONFIG_ALT0);
 
-       ret = mx51_fb_init(&nec_nl6448bc26_09c, 0, IPU_PIX_FMT_RGB666);
+       ret = ipuv3_fb_init(&nec_nl6448bc26_09c, 0, IPU_PIX_FMT_RGB666);
        if (ret)
                puts("LCD cannot be configured\n");
 }
@@ -685,11 +682,18 @@ int board_late_init(void)
        udelay(2000);
 #endif
 
-       setenv("stdout", "serial");
-
        return 0;
 }
 
+/*
+ * Do not overwrite the console
+ * Use always serial for U-Boot console
+ */
+int overwrite_console(void)
+{
+       return 1;
+}
+
 int checkboard(void)
 {
        puts("Board: TTControl Vision II CPU V\n");