⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sacsng.h

📁 AT91RM9200的完整启动代码:包括loader, boot及U-boot三部分均已编译通过!欢迎下载使用!
💻 H
📖 第 1 页 / 共 3 页
字号:
/*----------------------------------------------------------------------- * Cache Configuration */#define CFG_CACHELINE_SIZE	32	/* For MPC8260 CPU */#if (CONFIG_COMMANDS & CFG_CMD_KGDB)# define CFG_CACHELINE_SHIFT	5	/* log base 2 of the above value */#endif/*----------------------------------------------------------------------- * HIDx - Hardware Implementation-dependent Registers			 2-11 *----------------------------------------------------------------------- * HID0 also contains cache control - initially enable both caches and * invalidate contents, then the final state leaves only the instruction * cache enabled. Note that Power-On and Hard reset invalidate the caches, * but Soft reset does not. * * HID1 has only read-only information - nothing to set. */#define CFG_HID0_INIT	(HID0_ICE  |\			 HID0_DCE  |\			 HID0_ICFI |\			 HID0_DCI  |\			 HID0_IFEM |\			 HID0_ABE)#define CFG_HID0_FINAL	(HID0_ICE  |\			 HID0_IFEM |\			 HID0_ABE  |\			 HID0_EMCP)#define CFG_HID2	0/*----------------------------------------------------------------------- * RMR - Reset Mode Register *----------------------------------------------------------------------- */#define CFG_RMR		0/*----------------------------------------------------------------------- * BCR - Bus Configuration					 4-25 *----------------------------------------------------------------------- */#define CFG_BCR		(BCR_ETM)/*----------------------------------------------------------------------- * SIUMCR - SIU Module Configuration				 4-31 *----------------------------------------------------------------------- */#define CFG_SIUMCR	(SIUMCR_DPPC11	|\			 SIUMCR_L2CPC00 |\			 SIUMCR_APPC10	|\			 SIUMCR_MMR00)/*----------------------------------------------------------------------- * SYPCR - System Protection Control				11-9 * SYPCR can only be written once after reset! *----------------------------------------------------------------------- * Watchdog & Bus Monitor Timer max, 60x Bus Monitor enable */#define CFG_SYPCR	(SYPCR_SWTC |\			 SYPCR_BMT  |\			 SYPCR_PBME |\			 SYPCR_LBME |\			 SYPCR_SWRI |\			 SYPCR_SWP)/*----------------------------------------------------------------------- * TMCNTSC - Time Counter Status and Control			 4-40 *----------------------------------------------------------------------- * Clear once per Second and Alarm Interrupt Status, Set 32KHz timersclk, * and enable Time Counter */#define CFG_TMCNTSC	(TMCNTSC_SEC |\			 TMCNTSC_ALR |\			 TMCNTSC_TCF |\			 TMCNTSC_TCE)/*----------------------------------------------------------------------- * PISCR - Periodic Interrupt Status and Control		 4-42 *----------------------------------------------------------------------- * Clear Periodic Interrupt Status, Set 32KHz timersclk, and enable * Periodic timer */#define CFG_PISCR	(PISCR_PS  |\			 PISCR_PTF |\			 PISCR_PTE)/*----------------------------------------------------------------------- * SCCR - System Clock Control					 9-8 *----------------------------------------------------------------------- */#define CFG_SCCR	0/*----------------------------------------------------------------------- * RCCR - RISC Controller Configuration				13-7 *----------------------------------------------------------------------- */#define CFG_RCCR	0/* * Initialize Memory Controller: * * Bank Bus	Machine PortSz	Device * ---- ---	------- ------	------ *  0	60x	GPCM	16 bit	FLASH (primary flash - 2MB) *  1	60x	GPCM	-- bit	(Unused) *  2	60x	SDRAM	64 bit	SDRAM (DIMM) *  3	60x	SDRAM	64 bit	SDRAM (DIMM) *  4	60x	GPCM	-- bit	(Unused) *  5	60x	GPCM	-- bit	(Unused) *  6	60x	GPCM	16 bit	FLASH  (secondary flash - 2MB) *//*----------------------------------------------------------------------- * BR0,BR1 - Base Register *     Ref: Section 10.3.1 on page 10-14 * OR0,OR1 - Option Register *     Ref: Section 10.3.2 on page 10-18 *----------------------------------------------------------------------- *//* Bank 0 - Primary FLASH *//* BR0 is configured as follows: * *     - Base address of 0x40000000 *     - 16 bit port size *     - Data errors checking is disabled *     - Read and write access *     - GPCM 60x bus *     - Access are handled by the memory controller according to MSEL *     - Not used for atomic operations *     - No data pipelining is done *     - Valid */#define CFG_BR0_PRELIM	((CFG_FLASH0_BASE & BRx_BA_MSK) |\			 BRx_PS_16			|\			 BRx_MS_GPCM_P			|\			 BRx_V)/* OR0 is configured as follows: * *     - 4 MB *     - *BCTL0 is asserted upon access to the current memory bank *     - *CW / *WE are negated a quarter of a clock earlier *     - *CS is output at the same time as the address lines *     - Uses a clock cycle length of 5 *     - *PSDVAL is generated internally by the memory controller *	 unless *GTA is asserted earlier externally. *     - Relaxed timing is generated by the GPCM for accesses *	 initiated to this memory region. *     - One idle clock is inserted between a read access from the *	 current bank and the next access. */#define CFG_OR0_PRELIM	(MEG_TO_AM(CFG_FLASH0_SIZE)	|\			 ORxG_CSNT			|\			 ORxG_ACS_DIV1			|\			 ORxG_SCY_5_CLK			|\			 ORxG_TRLX			|\			 ORxG_EHTR)/*----------------------------------------------------------------------- * BR2,BR3 - Base Register *     Ref: Section 10.3.1 on page 10-14 * OR2,OR3 - Option Register *     Ref: Section 10.3.2 on page 10-16 *----------------------------------------------------------------------- *//* Bank 2,3 - SDRAM DIMM *//* The BR2 is configured as follows: * *     - Base address of 0x00000000 *     - 64 bit port size (60x bus only) *     - Data errors checking is disabled *     - Read and write access *     - SDRAM 60x bus *     - Access are handled by the memory controller according to MSEL *     - Not used for atomic operations *     - No data pipelining is done *     - Valid */#define CFG_BR2_PRELIM	((CFG_SDRAM0_BASE & BRx_BA_MSK) |\			 BRx_PS_64			|\			 BRx_MS_SDRAM_P			|\			 BRx_V)#define CFG_BR3_PRELIM	((CFG_SDRAM0_BASE & BRx_BA_MSK) |\			 BRx_PS_64			|\			 BRx_MS_SDRAM_P			|\			 BRx_V)/* With a 64 MB DIMM, the OR2 is configured as follows: * *     - 64 MB *     - 4 internal banks per device *     - Row start address bit is A8 with PSDMR[PBI] = 0 *     - 12 row address lines *     - Back-to-back page mode *     - Internal bank interleaving within save device enabled */#if (CFG_SDRAM0_SIZE == 64)#define CFG_OR2_PRELIM	(MEG_TO_AM(CFG_SDRAM0_SIZE)	|\			 ORxS_BPD_4			|\			 ORxS_ROWST_PBI0_A8		|\			 ORxS_NUMR_12)#else#error "INVALID SDRAM CONFIGURATION"#endif/*----------------------------------------------------------------------- * PSDMR - 60x Bus SDRAM Mode Register *     Ref: Section 10.3.3 on page 10-21 *----------------------------------------------------------------------- *//* Address that the DIMM SPD memory lives at. */#define SDRAM_SPD_ADDR 0x50#if (CFG_SDRAM0_SIZE == 64)/* With a 64 MB DIMM, the PSDMR is configured as follows: * *     - Bank Based Interleaving, *     - Refresh Enable, *     - Address Multiplexing where A5 is output on A14 pin *	 (A6 on A15, and so on), *     - use address pins A14-A16 as bank select, *     - A9 is output on SDA10 during an ACTIVATE command, *     - earliest timing for ACTIVATE command after REFRESH command is 7 clocks, *     - earliest timing for ACTIVATE or REFRESH command after PRECHARGE command *	 is 3 clocks, *     - earliest timing for READ/WRITE command after ACTIVATE command is *	 2 clocks, *     - earliest timing for PRECHARGE after last data was read is 1 clock, *     - earliest timing for PRECHARGE after last data was written is 1 clock, *     - CAS Latency is 2. */#define CFG_PSDMR	(PSDMR_RFEN	      |\			 PSDMR_SDAM_A14_IS_A5 |\			 PSDMR_BSMA_A14_A16   |\			 PSDMR_SDA10_PBI0_A9  |\			 PSDMR_RFRC_7_CLK     |\			 PSDMR_PRETOACT_3W    |\			 PSDMR_ACTTORW_2W     |\			 PSDMR_LDOTOPRE_1C    |\			 PSDMR_WRC_1C	      |\			 PSDMR_CL_2)#else#error "INVALID SDRAM CONFIGURATION"#endif/* * Shoot for approximately 1MHz on the prescaler. */#if (CONFIG_8260_CLKIN >= (60 * 1000 * 1000))#define CFG_MPTPR	MPTPR_PTP_DIV64#elif (CONFIG_8260_CLKIN >= (30 * 1000 * 1000))#define CFG_MPTPR	MPTPR_PTP_DIV32#else#warning "Unconfigured bus clock freq: check CFG_MPTPR and CFG_PSRT are OK"#define CFG_MPTPR	MPTPR_PTP_DIV32#endif#define CFG_PSRT	14/*----------------------------------------------------------------------- * BR6 - Base Register *     Ref: Section 10.3.1 on page 10-14 * OR6 - Option Register *     Ref: Section 10.3.2 on page 10-18 *----------------------------------------------------------------------- *//* Bank 6 - Secondary FLASH * * The secondary FLASH is connected to *CS6 */#if (defined(CFG_FLASH1_BASE) && defined(CFG_FLASH1_SIZE))/* BR6 is configured as follows: * *     - Base address of 0x60000000 *     - 16 bit port size *     - Data errors checking is disabled *     - Read and write access *     - GPCM 60x bus *     - Access are handled by the memory controller according to MSEL *     - Not used for atomic operations *     - No data pipelining is done *     - Valid */#  define CFG_BR6_PRELIM  ((CFG_FLASH1_BASE & BRx_BA_MSK) |\			   BRx_PS_16			  |\			   BRx_MS_GPCM_P		  |\			   BRx_V)/* OR6 is configured as follows: * *     - 2 MB *     - *BCTL0 is asserted upon access to the current memory bank *     - *CW / *WE are negated a quarter of a clock earlier *     - *CS is output at the same time as the address lines *     - Uses a clock cycle length of 5 *     - *PSDVAL is generated internally by the memory controller *	 unless *GTA is asserted earlier externally. *     - Relaxed timing is generated by the GPCM for accesses *	 initiated to this memory region. *     - One idle clock is inserted between a read access from the *	 current bank and the next access. */#  define CFG_OR6_PRELIM  (MEG_TO_AM(CFG_FLASH1_SIZE)  |\			   ORxG_CSNT		       |\			   ORxG_ACS_DIV1	       |\			   ORxG_SCY_5_CLK	       |\			   ORxG_TRLX		       |\			   ORxG_EHTR)#endif /* (defined(CFG_FLASH1_BASE) && defined(CFG_FLASH1_SIZE)) *//* * Internal Definitions * * Boot Flags */#define BOOTFLAG_COLD	0x01	/* Normal Power-On: Boot from FLASH  */#define BOOTFLAG_WARM	0x02	/* Software reboot		     */#endif	/* __CONFIG_H */

⌨️ 快捷键说明

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