]> git.sur5r.net Git - u-boot/blobdiff - board/freescale/t1040qds/t1040qds.c
env: Rename some other getenv()-related functions
[u-boot] / board / freescale / t1040qds / t1040qds.c
index 3dec4473e527a6656adb41f64dc3216926a3451b..a36997b48cb43cf98578d79e321d6239ba9bd57f 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 <hwconfig.h>
 
+#include "../common/sleep.h"
 #include "../common/qixis.h"
 #include "t1040qds.h"
 #include "t1040qds_qixis.h"
@@ -89,11 +90,45 @@ int select_i2c_ch_pca9547(u8 ch)
        return 0;
 }
 
+static void qe_board_setup(void)
+{
+       u8 brdcfg15, brdcfg9;
+
+       if (hwconfig("qe") && hwconfig("tdm")) {
+               brdcfg15 = QIXIS_READ(brdcfg[15]);
+               /*
+                * TDMRiser uses QE-TDM
+                * Route QE_TDM signals to TDM Riser slot
+                */
+               QIXIS_WRITE(brdcfg[15], brdcfg15 | 7);
+       } else if (hwconfig("qe") && hwconfig("uart")) {
+               brdcfg15 = QIXIS_READ(brdcfg[15]);
+               brdcfg9 = QIXIS_READ(brdcfg[9]);
+               /*
+                * Route QE_TDM signals to UCC
+                * ProfiBus controlled by UCC3
+                */
+               brdcfg15 &= 0xfc;
+               QIXIS_WRITE(brdcfg[15], brdcfg15 | 2);
+               QIXIS_WRITE(brdcfg[9], brdcfg9 | 4);
+       }
+}
+
+int board_early_init_f(void)
+{
+#if defined(CONFIG_DEEP_SLEEP)
+       if (is_warm_boot())
+               fsl_dp_disable_console();
+#endif
+
+       return 0;
+}
+
 int board_early_init_r(void)
 {
 #ifdef CONFIG_SYS_FLASH_BASE
        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
@@ -104,16 +139,18 @@ int board_early_init_r(void)
        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);
-#endif
-       set_liodns();
-#ifdef CONFIG_SYS_DPAA_QBMAN
-       setup_portals();
 #endif
        select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
 
@@ -196,18 +233,20 @@ int misc_init_r(void)
                }
        }
 
+       qe_board_setup();
+
        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;
 
        ft_cpu_setup(blob, bd);
 
-       base = getenv_bootm_low();
-       size = getenv_bootm_size();
+       base = env_get_bootm_low();
+       size = env_get_bootm_size();
 
        fdt_fixup_memory(blob, (u64)base, (u64)size);
 
@@ -218,13 +257,15 @@ void ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_liodn(blob);
 
 #ifdef CONFIG_HAS_FSL_DR_USB
-       fdt_fixup_dr_usb(blob, bd);
+       fsl_fdt_fixup_dr_usb(blob, bd);
 #endif
 
 #ifdef CONFIG_SYS_DPAA_FMAN
        fdt_fixup_fman_ethernet(blob);
        fdt_fixup_board_enet(blob);
 #endif
+
+       return 0;
 }
 
 void qixis_dump_switch(void)