]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/asm-ppc/processor.h
Merge branch 'master' of git://git.denx.de/u-boot-arm
[karo-tx-uboot.git] / include / asm-ppc / processor.h
index aec325b470aba707984e1841b80c09a046151299..f61778f864b5248da6133fe3a21592ea087b8342 100644 (file)
 #define CONFIG_BOOKE
 #endif
 
+#define SPRN_CCR0      0x3B3   /* Core Configuration Register 0 */
+#ifdef CONFIG_BOOKE
+#define SPRN_CCR1      0x378   /* Core Configuration Register for 440 only */
+#endif
 #define SPRN_CDBCR     0x3D7   /* Cache Debug Control Register */
 #define SPRN_CTR       0x009   /* Count Register */
 #define SPRN_DABR      0x3F5   /* Data Address Breakpoint Register */
 #define SPRN_DBSR      0x3F0   /* Debug Status Register */
 #else
 #define SPRN_DBCR1     0x135           /* Book E Debug Control Register 1 */
+#ifdef CONFIG_BOOKE
+#define        SPRN_DBDR       0x3f3           /* Debug Data Register */
+#endif
 #define SPRN_DBSR      0x130           /* Book E Debug Status Register */
 #define   DBSR_IC          0x08000000  /* Book E Instruction Completion  */
 #define   DBSR_TIE         0x01000000  /* Book E Trap Instruction Event */
 #define SPRN_DCCR      0x3FA   /* Data Cache Cacheability Register */
 #define   DCCR_NOCACHE         0       /* Noncacheable */
 #define   DCCR_CACHE           1       /* Cacheable */
+#ifndef CONFIG_BOOKE
+#define        SPRN_DCDBTRL    0x39c   /* Data Cache Debug Tag Register Low */
+#define        SPRN_DCDBTRH    0x39d   /* Data Cache Debug Tag Register High */
+#endif
 #define SPRN_DCMP      0x3D1   /* Data TLB Compare Register */
 #define SPRN_DCWR      0x3BA   /* Data Cache Write-thru Register */
 #define   DCWR_COPY            0       /* Copy-back */
 #endif /* CONFIG_BOOKE */
 #define SPRN_DEC       0x016   /* Decrement Register */
 #define SPRN_DMISS     0x3D0   /* Data TLB Miss Register */
+#ifdef CONFIG_BOOKE
+#define        SPRN_DNV0       0x390   /* Data Cache Normal Victim 0 */
+#define        SPRN_DNV1       0x391   /* Data Cache Normal Victim 1 */
+#define        SPRN_DNV2       0x392   /* Data Cache Normal Victim 2 */
+#define        SPRN_DNV3       0x393   /* Data Cache Normal Victim 3 */
+#endif
 #define SPRN_DSISR     0x012   /* Data Storage Interrupt Status Register */
+#ifdef CONFIG_BOOKE
+#define        SPRN_DTV0       0x394   /* Data Cache Transient Victim 0 */
+#define        SPRN_DTV1       0x395   /* Data Cache Transient Victim 1 */
+#define        SPRN_DTV2       0x396   /* Data Cache Transient Victim 2 */
+#define        SPRN_DTV3       0x397   /* Data Cache Transient Victim 3 */
+#define        SPRN_DVLIM      0x398   /* Data Cache Victim Limit */
+#endif
 #define SPRN_EAR       0x11A   /* External Address Register */
 #ifndef CONFIG_BOOKE
 #define SPRN_ESR       0x3D4   /* Exception Syndrome Register */
 #define   ICCR_NOCACHE         0       /* Noncacheable */
 #define   ICCR_CACHE           1       /* Cacheable */
 #define SPRN_ICDBDR    0x3D3   /* Instruction Cache Debug Data Register */
+#ifdef CONFIG_BOOKE
+#define SPRN_ICDBTRL   0x39e   /* instruction cache debug tag register low */
+#define        SPRN_ICDBTRH    0x39f   /* instruction cache debug tag register high */
+#endif
 #define SPRN_ICMP      0x3D5   /* Instruction TLB Compare Register */
 #define SPRN_ICTC      0x3FB   /* Instruction Cache Throttling Control Reg */
 #define SPRN_IMISS     0x3D4   /* Instruction TLB Miss Register */
 #define SPRN_IMMR      0x27E   /* Internal Memory Map Register */
