powerpc, 8xx: remove support for 8xx
[oweals/u-boot.git] / include / ppc_asm.tmpl
index c0f8cc85677f2a17827dee67c0539dfb1736f55c..82884335edc21cc7cce44bd4bfa3c0af53b2b2fd 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2000-2002
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*
@@ -28,6 +12,8 @@
 #ifndef        __PPC_ASM_TMPL__
 #define __PPC_ASM_TMPL__
 
+#include <config.h>
+
 /***************************************************************************
  *
  * These definitions simplify the ugly declarations necessary for GOT
 #define        r31     31
 
 
-#if defined(CONFIG_8xx) || defined(CONFIG_MPC824X)
-
-/* Some special registers */
-
-#define ICR    148     /* Interrupt Cause Register (37-44) */
-#define DER    149
-#define COUNTA 150     /* Breakpoint Counter       (37-44) */
-#define COUNTB 151     /* Breakpoint Counter       (37-44) */
-#define LCTRL1 156     /* Load/Store Support       (37-40) */
-#define LCTRL2 157     /* Load/Store Support       (37-41) */
-#define ICTRL  158
-
-#endif /* CONFIG_8xx, CONFIG_MPC824X */
-
-
 #if  defined(CONFIG_5xx)
 /* Some special purpose registers */
 #define DER    149             /* Debug Enable Register                */
 #define EID    81
 #endif /* CONFIG_5xx */
 
-#if defined(CONFIG_8xx)
-
-/* Registers in the processor's internal memory map that we use.
-*/
-#define SYPCR  0x00000004
-#define BR0    0x00000100
-#define OR0    0x00000104
-#define BR1    0x00000108
-#define OR1    0x0000010c
-#define BR2    0x00000110
-#define OR2    0x00000114
-#define BR3    0x00000118
-#define OR3    0x0000011c
-#define BR4    0x00000120
-#define OR4    0x00000124
-
-#define MAR    0x00000164
-#define MCR    0x00000168
-#define MAMR   0x00000170
-#define MBMR   0x00000174
-#define MSTAT  0x00000178
-#define MPTPR  0x0000017a
-#define MDR    0x0000017c
-
-#define TBSCR  0x00000200
-#define TBREFF0        0x00000204
-
-#define PLPRCR 0x00000284
-
-#elif defined(CONFIG_8260)
+#if defined(CONFIG_MPC8260)
 
 #define HID2           1011
 
  */
 #define COPY_EE(d, s)          rlwimi d,s,0,16,16
 #define NOCOPY(d, s)
+
+#ifdef CONFIG_E500
+#define EXC_XFER_TEMPLATE(n, label, hdlr, msr, copyee) \
+       stw     r22,_NIP(r21);                          \
+       stw     r23,_MSR(r21);                          \
+       li      r23,n;                                  \
+       stw     r23,TRAP(r21);                          \
+       li      r20,msr;                                \
+       copyee(r20,r23);                                \
+       rlwimi  r20,r23,0,25,25;                        \
+       mtmsr   r20;                                    \
+       bl      1f;                                     \
+1:     mflr    r23;                                    \
+       addis   r23,r23,(hdlr - 1b)@ha;                 \
+       addi    r23,r23,(hdlr - 1b)@l;                  \
+       b       transfer_to_handler
+
+#define STD_EXCEPTION(n, label, hdlr)                          \
+.align 4;                                                      \
+label:                                                         \
+       EXCEPTION_PROLOG(SRR0, SRR1);                           \
+       addi    r3,r1,STACK_FRAME_OVERHEAD;                     \
+       EXC_XFER_TEMPLATE(n, label, hdlr, MSR_KERNEL, NOCOPY)   \
+
+#define CRIT_EXCEPTION(n, label, hdlr)                         \
+.align 4;                                                      \
+label:                                                         \
+       EXCEPTION_PROLOG(CSRR0, CSRR1);                         \
+       addi    r3,r1,STACK_FRAME_OVERHEAD;                     \
+       EXC_XFER_TEMPLATE(n, label, hdlr,                       \
+       MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE), NOCOPY)           \
+
+#define MCK_EXCEPTION(n, label, hdlr)                          \
+.align 4;                                                      \
+label:                                                         \
+       EXCEPTION_PROLOG(MCSRR0, MCSRR1);                       \
+       addi    r3,r1,STACK_FRAME_OVERHEAD;                     \
+       EXC_XFER_TEMPLATE(n, label, hdlr,                       \
+       MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE), NOCOPY)           \
+
+#else  /* !E500 */
+
 #define EXC_XFER_TEMPLATE(label, hdlr, msr, copyee)    \
        bl      1f;                                     \
 1:     mflr    r20;                                    \
@@ -296,4 +280,5 @@ label:                                                              \
        EXC_XFER_TEMPLATE(label, hdlr,                          \
        MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE), NOCOPY)           \
 
+#endif /* !E500 */
 #endif /* __PPC_ASM_TMPL__ */