powerpc/85xx: Add is_serdes_configured() support for MPC8569 SERDES
[oweals/u-boot.git] / arch / powerpc / cpu / mpc85xx / start.S
index b3cb56a5b00da67201667460da4d4e3b970d32b9..945c1b8477940c5c7760af298a8f25964c54ac83 100644 (file)
@@ -28,6 +28,7 @@
  *
  */
 
+#include <asm-offsets.h>
 #include <config.h>
 #include <mpc85xx.h>
 #include <timestamp.h>
@@ -145,7 +146,7 @@ _start_e500:
        beq     2b
 
        /* Setup interrupt vectors */
-       lis     r1,TEXT_BASE@h
+       lis     r1,CONFIG_SYS_MONITOR_BASE@h
        mtspr   IVPR,r1
 
        li      r1,0x0100
@@ -291,25 +292,25 @@ _start_e500:
        lis     r7,FSL_BOOKE_MAS1(1, 1, 0, 1, BOOKE_PAGESZ_4M)@h
        ori     r7,r7,FSL_BOOKE_MAS1(1, 1, 0, 1, BOOKE_PAGESZ_4M)@l
 
-       lis     r8,FSL_BOOKE_MAS2(TEXT_BASE & 0xffc00000, (MAS2_I|MAS2_G))@h
-       ori     r8,r8,FSL_BOOKE_MAS2(TEXT_BASE & 0xffc00000, (MAS2_I|MAS2_G))@l
+       lis     r8,FSL_BOOKE_MAS2(CONFIG_SYS_MONITOR_BASE & 0xffc00000, (MAS2_I|MAS2_G))@h
+       ori     r8,r8,FSL_BOOKE_MAS2(CONFIG_SYS_MONITOR_BASE & 0xffc00000, (MAS2_I|MAS2_G))@l
 
        /* The 85xx has the default boot window 0xff800000 - 0xffffffff */
        lis     r9,FSL_BOOKE_MAS3(0xffc00000, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@h
        ori     r9,r9,FSL_BOOKE_MAS3(0xffc00000, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@l
 #else
        /*
-        * create a temp mapping in AS=1 to the 1M TEXT_BASE space, the main
-        * image has been relocated to TEXT_BASE on the second stage.
+        * create a temp mapping in AS=1 to the 1M CONFIG_SYS_MONITOR_BASE space, the main
+        * image has been relocated to CONFIG_SYS_MONITOR_BASE on the second stage.
         */
        lis     r7,FSL_BOOKE_MAS1(1, 1, 0, 1, BOOKE_PAGESZ_1M)@h
        ori     r7,r7,FSL_BOOKE_MAS1(1, 1, 0, 1, BOOKE_PAGESZ_1M)@l
 
-       lis     r8,FSL_BOOKE_MAS2(TEXT_BASE, (MAS2_I|MAS2_G))@h
-       ori     r8,r8,FSL_BOOKE_MAS2(TEXT_BASE, (MAS2_I|MAS2_G))@l
+       lis     r8,FSL_BOOKE_MAS2(CONFIG_SYS_MONITOR_BASE, (MAS2_I|MAS2_G))@h
+       ori     r8,r8,FSL_BOOKE_MAS2(CONFIG_SYS_MONITOR_BASE, (MAS2_I|MAS2_G))@l
 
-       lis     r9,FSL_BOOKE_MAS3(TEXT_BASE, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@h
-       ori     r9,r9,FSL_BOOKE_MAS3(TEXT_BASE, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@l
+       lis     r9,FSL_BOOKE_MAS3(CONFIG_SYS_MONITOR_BASE, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@h
+       ori     r9,r9,FSL_BOOKE_MAS3(CONFIG_SYS_MONITOR_BASE, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@l
 #endif
 
        mtspr   MAS0,r6
@@ -330,8 +331,18 @@ _start_e500:
        lis     r8,FSL_BOOKE_MAS2(CONFIG_SYS_INIT_RAM_ADDR, 0)@h
        ori     r8,r8,FSL_BOOKE_MAS2(CONFIG_SYS_INIT_RAM_ADDR, 0)@l
 
+#if defined(CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW) && \
+    defined(CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH)
+       lis     r9,FSL_BOOKE_MAS3(CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW, 0,
+                               (MAS3_SX|MAS3_SW|MAS3_SR))@h
+       ori     r9,r9,FSL_BOOKE_MAS3(CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW, 0,
+                               (MAS3_SX|MAS3_SW|MAS3_SR))@l
+       li      r10,CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH
+       mtspr   MAS7,r10
+#else
        lis     r9,FSL_BOOKE_MAS3(CONFIG_SYS_INIT_RAM_ADDR, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@h
        ori     r9,r9,FSL_BOOKE_MAS3(CONFIG_SYS_INIT_RAM_ADDR, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@l
+#endif
 
        mtspr   MAS0,r6
        mtspr   MAS1,r7
@@ -422,6 +433,8 @@ _start_cont:
        bl      board_init_f
        isync
 
+       /* NOTREACHED - board_init_f() does not return */
+
 #ifndef CONFIG_NAND_SPL
        . = EXC_OFF_SYS_RESET
        .globl  _start_of_vectors
@@ -1025,10 +1038,12 @@ in_ram:
        beq     4f
 3:     lwzu    r4,4(r3)
        lwzux   r0,r4,r11
+       cmpwi   r0,0
        add     r0,r0,r11
-       stw     r10,0(r3)
+       stw     r4,0(r3)
+       beq-    5f
        stw     r0,0(r4)
-       bdnz    3b
+5:     bdnz    3b
 4:
 clear_bss:
        /*