diff options
Diffstat (limited to 'include/asm-ppc')
| -rw-r--r-- | include/asm-ppc/interrupt.h | 36 | ||||
| -rw-r--r-- | include/asm-ppc/ppc4xx-ebc.h | 156 | ||||
| -rw-r--r-- | include/asm-ppc/ppc4xx-intvec.h | 474 | ||||
| -rw-r--r-- | include/asm-ppc/ppc4xx-sdram.h | 326 | ||||
| -rw-r--r-- | include/asm-ppc/ppc4xx-uic.h | 316 | ||||
| -rw-r--r-- | include/asm-ppc/processor.h | 6 | ||||
| -rw-r--r-- | include/asm-ppc/xilinx_irq.h | 36 | 
7 files changed, 829 insertions, 521 deletions
| diff --git a/include/asm-ppc/interrupt.h b/include/asm-ppc/interrupt.h new file mode 100644 index 000000000..792836b22 --- /dev/null +++ b/include/asm-ppc/interrupt.h @@ -0,0 +1,36 @@ +/* + * (C) Copyright 2008 + * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda@uam.es + * This work has been supported by: QTechnology  http://qtec.com/ + * Based on interrupts.c Wolfgang Denk-DENX Software Engineering-wd@denx.de + * + * 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, see <http://www.gnu.org/licenses/>. +*/ +#ifndef INTERRUPT_H +#define INTERRUPT_H + +#if defined(CONFIG_XILINX_440) +#include <asm/xilinx_irq.h> +#else +#include <asm/ppc4xx-uic.h> +#endif + +void pic_enable(void); +void pic_irq_enable(unsigned int irq); +void pic_irq_disable(unsigned int irq); +void pic_irq_ack(unsigned int irq); +void external_interrupt(struct pt_regs *regs); +void interrupt_run_handler(int vec); + +#endif diff --git a/include/asm-ppc/ppc4xx-ebc.h b/include/asm-ppc/ppc4xx-ebc.h new file mode 100644 index 000000000..d180e045f --- /dev/null +++ b/include/asm-ppc/ppc4xx-ebc.h @@ -0,0 +1,156 @@ +/* + * (C) Copyright 2008 + * Stefan Roese, DENX Software Engineering, sr@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 + */ + +#ifndef _PPC4xx_EBC_H_ +#define _PPC4xx_EBC_H_ + +/* + * Currently there are two register layout versions for the + * IBM EBC core used on 4xx PPC's: + */ +#if defined(CONFIG_405CR) || defined(CONFIG_405GP) || \ +    defined(CONFIG_405EP) || \ +    defined(CONFIG_440EP) || defined(CONFIG_440GR) || \ +    defined(CONFIG_440EPX) || defined(CONFIG_440GRX) +#define CONFIG_EBC_PPC4xx_IBM_VER1 +#endif + +/* Bank Configuration Register */ +#define	EBC_BXCR_BAS_MASK	PPC_REG_VAL(11, 0xFFF) +#define EBC_BXCR_BAS_ENCODE(n)	(((static_cast(u32, n)) & EBC_BXCR_BAS_MASK)) +#define EBC_BXCR_BS_MASK	PPC_REG_VAL(14, 0x7) +#define EBC_BXCR_BS_1MB		PPC_REG_VAL(14, 0x0) +#define EBC_BXCR_BS_2MB		PPC_REG_VAL(14, 0x1) +#define EBC_BXCR_BS_4MB		PPC_REG_VAL(14, 0x2) +#define EBC_BXCR_BS_8MB		PPC_REG_VAL(14, 0x3) +#define EBC_BXCR_BS_16MB	PPC_REG_VAL(14, 0x4) +#define EBC_BXCR_BS_32MB	PPC_REG_VAL(14, 0x5) +#define EBC_BXCR_BS_64MB	PPC_REG_VAL(14, 0x6) +#define EBC_BXCR_BS_128MB	PPC_REG_VAL(14, 0x7) +#define EBC_BXCR_BU_MASK	PPC_REG_VAL(16, 0x3) +#define	EBC_BXCR_BU_NONE	PPC_REG_VAL(16, 0x0) +#define EBC_BXCR_BU_R		PPC_REG_VAL(16, 0x1) +#define EBC_BXCR_BU_W		PPC_REG_VAL(16, 0x2) +#define EBC_BXCR_BU_RW		PPC_REG_VAL(16, 0x3) +#define EBC_BXCR_BW_MASK	PPC_REG_VAL(18, 0x3) +#define EBC_BXCR_BW_8BIT	PPC_REG_VAL(18, 0x0) +#define EBC_BXCR_BW_16BIT	PPC_REG_VAL(18, 0x1) +#if defined(CONFIG_EBC_PPC4xx_IBM_VER1) +#define EBC_BXCR_BW_32BIT	PPC_REG_VAL(18, 0x2) +#else +#define EBC_BXCR_BW_32BIT	PPC_REG_VAL(18, 0x3) +#endif + +/* Bank Access Parameter Register */ +#define EBC_BXAP_BME_ENABLED	PPC_REG_VAL(0, 0x1) +#define EBC_BXAP_BME_DISABLED	PPC_REG_VAL(0, 0x0) +#define EBC_BXAP_TWT_ENCODE(n)	PPC_REG_VAL(8, (static_cast(u32, n)) & 0xFF) +#define	EBC_BXAP_FWT_ENCODE(n)	PPC_REG_VAL(5, (static_cast(u32, n)) & 0x1F) +#define	EBC_BXAP_BWT_ENCODE(n)	PPC_REG_VAL(8, (static_cast(u32, n)) & 0x7) +#define EBC_BXAP_BCE_DISABLE	PPC_REG_VAL(9, 0x0) +#define EBC_BXAP_BCE_ENABLE	PPC_REG_VAL(9, 0x1) +#define EBC_BXAP_BCT_MASK	PPC_REG_VAL(11, 0x3) +#define EBC_BXAP_BCT_2TRANS	PPC_REG_VAL(11, 0x0) +#define EBC_BXAP_BCT_4TRANS	PPC_REG_VAL(11, 0x1) +#define EBC_BXAP_BCT_8TRANS	PPC_REG_VAL(11, 0x2) +#define EBC_BXAP_BCT_16TRANS	PPC_REG_VAL(11, 0x3) +#define EBC_BXAP_CSN_ENCODE(n)	PPC_REG_VAL(13, (static_cast(u32, n)) & 0x3) +#define EBC_BXAP_OEN_ENCODE(n)	PPC_REG_VAL(15, (static_cast(u32, n)) & 0x3) +#define EBC_BXAP_WBN_ENCODE(n)	PPC_REG_VAL(17, (static_cast(u32, n)) & 0x3) +#define EBC_BXAP_WBF_ENCODE(n)	PPC_REG_VAL(19, (static_cast(u32, n)) & 0x3) +#define EBC_BXAP_TH_ENCODE(n)	PPC_REG_VAL(22, (static_cast(u32, n)) & 0x7) +#define EBC_BXAP_RE_ENABLED	PPC_REG_VAL(23, 0x1) +#define EBC_BXAP_RE_DISABLED	PPC_REG_VAL(23, 0x0) +#define EBC_BXAP_SOR_DELAYED	PPC_REG_VAL(24, 0x0) +#define EBC_BXAP_SOR_NONDELAYED	PPC_REG_VAL(24, 0x1) +#define EBC_BXAP_BEM_WRITEONLY	PPC_REG_VAL(25, 0x0) +#define EBC_BXAP_BEM_RW		PPC_REG_VAL(25, 0x1) +#define EBC_BXAP_PEN_DISABLED	PPC_REG_VAL(26, 0x0) +#define EBC_BXAP_PEN_ENABLED	PPC_REG_VAL(26, 0x1) + +/* Common fields in EBC0_CFG register */ +#define EBC_CFG_PTD_MASK	PPC_REG_VAL(1, 0x1) +#define EBC_CFG_PTD_ENABLE	PPC_REG_VAL(1, 0x0) +#define EBC_CFG_PTD_DISABLE	PPC_REG_VAL(1, 0x1) +#define EBC_CFG_RTC_MASK	PPC_REG_VAL(4, 0x7) +#define EBC_CFG_RTC_16PERCLK	PPC_REG_VAL(4, 0x0) +#define EBC_CFG_RTC_32PERCLK	PPC_REG_VAL(4, 0x1) +#define EBC_CFG_RTC_64PERCLK	PPC_REG_VAL(4, 0x2) +#define EBC_CFG_RTC_128PERCLK	PPC_REG_VAL(4, 0x3) +#define EBC_CFG_RTC_256PERCLK	PPC_REG_VAL(4, 0x4) +#define EBC_CFG_RTC_512PERCLK	PPC_REG_VAL(4, 0x5) +#define EBC_CFG_RTC_1024PERCLK	PPC_REG_VAL(4, 0x6) +#define EBC_CFG_RTC_2048PERCLK	PPC_REG_VAL(4, 0x7) +#define EBC_CFG_PME_MASK	PPC_REG_VAL(14, 0x1) +#define EBC_CFG_PME_DISABLE	PPC_REG_VAL(14, 0x0) +#define EBC_CFG_PME_ENABLE	PPC_REG_VAL(14, 0x1) +#define EBC_CFG_PMT_MASK	PPC_REG_VAL(19, 0x1F) +#define EBC_CFG_PMT_ENCODE(n)	PPC_REG_VAL(19, (static_cast(u32, n)) & 0x1F) + +/* Now the two versions of the other bits */ +#if defined(CONFIG_EBC_PPC4xx_IBM_VER1) +#define EBC_CFG_EBTC_MASK	PPC_REG_VAL(0, 0x1) +#define EBC_CFG_EBTC_HI		PPC_REG_VAL(0, 0x0) +#define EBC_CFG_EBTC_DRIVEN	PPC_REG_VAL(0, 0x1) +#define EBC_CFG_EMPH_MASK	PPC_REG_VAL(6, 0x3) +#define EBC_CFG_EMPH_ENCODE(n)	PPC_REG_VAL(6, (static_cast(u32, n)) & 0x3) +#define EBC_CFG_EMPL_MASK	PPC_REG_VAL(8, 0x3) +#define EBC_CFG_EMPL_ENCODE(n)	PPC_REG_VAL(8, (static_cast(u32, n)) & 0x3) +#define EBC_CFG_CSTC_MASK	PPC_REG_VAL(9, 0x1) +#define EBC_CFG_CSTC_HI		PPC_REG_VAL(9, 0x0) +#define EBC_CFG_CSTC_DRIVEN	PPC_REG_VAL(9, 0x1) +#define EBC_CFG_BPR_MASK	PPC_REG_VAL(11, 0x3) +#define EBC_CFG_BPR_1DW		PPC_REG_VAL(11, 0x0) +#define EBC_CFG_BPR_2DW		PPC_REG_VAL(11, 0x1) +#define EBC_CFG_BPR_4DW		PPC_REG_VAL(11, 0x2) +#define EBC_CFG_EMS_MASK	PPC_REG_VAL(13, 0x3) +#define EBC_CFG_EMS_8BIT	PPC_REG_VAL(13, 0x0) +#define EBC_CFG_EMS_16BIT	PPC_REG_VAL(13, 0x1) +#define EBC_CFG_EMS_32BIT	PPC_REG_VAL(13, 0x2) +#else +#define EBC_CFG_LE_MASK		PPC_REG_VAL(0, 0x1) +#define EBC_CFG_LE_UNLOCK	PPC_REG_VAL(0, 0x0) +#define EBC_CFG_LE_LOCK		PPC_REG_VAL(0, 0x1) +#define EBC_CFG_ATC_MASK	PPC_REG_VAL(5, 0x1) +#define EBC_CFG_ATC_HI		PPC_REG_VAL(5, 0x0) +#define EBC_CFG_ATC_PREVIOUS	PPC_REG_VAL(5, 0x1) +#define EBC_CFG_DTC_MASK	PPC_REG_VAL(6, 0x1) +#define EBC_CFG_DTC_HI		PPC_REG_VAL(6, 0x0) +#define EBC_CFG_DTC_PREVIOUS	PPC_REG_VAL(6, 0x1) +#define EBC_CFG_CTC_MASK	PPC_REG_VAL(7, 0x1) +#define EBC_CFG_CTC_HI		PPC_REG_VAL(7, 0x0) +#define EBC_CFG_CTC_PREVIOUS	PPC_REG_VAL(7, 0x1) +#define EBC_CFG_OEO_MASK	PPC_REG_VAL(8, 0x1) +#define EBC_CFG_OEO_HI		PPC_REG_VAL(8, 0x0) +#define EBC_CFG_OEO_PREVIOUS	PPC_REG_VAL(8, 0x1) +#define EBC_CFG_EMC_MASK	PPC_REG_VAL(9, 0x1) +#define EBC_CFG_EMC_NONDEFAULT	PPC_REG_VAL(9, 0x0) +#define EBC_CFG_EMC_DEFAULT	PPC_REG_VAL(9, 0x1) +#define EBC_CFG_PR_MASK		PPC_REG_VAL(21, 0x3) +#define EBC_CFG_PR_16		PPC_REG_VAL(21, 0x0) +#define EBC_CFG_PR_32		PPC_REG_VAL(21, 0x1) +#define EBC_CFG_PR_64		PPC_REG_VAL(21, 0x2) +#define EBC_CFG_PR_128		PPC_REG_VAL(21, 0x3) +#endif + +#endif /* _PPC4xx_EBC_H_ */ diff --git a/include/asm-ppc/ppc4xx-intvec.h b/include/asm-ppc/ppc4xx-intvec.h deleted file mode 100644 index 5b45de433..000000000 --- a/include/asm-ppc/ppc4xx-intvec.h +++ /dev/null @@ -1,474 +0,0 @@ -/* -*  Copyright (C) 2002 Scott McNutt <smcnutt@artesyncp.com> -* -* 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 -*/ - -/* - * Interrupt vector number definitions to ease the - * 405 -- 440 porting pain ;-) - * - * NOTE: They're not all here yet ... update as needed. - * - */ - -#ifndef _VECNUMS_H_ -#define _VECNUMS_H_ - -#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX) - -/* UIC 0 */ -#define VECNUM_U0                   0  /* UART 0                        */ -#define VECNUM_U1                   1  /* UART 1                        */ -#define VECNUM_IIC0                 2  /* IIC                           */ -#define VECNUM_KRD                  3  /* Kasumi Ready for data         */ -#define VECNUM_KDA                  4  /* Kasumi Data Available         */ -#define VECNUM_PCRW                 5  /* PCI command register write    */ -#define VECNUM_PPM                  6  /* PCI power management          */ -#define VECNUM_IIC1                 7  /* IIC                           */ -#define VECNUM_SPI                  8  /* SPI                           */ -#define VECNUM_EPCISER              9  /* External PCI SERR             */ -#define VECNUM_MTE                 10  /* MAL TXEOB                     */ -#define VECNUM_MRE                 11  /* MAL RXEOB                     */ -#define VECNUM_D0                  12  /* DMA channel 0                 */ -#define VECNUM_D1                  13  /* DMA channel 1                 */ -#define VECNUM_D2                  14  /* DMA channel 2                 */ -#define VECNUM_D3                  15  /* DMA channel 3                 */ -#define VECNUM_UD0                 16  /* UDMA irq 0                    */ -#define VECNUM_UD1                 17  /* UDMA irq 1                    */ -#define VECNUM_UD2                 18  /* UDMA irq 2                    */ -#define VECNUM_UD3                 19  /* UDMA irq 3                    */ -#define VECNUM_HSB2D               20  /* USB2.0 Device                 */ -#define VECNUM_USBDEV		   20  /* USB 1.1/USB 2.0 Device        */ -#define VECNUM_OHCI1               21  /* USB2.0 Host OHCI irq 1        */ -#define VECNUM_OHCI2               22  /* USB2.0 Host OHCI irq 2        */ -#define VECNUM_EIP94               23  /* Security EIP94                */ -#define VECNUM_ETH0                24  /* Emac 0                        */ -#define VECNUM_ETH1                25  /* Emac 1                        */ -#define VECNUM_EHCI                26  /* USB2.0 Host EHCI              */ -#define VECNUM_EIR4                27  /* External interrupt 4          */ -#define VECNUM_UIC2NC              28  /* UIC2 non-critical interrupt   */ -#define VECNUM_UIC2C               29  /* UIC2 critical interrupt       */ -#define VECNUM_UIC1NC              30  /* UIC1 non-critical interrupt   */ -#define VECNUM_UIC1C               31  /* UIC1 critical interrupt       */ - -/* UIC 1 */ -#define VECNUM_MS           (32 +  0)  /* MAL SERR                      */ -#define VECNUM_MTDE         (32 +  1)  /* MAL TXDE                      */ -#define VECNUM_MRDE         (32 +  2)  /* MAL RXDE                      */ -#define VECNUM_U2           (32 +  3)  /* UART 2                        */ -#define VECNUM_U3           (32 +  4)  /* UART 3                        */ -#define VECNUM_EBCO         (32 +  5)  /* EBCO interrupt status         */ -#define VECNUM_NDFC         (32 +  6)  /* NDFC                          */ -#define VECNUM_KSLE         (32 +  7)  /* KASUMI slave error            */ -#define VECNUM_CT5          (32 +  8)  /* GPT compare timer 5           */ -#define VECNUM_CT6          (32 +  9)  /* GPT compare timer 6           */ -#define VECNUM_PLB34I0      (32 + 10)  /* PLB3X4X MIRQ0                 */ -#define VECNUM_PLB34I1      (32 + 11)  /* PLB3X4X MIRQ1                 */ -#define VECNUM_PLB34I2      (32 + 12)  /* PLB3X4X MIRQ2                 */ -#define VECNUM_PLB34I3      (32 + 13)  /* PLB3X4X MIRQ3                 */ -#define VECNUM_PLB34I4      (32 + 14)  /* PLB3X4X MIRQ4                 */ -#define VECNUM_PLB34I5      (32 + 15)  /* PLB3X4X MIRQ5                 */ -#define VECNUM_CT0          (32 + 16)  /* GPT compare timer 0           */ -#define VECNUM_CT1          (32 + 17)  /* GPT compare timer 1           */ -#define VECNUM_EIR7         (32 + 18)  /* External interrupt 7          */ -#define VECNUM_EIR8         (32 + 19)  /* External interrupt 8          */ -#define VECNUM_EIR9         (32 + 20)  /* External interrupt 9          */ -#define VECNUM_CT2          (32 + 21)  /* GPT compare timer 2           */ -#define VECNUM_CT3          (32 + 22)  /* GPT compare timer 3           */ -#define VECNUM_CT4          (32 + 23)  /* GPT compare timer 4           */ -#define VECNUM_SRE          (32 + 24)  /* Serial ROM error              */ -#define VECNUM_GPTDC        (32 + 25)  /* GPT decrementer pulse         */ -#define VECNUM_RSVD0        (32 + 26)  /* Reserved                      */ -#define VECNUM_EPCIPER      (32 + 27)  /* External PCI PERR             */ -#define VECNUM_EIR0         (32 + 28)  /* External interrupt 0          */ -#define VECNUM_EWU0         (32 + 29)  /* Ethernet 0 wakeup             */ -#define VECNUM_EIR1         (32 + 30)  /* External interrupt 1          */ -#define VECNUM_EWU1         (32 + 31)  /* Ethernet 1 wakeup             */ - -#define VECNUM_TXDE         VECNUM_MTDE -#define VECNUM_RXDE         VECNUM_MRDE - -/* UIC 2 */ -#define VECNUM_EIR5         (64 +  0)  /* External interrupt 5          */ -#define VECNUM_EIR6         (64 +  1)  /* External interrupt 6          */ -#define VECNUM_OPB          (64 +  2)  /* OPB to PLB bridge int stat    */ -#define VECNUM_EIR2         (64 +  3)  /* External interrupt 2          */ -#define VECNUM_EIR3         (64 +  4)  /* External interrupt 3          */ -#define VECNUM_DDR2         (64 +  5)  /* DDR2 sdram                    */ -#define VECNUM_MCTX0        (64 +  6)  /* MAl intp coalescence TX0      */ -#define VECNUM_MCTX1        (64 +  7)  /* MAl intp coalescence TX1      */ -#define VECNUM_MCTR0        (64 +  8)  /* MAl intp coalescence TR0      */ -#define VECNUM_MCTR1        (64 +  9)  /* MAl intp coalescence TR1      */ - -#elif defined(CONFIG_460EX) || defined(CONFIG_460GT) - -/* UIC 0 */ -#define VECNUM_U1	1		/* UART1			*/ -#define VECNUM_IIC0	2		/* IIC0				*/ -#define VECNUM_IIC1	3		/* IIC1				*/ -#define VECNUM_PIM	4		/* PCI inbound message		*/ -#define VECNUM_PCRW	5		/* PCI command reg write	*/ -#define VECNUM_PPM	6		/* PCI power management		*/ -#define VECNUM_MSI0	8		/* PCI MSI level 0		*/ -#define VECNUM_EIR0	9		/* External interrupt 0		*/ -#define VECNUM_UIC2NC	10		/* UIC2 non-critical interrupt	*/ -#define VECNUM_UIC2C	11		/* UIC2 critical interrupt	*/ -#define VECNUM_D0	12		/* DMA channel 0		*/ -#define VECNUM_D1	13		/* DMA channel 1		*/ -#define VECNUM_D2	14		/* DMA channel 2		*/ -#define VECNUM_D3	15		/* DMA channel 3		*/ -#define VECNUM_UIC3NC	16		/* UIC3 non-critical interrupt	*/ -#define VECNUM_UIC3C	17		/* UIC3 critical interrupt	*/ -#define VECNUM_EIR1	9		/* External interrupt 1		*/ -#define VECNUM_UIC1NC	30		/* UIC1 non-critical interrupt	*/ -#define VECNUM_UIC1C	31		/* UIC1 critical interrupt	*/ - -/* UIC 1 */ -#define VECNUM_EIR2	(32 + 0)	/* External interrupt 0		*/ -#define VECNUM_U0	(32 + 1)	/* UART0			*/ -#define VECNUM_EIR3	(32 + 20)	/* External interrupt 3		*/ -#define VECNUM_EIR4	(32 + 21)	/* External interrupt 4		*/ -#define VECNUM_EIR5	(32 + 26)	/* External interrupt 5		*/ -#define VECNUM_EIR6	(32 + 27)	/* External interrupt 6		*/ -#define VECNUM_U2	(32 + 28)	/* UART2			*/ -#define VECNUM_U3	(32 + 29)	/* UART3			*/ -#define VECNUM_EIR7	(32 + 30)	/* External interrupt 7		*/ -#define VECNUM_EIR8	(32 + 31)	/* External interrupt 8		*/ - -/* UIC 2 */ -#define VECNUM_EIR9	(64 + 2)	/* External interrupt 9		*/ -#define VECNUM_MS	(64 + 3)	/* MAL SERR			*/ -#define	VECNUM_TXDE	(64 + 4)	/* MAL TXDE			*/ -#define	VECNUM_RXDE	(64 + 5)	/* MAL RXDE			*/ -#define VECNUM_MTE	(64 + 6)	/* MAL TXEOB			*/ -#define	VECNUM_MRE	(64 + 7)	/* MAL RXEOB			*/ -#define	VECNUM_ETH0	(64 + 16)	/* Ethernet 0			*/ -#define	VECNUM_ETH1	(64 + 17)	/* Ethernet 1			*/ -#define	VECNUM_ETH2	(64 + 18)	/* Ethernet 2			*/ -#define	VECNUM_ETH3	(64 + 19)	/* Ethernet 3			*/ -#define VECNUM_EWU0	(64 + 20)	/* Emac 0 wakeup		*/ -#define VECNUM_EWU1	(64 + 21)	/* Emac 1 wakeup		*/ -#define VECNUM_EWU2	(64 + 22)	/* Emac 2 wakeup		*/ -#define VECNUM_EWU3	(64 + 23)	/* Emac 3 wakeup		*/ -#define VECNUM_EIR10	(64 + 24)	/* External interrupt 10	*/ -#define VECNUM_EIR11	(64 + 25)	/* External interrupt 11	*/ - -/* UIC 3 */ -#define VECNUM_EIR12	(96 + 20)	/* External interrupt 20	*/ -#define VECNUM_EIR13	(96 + 21)	/* External interrupt 21	*/ -#define VECNUM_EIR14	(96 + 22)	/* External interrupt 22	*/ -#define VECNUM_EIR15	(96 + 23)	/* External interrupt 23	*/ -#define VECNUM_PCIEMSI0	(96 + 24)	/* PCI Express MSI level 0	*/ -#define VECNUM_PCIEMSI1	(96 + 25)	/* PCI Express MSI level 1	*/ -#define VECNUM_PCIEMSI2	(96 + 26)	/* PCI Express MSI level 2	*/ -#define VECNUM_PCIEMSI3	(96 + 27)	/* PCI Express MSI level 3	*/ -#define VECNUM_PCIEMSI4	(96 + 28)	/* PCI Express MSI level 4	*/ -#define VECNUM_PCIEMSI5	(96 + 29)	/* PCI Express MSI level 5	*/ -#define VECNUM_PCIEMSI6	(96 + 30)	/* PCI Express MSI level 6	*/ -#define VECNUM_PCIEMSI7	(96 + 31)	/* PCI Express MSI level 7	*/ - -#elif defined(CONFIG_440SPE) - -/* UIC 0 */ -#define VECNUM_U0           0           /* UART0                        */ -#define VECNUM_U1           1           /* UART1                        */ -#define VECNUM_IIC0         2           /* IIC0                         */ -#define VECNUM_IIC1         3           /* IIC1                         */ -#define VECNUM_PIM          4           /* PCI inbound message          */ -#define VECNUM_PCRW         5           /* PCI command reg write        */ -#define VECNUM_PPM          6           /* PCI power management         */ -#define VECNUM_MSI0         7           /* PCI MSI level 0              */ -#define VECNUM_MSI1         8           /* PCI MSI level 0              */ -#define VECNUM_MSI2         9           /* PCI MSI level 0              */ -#define VECNUM_UIC2NC       10          /* UIC2 non-critical interrupt  */ -#define VECNUM_UIC2C        11          /* UIC2 critical interrupt      */ -#define VECNUM_D0           12          /* DMA channel 0                */ -#define VECNUM_D1           13          /* DMA channel 1                */ -#define VECNUM_D2           14          /* DMA channel 2                */ -#define VECNUM_D3           15          /* DMA channel 3                */ -#define VECNUM_UIC3NC       16          /* UIC3 non-critical interrupt  */ -#define VECNUM_UIC3C        17          /* UIC3 critical interrupt      */ -#define VECNUM_UIC1NC       30          /* UIC1 non-critical interrupt  */ -#define VECNUM_UIC1C        31          /* UIC1 critical interrupt      */ - -/* UIC 1 */ -#define VECNUM_MS           (32 + 1 )   /* MAL SERR                     */ -#define VECNUM_TXDE         (32 + 2 )   /* MAL TXDE                     */ -#define VECNUM_RXDE         (32 + 3 )   /* MAL RXDE                     */ -#define VECNUM_MTE          (32 + 6 )   /* MAL Tx EOB                   */ -#define VECNUM_MRE          (32 + 7 )   /* MAL Rx EOB                   */ -#define VECNUM_CT0          (32 + 12 )  /* GPT compare timer 0          */ -#define VECNUM_CT1          (32 + 13 )  /* GPT compare timer 1          */ -#define VECNUM_CT2          (32 + 14 )  /* GPT compare timer 2          */ -#define VECNUM_CT3          (32 + 15 )  /* GPT compare timer 3          */ -#define VECNUM_CT4          (32 + 16 )  /* GPT compare timer 4          */ -#define VECNUM_ETH0         (32 + 28)   /* Ethernet interrupt status    */ -#define VECNUM_EWU0         (32 + 29)   /* Emac  wakeup                 */ - -/* UIC 2 */ -#define VECNUM_EIR5         (64 + 24)   /* External interrupt 5         */ -#define VECNUM_EIR4         (64 + 25)   /* External interrupt 4         */ -#define VECNUM_EIR3         (64 + 26)   /* External interrupt 3         */ -#define VECNUM_EIR2         (64 + 27)   /* External interrupt 2         */ -#define VECNUM_EIR1         (64 + 28)   /* External interrupt 1         */ -#define VECNUM_EIR0         (64 + 29)   /* External interrupt 0         */ - -#elif defined(CONFIG_440SP) - -/* UIC 0 */ -#define VECNUM_U0           0           /* UART0                        */ -#define VECNUM_U1           1           /* UART1                        */ -#define VECNUM_IIC0         2           /* IIC0                         */ -#define VECNUM_IIC1         3           /* IIC1                         */ -#define VECNUM_PIM          4           /* PCI inbound message          */ -#define VECNUM_PCRW         5           /* PCI command reg write        */ -#define VECNUM_PPM          6           /* PCI power management         */ -#define VECNUM_UIC1NC       30          /* UIC1 non-critical interrupt  */ -#define VECNUM_UIC1C        31          /* UIC1 critical interrupt      */ - -/* UIC 1 */ -#define VECNUM_EIR0         (32 + 0)	/* External interrupt 0         */ -#define VECNUM_MS           (32 + 1)	/* MAL SERR                     */ -#define VECNUM_TXDE         (32 + 2)	/* MAL TXDE                     */ -#define VECNUM_RXDE         (32 + 3)	/* MAL RXDE                     */ -#define VECNUM_MTE          (32 + 6)	/* MAL Tx EOB                   */ -#define VECNUM_MRE          (32 + 7)	/* MAL Rx EOB                   */ -#define VECNUM_CT0          (32 + 12)	/* GPT compare timer 0          */ -#define VECNUM_CT1          (32 + 13)	/* GPT compare timer 1          */ -#define VECNUM_CT2          (32 + 14)	/* GPT compare timer 2          */ -#define VECNUM_CT3          (32 + 15)	/* GPT compare timer 3          */ -#define VECNUM_CT4          (32 + 16)	/* GPT compare timer 4          */ -#define VECNUM_ETH0         (32 + 28)	/* Ethernet interrupt status    */ -#define VECNUM_EWU0         (32 + 29)	/* Emac  wakeup                 */ - -#elif defined(CONFIG_440) - -/* UIC 0 */ -#define VECNUM_U0           0           /* UART0                        */ -#define VECNUM_U1           1           /* UART1                        */ -#define VECNUM_IIC0         2           /* IIC0                         */ -#define VECNUM_IIC1         3           /* IIC1                         */ -#define VECNUM_PIM          4           /* PCI inbound message          */ -#define VECNUM_PCRW         5           /* PCI command reg write        */ -#define VECNUM_PPM          6           /* PCI power management         */ -#define VECNUM_MSI0         7           /* PCI MSI level 0              */ -#define VECNUM_MSI1         8           /* PCI MSI level 0              */ -#define VECNUM_MSI2         9           /* PCI MSI level 0              */ -#define VECNUM_MTE          10          /* MAL TXEOB                    */ -#define VECNUM_MRE          11          /* MAL RXEOB                    */ -#define VECNUM_D0           12          /* DMA channel 0                */ -#define VECNUM_D1           13          /* DMA channel 1                */ -#define VECNUM_D2           14          /* DMA channel 2                */ -#define VECNUM_D3           15          /* DMA channel 3                */ -#define VECNUM_CT0          18          /* GPT compare timer 0          */ -#define VECNUM_CT1          19          /* GPT compare timer 1          */ -#define VECNUM_CT2          20          /* GPT compare timer 2          */ -#define VECNUM_CT3          21          /* GPT compare timer 3          */ -#define VECNUM_CT4          22          /* GPT compare timer 4          */ -#define VECNUM_EIR0         23          /* External interrupt 0         */ -#define VECNUM_EIR1         24          /* External interrupt 1         */ -#define VECNUM_EIR2         25          /* External interrupt 2         */ -#define VECNUM_EIR3         26          /* External interrupt 3         */ -#define VECNUM_EIR4         27          /* External interrupt 4         */ -#define VECNUM_EIR5         28          /* External interrupt 5         */ -#define VECNUM_EIR6         29          /* External interrupt 6         */ -#define VECNUM_UIC1NC       30          /* UIC1 non-critical interrupt  */ -#define VECNUM_UIC1C        31          /* UIC1 critical interrupt      */ - -/* UIC 1 */ -#define VECNUM_MS           (32 + 0 )   /* MAL SERR                     */ -#define VECNUM_TXDE         (32 + 1 )   /* MAL TXDE                     */ -#define VECNUM_RXDE         (32 + 2 )   /* MAL RXDE                     */ -#define VECNUM_USBDEV	    (32 + 23)   /* USB 1.1/USB 2.0 Device       */ -#define VECNUM_ETH0         (32 + 28)   /* Ethernet 0 interrupt status  */ -#define VECNUM_EWU0         (32 + 29)   /* Ethernet 0 wakeup            */ - -#else /* !defined(CONFIG_440) */ - -#if defined(CONFIG_405EZ) -#define VECNUM_D0		0	/* DMA channel 0		*/ -#define VECNUM_D1		1	/* DMA channel 1		*/ -#define VECNUM_D2		2	/* DMA channel 2		*/ -#define VECNUM_D3		3	/* DMA channel 3		*/ -#define VECNUM_1588		4	/* IEEE 1588 network synchronization */ -#define VECNUM_U0		5	/* UART0			*/ -#define VECNUM_U1		6	/* UART1			*/ -#define VECNUM_CAN0		7	/* CAN 0			*/ -#define VECNUM_CAN1		8	/* CAN 1			*/ -#define VECNUM_SPI		9	/* SPI				*/ -#define VECNUM_IIC0		10	/* I2C				*/ -#define VECNUM_CHT0		11	/* Chameleon timer high pri interrupt */ -#define VECNUM_CHT1		12	/* Chameleon timer high pri interrupt */ -#define VECNUM_USBH1		13	/* USB Host 1			*/ -#define VECNUM_USBH2		14	/* USB Host 2			*/ -#define VECNUM_USBDEV		15	/* USB Device			*/ -#define VECNUM_ETH0		16	/* 10/100 Ethernet interrupt status */ -#define VECNUM_EWU0		17	/* Ethernet wakeup sequence detected */ - -#define VECNUM_MADMAL		18	/* Logical OR of following MadMAL int */ -#define VECNUM_MS		18	/*	MAL_SERR_INT		*/ -#define VECNUM_TXDE		18	/*	MAL_TXDE_INT		*/ -#define VECNUM_RXDE		18	/*	MAL_RXDE_INT		*/ - -#define VECNUM_MTE		19	/* MAL TXEOB			*/ -#define VECNUM_MTE1		20	/* MAL TXEOB1			*/ -#define VECNUM_MRE		21	/* MAL RXEOB			*/ -#define VECNUM_NAND		22	/* NAND Flash controller	*/ -#define VECNUM_ADC		23	/* ADC				*/ -#define VECNUM_DAC		24	/* DAC				*/ -#define VECNUM_OPB2PLB		25	/* OPB to PLB bridge interrupt	*/ -#define VECNUM_RESERVED0	26	/* Reserved			*/ -#define VECNUM_EIR0		27	/* External interrupt 0		*/ -#define VECNUM_EIR1		28	/* External interrupt 1		*/ -#define VECNUM_EIR2		29	/* External interrupt 2		*/ -#define VECNUM_EIR3		30	/* External interrupt 3		*/ -#define VECNUM_EIR4		31	/* External interrupt 4		*/ - -#elif defined(CONFIG_405EX) - -/* UIC 0 */ -#define VECNUM_U0		00 -#define VECNUM_U1		01 -#define VECNUM_IIC0		02 -#define VECNUM_PKA		03 -#define VECNUM_TRNG		04 -#define VECNUM_EBM		05 -#define VECNUM_BGI		06 -#define VECNUM_IIC1		07 -#define VECNUM_SPI		08 -#define VECNUM_EIR0		09 -#define VECNUM_MTE		10	/* MAL Tx EOB */ -#define VECNUM_MRE		11	/* MAL Rx EOB */ -#define VECNUM_DMA0		12 -#define VECNUM_DMA1		13 -#define VECNUM_DMA2		14 -#define VECNUM_DMA3		15 -#define VECNUM_PCIE0AL		16 -#define VECNUM_PCIE0VPD		17 -#define VECNUM_RPCIE0HRST	18 -#define VECNUM_FPCIE0HRST	19 -#define VECNUM_PCIE0TCR		20 -#define VECNUM_PCIEMSI0		21 -#define VECNUM_PCIEMSI1		22 -#define VECNUM_SECURITY		23 -#define VECNUM_ETH0		24 -#define VECNUM_ETH1		25 -#define VECNUM_PCIEMSI2		26 -#define VECNUM_EIR4		27 -#define VECNUM_UIC2NC		28 -#define VECNUM_UIC2C		29 -#define VECNUM_UIC1NC		30 -#define VECNUM_UIC1C		31 - -/* UIC 1 */ -#define VECNUM_MS		(32 + 00)	/* MAL SERR */ -#define VECNUM_TXDE		(32 + 01)	/* MAL TXDE */ -#define VECNUM_RXDE		(32 + 02)	/* MAL RXDE */ -#define VECNUM_PCIE0BMVC0	(32 + 03) -#define VECNUM_PCIE0DCRERR	(32 + 04) -#define VECNUM_EBC		(32 + 05) -#define VECNUM_NDFC		(32 + 06) -#define VECNUM_PCEI1DCRERR	(32 + 07) -#define VECNUM_CT8		(32 + 08) -#define VECNUM_CT9		(32 + 09) -#define VECNUM_PCIE1AL		(32 + 10) -#define VECNUM_PCIE1VPD		(32 + 11) -#define VECNUM_RPCE1HRST	(32 + 12) -#define VECNUM_FPCE1HRST	(32 + 13) -#define VECNUM_PCIE1TCR		(32 + 14) -#define VECNUM_PCIE1VC0		(32 + 15) -#define VECNUM_CT3		(32 + 16) -#define VECNUM_CT4		(32 + 17) -#define VECNUM_EIR7		(32 + 18) -#define VECNUM_EIR8		(32 + 19) -#define VECNUM_EIR9		(32 + 20) -#define VECNUM_CT5		(32 + 21) -#define VECNUM_CT6		(32 + 22) -#define VECNUM_CT7		(32 + 23) -#define VECNUM_SROM		(32 + 24)	/* SERIAL ROM */ -#define VECNUM_GPTDECPULS	(32 + 25)	/* GPT Decrement pulse */ -#define VECNUM_EIR2		(32 + 26) -#define VECNUM_EIR5		(32 + 27) -#define VECNUM_EIR6		(32 + 28) -#define VECNUM_EMAC0WAKE	(32 + 29) -#define VECNUM_EIR1		(32 + 30) -#define VECNUM_EMAC1WAKE	(32 + 31) - -/* UIC 2 */ -#define VECNUM_PCIE0INTA	(64 + 00)	/* PCIE0 INTA */ -#define VECNUM_PCIE0INTB	(64 + 01)	/* PCIE0 INTB */ -#define VECNUM_PCIE0INTC	(64 + 02)	/* PCIE0 INTC */ -#define VECNUM_PCIE0INTD	(64 + 03)	/* PCIE0 INTD */ -#define VECNUM_EIR3		(64 + 04)	/* External IRQ 3 */ -#define VECNUM_DDRMCUE		(64 + 05) -#define VECNUM_DDRMCCE		(64 + 06) -#define VECNUM_MALINTCOATX0	(64 + 07)	/* Interrupt coalecence TX0 */ -#define VECNUM_MALINTCOATX1	(64 + 08)	/* Interrupt coalecence TX1 */ -#define VECNUM_MALINTCOARX0	(64 + 09)	/* Interrupt coalecence RX0 */ -#define VECNUM_MALINTCOARX1	(64 + 10)	/* Interrupt coalecence RX1 */ -#define VECNUM_PCIE1INTA	(64 + 11)	/* PCIE0 INTA */ -#define VECNUM_PCIE1INTB	(64 + 12)	/* PCIE0 INTB */ -#define VECNUM_PCIE1INTC	(64 + 13)	/* PCIE0 INTC */ -#define VECNUM_PCIE1INTD	(64 + 14)	/* PCIE0 INTD */ -#define VECNUM_RPCIEMSI2	(64 + 15)	/* MSI level 2 */ -#define VECNUM_PCIEMSI3		(64 + 16)	/* MSI level 2 */ -#define VECNUM_PCIEMSI4		(64 + 17)	/* MSI level 2 */ -#define VECNUM_PCIEMSI5		(64 + 18)	/* MSI level 2 */ -#define VECNUM_PCIEMSI6		(64 + 19)	/* MSI level 2 */ -#define VECNUM_PCIEMSI7		(64 + 20)	/* MSI level 2 */ -#define VECNUM_PCIEMSI8		(64 + 21)	/* MSI level 2 */ -#define VECNUM_PCIEMSI9		(64 + 22)	/* MSI level 2 */ -#define VECNUM_PCIEMSI10	(64 + 23)	/* MSI level 2 */ -#define VECNUM_PCIEMSI11	(64 + 24)	/* MSI level 2 */ -#define VECNUM_PCIEMSI12	(64 + 25)	/* MSI level 2 */ -#define VECNUM_PCIEMSI13	(64 + 26)	/* MSI level 2 */ -#define VECNUM_PCIEMSI14	(64 + 27)	/* MSI level 2 */ -#define VECNUM_PCIEMSI15	(64 + 28)	/* MSI level 2 */ -#define VECNUM_PLB4XAHB		(64 + 29)	/* PLBxAHB bridge */ -#define VECNUM_USBWAKE		(64 + 30)	/* USB wakup */ -#define VECNUM_USBOTG		(64 + 31)	/* USB OTG */ - -#else	/* !CONFIG_405EZ */ - -#define VECNUM_U0           0           /* UART0                        */ -#define VECNUM_U1           1           /* UART1                        */ -#define VECNUM_D0           5           /* DMA channel 0                */ -#define VECNUM_D1           6           /* DMA channel 1                */ -#define VECNUM_D2           7           /* DMA channel 2                */ -#define VECNUM_D3           8           /* DMA channel 3                */ -#define VECNUM_EWU0         9           /* Ethernet wakeup              */ -#define VECNUM_MS           10          /* MAL SERR                     */ -#define VECNUM_MTE          11          /* MAL TXEOB                    */ -#define VECNUM_MRE          12          /* MAL RXEOB                    */ -#define VECNUM_TXDE         13          /* MAL TXDE                     */ -#define VECNUM_RXDE         14          /* MAL RXDE                     */ -#define VECNUM_ETH0         15          /* Ethernet interrupt status    */ -#define VECNUM_EIR0         25          /* External interrupt 0         */ -#define VECNUM_EIR1         26          /* External interrupt 1         */ -#define VECNUM_EIR2         27          /* External interrupt 2         */ -#define VECNUM_EIR3         28          /* External interrupt 3         */ -#define VECNUM_EIR4         29          /* External interrupt 4         */ -#define VECNUM_EIR5         30          /* External interrupt 5         */ -#define VECNUM_EIR6         31          /* External interrupt 6         */ -#endif	/* defined(CONFIG_405EZ) */ - -#endif /* defined(CONFIG_440) */ - -#endif /* _VECNUMS_H_ */ diff --git a/include/asm-ppc/ppc4xx-sdram.h b/include/asm-ppc/ppc4xx-sdram.h index e151f0c11..df787b3d4 100644 --- a/include/asm-ppc/ppc4xx-sdram.h +++ b/include/asm-ppc/ppc4xx-sdram.h @@ -282,7 +282,8 @@   * Memory Bank 0-7 configuration   */  #if defined(CONFIG_440SPE) || \ -    defined(CONFIG_460EX) || defined(CONFIG_460GT) +    defined(CONFIG_460EX) || defined(CONFIG_460GT) || \ +    defined(CONFIG_460SX)  #define SDRAM_RXBAS_SDBA_MASK		0xFFE00000	/* Base address	*/  #define SDRAM_RXBAS_SDBA_ENCODE(n)	((u32)(((phys_size_t)(n) >> 2) & 0xFFE00000))  #define SDRAM_RXBAS_SDBA_DECODE(n)	((((phys_size_t)(n)) & 0xFFE00000) << 2) @@ -353,7 +354,19 @@  /*   * Memory controller registers   */ +#define SDRAM_BESR	0x00	/* PLB bus error status (read/clear)         */ +#define SDRAM_BESRT	0x01	/* PLB bus error status (test/set)           */ +#define SDRAM_BEARL	0x02	/* PLB bus error address low                 */ +#define SDRAM_BEARH	0x03	/* PLB bus error address high                */ +#define SDRAM_WMIRQ	0x06	/* PLB write master interrupt (read/clear)   */ +#define SDRAM_WMIRQT	0x07	/* PLB write master interrupt (test/set)     */ +#define SDRAM_PLBOPT	0x08	/* PLB slave options                         */ +#define SDRAM_PUABA	0x09	/* PLB upper address base                    */ +#ifndef CONFIG_405EX  #define SDRAM_MCSTAT	0x14	/* memory controller status                  */ +#else +#define SDRAM_MCSTAT	0x1F	/* memory controller status                  */ +#endif  #define SDRAM_MCOPT1	0x20	/* memory controller options 1               */  #define SDRAM_MCOPT2	0x21	/* memory controller options 2               */  #define SDRAM_MODT0	0x22	/* on die termination for bank 0             */ @@ -398,9 +411,35 @@  #define SDRAM_MMODE	0x88	/* memory mode                               */  #define SDRAM_MEMODE	0x89	/* memory extended mode                      */  #define SDRAM_ECCCR	0x98	/* ECC error status                          */ +#define SDRAM_ECCES	SDRAM_ECCCR  #define SDRAM_CID	0xA4	/* core ID                                   */ +#ifndef CONFIG_405EX  #define SDRAM_RID	0xA8	/* revision ID                               */ +#endif +#define SDRAM_FCSR	0xB0	/* feedback calibration status               */  #define SDRAM_RTSR	0xB1	/* run time status tracking                  */ +#ifdef CONFIG_405EX +#define SDRAM_RID	0xF8	/* revision ID                               */ +#endif + +/* + * Memory Controller Bus Error Status + */ +#define SDRAM_BESR_MASK			PPC_REG_VAL(7, 0xFF) +#define SDRAM_BESR_M0ID_MASK		PPC_REG_VAL(3, 0xF) +#define SDRAM_BESR_M0ID_ICU		PPC_REG_VAL(3, 0x0) +#define SDRAM_BESR_M0ID_PCIE0		PPC_REG_VAL(3, 0x1) +#define SDRAM_BESR_M0ID_PCIE1		PPC_REG_VAL(3, 0x2) +#define SDRAM_BESR_M0ID_DMA		PPC_REG_VAL(3, 0x3) +#define SDRAM_BESR_M0ID_DCU		PPC_REG_VAL(3, 0x4) +#define SDRAM_BESR_M0ID_OPB		PPC_REG_VAL(3, 0x5) +#define SDRAM_BESR_M0ID_MAL		PPC_REG_VAL(3, 0x6) +#define SDRAM_BESR_M0ID_SEC		PPC_REG_VAL(3, 0x7) +#define SDRAM_BESR_M0ET_MASK		PPC_REG_VAL(6, 0x7) +#define SDRAM_BESR_M0ET_NONE		PPC_REG_VAL(6, 0x0) +#define SDRAM_BESR_M0ET_ECC		PPC_REG_VAL(6, 0x1) +#define SDRAM_BESR_M0RW_WRITE		PPC_REG_VAL(7, 0) +#define SDRAM_BESR_M0RW_READ		PPC_REG_VAL(8, 1)  /*   * Memory Controller Status @@ -523,7 +562,7 @@   * SDRAM Delay Line Calibration Register   */  #define SDRAM_DLCR_DCLM_MASK		0x80000000 -#define SDRAM_DLCR_DCLM_MANUEL		0x80000000 +#define SDRAM_DLCR_DCLM_MANUAL		0x80000000  #define SDRAM_DLCR_DCLM_AUTO		0x00000000  #define SDRAM_DLCR_DLCR_MASK		0x08000000  #define SDRAM_DLCR_DLCR_CALIBRATE	0x08000000 @@ -539,59 +578,234 @@  #define SDRAM_DLCR_DLCV_DECODE(n)	((((u32)(n))>>0)&0x1FF)  /* + * SDRAM Memory On Die Terimination Control Register + */ +#define SDRAM_MODT_ODTON_DISABLE		PPC_REG_VAL(0, 0) +#define SDRAM_MODT_ODTON_ENABLE			PPC_REG_VAL(0, 1) +#define SDRAM_MODT_EB1W_DISABLE			PPC_REG_VAL(1, 0) +#define SDRAM_MODT_EB1W_ENABLE			PPC_REG_VAL(1, 1) +#define SDRAM_MODT_EB1R_DISABLE			PPC_REG_VAL(2, 0) +#define SDRAM_MODT_EB1R_ENABLE			PPC_REG_VAL(2, 1) +#define SDRAM_MODT_EB0W_DISABLE			PPC_REG_VAL(7, 0) +#define SDRAM_MODT_EB0W_ENABLE			PPC_REG_VAL(7, 1) +#define SDRAM_MODT_EB0R_DISABLE			PPC_REG_VAL(8, 0) +#define SDRAM_MODT_EB0R_ENABLE			PPC_REG_VAL(8, 1) + +/*   * SDRAM Controller On Die Termination Register   */ -#define SDRAM_CODT_ODT_ON			0x80000000 -#define SDRAM_CODT_ODT_OFF			0x00000000 -#define SDRAM_CODT_DQS_VOLTAGE_DDR_MASK		0x00000020 -#define SDRAM_CODT_DQS_2_5_V_DDR1		0x00000000 -#define SDRAM_CODT_DQS_1_8_V_DDR2		0x00000020 -#define SDRAM_CODT_DQS_MASK			0x00000010 -#define SDRAM_CODT_DQS_DIFFERENTIAL		0x00000000 -#define SDRAM_CODT_DQS_SINGLE_END		0x00000010 -#define SDRAM_CODT_CKSE_DIFFERENTIAL		0x00000000 -#define SDRAM_CODT_CKSE_SINGLE_END		0x00000008 -#define SDRAM_CODT_FEEBBACK_RCV_SINGLE_END	0x00000004 -#define SDRAM_CODT_FEEBBACK_DRV_SINGLE_END	0x00000002 -#define SDRAM_CODT_IO_HIZ			0x00000000 -#define SDRAM_CODT_IO_NMODE			0x00000001 +#define SDRAM_CODT_ODT_ON			PPC_REG_VAL(0, 1) +#define SDRAM_CODT_ODT_OFF			PPC_REG_VAL(0, 0) +#define SDRAM_CODT_RK1W_ON			PPC_REG_VAL(1, 1) +#define SDRAM_CODT_RK1W_OFF			PPC_REG_VAL(1, 0) +#define SDRAM_CODT_RK1R_ON			PPC_REG_VAL(2, 1) +#define SDRAM_CODT_RK1R_OFF			PPC_REG_VAL(2, 0) +#define SDRAM_CODT_RK0W_ON			PPC_REG_VAL(7, 1) +#define SDRAM_CODT_RK0W_OFF			PPC_REG_VAL(7, 0) +#define SDRAM_CODT_RK0R_ON			PPC_REG_VAL(8, 1) +#define SDRAM_CODT_RK0R_OFF			PPC_REG_VAL(8, 0) +#define SDRAM_CODT_ODTSH_NORMAL			PPC_REG_VAL(10, 0) +#define SDRAM_CODT_ODTSH_REMOVE_ONE_AT_END	PPC_REG_VAL(10, 1) +#define SDRAM_CODT_ODTSH_ADD_ONE_AT_START	PPC_REG_VAL(10, 2) +#define SDRAM_CODT_ODTSH_SHIFT_ONE_EARLIER	PPC_REG_VAL(10, 3) +#define SDRAM_CODT_CODTZ_75OHM			PPC_REG_VAL(11, 0) +#define SDRAM_CODT_CKEG_ON			PPC_REG_VAL(12, 1) +#define SDRAM_CODT_CKEG_OFF			PPC_REG_VAL(12, 0) +#define SDRAM_CODT_CTLG_ON			PPC_REG_VAL(13, 1) +#define SDRAM_CODT_CTLG_OFF			PPC_REG_VAL(13, 0) +#define SDRAM_CODT_FBDG_ON			PPC_REG_VAL(14, 1) +#define SDRAM_CODT_FBDG_OFF			PPC_REG_VAL(14, 0) +#define SDRAM_CODT_FBRG_ON			PPC_REG_VAL(15, 1) +#define SDRAM_CODT_FBRG_OFF			PPC_REG_VAL(15, 0) +#define SDRAM_CODT_CKLZ_36OHM			PPC_REG_VAL(18, 1) +#define SDRAM_CODT_CKLZ_18OHM			PPC_REG_VAL(18, 0) +#define SDRAM_CODT_DQS_VOLTAGE_DDR_MASK		PPC_REG_VAL(26, 1) +#define SDRAM_CODT_DQS_2_5_V_DDR1		PPC_REG_VAL(26, 0) +#define SDRAM_CODT_DQS_1_8_V_DDR2		PPC_REG_VAL(26, 1) +#define SDRAM_CODT_DQS_MASK			PPC_REG_VAL(27, 1) +#define SDRAM_CODT_DQS_DIFFERENTIAL		PPC_REG_VAL(27, 0) +#define SDRAM_CODT_DQS_SINGLE_END		PPC_REG_VAL(27, 1) +#define SDRAM_CODT_CKSE_DIFFERENTIAL		PPC_REG_VAL(28, 0) +#define SDRAM_CODT_CKSE_SINGLE_END		PPC_REG_VAL(28, 1) +#define SDRAM_CODT_FEEBBACK_RCV_SINGLE_END	PPC_REG_VAL(29, 1) +#define SDRAM_CODT_FEEBBACK_DRV_SINGLE_END	PPC_REG_VAL(30, 1) +#define SDRAM_CODT_IO_HIZ			PPC_REG_VAL(31, 0) +#define SDRAM_CODT_IO_NMODE			PPC_REG_VAL(31, 1)  /* - * SDRAM Mode Register + * SDRAM Initialization Preload Register   */ -#define SDRAM_MMODE_WR_MASK		0x00000E00 -#define SDRAM_MMODE_WR_DDR1		0x00000000 -#define SDRAM_MMODE_WR_DDR2_3_CYC	0x00000400 -#define SDRAM_MMODE_WR_DDR2_4_CYC	0x00000600 -#define SDRAM_MMODE_WR_DDR2_5_CYC	0x00000800 -#define SDRAM_MMODE_WR_DDR2_6_CYC	0x00000A00 -#define SDRAM_MMODE_DCL_MASK		0x00000070 -#define SDRAM_MMODE_DCL_DDR1_2_0_CLK	0x00000020 -#define SDRAM_MMODE_DCL_DDR1_2_5_CLK	0x00000060 -#define SDRAM_MMODE_DCL_DDR1_3_0_CLK	0x00000030 -#define SDRAM_MMODE_DCL_DDR2_2_0_CLK	0x00000020 -#define SDRAM_MMODE_DCL_DDR2_3_0_CLK	0x00000030 -#define SDRAM_MMODE_DCL_DDR2_4_0_CLK	0x00000040 -#define SDRAM_MMODE_DCL_DDR2_5_0_CLK	0x00000050 -#define SDRAM_MMODE_DCL_DDR2_6_0_CLK	0x00000060 -#define SDRAM_MMODE_DCL_DDR2_7_0_CLK	0x00000070 +#define SDRAM_INITPLR_ENABLE			PPC_REG_VAL(0, 1) +#define SDRAM_INITPLR_DISABLE			PPC_REG_VAL(0, 0) +#define SDRAM_INITPLR_IMWT_MASK			PPC_REG_VAL(8, 0xFF) +#define SDRAM_INITPLR_IMWT_ENCODE(n)		PPC_REG_VAL(8, \ +							    (static_cast(u32, \ +									 n)) \ +							    & 0xFF) +#define SDRAM_INITPLR_ICMD_MASK			PPC_REG_VAL(12, 0x7) +#define SDRAM_INITPLR_ICMD_ENCODE(n)		PPC_REG_VAL(12, \ +							    (static_cast(u32, \ +									 n)) \ +							    & 0x7) +#define SDRAM_INITPLR_IBA_MASK			PPC_REG_VAL(15, 0x7) +#define SDRAM_INITPLR_IBA_ENCODE(n)		PPC_REG_VAL(15, \ +							    (static_cast(u32, \ +									 n)) \ +							    & 0x7) +#define SDRAM_INITPLR_IMA_MASK			PPC_REG_VAL(31, 0x7FFF) +#define SDRAM_INITPLR_IMA_ENCODE(n)		PPC_REG_VAL(31, \ +							    (static_cast(u32, \ +									 n)) \ +							    & 0x7FFF)  /* - * SDRAM Extended Mode Register + * JEDEC DDR Initialization Commands   */ -#define SDRAM_MEMODE_DIC_MASK		0x00000002 -#define SDRAM_MEMODE_DIC_NORMAL		0x00000000 -#define SDRAM_MEMODE_DIC_WEAK		0x00000002 -#define SDRAM_MEMODE_DLL_MASK		0x00000001 -#define SDRAM_MEMODE_DLL_DISABLE	0x00000001 -#define SDRAM_MEMODE_DLL_ENABLE		0x00000000 -#define SDRAM_MEMODE_RTT_MASK		0x00000044 -#define SDRAM_MEMODE_RTT_DISABLED	0x00000000 -#define SDRAM_MEMODE_RTT_75OHM		0x00000004 -#define SDRAM_MEMODE_RTT_150OHM		0x00000040 -#define SDRAM_MEMODE_DQS_MASK		0x00000400 -#define SDRAM_MEMODE_DQS_DISABLE	0x00000400 -#define SDRAM_MEMODE_DQS_ENABLE		0x00000000 +#define JEDEC_CMD_NOP				7 +#define JEDEC_CMD_PRECHARGE			2 +#define JEDEC_CMD_REFRESH			1 +#define JEDEC_CMD_EMR				0 +#define JEDEC_CMD_READ				5 +#define JEDEC_CMD_WRITE				4 + +/* + * JEDEC Precharge Command Memory Address Arguments + */ +#define JEDEC_MA_PRECHARGE_ONE			(0 << 10) +#define JEDEC_MA_PRECHARGE_ALL			(1 << 10) + +/* + * JEDEC DDR EMR Command Bank Address Arguments + */ +#define JEDEC_BA_MR				0 +#define JEDEC_BA_EMR				1 +#define JEDEC_BA_EMR2				2 +#define JEDEC_BA_EMR3				3 + +/* + * JEDEC DDR Mode Register + */ +#define JEDEC_MA_MR_PDMODE_FAST_EXIT		(0 << 12) +#define JEDEC_MA_MR_PDMODE_SLOW_EXIT		(1 << 12) +#define JEDEC_MA_MR_WR_MASK			(0x7 << 9) +#define JEDEC_MA_MR_WR_DDR1			(0x0 << 9) +#define JEDEC_MA_MR_WR_DDR2_2_CYC		(0x1 << 9) +#define JEDEC_MA_MR_WR_DDR2_3_CYC		(0x2 << 9) +#define JEDEC_MA_MR_WR_DDR2_4_CYC		(0x3 << 9) +#define JEDEC_MA_MR_WR_DDR2_5_CYC		(0x4 << 9) +#define JEDEC_MA_MR_WR_DDR2_6_CYC		(0x5 << 9) +#define JEDEC_MA_MR_DLL_RESET			(1 << 8) +#define JEDEC_MA_MR_MODE_NORMAL			(0 << 8) +#define JEDEC_MA_MR_MODE_TEST			(1 << 8) +#define JEDEC_MA_MR_CL_MASK			(0x7 << 4) +#define JEDEC_MA_MR_CL_DDR1_2_0_CLK		(0x2 << 4) +#define JEDEC_MA_MR_CL_DDR1_2_5_CLK		(0x6 << 4) +#define JEDEC_MA_MR_CL_DDR1_3_0_CLK		(0x3 << 4) +#define JEDEC_MA_MR_CL_DDR2_2_0_CLK		(0x2 << 4) +#define JEDEC_MA_MR_CL_DDR2_3_0_CLK		(0x3 << 4) +#define JEDEC_MA_MR_CL_DDR2_4_0_CLK		(0x4 << 4) +#define JEDEC_MA_MR_CL_DDR2_5_0_CLK		(0x5 << 4) +#define JEDEC_MA_MR_CL_DDR2_6_0_CLK		(0x6 << 4) +#define JEDEC_MA_MR_CL_DDR2_7_0_CLK		(0x7 << 4) +#define JEDEC_MA_MR_BTYP_SEQUENTIAL		(0 << 3) +#define JEDEC_MA_MR_BTYP_INTERLEAVED		(1 << 3) +#define JEDEC_MA_MR_BLEN_MASK			(0x7 << 0) +#define JEDEC_MA_MR_BLEN_4			(2 << 0) +#define JEDEC_MA_MR_BLEN_8			(3 << 0) + +/* + * JEDEC DDR Extended Mode Register + */ +#define JEDEC_MA_EMR_OUTPUT_MASK		(1 << 12) +#define JEDEC_MA_EMR_OUTPUT_ENABLE		(0 << 12) +#define JEDEC_MA_EMR_OUTPUT_DISABLE		(1 << 12) +#define JEDEC_MA_EMR_RQDS_MASK			(1 << 11) +#define JEDEC_MA_EMR_RDQS_DISABLE		(0 << 11) +#define JEDEC_MA_EMR_RDQS_ENABLE		(1 << 11) +#define JEDEC_MA_EMR_DQS_MASK			(1 << 10) +#define JEDEC_MA_EMR_DQS_DISABLE		(1 << 10) +#define JEDEC_MA_EMR_DQS_ENABLE			(0 << 10) +#define JEDEC_MA_EMR_OCD_MASK			(0x7 << 7) +#define JEDEC_MA_EMR_OCD_EXIT			(0 << 7) +#define JEDEC_MA_EMR_OCD_ENTER			(7 << 7) +#define JEDEC_MA_EMR_AL_DDR1_0_CYC		(0 << 3) +#define JEDEC_MA_EMR_AL_DDR2_1_CYC		(1 << 3) +#define JEDEC_MA_EMR_AL_DDR2_2_CYC		(2 << 3) +#define JEDEC_MA_EMR_AL_DDR2_3_CYC		(3 << 3) +#define JEDEC_MA_EMR_AL_DDR2_4_CYC		(4 << 3) +#define JEDEC_MA_EMR_RTT_MASK			(0x11 << 2) +#define JEDEC_MA_EMR_RTT_DISABLED		(0x00 << 2) +#define JEDEC_MA_EMR_RTT_75OHM			(0x01 << 2) +#define JEDEC_MA_EMR_RTT_150OHM			(0x10 << 2) +#define JEDEC_MA_EMR_RTT_50OHM			(0x11 << 2) +#define JEDEC_MA_EMR_ODS_MASK			(1 << 1) +#define JEDEC_MA_EMR_ODS_NORMAL			(0 << 1) +#define JEDEC_MA_EMR_ODS_WEAK			(1 << 1) +#define JEDEC_MA_EMR_DLL_MASK			(1 << 0) +#define JEDEC_MA_EMR_DLL_ENABLE			(0 << 0) +#define JEDEC_MA_EMR_DLL_DISABLE		(1 << 0) + +/* + * JEDEC DDR Extended Mode Register 2 + */ +#define JEDEC_MA_EMR2_TEMP_COMMERCIAL		(0 << 7) +#define JEDEC_MA_EMR2_TEMP_INDUSTRIAL		(1 << 7) + +/* + * SDRAM Mode Register (Corresponds 1:1 w/ JEDEC Mode Register) + */ +#define SDRAM_MMODE_WR_MASK			JEDEC_MA_MR_WR_MASK +#define SDRAM_MMODE_WR_DDR1			JEDEC_MA_MR_WR_DDR1 +#define SDRAM_MMODE_WR_DDR2_2_CYC		JEDEC_MA_MR_WR_DDR2_2_CYC +#define SDRAM_MMODE_WR_DDR2_3_CYC		JEDEC_MA_MR_WR_DDR2_3_CYC +#define SDRAM_MMODE_WR_DDR2_4_CYC		JEDEC_MA_MR_WR_DDR2_4_CYC +#define SDRAM_MMODE_WR_DDR2_5_CYC		JEDEC_MA_MR_WR_DDR2_5_CYC +#define SDRAM_MMODE_WR_DDR2_6_CYC		JEDEC_MA_MR_WR_DDR2_6_CYC +#define SDRAM_MMODE_DCL_MASK			JEDEC_MA_MR_CL_MASK +#define SDRAM_MMODE_DCL_DDR1_2_0_CLK		JEDEC_MA_MR_CL_DDR1_2_0_CLK +#define SDRAM_MMODE_DCL_DDR1_2_5_CLK		JEDEC_MA_MR_CL_DDR1_2_5_CLK +#define SDRAM_MMODE_DCL_DDR1_3_0_CLK		JEDEC_MA_MR_CL_DDR1_3_0_CLK +#define SDRAM_MMODE_DCL_DDR2_2_0_CLK		JEDEC_MA_MR_CL_DDR2_2_0_CLK +#define SDRAM_MMODE_DCL_DDR2_3_0_CLK		JEDEC_MA_MR_CL_DDR2_3_0_CLK +#define SDRAM_MMODE_DCL_DDR2_4_0_CLK		JEDEC_MA_MR_CL_DDR2_4_0_CLK +#define SDRAM_MMODE_DCL_DDR2_5_0_CLK		JEDEC_MA_MR_CL_DDR2_5_0_CLK +#define SDRAM_MMODE_DCL_DDR2_6_0_CLK		JEDEC_MA_MR_CL_DDR2_6_0_CLK +#define SDRAM_MMODE_DCL_DDR2_7_0_CLK		JEDEC_MA_MR_CL_DDR2_7_0_CLK +#define SDRAM_MMODE_BTYP_SEQUENTIAL		JEDEC_MA_MR_BTYP_SEQUENTIAL +#define SDRAM_MMODE_BTYP_INTERLEAVED		JEDEC_MA_MR_BTYP_INTERLEAVED +#define SDRAM_MMODE_BLEN_MASK			JEDEC_MA_MR_BLEN_MASK +#define SDRAM_MMODE_BLEN_4			JEDEC_MA_MR_BLEN_4 +#define SDRAM_MMODE_BLEN_8			JEDEC_MA_MR_BLEN_8 + +/* + * SDRAM Extended Mode Register (Corresponds 1:1 w/ JEDEC Extended + * Mode Register) + */ +#define SDRAM_MEMODE_QOFF_MASK			JEDEC_MA_EMR_OUTPUT_MASK +#define SDRAM_MEMODE_QOFF_DISABLE		JEDEC_MA_EMR_OUTPUT_DISABLE +#define SDRAM_MEMODE_QOFF_ENABLE		JEDEC_MA_EMR_OUTPUT_ENABLE +#define SDRAM_MEMODE_RDQS_MASK			JEDEC_MA_EMR_RQDS_MASK +#define SDRAM_MEMODE_RDQS_DISABLE		JEDEC_MA_EMR_RDQS_DISABLE +#define SDRAM_MEMODE_RDQS_ENABLE		JEDEC_MA_EMR_RDQS_ENABLE +#define SDRAM_MEMODE_DQS_MASK			JEDEC_MA_EMR_DQS_MASK +#define SDRAM_MEMODE_DQS_DISABLE		JEDEC_MA_EMR_DQS_DISABLE +#define SDRAM_MEMODE_DQS_ENABLE			JEDEC_MA_EMR_DQS_ENABLE +#define SDRAM_MEMODE_AL_DDR1_0_CYC		JEDEC_MA_EMR_AL_DDR1_0_CYC +#define SDRAM_MEMODE_AL_DDR2_1_CYC		JEDEC_MA_EMR_AL_DDR2_1_CYC +#define SDRAM_MEMODE_AL_DDR2_2_CYC		JEDEC_MA_EMR_AL_DDR2_2_CYC +#define SDRAM_MEMODE_AL_DDR2_3_CYC		JEDEC_MA_EMR_AL_DDR2_3_CYC +#define SDRAM_MEMODE_AL_DDR2_4_CYC		JEDEC_MA_EMR_AL_DDR2_4_CYC +#define SDRAM_MEMODE_RTT_MASK			JEDEC_MA_EMR_RTT_MASK +#define SDRAM_MEMODE_RTT_DISABLED		JEDEC_MA_EMR_RTT_DISABLED +#define SDRAM_MEMODE_RTT_75OHM			JEDEC_MA_EMR_RTT_75OHM +#define SDRAM_MEMODE_RTT_150OHM			JEDEC_MA_EMR_RTT_150OHM +#define SDRAM_MEMODE_RTT_50OHM			JEDEC_MA_EMR_RTT_50OHM +#define SDRAM_MEMODE_DIC_MASK			JEDEC_MA_EMR_ODS_MASK +#define SDRAM_MEMODE_DIC_NORMAL			JEDEC_MA_EMR_ODS_NORMAL +#define SDRAM_MEMODE_DIC_WEAK			JEDEC_MA_EMR_ODS_WEAK +#define SDRAM_MEMODE_DLL_MASK			JEDEC_MA_EMR_DLL_MASK +#define SDRAM_MEMODE_DLL_DISABLE		JEDEC_MA_EMR_DLL_DISABLE +#define SDRAM_MEMODE_DLL_ENABLE			JEDEC_MA_EMR_DLL_ENABLE  /*   * SDRAM Clock Timing Register @@ -684,6 +898,24 @@  #define SDRAM_SDTR3_RFC_ENCODE(n)	((((u32)(n))&0x3F)<<0)  /* + * ECC Error Status + */ +#define SDRAM_ECCES_MASK		 PPC_REG_VAL(21, 0x3FFFFF) +#define SDRAM_ECCES_BNCE_MASK		 PPC_REG_VAL(15, 0xFFFF) +#define SDRAM_ECCES_BNCE_ENCODE(lane)	 PPC_REG_VAL(((lane) & 0xF), 1) +#define SDRAM_ECCES_CKBER_MASK		 PPC_REG_VAL(17, 0x3) +#define SDRAM_ECCES_CKBER_NONE		 PPC_REG_VAL(17, 0) +#define SDRAM_ECCES_CKBER_16_ECC_0_3	 PPC_REG_VAL(17, 2) +#define SDRAM_ECCES_CKBER_32_ECC_0_3	 PPC_REG_VAL(17, 1) +#define SDRAM_ECCES_CKBER_32_ECC_4_8	 PPC_REG_VAL(17, 2) +#define SDRAM_ECCES_CKBER_32_ECC_0_8	 PPC_REG_VAL(17, 3) +#define SDRAM_ECCES_CE			 PPC_REG_VAL(18, 1) +#define SDRAM_ECCES_UE			 PPC_REG_VAL(19, 1) +#define SDRAM_ECCES_BKNER_MASK		 PPC_REG_VAL(21, 0x3) +#define SDRAM_ECCES_BK0ER		 PPC_REG_VAL(20, 1) +#define SDRAM_ECCES_BK1ER		 PPC_REG_VAL(21, 1) + +/*   * Memory Bank 0-1 configuration   */  #define SDRAM_BXCF_M_AM_MASK		0x00000F00	/* Addressing mode	*/ diff --git a/include/asm-ppc/ppc4xx-uic.h b/include/asm-ppc/ppc4xx-uic.h new file mode 100644 index 000000000..c908d4245 --- /dev/null +++ b/include/asm-ppc/ppc4xx-uic.h @@ -0,0 +1,316 @@ +/* + *  Copyright (C) 2002 Scott McNutt <smcnutt@artesyncp.com> + * + * (C) Copyright 2008 + * Stefan Roese, DENX Software Engineering, sr@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 + */ + +#ifndef _PPC4xx_UIC_H_ +#define _PPC4xx_UIC_H_ + +/* + * Define the number of UIC's + */ +#if defined(CONFIG_440GX) || defined(CONFIG_440SPE) || \ +    defined(CONFIG_460EX) || defined(CONFIG_460GT) || \ +    defined(CONFIG_460SX) +#define UIC_MAX		4 +#elif defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \ +    defined(CONFIG_405EX) +#define UIC_MAX		3 +#elif defined(CONFIG_440GP) || defined(CONFIG_440SP) || \ +    defined(CONFIG_440EP) || defined(CONFIG_440GR) +#define UIC_MAX		2 +#else +#define UIC_MAX		1 +#endif + +#define IRQ_MAX UIC_MAX * 32 + +/* + * UIC register + */ +#define UIC_SR	0x0			/* UIC status			*/ +#define UIC_ER	0x2			/* UIC enable			*/ +#define UIC_CR	0x3			/* UIC critical			*/ +#define UIC_PR	0x4			/* UIC polarity			*/ +#define UIC_TR	0x5			/* UIC triggering		*/ +#define UIC_MSR 0x6			/* UIC masked status		*/ +#define UIC_VR	0x7			/* UIC vector			*/ +#define UIC_VCR 0x8			/* UIC vector configuration	*/ + +/* + * On 440GX we use the UICB0 as UIC0. Its the root UIC where all other UIC's + * are cascaded on. With this trick we can use the common UIC code for 440GX + * too. + */ +#if defined(CONFIG_440GX) +#define UIC0_DCR_BASE 0x200 +#define UIC1_DCR_BASE 0xc0 +#define UIC2_DCR_BASE 0xd0 +#define UIC3_DCR_BASE 0x210 +#else +#define UIC0_DCR_BASE 0xc0 +#define UIC1_DCR_BASE 0xd0 +#define UIC2_DCR_BASE 0xe0 +#define UIC3_DCR_BASE 0xf0 +#endif + +#define uic0sr	(UIC0_DCR_BASE+0x0)	/* UIC0 status			*/ +#define uic0er	(UIC0_DCR_BASE+0x2)	/* UIC0 enable			*/ +#define uic0cr	(UIC0_DCR_BASE+0x3)	/* UIC0 critical		*/ +#define uic0pr	(UIC0_DCR_BASE+0x4)	/* UIC0 polarity		*/ +#define uic0tr	(UIC0_DCR_BASE+0x5)	/* UIC0 triggering		*/ +#define uic0msr (UIC0_DCR_BASE+0x6)	/* UIC0 masked status		*/ +#define uic0vr	(UIC0_DCR_BASE+0x7)	/* UIC0 vector			*/ +#define uic0vcr (UIC0_DCR_BASE+0x8)	/* UIC0 vector configuration	*/ + +#define uic1sr	(UIC1_DCR_BASE+0x0)	/* UIC1 status			*/ +#define uic1er	(UIC1_DCR_BASE+0x2)	/* UIC1 enable			*/ +#define uic1cr	(UIC1_DCR_BASE+0x3)	/* UIC1 critical		*/ +#define uic1pr	(UIC1_DCR_BASE+0x4)	/* UIC1 polarity		*/ +#define uic1tr	(UIC1_DCR_BASE+0x5)	/* UIC1 triggering		*/ +#define uic1msr (UIC1_DCR_BASE+0x6)	/* UIC1 masked status		*/ +#define uic1vr	(UIC1_DCR_BASE+0x7)	/* UIC1 vector			*/ +#define uic1vcr (UIC1_DCR_BASE+0x8)	/* UIC1 vector configuration	*/ + +#define uic2sr	(UIC2_DCR_BASE+0x0)	/* UIC2 status-Read Clear	*/ +#define uic2srs	(UIC2_DCR_BASE+0x1)	/* UIC2 status-Read Set		*/ +#define uic2er	(UIC2_DCR_BASE+0x2)	/* UIC2 enable			*/ +#define uic2cr	(UIC2_DCR_BASE+0x3)	/* UIC2 critical		*/ +#define uic2pr	(UIC2_DCR_BASE+0x4)	/* UIC2 polarity		*/ +#define uic2tr	(UIC2_DCR_BASE+0x5)	/* UIC2 triggering		*/ +#define uic2msr (UIC2_DCR_BASE+0x6)	/* UIC2 masked status		*/ +#define uic2vr	(UIC2_DCR_BASE+0x7)	/* UIC2 vector			*/ +#define uic2vcr (UIC2_DCR_BASE+0x8)	/* UIC2 vector configuration	*/ + +#define uic3sr	(UIC3_DCR_BASE+0x0)	/* UIC3 status-Read Clear	*/ +#define uic3srs	(UIC3_DCR_BASE+0x1)	/* UIC3 status-Read Set		*/ +#define uic3er	(UIC3_DCR_BASE+0x2)	/* UIC3 enable			*/ +#define uic3cr	(UIC3_DCR_BASE+0x3)	/* UIC3 critical		*/ +#define uic3pr	(UIC3_DCR_BASE+0x4)	/* UIC3 polarity		*/ +#define uic3tr	(UIC3_DCR_BASE+0x5)	/* UIC3 triggering		*/ +#define uic3msr (UIC3_DCR_BASE+0x6)	/* UIC3 masked status		*/ +#define uic3vr	(UIC3_DCR_BASE+0x7)	/* UIC3 vector			*/ +#define uic3vcr (UIC3_DCR_BASE+0x8)	/* UIC3 vector configuration	*/ + +/* The following is for compatibility with 405 code */ +#define uicsr	uic0sr +#define uicer	uic0er +#define uiccr	uic0cr +#define uicpr	uic0pr +#define uictr	uic0tr +#define uicmsr	uic0msr +#define uicvr	uic0vr +#define uicvcr	uic0vcr + +/* + * Now the interrupt vector definitions. They are different for most of + * the 4xx variants, so we need some more #ifdef's here. No mask + * definitions anymore here. For this please use the UIC_MASK macro below. + * + * Note: Please only define the interrupts really used in U-Boot here. + * Those are the cascading and EMAC/MAL related interrupt. + */ + +#if defined(CONFIG_405EP) || defined(CONFIG_405GP) +#define VECNUM_MAL_SERR		10 +#define VECNUM_MAL_TXEOB	11 +#define VECNUM_MAL_RXEOB	12 +#define VECNUM_MAL_TXDE		13 +#define VECNUM_MAL_RXDE		14 +#define VECNUM_ETH0		15 +#define VECNUM_ETH1_OFFS	2 +#define VECNUM_EIRQ6		29 +#endif /* defined(CONFIG_405EP) */ + +#if defined(CONFIG_405EZ) +#define VECNUM_USBDEV		15 +#define VECNUM_ETH0		16 +#define VECNUM_MAL_SERR		18 +#define VECNUM_MAL_TXDE		18 +#define VECNUM_MAL_RXDE		18 +#define VECNUM_MAL_TXEOB	19 +#define VECNUM_MAL_RXEOB	21 +#endif /* CONFIG_405EX */ + +#if defined(CONFIG_405EX) +/* UIC 0 */ +#define VECNUM_MAL_TXEOB	10 +#define VECNUM_MAL_RXEOB	11 +#define VECNUM_ETH0		24 +#define VECNUM_ETH1_OFFS	1 +#define VECNUM_UIC2NCI		28 +#define VECNUM_UIC2CI		29 +#define VECNUM_UIC1NCI		30 +#define VECNUM_UIC1CI		31 + +/* UIC 1 */ +#define VECNUM_MAL_SERR		(32 + 0) +#define VECNUM_MAL_TXDE		(32 + 1) +#define VECNUM_MAL_RXDE		(32 + 2) +#endif /* CONFIG_405EX */ + +#if defined(CONFIG_440GP) || \ +    defined(CONFIG_440EP) || defined(CONFIG_440GR) +/* UIC 0 */ +#define VECNUM_MAL_TXEOB	10 +#define VECNUM_MAL_RXEOB	11 +#define VECNUM_UIC1NCI		30 +#define VECNUM_UIC1CI		31 + +/* UIC 1 */ +#define VECNUM_MAL_SERR		(32 + 0) +#define VECNUM_MAL_TXDE		(32 + 1) +#define VECNUM_MAL_RXDE		(32 + 2) +#define VECNUM_USBDEV		(32 + 23) +#define VECNUM_ETH0		(32 + 28) +#define VECNUM_ETH1_OFFS	2 +#endif /* CONFIG_440GP */ + +#if defined(CONFIG_440GX) +/* UICB 0 (440GX only) */ +/* + * All those defines below are off-by-one, so that the common UIC code + * can be used. So VECNUM_UIC1CI refers to VECNUM_UIC0CI etc. + */ +#define VECNUM_UIC1CI		0 +#define VECNUM_UIC1NCI		1 +#define VECNUM_UIC2CI		2 +#define VECNUM_UIC2NCI		3 +#define VECNUM_UIC3CI		4 +#define VECNUM_UIC3NCI		5 + +/* UIC 0, used as UIC1 on 440GX because of UICB0 */ +#define VECNUM_MAL_TXEOB	(32 + 10) +#define VECNUM_MAL_RXEOB	(32 + 11) + +/* UIC 1, used as UIC2 on 440GX because of UICB0 */ +#define VECNUM_MAL_SERR		(64 + 0) +#define VECNUM_MAL_TXDE		(64 + 1) +#define VECNUM_MAL_RXDE		(64 + 2) +#define VECNUM_ETH0		(64 + 28) +#define VECNUM_ETH1_OFFS	2 +#endif /* CONFIG_440GX */ + +#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX) +/* UIC 0 */ +#define VECNUM_MAL_TXEOB	10 +#define VECNUM_MAL_RXEOB	11 +#define VECNUM_USBDEV		20 +#define VECNUM_ETH0		24 +#define VECNUM_ETH1_OFFS	1 +#define VECNUM_UIC2NCI		28 +#define VECNUM_UIC2CI		29 +#define VECNUM_UIC1NCI		30 +#define VECNUM_UIC1CI		31 + +/* UIC 1 */ +#define VECNUM_MAL_SERR		(32 + 0) +#define VECNUM_MAL_TXDE		(32 + 1) +#define VECNUM_MAL_RXDE		(32 + 2) + +/* UIC 2 */ +#define VECNUM_EIRQ2		(64 + 3) +#endif /* CONFIG_440EPX */ + +#if defined(CONFIG_440SP) +/* UIC 0 */ +#define VECNUM_UIC1NCI		30 +#define VECNUM_UIC1CI		31 + +/* UIC 1 */ +#define VECNUM_MAL_SERR		(32 + 1) +#define VECNUM_MAL_TXDE		(32 + 2) +#define VECNUM_MAL_RXDE		(32 + 3) +#define VECNUM_MAL_TXEOB	(32 + 6) +#define VECNUM_MAL_RXEOB	(32 + 7) +#define VECNUM_ETH0		(32 + 28) +#endif /* CONFIG_440SP */ + +#if defined(CONFIG_440SPE) +/* UIC 0 */ +#define VECNUM_UIC2NCI		10 +#define VECNUM_UIC2CI		11 +#define VECNUM_UIC3NCI		16 +#define VECNUM_UIC3CI		17 +#define VECNUM_UIC1NCI		30 +#define VECNUM_UIC1CI		31 + +/* UIC 1 */ +#define VECNUM_MAL_SERR		(32 + 1) +#define VECNUM_MAL_TXDE		(32 + 2) +#define VECNUM_MAL_RXDE		(32 + 3) +#define VECNUM_MAL_TXEOB	(32 + 6) +#define VECNUM_MAL_RXEOB	(32 + 7) +#define VECNUM_ETH0		(32 + 28) +#endif /* CONFIG_440SPE */ + +#if defined(CONFIG_460EX) || defined(CONFIG_460GT) +/* UIC 0 */ +#define VECNUM_UIC2NCI		10 +#define VECNUM_UIC2CI		11 +#define VECNUM_UIC3NCI		16 +#define VECNUM_UIC3CI		17 +#define VECNUM_UIC1NCI		30 +#define VECNUM_UIC1CI		31 + +/* UIC 2 */ +#define VECNUM_MAL_SERR		(64 + 3) +#define	VECNUM_MAL_TXDE		(64 + 4) +#define	VECNUM_MAL_RXDE		(64 + 5) +#define VECNUM_MAL_TXEOB	(64 + 6) +#define	VECNUM_MAL_RXEOB	(64 + 7) +#define	VECNUM_ETH0		(64 + 16) +#define VECNUM_ETH1_OFFS	1 +#endif /* CONFIG_460EX */ + +#if defined(CONFIG_460SX) +/* UIC 0 */ +#define VECNUM_UIC2NCI		10 +#define VECNUM_UIC2CI		11 +#define VECNUM_UIC3NCI		16 +#define VECNUM_UIC3CI		17 +#define	VECNUM_ETH0		19 +#define VECNUM_ETH1_OFFS	1 +#define VECNUM_UIC1NCI		30 +#define VECNUM_UIC1CI		31 + +/* UIC 1 */ +#define VECNUM_MAL_SERR		(32 + 1) +#define	VECNUM_MAL_TXDE		(32 + 2) +#define	VECNUM_MAL_RXDE		(32 + 3) +#define VECNUM_MAL_TXEOB	(32 + 6) +#define	VECNUM_MAL_RXEOB	(32 + 7) +#endif /* CONFIG_460EX */ + +#if !defined(VECNUM_ETH1_OFFS) +#define VECNUM_ETH1_OFFS	1 +#endif + +/* + * Mask definitions (used for example in 4xx_enet.c) + */ +#define UIC_MASK(vec)		(0x80000000 >> ((vec) & 0x1f)) +/* UIC_NR won't work for 440GX because of its specific UIC DCR addresses */ +#define UIC_NR(vec)		((vec) >> 5) + +#endif /* _PPC4xx_UIC_H_ */ diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h index e61786809..dce4717f4 100644 --- a/include/asm-ppc/processor.h +++ b/include/asm-ppc/processor.h @@ -830,6 +830,10 @@  #define PVR_460EX_RA	0x130218A3 /* 460EX rev A without Security Engine */  #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_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 @@ -855,6 +859,8 @@  #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   * the PowerPC core. The various versions of these processors must be diff --git a/include/asm-ppc/xilinx_irq.h b/include/asm-ppc/xilinx_irq.h new file mode 100644 index 000000000..61171c21f --- /dev/null +++ b/include/asm-ppc/xilinx_irq.h @@ -0,0 +1,36 @@ +/* + * (C) Copyright 2008 + * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda@uam.es + * This work has been supported by: QTechnology  http://qtec.com/ + * Based on interrupts.c Wolfgang Denk-DENX Software Engineering-wd@denx.de + * 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, see <http://www.gnu.org/licenses/>. +*/ +#ifndef XILINX_IRQ_H +#define XILINX_IRQ_H + +#define intc	XPAR_INTC_0_BASEADDR +#define ISR	(intc + (0 * 4))	/* Interrupt Status Register */ +#define IPR	(intc + (1 * 4))	/* Interrupt Pending Register */ +#define IER	(intc + (2 * 4))	/* Interrupt Enable Register */ +#define IAR	(intc + (3 * 4))	/* Interrupt Acknowledge Register */ +#define SIE	(intc + (4 * 4))	/* Set Interrupt Enable bits */ +#define CIE	(intc + (5 * 4))	/* Clear Interrupt Enable bits */ +#define IVR	(intc + (6 * 4))	/* Interrupt Vector Register */ +#define MER	(intc + (7 * 4))	/* Master Enable Register */ + +#define IRQ_MASK(irq)	(1 << (irq & 0x1f)) + +#define IRQ_MAX		XPAR_INTC_MAX_NUM_INTR_INPUTS + +#endif |