+#ifdef CONFIG_BOOKE
+#define        SPRN_INV0       0x370   /* Instruction Cache Normal Victim 0 */
+#define        SPRN_INV1       0x371   /* Instruction Cache Normal Victim 1 */
+#define        SPRN_INV2       0x372   /* Instruction Cache Normal Victim 2 */
+#define        SPRN_INV3       0x373   /* Instruction Cache Normal Victim 3 */
+#define        SPRN_ITV0       0x374   /* Instruction Cache Transient Victim 0 */
+#define        SPRN_ITV1       0x375   /* Instruction Cache Transient Victim 1 */
+#define        SPRN_ITV2       0x376   /* Instruction Cache Transient Victim 2 */
+#define        SPRN_ITV3       0x377   /* Instruction Cache Transient Victim 3 */
+#define        SPRN_IVLIM      0x399   /* Instruction Cache Victim Limit */
+#endif
 #define SPRN_LDSTCR    0x3F8   /* Load/Store Control Register */
 #define SPRN_L2CR      0x3F9   /* Level 2 Cache Control Regsiter */
 #define SPRN_LR                0x008   /* Link Register */
 #define SPRN_MBAR      0x137   /* System memory base address */
 #define SPRN_MMCR0     0x3B8   /* Monitor Mode Control Register 0 */
 #define SPRN_MMCR1     0x3BC   /* Monitor Mode Control Register 1 */
+#ifdef CONFIG_BOOKE
+#define        SPRN_MMUCR      0x3b2   /* MMU Control Register */
+#endif
 #define SPRN_PBL1      0x3FC   /* Protection Bound Lower 1 */
 #define SPRN_PBL2      0x3FE   /* Protection Bound Lower 2 */
 #define SPRN_PBU1      0x3FD   /* Protection Bound Upper 1 */
 #define SPRN_PMC4      0x3BE   /* Performance Counter Register 4 */
 #define SPRN_PVR       0x11F   /* Processor Version Register */
 #define SPRN_RPA       0x3D6   /* Required Physical Address Register */
+#ifdef CONFIG_BOOKE
+#define        SPRN_RSTCFG     0x39b   /* Reset Configuration */
+#endif
 #define SPRN_SDA       0x3BF   /* Sampled Data Address Register */
 #define SPRN_SDR1      0x019   /* MMU Hash Base Register */
 #define SPRN_SGR       0x3B9   /* Storage Guarded Register */
 #define SPRN_SRR1      0x01B   /* Save/Restore Register 1 */
 #define SPRN_SRR2      0x3DE   /* Save/Restore Register 2 */
 #define SPRN_SRR3      0x3DF   /* Save/Restore Register 3 */
+
 #ifdef CONFIG_BOOKE
 #define SPRN_SVR       0x3FF   /* System Version Register */
 #else
 #define SPRN_IVOR13    0x19d   /* Interrupt Vector Offset Register 13 */
 #define SPRN_IVOR14    0x19e   /* Interrupt Vector Offset Register 14 */
 #define SPRN_IVOR15    0x19f   /* Interrupt Vector Offset Register 15 */
+#define SPRN_IVOR38    0x1b0   /* Interrupt Vector Offset Register 38 */
+#define SPRN_IVOR39    0x1b1   /* Interrupt Vector Offset Register 39 */
+#define SPRN_IVOR40    0x1b2   /* Interrupt Vector Offset Register 40 */
+#define SPRN_IVOR41    0x1b3   /* Interrupt Vector Offset Register 41 */
+#define SPRN_GIVOR2    0x1b8   /* Guest Interrupt Vector Offset Register 2 */
+#define SPRN_GIVOR3    0x1b9   /* Guest Interrupt Vector Offset Register 3 */
+#define SPRN_GIVOR4    0x1ba   /* Guest Interrupt Vector Offset Register 4 */
+#define SPRN_GIVOR8    0x1bb   /* Guest Interrupt Vector Offset Register 8 */
+#define SPRN_GIVOR13   0x1bc   /* Guest Interrupt Vector Offset Register 13 */
+#define SPRN_GIVOR14   0x1bd   /* Guest Interrupt Vector Offset Register 14 */
 
 /* e500 definitions */
 #define SPRN_L1CFG0    0x203   /* L1 Cache Configuration Register 0 */
 #define SPRN_L1CFG1    0x204   /* L1 Cache Configuration Register 1 */
