]> git.sur5r.net Git - u-boot/blobdiff - board/freescale/t208xrdb/t208xrdb.c
board: ls2080a: Add "mcinitcmd" env for MC & DPL deployment
[u-boot] / board / freescale / t208xrdb / t208xrdb.c
index f3fec2aa6ebc49c69931dbe0f6c45c9836b1791a..0cb05aa03f0788cac40011c16ed761bac18fd8da 100644 (file)
 #include <asm/immap_85xx.h>
 #include <asm/fsl_law.h>
 #include <asm/fsl_serdes.h>
-#include <asm/fsl_portals.h>
 #include <asm/fsl_liodn.h>
 #include <fm_eth.h>
 #include "t208xrdb.h"
 #include "cpld.h"
+#include "../common/vid.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -44,7 +44,7 @@ int checkboard(void)
                puts("NAND\n");
        } else {
                reg = ((reg & CPLD_LBMAP_MASK) >> CPLD_LBMAP_SHIFT);
-               printf("NOR vBank%d\n", ~reg & 0x7);
+               printf("NOR vBank%d\n", reg);
        }
 #endif
 
@@ -58,7 +58,7 @@ int checkboard(void)
 int board_early_init_r(void)
 {
        const unsigned int flashbase = CONFIG_SYS_FLASH_BASE;
-       const u8 flash_esel = find_tlb_idx((void *)flashbase, 1);
+       int flash_esel = find_tlb_idx((void *)flashbase, 1);
        /*
         * Remap Boot flash + PROMJET region to caching-inhibited
         * so that flash can be erased properly.
@@ -67,19 +67,25 @@ int board_early_init_r(void)
        /* Flush d-cache and invalidate i-cache of any FLASH data */
        flush_dcache();
        invalidate_icache();
-
-       /* invalidate existing TLB entry for flash + promjet */
-       disable_tlb(flash_esel);
+       if (flash_esel == -1) {
+               /* very unlikely unless something is messed up */
+               puts("Error: Could not find TLB for FLASH BASE\n");
+               flash_esel = 2; /* give our best effort to continue */
+       } else {
+               /* invalidate existing TLB entry for flash + promjet */
+               disable_tlb(flash_esel);
+       }
 
        set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS,
                MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                0, flash_esel, BOOKE_PAGESZ_256M, 1);
 
-       set_liodns();
-#ifdef CONFIG_SYS_DPAA_QBMAN
-       setup_portals();
-#endif
-
+       /*
+        * Adjust core voltage according to voltage ID
+        * This function changes I2C mux to channel 2.
+        */
+       if (adjust_vdd(0))
+               printf("Warning: Adjusting core voltage failed.\n");
        return 0;
 }
 
@@ -95,10 +101,17 @@ unsigned long get_board_ddr_clk(void)
 
 int misc_init_r(void)
 {
+       u8 reg;
+
+       /* Reset CS4315 PHY */
+       reg = CPLD_READ(reset_ctl);
+       reg |= CPLD_RSTCON_EDC_RST;
+       CPLD_WRITE(reset_ctl, reg);
+
        return 0;
 }
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
@@ -121,4 +134,6 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_fman_ethernet(blob);
        fdt_fixup_board_enet(blob);
 #endif
+
+       return 0;
 }