MPC512x: add more hardware description to immap_512x.h
[oweals/u-boot.git] / board / sbc8641d / sbc8641d.c
index 508bdc5dd8259c3ce36dc51f09eb3d29f8518cdd..c39d2c020c6d83315b2eaba5d03f4e91fa2d11c9 100644 (file)
@@ -33,7 +33,7 @@
 #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>
@@ -209,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;
@@ -321,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);
@@ -384,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