+#define SPRN_L2CFG0    0x207   /* L2 Cache Configuration Register 0 */
 #define SPRN_L1CSR0    0x3f2   /* L1 Data Cache Control and Status Register 0 */
 #define   L1CSR0_CPE           0x00010000      /* Data Cache Parity Enable */
 #define   L1CSR0_DCFI          0x00000002      /* Data Cache Flash Invalidate */
 #define   L1CSR1_CPE           0x00010000      /* Instruction Cache Parity Enable */
 #define   L1CSR1_ICFI          0x00000002      /* Instruction Cache Flash Invalidate */
 #define   L1CSR1_ICE           0x00000001      /* Instruction Cache Enable */
-
+#define SPRN_L1CSR2    0x25e   /* L1 Data Cache Control and Status Register 2 */
+#define SPRN_L2CSR0    0x3f9   /* L2 Data Cache Control and Status Register 0 */
+#define   L2CSR0_L2E           0x80000000      /* L2 Cache Enable */
+#define   L2CSR0_L2PE          0x40000000      /* L2 Cache Parity/ECC Enable */
+#define   L2CSR0_L2WP          0x1c000000      /* L2 I/D Way Partioning */
+#define   L2CSR0_L2CM          0x03000000      /* L2 Cache Coherency Mode */
+#define   L2CSR0_L2FI          0x00200000      /* L2 Cache Flash Invalidate */
+#define   L2CSR0_L2IO          0x00100000      /* L2 Cache Instruction Only */
+#define   L2CSR0_L2DO          0x00010000      /* L2 Cache Data Only */
+#define   L2CSR0_L2REP         0x00003000      /* L2 Line Replacement Algo */
+#define   L2CSR0_L2FL          0x00000800      /* L2 Cache Flush */
+#define   L2CSR0_L2LFC         0x00000400      /* L2 Cache Lock Flash Clear */
+#define   L2CSR0_L2LOA         0x00000080      /* L2 Cache Lock Overflow Allocate */
+#define   L2CSR0_L2LO          0x00000020      /* L2 Cache Lock Overflow */
+#define SPRN_L2CSR1    0x3fa   /* L2 Data Cache Control and Status Register 1 */
+
+#define SPRN_TLB0CFG   0x2B0   /* TLB 0 Config Register */
+#define SPRN_TLB1CFG   0x2B1   /* TLB 1 Config Register */
 #define SPRN_MMUCSR0   0x3f4   /* MMU control and status register 0 */
 #define SPRN_MAS0      0x270   /* MMU Assist Register 0 */
 #define SPRN_MAS1      0x271   /* MMU Assist Register 1 */
 #define SPRN_MAS5      0x275   /* MMU Assist Register 5 */
 #define SPRN_MAS6      0x276   /* MMU Assist Register 6 */
 #define SPRN_MAS7      0x3B0   /* MMU Assist Register 7 */
+#define SPRN_MAS8      0x155   /* MMU Assist Register 8 */
 
 #define SPRN_IVOR32    0x210   /* Interrupt Vector Offset Register 32 */
 #define SPRN_IVOR33    0x211   /* Interrupt Vector Offset Register 33 */
 #define SPRN_IVOR34    0x212   /* Interrupt Vector Offset Register 34 */
 #define SPRN_IVOR35    0x213   /* Interrupt Vector Offset Register 35 */
