]> git.sur5r.net Git - u-boot/blobdiff - board/mpc7448hpc2/tsi108_init.c
FSL: Move board/mpc8260ads under board/freescale
[u-boot] / board / mpc7448hpc2 / tsi108_init.c
index fdb53653d14a682e052622d38dc66c6d09d77afa..30ae17d87295ed2d90d3f1a325904c57d564247d 100644 (file)
@@ -33,6 +33,8 @@
 #include <asm/processor.h>
 #include <tsi108.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 extern void mpicInit (int verbose);
 
 /*
@@ -141,13 +143,12 @@ unsigned long get_board_bus_clk (void)
 
 int board_early_init_f (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        ulong i;
 
        gd->mem_clk = 0;
        i = in32 (CFG_TSI108_CSR_BASE + TSI108_CLK_REG_OFFSET +
                        CG_PWRUP_STATUS);
-       i = (i >> 20) & 0x07;   /* value of SW4[4:7] */
+       i = (i >> 20) & 0x07;   /* Get GD PLL multiplier */
        switch (i) {
        case 0: /* external clock */
                printf ("Using external clock\n");
@@ -179,7 +180,7 @@ int board_early_init_r (void)
        ulong temp, i;
        ulong reg_val;
        volatile ulong *reg_ptr;
-       
+
        reg_ptr =
                (ulong *) (CFG_TSI108_CSR_BASE + TSI108_PB_REG_OFFSET + 0x900);
 
@@ -229,7 +230,7 @@ int board_early_init_r (void)
 
        __asm__ __volatile__ ("sync");
 
-       /* Base addresses for Cs0, CS1, CS2, CS3 */
+       /* Base addresses for CS0, CS1, CS2, CS3 */
 
        out32 (CFG_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B0_ADDR,
                0x00000000);
@@ -300,7 +301,7 @@ int board_early_init_r (void)
        out32 (CFG_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B3_CTRL1,
                0x7C0F2000);
        __asm__ __volatile__ ("sync");
-       
+
        /*
         * Set new value for PB_OCN_BAR1: switch from BOOT to LUT mode.
         * value for PB_OCN_BAR1: (BA-0xE000_0000 + size 512MB + ENable)
@@ -312,7 +313,7 @@ int board_early_init_r (void)
        /* Make sure that OCN_BAR2 decoder is set (to allow following
         * immediate read from SDRAM)
         */
-       
+
        temp = in32(CFG_TSI108_CSR_BASE + TSI108_PB_REG_OFFSET + PB_OCN_BAR1);
        __asm__ __volatile__ ("sync");
 
@@ -327,11 +328,11 @@ int board_early_init_r (void)
         * and enable all HLP banks and not just HLP 0 as is being done for
         * Taiga Rev. 2.
         */
-       
+
        env_init ();
 
 #ifndef DISABLE_PBM
-       
+
        /*
         * For IBM processors we have to set Address-Only commands generated
         * by PBM that are different from ones set after reset.
@@ -475,10 +476,10 @@ int board_early_init_r (void)
 
        for (i = 0; i < 32; i++) {
                *reg_ptr++ = reg_val;   /* P2O_BAR3_LUTx */
-               
+
 /* P2O_BAR3_LUT_UPPERx : Set data swapping mode for PBM (byte swapping) */
-               *reg_ptr++ = 0; 
-               
+               *reg_ptr++ = 0;
+
 /* offset = 16MB, address translation is enabled to allow byte swapping */
                reg_val += 0x01000000;
        }
@@ -507,7 +508,7 @@ int board_early_init_r (void)
 
 #endif /* !DISABLE_PBM */
 
-#ifdef ENABLE_PCI_CSR_BAR      
+#ifdef ENABLE_PCI_CSR_BAR
        /* open if required access to Tsi108 CSRs from the PCI/X bus */
        /* enable BAR0 on the PCI/X bus */
        reg_val = in32(CFG_TSI108_CSR_BASE +
@@ -528,7 +529,7 @@ int board_early_init_r (void)
        /*
         * Finally enable PCI/X Bus Master and Memory Space access
         */
-       
+
        reg_val = in32(CFG_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + PCI_CSR);
        reg_val |= 0x06;
        out32 (CFG_TSI108_CSR_BASE + TSI108_PCI_REG_OFFSET + PCI_CSR, reg_val);
@@ -555,7 +556,7 @@ int board_early_init_r (void)
         * Ensure that Machine Check exception is enabled
         * We need it to support PCI Bus probing (configuration reads)
         */
-       
+
        reg_val = mfmsr ();
        mtmsr(reg_val | MSR_ME);
 
@@ -583,7 +584,6 @@ unsigned long get_l2cr (void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
 #ifdef CFG_CLK_SPREAD  /* Initialize Spread-Spectrum Clock generation */
        ulong i;
 
@@ -631,7 +631,7 @@ int misc_init_r (void)
         * thing done with regards to enabling diabling the cache.
         * So this seems like a good place to print all this information
         */
-       
+
        printf ("CACHE: ");
        switch (get_cpu_type()) {
        case CPU_7447A: