]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/freescale/mpc8641hpcn/mpc8641hpcn.c
Merge branch 'master' of git://www.denx.de/git/u-boot-nand-flash
[karo-tx-uboot.git] / board / freescale / mpc8641hpcn / mpc8641hpcn.c
index 827878939d2f6f0f3bb2025ca485993dc4157381..915fb58ee9c86db6fe4b45f0fa7db3bca601239f 100644 (file)
@@ -25,7 +25,7 @@
 #include <asm/processor.h>
 #include <asm/immap_86xx.h>
 #include <asm/immap_fsl_pci.h>
-#include <spd.h>
+#include <spd_sdram.h>
 #include <asm/io.h>
 #include <libfdt.h>
 #include <fdt_support.h>
 extern void ddr_enable_ecc(unsigned int dram_size);
 #endif
 
-#if defined(CONFIG_SPD_EEPROM)
-#include "spd_sdram.h"
-#endif
-
 void sdram_init(void);
 long int fixed_sdram(void);
 
@@ -85,42 +81,6 @@ initdram(int board_type)
 }
 
 
-#if defined(CFG_DRAM_TEST)
-int
-testdram(void)
-{
-       uint *pstart = (uint *) CFG_MEMTEST_START;
-       uint *pend = (uint *) CFG_MEMTEST_END;
-       uint *p;
-
-       puts("SDRAM test phase 1:\n");
-       for (p = pstart; p < pend; p++)
-               *p = 0xaaaaaaaa;
-
-       for (p = pstart; p < pend; p++) {
-               if (*p != 0xaaaaaaaa) {
-                       printf("SDRAM test fails at: %08x\n", (uint) p);
-                       return 1;
-               }
-       }
-
-       puts("SDRAM test phase 2:\n");
-       for (p = pstart; p < pend; p++)
-               *p = 0x55555555;
-
-       for (p = pstart; p < pend; p++) {
-               if (*p != 0x55555555) {
-                       printf("SDRAM test fails at: %08x\n", (uint) p);
-                       return 1;
-               }
-       }
-
-       puts("SDRAM test passed.\n");
-       return 0;
-}
-#endif
-
-
 #if !defined(CONFIG_SPD_EEPROM)
 /*
  * Fixed sdram init -- doesn't use serial presence detect.
@@ -134,7 +94,7 @@ fixed_sdram(void)
 
        ddr->cs0_bnds = CFG_DDR_CS0_BNDS;
        ddr->cs0_config = CFG_DDR_CS0_CONFIG;
-       ddr->ext_refrec = CFG_DDR_EXT_REFRESH;
+       ddr->timing_cfg_3 = CFG_DDR_TIMING_3;
        ddr->timing_cfg_0 = CFG_DDR_TIMING_0;
        ddr->timing_cfg_1 = CFG_DDR_TIMING_1;
        ddr->timing_cfg_2 = CFG_DDR_TIMING_2;
@@ -206,7 +166,8 @@ void pci_init_board(void)
        volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
        volatile ccsr_gur_t *gur = &immap->im_gur;
        uint devdisr = gur->devdisr;
-       uint io_sel = (gur->pordevsr & MPC86xx_PORDEVSR_IO_SEL) >> 16;
+       uint io_sel = (gur->pordevsr & MPC8641_PORDEVSR_IO_SEL)
+               >> MPC8641_PORDEVSR_IO_SEL_SHIFT;
 
 #ifdef CONFIG_PCI1
 {
@@ -214,7 +175,8 @@ void pci_init_board(void)
        extern void fsl_pci_init(struct pci_controller *hose);
        struct pci_controller *hose = &pci1_hose;
 #ifdef DEBUG
-       uint host1_agent = (gur->porbmsr & MPC86xx_PORBMSR_HA) >> 17;
+       uint host1_agent = (gur->porbmsr & MPC8641_PORBMSR_HA)
+               >> MPC8641_PORBMSR_HA_SHIFT;
        uint pex1_agent = (host1_agent == 0) || (host1_agent == 1);
 #endif
        if ((io_sel == 2 || io_sel == 3 || io_sel == 5
@@ -321,28 +283,16 @@ void pci_init_board(void)
 
 }
 
+
 #if defined(CONFIG_OF_BOARD_SETUP)
+
 void
 ft_board_setup(void *blob, bd_t *bd)
 {
        int node, tmp[2];
        const char *path;
 
-       fdt_fixup_ethernet(blob, bd);
-
-       do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
-                            "timebase-frequency", bd->bi_busfreq / 4, 1);
-       do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
-                            "bus-frequency", bd->bi_busfreq, 1);
-       do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
-                            "clock-frequency", bd->bi_intfreq, 1);
-       do_fixup_by_prop_u32(blob, "device_type", "soc", 4,
-                            "bus-frequency", bd->bi_busfreq, 1);
-
-       do_fixup_by_compat_u32(blob, "ns16550",
-                              "clock-frequency", bd->bi_busfreq, 1);
-
-       fdt_fixup_memory(blob, bd->bi_memstart, bd->bi_memsize);
+       ft_cpu_setup(blob, bd);
 
        node = fdt_path_offset(blob, "/aliases");
        tmp[0] = 0;