MPC512x: add more hardware description to immap_512x.h
[oweals/u-boot.git] / board / sbc8641d / sbc8641d.c
index 191045a239528ed8283fcc2bee96fb76d52b687c..c39d2c020c6d83315b2eaba5d03f4e91fa2d11c9 100644 (file)
 #include <pci.h>
 #include <asm/processor.h>
 #include <asm/immap_86xx.h>
-#include <asm/immap_fsl_pci.h>
+#include <asm/fsl_pci.h>
 #include <asm/fsl_ddr_sdram.h>
 #include <libfdt.h>
 #include <fdt_support.h>
 
-#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
-extern void ddr_enable_ecc (unsigned int dram_size);
-#endif
-
 long int fixed_sdram (void);
 
 int board_early_init_f (void)
@@ -71,13 +67,6 @@ phys_size_t initdram (int board_type)
        return dram_size;
 #endif
 
-#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
-       /*
-        * Initialize and enable DDR ECC.
-        */
-       ddr_enable_ecc (dram_size);
-#endif
-
        puts ("    DDR: ");
        return dram_size;
 }
@@ -220,9 +209,6 @@ static struct pci_controller pci2_hose;
 
 int first_free_busno = 0;
 
-extern int fsl_pci_setup_inbound_windows(struct pci_region *r);
-extern void fsl_pci_init(struct pci_controller *hose);
-
 void pci_init_board(void)
 {
        volatile immap_t *immap = (immap_t *) CONFIG_SYS_CCSRBAR;
@@ -258,14 +244,14 @@ void pci_init_board(void)
 
                /* outbound memory */
                pci_set_region(r++,
-                              CONFIG_SYS_PCI1_MEM_BASE,
+                              CONFIG_SYS_PCI1_MEM_BUS,
                               CONFIG_SYS_PCI1_MEM_PHYS,
                               CONFIG_SYS_PCI1_MEM_SIZE,
                               PCI_REGION_MEM);
 
                /* outbound io */
                pci_set_region(r++,
-                              CONFIG_SYS_PCI1_IO_BASE,
+                              CONFIG_SYS_PCI1_IO_BUS,
                               CONFIG_SYS_PCI1_IO_PHYS,
                               CONFIG_SYS_PCI1_IO_SIZE,
                               PCI_REGION_IO);
@@ -301,14 +287,14 @@ void pci_init_board(void)
 
        /* outbound memory */
        pci_set_region(r++,
-                      CONFIG_SYS_PCI2_MEM_BASE,
+                      CONFIG_SYS_PCI2_MEM_BUS,
                       CONFIG_SYS_PCI2_MEM_PHYS,
                       CONFIG_SYS_PCI2_MEM_SIZE,
                       PCI_REGION_MEM);
 
        /* outbound io */
        pci_set_region(r++,
-                      CONFIG_SYS_PCI2_IO_BASE,
+                      CONFIG_SYS_PCI2_IO_BUS,
                       CONFIG_SYS_PCI2_IO_PHYS,
                       CONFIG_SYS_PCI2_IO_SIZE,
                       PCI_REGION_IO);
@@ -332,9 +318,6 @@ void pci_init_board(void)
 
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-extern void ft_fsl_pci_setup(void *blob, const char *pci_alias,
-                        struct pci_controller *hose);
-
 void ft_board_setup (void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
@@ -395,3 +378,41 @@ unsigned long get_board_sys_clk (ulong dummy)
 
        return val;
 }
+
+void board_reset(void)
+{
+#ifdef CONFIG_SYS_RESET_ADDRESS
+       ulong addr = CONFIG_SYS_RESET_ADDRESS;
+
+       /* flush and disable I/D cache */
+       __asm__ __volatile__ ("mfspr    3, 1008"        ::: "r3");
+       __asm__ __volatile__ ("ori      5, 5, 0xcc00"   ::: "r5");
+       __asm__ __volatile__ ("ori      4, 3, 0xc00"    ::: "r4");
+       __asm__ __volatile__ ("andc     5, 3, 5"        ::: "r5");
+       __asm__ __volatile__ ("sync");
+       __asm__ __volatile__ ("mtspr    1008, 4");
+       __asm__ __volatile__ ("isync");
+       __asm__ __volatile__ ("sync");
+       __asm__ __volatile__ ("mtspr    1008, 5");
+       __asm__ __volatile__ ("isync");
+       __asm__ __volatile__ ("sync");
+
+       /*
+        * SRR0 has system reset vector, SRR1 has default MSR value
+        * rfi restores MSR from SRR1 and sets the PC to the SRR0 value
+        */
+       __asm__ __volatile__ ("mtspr    26, %0"         :: "r" (addr));
+       __asm__ __volatile__ ("li       4, (1 << 6)"    ::: "r4");
+       __asm__ __volatile__ ("mtspr    27, 4");
+       __asm__ __volatile__ ("rfi");
+#endif
+}
+
+#ifdef CONFIG_MP
+extern void cpu_mp_lmb_reserve(struct lmb *lmb);
+
+void board_lmb_reserve(struct lmb *lmb)
+{
+       cpu_mp_lmb_reserve(lmb);
+}
+#endif