Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'
[platform/kernel/u-boot.git] / board / freescale / corenet_ds / corenet_ds.c
index cf9b7b8..21428e3 100644 (file)
 #include <asm/fsl_serdes.h>
 #include <asm/fsl_portals.h>
 #include <asm/fsl_liodn.h>
-
-extern void pci_of_setup(void *blob, bd_t *bd);
+#include <fm_eth.h>
 
 #include "../common/ngpixis.h"
+#include "corenet_ds.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -45,6 +45,7 @@ int checkboard (void)
        struct cpu_type *cpu = gd->cpu;
        ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
        unsigned int i;
+       static const char * const freq[] = {"100", "125", "156.25", "212.5" };
 
        printf("Board: %sDS, ", cpu->name);
        printf("Sys ID: 0x%02x, Sys Ver: 0x%02x, FPGA Ver: 0x%02x, ",
@@ -62,10 +63,6 @@ int checkboard (void)
        else
                printf("invalid setting of SW%u\n", PIXIS_LBMAP_SWITCH);
 
-#ifdef CONFIG_PHYS_64BIT
-       puts("36-bit Addressing\n");
-#endif
-
        /* Display the RCW, so that no one gets confused as to what RCW
         * we're actually using for this boot.
         */
@@ -87,20 +84,28 @@ int checkboard (void)
         * don't match.
         */
        puts("SERDES Reference Clocks: ");
-#if defined(CONFIG_P3041DS) || defined(CONFIG_P5020DS)
+#if defined(CONFIG_P3041DS) || defined(CONFIG_P5020DS) \
+       || defined(CONFIG_P5040DS)
        sw = in_8(&PIXIS_SW(5));
        for (i = 0; i < 3; i++) {
-               static const char *freq[] = {"100", "125", "156.25", "212.5" };
                unsigned int clock = (sw >> (6 - (2 * i))) & 3;
 
                printf("Bank%u=%sMhz ", i+1, freq[clock]);
        }
+#ifdef CONFIG_P5040DS
+       /* On P5040DS, SW11[7:8] determines the Bank 4 frequency */
+       sw = in_8(&PIXIS_SW(9));
+       printf("Bank4=%sMhz ", freq[sw & 3]);
+#endif
        puts("\n");
 #else
        sw = in_8(&PIXIS_SW(3));
-       printf("Bank1=%uMHz ", (sw & 0x40) ? 125 : 100);
-       printf("Bank2=%sMHz ", (sw & 0x20) ? "156.25" : "125");
-       printf("Bank3=%sMHz\n", (sw & 0x10) ? "156.25" : "125");
+       /* SW3[2]: 0 = 100 Mhz, 1 = 125 MHz */
+       /* SW3[3]: 0 = 125 Mhz, 1 = 156.25 MHz */
+       /* SW3[4]: 0 = 125 Mhz, 1 = 156.25 MHz */
+       printf("Bank1=%sMHz ", freq[!!(sw & 0x40)]);
+       printf("Bank2=%sMHz ", freq[1 + !!(sw & 0x20)]);
+       printf("Bank3=%sMHz\n", freq[1 + !!(sw & 0x10)]);
 #endif
 
        return 0;
@@ -172,7 +177,8 @@ int misc_init_r(void)
        unsigned int i;
        u8 sw;
 
-#if defined(CONFIG_P3041DS) || defined(CONFIG_P5020DS)
+#if defined(CONFIG_P3041DS) || defined(CONFIG_P5020DS) \
+       || defined(CONFIG_P5040DS)
        sw = in_8(&PIXIS_SW(5));
        for (i = 0; i < 3; i++) {
                unsigned int clock = (sw >> (6 - (2 * i))) & 3;
@@ -236,9 +242,10 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
 
        fdt_fixup_liodn(blob);
-}
+       fdt_fixup_dr_usb(blob, bd);
 
-int board_eth_init(bd_t *bis)
-{
-       return pci_eth_init(bis);
+#ifdef CONFIG_SYS_DPAA_FMAN
+       fdt_fixup_fman_ethernet(blob);
+       fdt_fixup_board_enet(blob);
+#endif
 }