ppc4xx-sdram.h

来自「最新版的u-boot,2008-10-18发布」· C头文件 代码 · 共 1,425 行 · 第 1/5 页

H
1,425
字号
#define SDRAM_CONF1LL_AAFR	0x80000000		/* Address Ack on First Request - Bit 0 */#define SDRAM_CONF1LL_PRPD	0x00080000		/* PLB Read pipeline Disable - Bit 12 */#define SDRAM_CONF1LL_PWPD	0x00040000		/* PLB Write pipeline Disable - Bit 13 */#define SDRAM_CONF1LL_PRW	0x00020000		/* PLB Read Wait - Bit 14 */#define SDRAM_CONF1LL_RPLM	0x00001000		/* Read Passing Limit 1 - Bits 16..19 */#define SDRAM_CONF1LL_RPEN	0x00000800		/* Read Passing Enable - Bit 20 */#define SDRAM_CONF1LL_RFTE	0x00000400		/* Read Flow Through Enable - Bit 21 */#define SDRAM_CONF1LL_MASK	0x0000F000		/* RPLM mask */#define SDRAM_ERRSTATLL		(SDRAMQ_DCR_BASE+0xC)	/* error status LL             */#define SDRAM_ERRADDULL		(SDRAMQ_DCR_BASE+0xD)	/* error address upper 32 LL   */#define SDRAM_ERRADDLLL		(SDRAMQ_DCR_BASE+0xE)	/* error address lower 32 LL   */#define SDRAM_CONFPATHB		(SDRAMQ_DCR_BASE+0xF)	/* configuration between paths */#define SDRAM_CONFPATHB_TPEN	0x08000000		/* Transaction Passing Enable - Bit 4 */#define SDRAM_PLBADDUHB		(SDRAMQ_DCR_BASE+0x10)  /* PLB base address upper 32 LL *//* * Memory Bank 0-7 configuration */#if defined(CONFIG_440SPE) || \    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)#endif /* CONFIG_440SPE */#if defined(CONFIG_440SP)#define SDRAM_RXBAS_SDBA_MASK		0xFF800000	/* Base address	*/#define SDRAM_RXBAS_SDBA_ENCODE(n)	((((u32)(n))&0xFF800000))#define SDRAM_RXBAS_SDBA_DECODE(n)	((((u32)(n))&0xFF800000))#endif /* CONFIG_440SP */#define SDRAM_RXBAS_SDSZ_MASK		0x0000FFC0	/* Size		*/#define SDRAM_RXBAS_SDSZ_ENCODE(n)	((((u32)(n))&0x3FF)<<6)#define SDRAM_RXBAS_SDSZ_DECODE(n)	((((u32)(n))>>6)&0x3FF)#define SDRAM_RXBAS_SDSZ_0		0x00000000	/*   0M		*/#define SDRAM_RXBAS_SDSZ_8		0x0000FFC0	/*   8M		*/#define SDRAM_RXBAS_SDSZ_16		0x0000FF80	/*  16M		*/#define SDRAM_RXBAS_SDSZ_32		0x0000FF00	/*  32M		*/#define SDRAM_RXBAS_SDSZ_64		0x0000FE00	/*  64M		*/#define SDRAM_RXBAS_SDSZ_128		0x0000FC00	/* 128M		*/#define SDRAM_RXBAS_SDSZ_256		0x0000F800	/* 256M		*/#define SDRAM_RXBAS_SDSZ_512		0x0000F000	/* 512M		*/#define SDRAM_RXBAS_SDSZ_1024		0x0000E000	/* 1024M	*/#define SDRAM_RXBAS_SDSZ_2048		0x0000C000	/* 2048M	*/#define SDRAM_RXBAS_SDSZ_4096		0x00008000	/* 4096M	*/#else /* CONFIG_405EX *//* * XXX - ToDo: * Revisit this file to check if all these 405EX defines are correct and * can be used in the common 44x_spd_ddr2 code as well. sr, 2008-06-02 */#define SDRAM_RXBAS_SDSZ_MASK		PPC_REG_VAL(19, 0xF)#define SDRAM_RXBAS_SDSZ_4MB	   	PPC_REG_VAL(19, 0x0)#define SDRAM_RXBAS_SDSZ_8MB	   	PPC_REG_VAL(19, 0x1)#define SDRAM_RXBAS_SDSZ_16MB	   	PPC_REG_VAL(19, 0x2)#define SDRAM_RXBAS_SDSZ_32MB	   	PPC_REG_VAL(19, 0x3)#define SDRAM_RXBAS_SDSZ_64MB	   	PPC_REG_VAL(19, 0x4)#define SDRAM_RXBAS_SDSZ_128MB	   	PPC_REG_VAL(19, 0x5)#define SDRAM_RXBAS_SDSZ_256MB	   	PPC_REG_VAL(19, 0x6)#define SDRAM_RXBAS_SDSZ_512MB	   	PPC_REG_VAL(19, 0x7)#define SDRAM_RXBAS_SDSZ_1024MB	   	PPC_REG_VAL(19, 0x8)#define SDRAM_RXBAS_SDSZ_2048MB	   	PPC_REG_VAL(19, 0x9)#define SDRAM_RXBAS_SDSZ_4096MB		PPC_REG_VAL(19, 0xA)#define SDRAM_RXBAS_SDSZ_8192MB		PPC_REG_VAL(19, 0xB)#define SDRAM_RXBAS_SDSZ_8      	SDRAM_RXBAS_SDSZ_8MB#define SDRAM_RXBAS_SDSZ_16     	SDRAM_RXBAS_SDSZ_16MB#define SDRAM_RXBAS_SDSZ_32     	SDRAM_RXBAS_SDSZ_32MB#define SDRAM_RXBAS_SDSZ_64     	SDRAM_RXBAS_SDSZ_64MB#define SDRAM_RXBAS_SDSZ_128    	SDRAM_RXBAS_SDSZ_128MB#define SDRAM_RXBAS_SDSZ_256    	SDRAM_RXBAS_SDSZ_256MB#define SDRAM_RXBAS_SDSZ_512    	SDRAM_RXBAS_SDSZ_512MB#define SDRAM_RXBAS_SDSZ_1024		SDRAM_RXBAS_SDSZ_1024MB#define SDRAM_RXBAS_SDSZ_2048		SDRAM_RXBAS_SDSZ_2048MB#define SDRAM_RXBAS_SDSZ_4096		SDRAM_RXBAS_SDSZ_4096MB#define SDRAM_RXBAS_SDSZ_8192		SDRAM_RXBAS_SDSZ_8192MB#define SDRAM_RXBAS_SDAM_MODE0		PPC_REG_VAL(23, 0x0)#define SDRAM_RXBAS_SDAM_MODE1		PPC_REG_VAL(23, 0x1)#define SDRAM_RXBAS_SDAM_MODE2		PPC_REG_VAL(23, 0x2)#define SDRAM_RXBAS_SDAM_MODE3		PPC_REG_VAL(23, 0x3)#define SDRAM_RXBAS_SDAM_MODE4		PPC_REG_VAL(23, 0x4)#define SDRAM_RXBAS_SDAM_MODE5		PPC_REG_VAL(23, 0x5)#define SDRAM_RXBAS_SDAM_MODE6		PPC_REG_VAL(23, 0x6)#define SDRAM_RXBAS_SDAM_MODE7		PPC_REG_VAL(23, 0x7)#define SDRAM_RXBAS_SDAM_MODE8		PPC_REG_VAL(23, 0x8)#define SDRAM_RXBAS_SDAM_MODE9		PPC_REG_VAL(23, 0x9)#define SDRAM_RXBAS_SDBE_DISABLE	PPC_REG_VAL(31, 0x0)#define SDRAM_RXBAS_SDBE_ENABLE		PPC_REG_VAL(31, 0x1)#endif /* CONFIG_405EX *//* * 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             */#define SDRAM_MODT1	0x23	/* on die termination for bank 1             */#define SDRAM_MODT2	0x24	/* on die termination for bank 2             */#define SDRAM_MODT3	0x25	/* on die termination for bank 3             */#define SDRAM_CODT	0x26	/* on die termination for controller         */#define SDRAM_VVPR	0x27	/* variable VRef programmming                */#define SDRAM_OPARS	0x28	/* on chip driver control setup              */#define SDRAM_OPART	0x29	/* on chip driver control trigger            */#define SDRAM_RTR	0x30	/* refresh timer                             */#define SDRAM_PMIT	0x34	/* power management idle timer               */#define SDRAM_MB0CF	0x40	/* memory bank 0 configuration               */#define SDRAM_MB1CF	0x44	/* memory bank 1 configuration               */#define SDRAM_MB2CF	0x48#define SDRAM_MB3CF	0x4C#define SDRAM_INITPLR0	0x50	/* manual initialization control             */#define SDRAM_INITPLR1	0x51	/* manual initialization control             */#define SDRAM_INITPLR2	0x52	/* manual initialization control             */#define SDRAM_INITPLR3	0x53	/* manual initialization control             */#define SDRAM_INITPLR4	0x54	/* manual initialization control             */#define SDRAM_INITPLR5	0x55	/* manual initialization control             */#define SDRAM_INITPLR6	0x56	/* manual initialization control             */#define SDRAM_INITPLR7	0x57	/* manual initialization control             */#define SDRAM_INITPLR8	0x58	/* manual initialization control             */#define SDRAM_INITPLR9	0x59	/* manual initialization control             */#define SDRAM_INITPLR10	0x5a	/* manual initialization control             */#define SDRAM_INITPLR11	0x5b	/* manual initialization control             */#define SDRAM_INITPLR12	0x5c	/* manual initialization control             */#define SDRAM_INITPLR13	0x5d	/* manual initialization control             */#define SDRAM_INITPLR14	0x5e	/* manual initialization control             */#define SDRAM_INITPLR15	0x5f	/* manual initialization control             */#define SDRAM_RQDC	0x70	/* read DQS delay control                    */#define SDRAM_RFDC	0x74	/* read feedback delay control               */#define SDRAM_RDCC	0x78	/* read data capture control                 */#define SDRAM_DLCR	0x7A	/* delay line calibration                    */#define SDRAM_CLKTR	0x80	/* DDR clock timing                          */#define SDRAM_WRDTR	0x81	/* write data, DQS, DM clock, timing         */#define SDRAM_SDTR1	0x85	/* DDR SDRAM timing 1                        */#define SDRAM_SDTR2	0x86	/* DDR SDRAM timing 2                        */#define SDRAM_SDTR3	0x87	/* DDR SDRAM timing 3                        */#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 */#define SDRAM_MCSTAT_MIC_MASK		0x80000000	/* Memory init status mask	*/#define SDRAM_MCSTAT_MIC_NOTCOMP	0x00000000	/* Mem init not complete	*/#define SDRAM_MCSTAT_MIC_COMP		0x80000000	/* Mem init complete		*/#define SDRAM_MCSTAT_SRMS_MASK		0x40000000	/* Mem self refresh stat mask	*/#define SDRAM_MCSTAT_SRMS_NOT_SF	0x00000000	/* Mem not in self refresh	*/#define SDRAM_MCSTAT_SRMS_SF		0x40000000	/* Mem in self refresh		*/#define SDRAM_MCSTAT_IDLE_MASK		0x20000000	/* Mem self refresh stat mask	*/#define SDRAM_MCSTAT_IDLE_NOT		0x00000000	/* Mem contr not idle		*/#define SDRAM_MCSTAT_IDLE		0x20000000	/* Mem contr idle		*//* * Memory Controller Options 1 */#define SDRAM_MCOPT1_MCHK_MASK		0x30000000 /* Memory data err check mask*/#define SDRAM_MCOPT1_MCHK_NON		0x00000000 /* No ECC generation		*/#define SDRAM_MCOPT1_MCHK_GEN		0x20000000 /* ECC generation		*/#define SDRAM_MCOPT1_MCHK_CHK		0x10000000 /* ECC generation and check	*/#define SDRAM_MCOPT1_MCHK_CHK_REP	0x30000000 /* ECC generation, chk, report*/#define SDRAM_MCOPT1_MCHK_CHK_DECODE(n)	((((u32)(n))>>28)&0x3)#define SDRAM_MCOPT1_RDEN_MASK		0x08000000 /* Registered DIMM mask	*/#define SDRAM_MCOPT1_RDEN		0x08000000 /* Registered DIMM enable	*/#define SDRAM_MCOPT1_PMU_MASK		0x06000000 /* Page management unit mask	*/#define SDRAM_MCOPT1_PMU_CLOSE		0x00000000 /* PMU Close			*/#define SDRAM_MCOPT1_PMU_OPEN		0x04000000 /* PMU Open			*/#define SDRAM_MCOPT1_PMU_AUTOCLOSE	0x02000000 /* PMU AutoClose		*/#define SDRAM_MCOPT1_DMWD_MASK		0x01000000 /* DRAM width mask		*/#define SDRAM_MCOPT1_DMWD_32		0x00000000 /* 32 bits			*/#define SDRAM_MCOPT1_DMWD_64		0x01000000 /* 64 bits			*/#define SDRAM_MCOPT1_UIOS_MASK		0x00C00000 /* Unused IO State		*/#define SDRAM_MCOPT1_BCNT_MASK		0x00200000 /* Bank count		*/#define SDRAM_MCOPT1_4_BANKS		0x00000000 /* 4 Banks			*/#define SDRAM_MCOPT1_8_BANKS		0x00200000 /* 8 Banks			*/#define SDRAM_MCOPT1_DDR_TYPE_MASK	0x00100000 /* DDR Memory Type mask	*/#define SDRAM_MCOPT1_DDR1_TYPE		0x00000000 /* DDR1 Memory Type		*/#define SDRAM_MCOPT1_DDR2_TYPE		0x00100000 /* DDR2 Memory Type		*/#define SDRAM_MCOPT1_QDEP		0x00020000 /* 4 commands deep		*/#define SDRAM_MCOPT1_RWOO_MASK		0x00008000 /* Out of Order Read mask	*/#define SDRAM_MCOPT1_RWOO_DISABLED	0x00000000 /* disabled			*/#define SDRAM_MCOPT1_RWOO_ENABLED	0x00008000 /* enabled			*/#define SDRAM_MCOPT1_WOOO_MASK		0x00004000 /* Out of Order Write mask	*/#define SDRAM_MCOPT1_WOOO_DISABLED	0x00000000 /* disabled			*/#define SDRAM_MCOPT1_WOOO_ENABLED	0x00004000 /* enabled			*/#define SDRAM_MCOPT1_DCOO_MASK		0x00002000 /* All Out of Order mask	*/#define SDRAM_MCOPT1_DCOO_DISABLED	0x00002000 /* disabled			*/#define SDRAM_MCOPT1_DCOO_ENABLED	0x00000000 /* enabled			*/#define SDRAM_MCOPT1_DREF_MASK		0x00001000 /* Deferred refresh mask	*/#define SDRAM_MCOPT1_DREF_NORMAL	0x00000000 /* normal refresh		*/#define SDRAM_MCOPT1_DREF_DEFER_4	0x00001000 /* defer up to 4 refresh cmd	*//* * Memory Controller Options 2 */#define SDRAM_MCOPT2_SREN_MASK		0x80000000 /* Self Test mask		*/#define SDRAM_MCOPT2_SREN_EXIT		0x00000000 /* Self Test exit		*/#define SDRAM_MCOPT2_SREN_ENTER		0x80000000 /* Self Test enter		*/#define SDRAM_MCOPT2_PMEN_MASK		0x40000000 /* Power Management mask	*/#define SDRAM_MCOPT2_PMEN_DISABLE	0x00000000 /* disable			*/#define SDRAM_MCOPT2_PMEN_ENABLE	0x40000000 /* enable			*/#define SDRAM_MCOPT2_IPTR_MASK		0x20000000 /* Init Trigger Reg mask	*/#define SDRAM_MCOPT2_IPTR_IDLE		0x00000000 /* idle			*/#define SDRAM_MCOPT2_IPTR_EXECUTE	0x20000000 /* execute preloaded init	*/#define SDRAM_MCOPT2_XSRP_MASK		0x10000000 /* Exit Self Refresh Prevent	*/#define SDRAM_MCOPT2_XSRP_ALLOW		0x00000000 /* allow self refresh exit	*/#define SDRAM_MCOPT2_XSRP_PREVENT	0x10000000 /* prevent self refresh exit	*/#define SDRAM_MCOPT2_DCEN_MASK		0x08000000 /* SDRAM Controller Enable	*/#define SDRAM_MCOPT2_DCEN_DISABLE	0x00000000 /* SDRAM Controller Enable	*/#define SDRAM_MCOPT2_DCEN_ENABLE	0x08000000 /* SDRAM Controller Enable	*/#define SDRAM_MCOPT2_ISIE_MASK		0x04000000 /* Init Seq Interruptable mas*/#define SDRAM_MCOPT2_ISIE_DISABLE	0x00000000 /* disable			*/#define SDRAM_MCOPT2_ISIE_ENABLE	0x04000000 /* enable			*//* * SDRAM Refresh Timer Register */#define SDRAM_RTR_RINT_MASK		0xFFF80000#define SDRAM_RTR_RINT_ENCODE(n)	((((u32)(n))&0xFFF8)<<16)#define SDRAM_RTR_RINT_DECODE(n)	((((u32)(n))>>16)&0xFFF8)/* * SDRAM Read DQS Delay Control Register */#define SDRAM_RQDC_RQDE_MASK		0x80000000#define SDRAM_RQDC_RQDE_DISABLE		0x00000000#define SDRAM_RQDC_RQDE_ENABLE		0x80000000#define SDRAM_RQDC_RQFD_MASK		0x000001FF#define SDRAM_RQDC_RQFD_ENCODE(n)	((((u32)(n))&0x1FF)<<0)#define SDRAM_RQDC_RQFD_MAX		0x1FF/* * SDRAM Read Data Capture Control Register */#define SDRAM_RDCC_RDSS_MASK		0xC0000000#define SDRAM_RDCC_RDSS_T1		0x00000000#define SDRAM_RDCC_RDSS_T2		0x40000000#define SDRAM_RDCC_RDSS_T3		0x80000000#define SDRAM_RDCC_RDSS_T4		0xC0000000#define SDRAM_RDCC_RSAE_MASK		0x00000001#define SDRAM_RDCC_RSAE_DISABLE		0x00000001#define SDRAM_RDCC_RSAE_ENABLE		0x00000000/*

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?