#elif defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2)
        struct ccsr_cluster_l2 * l2cache = (void __iomem *)CONFIG_SYS_FSL_CLUSTER_1_L2;
 #endif
+#ifdef CONFIG_PPC_SPINTABLE_COMPATIBLE
+       extern int spin_table_compat;
+       const char *spin;
+#endif
 
 #if defined(CONFIG_SYS_P4080_ERRATUM_CPU22) || \
        defined(CONFIG_SYS_FSL_ERRATUM_NMG_CPU_A011)
        }
 #endif
 
+#ifdef CONFIG_PPC_SPINTABLE_COMPATIBLE
+       spin = getenv("spin_table_compat");
+       if (spin && (*spin == 'n'))
+               spin_table_compat = 0;
+       else
+               spin_table_compat = 1;
+#endif
+
        puts ("L2:    ");
 
 #if defined(CONFIG_L2_CACHE)
 
        .align L1_CACHE_SHIFT
        .global __second_half_boot_page
 __second_half_boot_page:
+#ifdef CONFIG_PPC_SPINTABLE_COMPATIBLE
+       lis     r3,(spin_table_compat - __second_half_boot_page)@h
+       ori     r3,r3,(spin_table_compat - __second_half_boot_page)@l
+       add     r3,r3,r11 /* r11 has the address of __second_half_boot_page */
+       lwz     r14,0(r3)
+#endif
+
 #define EPAPR_MAGIC            0x45504150
 #define ENTRY_ADDR_UPPER       0
 #define ENTRY_ADDR_LOWER       4
        stw     r8,ENTRY_ADDR_LOWER(r10)
 
        /* spin waiting for addr */
-3:     lwz     r4,ENTRY_ADDR_LOWER(r10)
+3:
+/*
+ * To comply with ePAPR 1.1, the spin table has been moved to cache-enabled
+ * memory. Old OS may not work with this change. A patch is waiting to be
+ * accepted for Linux kernel. Other OS needs similar fix to spin table.
+ * For OSes with old spin table code, we can enable this temporary fix by
+ * setting environmental variable "spin_table_compat". For new OSes, set
+ * "spin_table_compat=no". After Linux is fixed, we can remove this macro
+ * and related code. For now, it is enabled by default.
+ */
+#ifdef CONFIG_PPC_SPINTABLE_COMPATIBLE
+       cmpwi   r14,0
+       beq     4f
+       dcbf    0, r10
+       sync
+4:
+#endif
+       lwz     r4,ENTRY_ADDR_LOWER(r10)
        andi.   r11,r4,1
        bne     3b
        isync
        .globl __spin_table
 __spin_table:
        .space CONFIG_MAX_CPUS*ENTRY_SIZE
+
+#ifdef CONFIG_PPC_SPINTABLE_COMPATIBLE
+       .align L1_CACHE_SHIFT
+       .global spin_table_compat
+spin_table_compat:
+       .long   1
+
+#endif
+
 __spin_table_end:
        .space 4096 - (__spin_table_end - __spin_table)
 
 #error "Do not define CONFIG_SYS_CCSRBAR_DEFAULT in the board header file."
 #endif
 
+/*
+ * This macro should be removed when we no longer care about backwards
+ * compatibility with older operating systems.
+ */
+#define CONFIG_PPC_SPINTABLE_COMPATIBLE
+
 #define FSL_DDR_VER_4_7        47
 
 /* Number of TLB CAM entries we have on FSL Book-E chips */