+#define SPRN_IVOR36    0x214   /* Interrupt Vector Offset Register 36 */
+#define SPRN_IVOR37    0x215   /* Interrupt Vector Offset Register 37 */
 #define SPRN_SPEFSCR   0x200   /* SPE & Embedded FP Status & Control */
 
 #define SPRN_MCSRR0    0x23a   /* Machine Check Save and Restore Register 0 */
 #define SPRN_PID2      0x27a   /* Process ID Register 2 */
 #define SPRN_MCSR      0x23c   /* Machine Check Syndrome register */
 #define SPRN_MCAR      0x23d   /* Machine Check Address register */
-#ifdef CONFIG_440
 #define MCSR_MCS       0x80000000      /* Machine Check Summary */
 #define MCSR_IB                0x40000000      /* Instruction PLB Error */
+#if defined(CONFIG_440)
 #define MCSR_DRB       0x20000000      /* Data Read PLB Error */
 #define MCSR_DWB       0x10000000      /* Data Write PLB Error */
+#else
+#define MCSR_DB                0x20000000      /* Data PLB Error */
+#endif /* defined(CONFIG_440) */
 #define MCSR_TLBP      0x08000000      /* TLB Parity Error */
 #define MCSR_ICP       0x04000000      /* I-Cache Parity Error */
 #define MCSR_DCSP      0x02000000      /* D-Cache Search Parity Error */
 #define MCSR_DCFP      0x01000000      /* D-Cache Flush Parity Error */
 #define MCSR_IMPE      0x00800000      /* Imprecise Machine Check Exception */
-#endif
 #define ESR_ST         0x00800000      /* Store Operation */
 
 #if defined(CONFIG_MPC86xx)
 #define MCSRR1 SPRN_MCSRR1
 #define L1CSR0 SPRN_L1CSR0
 #define L1CSR1 SPRN_L1CSR1
+#define L1CSR2 SPRN_L1CSR2
 #define L1CFG0 SPRN_L1CFG0
 #define L1CFG1 SPRN_L1CFG1
+#define L2CFG0 SPRN_L2CFG0
+#define L2CSR0 SPRN_L2CSR0
+#define L2CSR1 SPRN_L2CSR1
 #define MCSR   SPRN_MCSR
 #define MMUCSR0        SPRN_MMUCSR0
 #define BUCSR  SPRN_BUCSR
 #define MAS5   SPRN_MAS5
 #define MAS6   SPRN_MAS6
 #define MAS7   SPRN_MAS7
+#define MAS8   SPRN_MAS8
 
 #if defined(CONFIG_4xx) || defined(CONFIG_44x) || defined(CONFIG_MPC85xx)
 #define DAR_DEAR DEAR
 #define PVR_MAJ(pvr)   (((pvr) >>  4) & 0xF)   /* Major revision field */
 #define PVR_MIN(pvr)   (((pvr) >>  0) & 0xF)   /* Minor revision field */
 
+/* e600 core PVR fields */
+
+#define PVR_E600_VER(pvr)      (((pvr) >> 15) & 0xFFFF) /* Version/type */
+#define PVR_E600_TECH(pvr)     (((pvr) >> 12) & 0xF)    /* Technology */
+#define PVR_E600_MAJ(pvr)      (((pvr) >> 8) & 0xF)     /* Major revision */
+#define PVR_E600_MIN(pvr)      (((pvr) >> 0) & 0xFF)    /* Minor revision */
+
 /* Processor Version Numbers */
 
 #define PVR_403GA      0x00200000
 #define PVR_405EP_RA   0x51210950
 #define PVR_405GPR_RB  0x50910951
 #define PVR_405EZ_RA   0x41511460
