X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-ppc%2Fibm44x.h;h=7818b54b6e37de0223a59274c7c4e015128cc8d5;hb=refs%2Fheads%2Fvserver;hp=2aea5c891a15a43598965772f04cef0157d97f90;hpb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;p=linux-2.6.git diff --git a/include/asm-ppc/ibm44x.h b/include/asm-ppc/ibm44x.h index 2aea5c891..7818b54b6 100644 --- a/include/asm-ppc/ibm44x.h +++ b/include/asm-ppc/ibm44x.h @@ -3,9 +3,9 @@ * * PPC44x definitions * - * Matt Porter + * Matt Porter * - * Copyright 2002-2003 MontaVista Software Inc. + * Copyright 2002-2005 MontaVista Software Inc. * * 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 @@ -17,7 +17,6 @@ #ifndef __ASM_IBM44x_H__ #define __ASM_IBM44x_H__ -#include #ifndef NR_BOARD_IRQS #define NR_BOARD_IRQS 0 @@ -29,28 +28,87 @@ /* TLB entry offset/size used for pinning kernel lowmem */ #define PPC44x_PIN_SHIFT 28 -#define PPC44x_PIN_SIZE (1 << PPC44x_PIN_SHIFT) +#define PPC_PIN_SIZE (1 << PPC44x_PIN_SHIFT) /* Lowest TLB slot consumed by the default pinned TLBs */ #define PPC44x_LOW_SLOT 63 +/* + * Least significant 32-bits and extended real page number (ERPN) of + * UART0 physical address location for early serial text debug + */ +#if defined(CONFIG_440SP) +#define UART0_PHYS_ERPN 1 +#define UART0_PHYS_IO_BASE 0xf0000200 +#elif defined(CONFIG_440SPE) +#define UART0_PHYS_ERPN 4 +#define UART0_PHYS_IO_BASE 0xf0000200 +#elif defined(CONFIG_440EP) +#define UART0_PHYS_IO_BASE 0xe0000000 +#else +#define UART0_PHYS_ERPN 1 +#define UART0_PHYS_IO_BASE 0x40000200 +#endif + +/* + * XXX This 36-bit trap stuff will move somewhere in syslib/ + * when we rework/abstract the PPC44x PCI-X handling -mdp + */ + /* * Standard 4GB "page" definitions */ +#if defined(CONFIG_440SP) +#define PPC44x_IO_PAGE 0x0000000100000000ULL +#define PPC44x_PCICFG_PAGE 0x0000000900000000ULL +#define PPC44x_PCIIO_PAGE PPC44x_PCICFG_PAGE +#define PPC44x_PCIMEM_PAGE 0x0000000a00000000ULL +#elif defined(CONFIG_440SPE) +#define PPC44x_IO_PAGE 0x0000000400000000ULL +#define PPC44x_PCICFG_PAGE 0x0000000c00000000ULL +#define PPC44x_PCIIO_PAGE PPC44x_PCICFG_PAGE +#define PPC44x_PCIMEM_PAGE 0x0000000d00000000ULL +#elif defined(CONFIG_440EP) +#define PPC44x_IO_PAGE 0x0000000000000000ULL +#define PPC44x_PCICFG_PAGE 0x0000000000000000ULL +#define PPC44x_PCIIO_PAGE PPC44x_PCICFG_PAGE +#define PPC44x_PCIMEM_PAGE 0x0000000000000000ULL +#else #define PPC44x_IO_PAGE 0x0000000100000000ULL #define PPC44x_PCICFG_PAGE 0x0000000200000000ULL #define PPC44x_PCIIO_PAGE PPC44x_PCICFG_PAGE #define PPC44x_PCIMEM_PAGE 0x0000000300000000ULL +#endif /* * 36-bit trap ranges */ -#define PPC44x_IO_LO 0x40000000 -#define PPC44x_IO_HI 0x40001000 -#define PPC44x_PCICFG_LO 0x0ec00000 -#define PPC44x_PCICFG_HI 0x0ec7ffff -#define PPC44x_PCIMEM_LO 0x80002000 -#define PPC44x_PCIMEM_HI 0xffffffff +#if defined(CONFIG_440SP) || defined(CONFIG_440SPE) +#define PPC44x_IO_LO 0xf0000000UL +#define PPC44x_IO_HI 0xf0000fffUL +#define PPC44x_PCI0CFG_LO 0x0ec00000UL +#define PPC44x_PCI0CFG_HI 0x0ec00007UL +#define PPC44x_PCI1CFG_LO 0x1ec00000UL +#define PPC44x_PCI1CFG_HI 0x1ec00007UL +#define PPC44x_PCI2CFG_LO 0x2ec00000UL +#define PPC44x_PCI2CFG_HI 0x2ec00007UL +#define PPC44x_PCIMEM_LO 0x80000000UL +#define PPC44x_PCIMEM_HI 0xdfffffffUL +#elif defined(CONFIG_440EP) +#define PPC44x_IO_LO 0xef500000UL +#define PPC44x_IO_HI 0xefffffffUL +#define PPC44x_PCI0CFG_LO 0xeec00000UL +#define PPC44x_PCI0CFG_HI 0xeecfffffUL +#define PPC44x_PCIMEM_LO 0xa0000000UL +#define PPC44x_PCIMEM_HI 0xdfffffffUL +#else +#define PPC44x_IO_LO 0x40000000UL +#define PPC44x_IO_HI 0x40000fffUL +#define PPC44x_PCI0CFG_LO 0x0ec00000UL +#define PPC44x_PCI0CFG_HI 0x0ec00007UL +#define PPC44x_PCIMEM_LO 0x80002000UL +#define PPC44x_PCIMEM_HI 0xffffffffUL +#endif /* * The "residual" board information structure the boot loader passes @@ -58,17 +116,12 @@ */ #ifndef __ASSEMBLY__ -/* - * SPRN definitions - */ -#define SPRN_CPC0_GPIO 0xe5/BEARLRL - /* * DCRN definitions */ -#ifdef CONFIG_440GX -/* CPRs */ + +/* CPRs (440GX and 440SP/440SPe) */ #define DCRN_CPR_CONFIG_ADDR 0xc #define DCRN_CPR_CONFIG_DATA 0xd @@ -89,7 +142,7 @@ mtdcr(DCRN_CPR_CONFIG_ADDR, offset); \ mtdcr(DCRN_CPR_CONFIG_DATA, data);}) -/* SDRs */ +/* SDRs (440GX and 440SP/440SPe) */ #define DCRN_SDR_CONFIG_ADDR 0xe #define DCRN_SDR_CONFIG_DATA 0xf #define DCRN_SDR_PFC0 0x4100 @@ -125,6 +178,12 @@ #define DCRN_SDR_UART0 0x0120 #define DCRN_SDR_UART1 0x0121 +#ifdef CONFIG_440EP +#define DCRN_SDR_UART2 0x0122 +#define DCRN_SDR_UART3 0x0123 +#define DCRN_SDR_CUST0 0x4000 +#endif + /* SDR read/write helper macros */ #define SDR_READ(offset) ({\ mtdcr(DCRN_SDR_CONFIG_ADDR, offset); \ @@ -132,9 +191,8 @@ #define SDR_WRITE(offset, data) ({\ mtdcr(DCRN_SDR_CONFIG_ADDR, offset); \ mtdcr(DCRN_SDR_CONFIG_DATA,data);}) -#endif /* CONFIG_440GX */ -/* Base DCRNs */ +/* DMA (excluding 440SP/440SPe) */ #define DCRN_DMA0_BASE 0x100 #define DCRN_DMA1_BASE 0x108 #define DCRN_DMA2_BASE 0x110 @@ -143,15 +201,31 @@ #define DCRNCAP_DMA_SG 1 /* have DMA scatter/gather capability */ #define DCRN_MAL_BASE 0x180 +#ifdef CONFIG_440EP +#define DCRN_DMA2P40_BASE 0x300 +#define DCRN_DMA2P41_BASE 0x308 +#define DCRN_DMA2P42_BASE 0x310 +#define DCRN_DMA2P43_BASE 0x318 +#define DCRN_DMA2P4SR_BASE 0x320 +#endif + /* UIC */ #define DCRN_UIC0_BASE 0xc0 #define DCRN_UIC1_BASE 0xd0 -#define DCRN_UIC2_BASE 0x210 -#define DCRN_UICB_BASE 0x200 #define UIC0 DCRN_UIC0_BASE #define UIC1 DCRN_UIC1_BASE + +#ifdef CONFIG_440SPE +#define DCRN_UIC2_BASE 0xe0 +#define DCRN_UIC3_BASE 0xf0 +#define UIC2 DCRN_UIC2_BASE +#define UIC3 DCRN_UIC3_BASE +#else +#define DCRN_UIC2_BASE 0x210 +#define DCRN_UICB_BASE 0x200 #define UIC2 DCRN_UIC2_BASE #define UICB DCRN_UICB_BASE +#endif #define DCRN_UIC_SR(base) (base + 0x0) #define DCRN_UIC_ER(base) (base + 0x2) @@ -162,14 +236,19 @@ #define DCRN_UIC_VR(base) (base + 0x7) #define DCRN_UIC_VCR(base) (base + 0x8) -#define UIC0_UIC1NC 30 /* UIC1 non-critical interrupt */ -#define UIC0_UIC1CR 31 /* UIC1 critical interrupt */ +#define UIC0_UIC1NC 0x00000002 + +#ifdef CONFIG_440SPE +#define UIC0_UIC1NC 0x00000002 +#define UIC0_UIC2NC 0x00200000 +#define UIC0_UIC3NC 0x00008000 +#endif #define UICB_UIC0NC 0x40000000 #define UICB_UIC1NC 0x10000000 #define UICB_UIC2NC 0x04000000 -/* 440GP MAL DCRs */ +/* 440 MAL DCRs */ #define DCRN_MALCR(base) (base + 0x0) /* Configuration */ #define DCRN_MALESR(base) (base + 0x1) /* Error Status */ #define DCRN_MALIER(base) (base + 0x2) /* Interrupt Enable */ @@ -200,7 +279,6 @@ #define DCRN_MALRCBS2(base) ((base) + 0x62) /* Channel Rx 2 Channel Buffer Size */ #define DCRN_MALRCBS3(base) ((base) + 0x63) /* Channel Rx 3 Channel Buffer Size */ - #define MALCR_MMSR 0x80000000 /* MAL Software reset */ #define MALCR_PLBP_1 0x00400000 /* MAL reqest priority: */ #define MALCR_PLBP_2 0x00800000 /* lowsest is 00 */ @@ -245,13 +323,42 @@ #define MALOBISR_CH0 0x80000000 /* EOB channel 1 bit */ #define MALOBISR_CH2 0x40000000 /* EOB channel 2 bit */ -/* 440GP PLB Arbiter DCRs */ +#if defined(CONFIG_440SP) || defined(CONFIG_440SPE) +/* 440SP/440SPe PLB Arbiter DCRs */ +#define DCRN_PLB_REVID 0x080 /* PLB Revision ID */ +#define DCRN_PLB_CCR 0x088 /* PLB Crossbar Control */ + +#define DCRN_PLB0_ACR 0x081 /* PLB Arbiter Control */ +#define DCRN_PLB0_BESRL 0x082 /* PLB Error Status */ +#define DCRN_PLB0_BESRH 0x083 /* PLB Error Status */ +#define DCRN_PLB0_BEARL 0x084 /* PLB Error Address Low */ +#define DCRN_PLB0_BEARH 0x085 /* PLB Error Address High */ + +#define DCRN_PLB1_ACR 0x089 /* PLB Arbiter Control */ +#define DCRN_PLB1_BESRL 0x08a /* PLB Error Status */ +#define DCRN_PLB1_BESRH 0x08b /* PLB Error Status */ +#define DCRN_PLB1_BEARL 0x08c /* PLB Error Address Low */ +#define DCRN_PLB1_BEARH 0x08d /* PLB Error Address High */ +#else +/* 440GP/GX PLB Arbiter DCRs */ #define DCRN_PLB0_REVID 0x082 /* PLB Arbiter Revision ID */ #define DCRN_PLB0_ACR 0x083 /* PLB Arbiter Control */ #define DCRN_PLB0_BESR 0x084 /* PLB Error Status */ #define DCRN_PLB0_BEARL 0x086 /* PLB Error Address Low */ #define DCRN_PLB0_BEAR DCRN_PLB0_BEARL /* 40x compatibility */ #define DCRN_PLB0_BEARH 0x087 /* PLB Error Address High */ +#endif + +/* 440GP/GX PLB to OPB bridge DCRs */ +#define DCRN_POB0_BESR0 0x090 +#define DCRN_POB0_BESR1 0x094 +#define DCRN_POB0_BEARL 0x092 +#define DCRN_POB0_BEARH 0x093 + +/* 440GP/GX OPB to PLB bridge DCRs */ +#define DCRN_OPB0_BSTAT 0x0a9 +#define DCRN_OPB0_BEARL 0x0aa +#define DCRN_OPB0_BEARH 0x0ab /* 440GP Clock, PM, chip control */ #define DCRN_CPC0_SR 0x0b0 @@ -315,7 +422,7 @@ #define DCRN_SLP (DCRN_DMASR_BASE + 0x5) /* DMA Sleep Register */ #define DCRN_POL (DCRN_DMASR_BASE + 0x6) /* DMA Polarity Register */ -/* 440GP DRAM controller DCRs */ +/* 440GP/440GX SDRAM controller DCRs */ #define DCRN_SDRAM0_CFGADDR 0x010 #define DCRN_SDRAM0_CFGDATA 0x011 @@ -341,13 +448,36 @@ #define PPC44x_MEM_SIZE_128M 0x08000000 #define PPC44x_MEM_SIZE_256M 0x10000000 #define PPC44x_MEM_SIZE_512M 0x20000000 +#define PPC44x_MEM_SIZE_1G 0x40000000 +#define PPC44x_MEM_SIZE_2G 0x80000000 + +/* 440SP/440SPe memory controller DCRs */ +#define DCRN_MQ0_BS0BAS 0x40 +#if defined(CONFIG_440SP) +#define MQ0_NUM_BANKS 2 +#elif defined(CONFIG_440SPE) +#define MQ0_NUM_BANKS 4 +#endif -#ifdef CONFIG_440GX -/* Internal SRAM Controller */ -#define DCRN_SRAM0_SB0CR 0x020 -#define DCRN_SRAM0_SB1CR 0x021 -#define DCRN_SRAM0_SB2CR 0x022 -#define DCRN_SRAM0_SB3CR 0x023 +#define MQ0_CONFIG_SIZE_MASK 0x0000fff0 +#define MQ0_CONFIG_SIZE_8M 0x0000ffc0 +#define MQ0_CONFIG_SIZE_16M 0x0000ff80 +#define MQ0_CONFIG_SIZE_32M 0x0000ff00 +#define MQ0_CONFIG_SIZE_64M 0x0000fe00 +#define MQ0_CONFIG_SIZE_128M 0x0000fc00 +#define MQ0_CONFIG_SIZE_256M 0x0000f800 +#define MQ0_CONFIG_SIZE_512M 0x0000f000 +#define MQ0_CONFIG_SIZE_1G 0x0000e000 +#define MQ0_CONFIG_SIZE_2G 0x0000c000 +#define MQ0_CONFIG_SIZE_4G 0x00008000 + +/* Internal SRAM Controller 440GX/440SP/440SPe */ +#define DCRN_SRAM0_BASE 0x000 + +#define DCRN_SRAM0_SB0CR (DCRN_SRAM0_BASE + 0x020) +#define DCRN_SRAM0_SB1CR (DCRN_SRAM0_BASE + 0x021) +#define DCRN_SRAM0_SB2CR (DCRN_SRAM0_BASE + 0x022) +#define DCRN_SRAM0_SB3CR (DCRN_SRAM0_BASE + 0x023) #define SRAM_SBCR_BAS0 0x80000000 #define SRAM_SBCR_BAS1 0x80010000 #define SRAM_SBCR_BAS2 0x80020000 @@ -356,16 +486,16 @@ #define SRAM_SBCR_BS_64KB 0x00000800 #define SRAM_SBCR_BU_RO 0x00000080 #define SRAM_SBCR_BU_RW 0x00000180 -#define DCRN_SRAM0_BEAR 0x024 -#define DCRN_SRAM0_BESR0 0x025 -#define DCRN_SRAM0_BESR1 0x026 -#define DCRN_SRAM0_PMEG 0x027 -#define DCRN_SRAM0_CID 0x028 -#define DCRN_SRAM0_REVID 0x029 -#define DCRN_SRAM0_DPC 0x02a +#define DCRN_SRAM0_BEAR (DCRN_SRAM0_BASE + 0x024) +#define DCRN_SRAM0_BESR0 (DCRN_SRAM0_BASE + 0x025) +#define DCRN_SRAM0_BESR1 (DCRN_SRAM0_BASE + 0x026) +#define DCRN_SRAM0_PMEG (DCRN_SRAM0_BASE + 0x027) +#define DCRN_SRAM0_CID (DCRN_SRAM0_BASE + 0x028) +#define DCRN_SRAM0_REVID (DCRN_SRAM0_BASE + 0x029) +#define DCRN_SRAM0_DPC (DCRN_SRAM0_BASE + 0x02a) #define SRAM_DPC_ENABLE 0x80000000 -/* L2 Cache Controller */ +/* L2 Cache Controller 440GX/440SP/440SPe */ #define DCRN_L2C0_CFG 0x030 #define L2C_CFG_L2M 0x80000000 #define L2C_CFG_ICU 0x40000000 @@ -415,13 +545,29 @@ #define L2C_SNP_SSR_MASK 0x0000f000 #define L2C_SNP_SSR_32G 0x0000f000 #define L2C_SNP_ESR 0x00000800 -#endif /* CONFIG_440GX */ /* * PCI-X definitions */ -#define PCIX0_REG_BASE 0x20ec80000ULL -#define PCIX0_REG_SIZE 0x200 +#define PCIX0_CFGA 0x0ec00000UL +#define PCIX1_CFGA 0x1ec00000UL +#define PCIX2_CFGA 0x2ec00000UL +#define PCIX0_CFGD 0x0ec00004UL +#define PCIX1_CFGD 0x1ec00004UL +#define PCIX2_CFGD 0x2ec00004UL + +#define PCIX0_IO_BASE 0x0000000908000000ULL +#define PCIX1_IO_BASE 0x0000000908000000ULL +#define PCIX2_IO_BASE 0x0000000908000000ULL +#define PCIX_IO_SIZE 0x00010000 + +#ifdef CONFIG_440SP +#define PCIX0_REG_BASE 0x000000090ec80000ULL +#else +#define PCIX0_REG_BASE 0x000000020ec80000ULL +#endif +#define PCIX_REG_OFFSET 0x10000000 +#define PCIX_REG_SIZE 0x200 #define PCIX0_VENDID 0x000 #define PCIX0_DEVID 0x002 @@ -513,14 +659,13 @@ #define IIC_CLOCK 50 #undef NR_UICS -#ifdef CONFIG_440GX +#if defined(CONFIG_440GX) #define NR_UICS 3 +#elif defined(CONFIG_440SPE) +#define NR_UICS 4 #else #define NR_UICS 2 #endif -#define UIC_CASCADE_MASK 0x0003 /* bits 30 & 31 */ - -#define BD_EMAC_ADDR(e,i) bi_enetaddr[e][i] #include