-#define PVR_405EXR1_RA 0x12911473 /* 405EXr rev A with Security */
-#define PVR_405EXR2_RA 0x12911471 /* 405EXr rev A without Security */
-#define PVR_405EX1_RA  0x12911477 /* 405EX rev A with Security */
-#define PVR_405EX2_RA  0x12911475 /* 405EX rev A without Security */
+#define PVR_405EXR2_RA 0x12911471 /* 405EXr rev A/B without Security */
+#define PVR_405EX1_RA  0x12911477 /* 405EX rev A/B with Security */
+#define PVR_405EXR1_RC 0x1291147B /* 405EXr rev C with Security */
+#define PVR_405EXR2_RC 0x12911479 /* 405EXr rev C without Security */
+#define PVR_405EX1_RC  0x1291147F /* 405EX rev C with Security */
+#define PVR_405EX2_RC  0x1291147D /* 405EX rev C without Security */
+#define PVR_405EXR1_RD 0x12911472 /* 405EXr rev D with Security */
+#define PVR_405EXR2_RD 0x12911470 /* 405EXr rev D without Security */
+#define PVR_405EX1_RD  0x12911475 /* 405EX rev D with Security */
+#define PVR_405EX2_RD  0x12911473 /* 405EX rev D without Security */
 #define PVR_440GP_RB   0x40120440
 #define PVR_440GP_RC   0x40120481
 #define PVR_440EP_RA   0x42221850
 #define PVR_440SPe_RB  0x53521891 /* 440SPe rev B without RAID 6 support       */
 #define PVR_460EX_SE_RA        0x130218A2 /* 460EX rev A with Security Engine    */
 #define PVR_460EX_RA   0x130218A3 /* 460EX rev A without Security Engine */
+#define PVR_460EX_RB   0x130218A4 /* 460EX rev B with and without Sec Eng*/
 #define PVR_460GT_SE_RA        0x130218A0 /* 460GT rev A with Security Engine    */
 #define PVR_460GT_RA   0x130218A1 /* 460GT rev A without Security Engine */
+#define PVR_460GT_RB   0x130218A5 /* 460GT rev B with and without Sec Eng*/
+#define PVR_460SX_RA    0x13541800 /* 460SX rev A                   */
+#define PVR_460SX_RA_V1 0x13541801 /* 460SX rev A Variant 1 Security disabled */
+#define PVR_460GX_RA    0x13541802 /* 460GX rev A                   */
+#define PVR_460GX_RA_V1 0x13541803 /* 460GX rev A Variant 1 Security disabled */
 #define PVR_601                0x00010000
 #define PVR_602                0x00050000
 #define PVR_603                0x00030000
 #define PVR_85xx_REV2  (PVR_85xx | 0x0020)
 
 #define PVR_86xx       0x80040000
-#define PVR_86xx_REV1  (PVR_86xx | 0x0010)
+
+#define PVR_VIRTEX5     0x7ff21912
 
 /*
  * For the 8xx processors, all of them report the same PVR family for
 /* Some parts define SVR[0:23] as the SOC version */
 #define SVR_SOC_VER(svr) (((svr) >> 8) & 0xFFFFFF)     /* SOC Version fields */
 
+/* whether MPC8xxxE (i.e. has SEC) */
+#if defined(CONFIG_MPC85xx)
+#define IS_E_PROCESSOR(svr)    (svr & 0x80000)
+#else
+#if defined(CONFIG_MPC83xx)
+#define IS_E_PROCESSOR(spridr) (!(spridr & 0x00010000))
+#endif
+#endif
+
 /*
  * SVR_SOC_VER() Version Values
  */
 
 #define SVR_8533       0x803400
 #define SVR_8533_E     0x803C00
+#define SVR_8535       0x803701
+#define SVR_8535_E     0x803F01
+#define SVR_8536       0x803700
+#define SVR_8536_E     0x803F00
 #define SVR_8540       0x803000
 #define SVR_8541       0x807200
 #define SVR_8541_E     0x807A00
 #define SVR_8567_E     0x807E00
 #define SVR_8568       0x807500
 #define SVR_8568_E     0x807D00
+#define SVR_8569       0x808000
+#define SVR_8569_E     0x808800
 #define SVR_8572       0x80E000
 #define SVR_8572_E     0x80E800
+#define SVR_P1011      0x80E500
+#define SVR_P1011_E    0x80ED00
+#define SVR_P1020      0x80E400
+#define SVR_P1020_E    0x80EC00
+#define SVR_P2010      0x80E300
+#define SVR_P2010_E    0x80EB00
+#define SVR_P2020      0x80E200
+#define SVR_P2020_E    0x80EA00
+#define SVR_P4040      0x820100
+#define SVR_P4040_E    0x820900
+#define SVR_P4080      0x820000
+#define SVR_P4080_E    0x820800
 
 #define SVR_8610       0x80A000
 #define SVR_8641       0x809000
 #define SVR_8641D      0x809001
 
-/* I am just adding a single entry for 8260 boards.  I think we may be
- * able to combine mbx, fads, rpxlite, bseip, and classic into a single
- * generic 8xx as well.  The boards containing these processors are either
- * identical at the processor level (due to the high integration) or so
- * wildly different that testing _machine at run time is best replaced by
- * conditional compilation by board type (found in their respective .h file).
- *     -- Dan
- */
-#define _MACH_prep     0x00000001
-#define _MACH_Pmac     0x00000002      /* pmac or pmac clone (non-chrp) */
-#define _MACH_chrp     0x00000004      /* chrp machine */
-#define _MACH_mbx      0x00000008      /* Motorola MBX board */
-#define _MACH_apus     0x00000010      /* amiga with phase5 powerup */
-#define _MACH_fads     0x00000020      /* Motorola FADS board */
-#define _MACH_rpxlite  0x00000040      /* RPCG RPX-Lite 8xx board */
-#define _MACH_bseip    0x00000080      /* Bright Star Engineering ip-Engine */
-#define _MACH_yk       0x00000100      /* Motorola Yellowknife */
-#define _MACH_gemini   0x00000200      /* Synergy Microsystems gemini board */
-#define _MACH_classic  0x00000400      /* RPCG RPX-Classic 8xx board */
-#define _MACH_oak      0x00000800      /* IBM "Oak" 403 eval. board */
-#define _MACH_walnut   0x00001000      /* AMCC "Walnut" 405GP eval. board */
-#define _MACH_8260     0x00002000      /* Generic 8260 */
-#define _MACH_sandpoint 0x00004000     /* Motorola SPS Processor eval board */
-#define _MACH_tqm860   0x00008000      /* TQM860/L */
-#define _MACH_tqm8xxL  0x00010000      /* TQM8xxL */
-#define _MACH_hidden_dragon 0x00020000 /* Motorola Hidden Dragon eval board */
-
-/* see residual.h for these */
-#define _PREP_Motorola 0x01  /* motorola prep */
-#define _PREP_Firm     0x02  /* firmworks prep */
-#define _PREP_IBM      0x00  /* ibm prep */
-#define _PREP_Bull     0x03  /* bull prep */
-#define _PREP_Radstone 0x04  /* Radstone Technology PLC prep */
-
-/*
- * Radstone board types
- */
-#define RS_SYS_TYPE_PPC1   0
-#define RS_SYS_TYPE_PPC2   1
-#define RS_SYS_TYPE_PPC1a  2
-#define RS_SYS_TYPE_PPC2a  3
-#define RS_SYS_TYPE_PPC4   4
-#define RS_SYS_TYPE_PPC4a  5
-#define RS_SYS_TYPE_PPC2ep 6
-
-/* these are arbitrary */
-#define _CHRP_Motorola 0x04  /* motorola chrp, the cobra */
-#define _CHRP_IBM      0x05  /* IBM chrp, the longtrail and longtrail 2 */
+#define SVR_Unknown    0xFFFFFF
 
 #define _GLOBAL(n)\
        .globl n;\
@@ -1005,6 +1089,25 @@ n:
 #define SR15   15
 
 #ifndef __ASSEMBLY__
+
+struct cpu_type {
+       char name[15];
+       u32 soc_ver;
+       u32 num_cores;
+};
+
+struct cpu_type *identify_cpu(u32 ver);
+
+#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
+#define CPU_TYPE_ENTRY(n, v, nc) \
+       { .name = #n, .soc_ver = SVR_##v, .num_cores = (nc), }
+#else
+#if defined(CONFIG_MPC83xx)
+#define CPU_TYPE_ENTRY(x) {#x, SPR_##x}
+#endif
+#endif
+
+
 #ifndef CONFIG_MACH_SPECIFIC
 extern int _machine;
 extern int have_of;