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

📄 uc100.h

📁 嵌入式试验箱S3C2410的bootloader源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
 * SYPCR can only be written once after reset! *----------------------------------------------------------------------- * Software & Bus Monitor Timer max, Bus Monitor enable, SW Watchdog freeze */#if defined(CONFIG_WATCHDOG)#define CFG_SYPCR	(SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | \			 SYPCR_SWE  | SYPCR_SWRI| SYPCR_SWP)#else#define CFG_SYPCR	(SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | SYPCR_SWP)#endif/*----------------------------------------------------------------------- * SIUMCR - SIU Module Configuration				11-6 *----------------------------------------------------------------------- * PCMCIA config., multi-function pin tri-state */#define CFG_SIUMCR	(SIUMCR_FRC | SIUMCR_DBGC00 | SIUMCR_DBPC00 | SIUMCR_MLRC01)/*----------------------------------------------------------------------- * TBSCR - Time Base Status and Control				11-26 *----------------------------------------------------------------------- * Clear Reference Interrupt Status, Timebase freezing enabled */#define CFG_TBSCR	(TBSCR_REFA | TBSCR_REFB | TBSCR_TBF)/*----------------------------------------------------------------------- * RTCSC - Real-Time Clock Status and Control Register		11-27 *----------------------------------------------------------------------- */#define CFG_RTCSC	(RTCSC_SEC | RTCSC_ALR | RTCSC_RTF| RTCSC_RTE)/*----------------------------------------------------------------------- * PISCR - Periodic Interrupt Status and Control		11-31 *----------------------------------------------------------------------- * Clear Periodic Interrupt Status, Interrupt Timer freezing enabled */#define CFG_PISCR	(PISCR_PS | PISCR_PITF)/*----------------------------------------------------------------------- * PLPRCR - PLL, Low-Power, and Reset Control Register		15-30 *----------------------------------------------------------------------- * Reset PLL lock status sticky bit, timer expired status bit and timer * interrupt status bit */#define CFG_PLPRCR	(((MPC8XX_FACT-1) << PLPRCR_MF_SHIFT) |	\				PLPRCR_SPLSS | PLPRCR_TEXPS | PLPRCR_TMIST)/*----------------------------------------------------------------------- * SCCR - System Clock and reset Control Register		15-27 *----------------------------------------------------------------------- * Set clock output, timebase and RTC source and divider, * power management and some other internal clocks */#define SCCR_MASK	0x00000000#define CFG_SCCR        (SCCR_EBDF11)/*----------------------------------------------------------------------- * PCMCIA stuff *----------------------------------------------------------------------- * */#define CFG_PCMCIA_MEM_ADDR	(0xE0000000)#define CFG_PCMCIA_MEM_SIZE	( 64 << 20 )#define CFG_PCMCIA_DMA_ADDR	(0xE4000000)#define CFG_PCMCIA_DMA_SIZE	( 64 << 20 )#define CFG_PCMCIA_ATTRB_ADDR	(0xE8000000)#define CFG_PCMCIA_ATTRB_SIZE	( 64 << 20 )#define CFG_PCMCIA_IO_ADDR	(0xEC000000)#define CFG_PCMCIA_IO_SIZE	( 64 << 20 )/*----------------------------------------------------------------------- * IDE/ATA stuff (Supports IDE harddisk on PCMCIA Adapter) *----------------------------------------------------------------------- */#define	CONFIG_IDE_8xx_PCCARD	1	/* Use IDE with PC Card	Adapter	*/#undef	CONFIG_IDE_8xx_DIRECT		/* Direct IDE    not supported	*/#undef	CONFIG_IDE_LED			/* LED   for ide not supported	*/#undef	CONFIG_IDE_RESET		/* reset for ide not supported	*/#define CFG_IDE_MAXBUS		1	/* max. 1 IDE bus		*/#define CFG_IDE_MAXDEVICE	1	/* max. 1 drive per IDE bus	*/#define CFG_ATA_IDE0_OFFSET	0x0000#define CFG_ATA_BASE_ADDR	CFG_PCMCIA_MEM_ADDR/* Offset for data I/O			*/#define CFG_ATA_DATA_OFFSET	(CFG_PCMCIA_MEM_SIZE + 0x320)/* Offset for normal register accesses	*/#define CFG_ATA_REG_OFFSET	(2 * CFG_PCMCIA_MEM_SIZE + 0x320)/* Offset for alternate registers	*/#define CFG_ATA_ALT_OFFSET	0x0100/*----------------------------------------------------------------------- * *----------------------------------------------------------------------- * */#define CFG_DER	0/* * Init Memory Controller: * * BR0/1 and OR0/1 (FLASH) */#define FLASH_BASE0_PRELIM	0x40000000	/* FLASH bank #0	*/#define FLASH_BASE1_PRELIM	0x60000000	/* FLASH bank #0	*//* used to re-map FLASH both when starting from SRAM or FLASH: * restrict access enough to keep SRAM working (if any) * but not too much to meddle with FLASH accesses */#define CFG_REMAP_OR_AM		0x80000000	/* OR addr mask */#define CFG_PRELIM_OR_AM	0xFF800000	/* OR addr mask *//* * FLASH timing: */#define CFG_OR_TIMING_FLASH	(0x00000d24)#define CFG_OR0_REMAP	(CFG_REMAP_OR_AM  | CFG_OR_TIMING_FLASH)#define CFG_OR0_PRELIM	(CFG_PRELIM_OR_AM | CFG_OR_TIMING_FLASH)#define CFG_BR0_PRELIM	((FLASH_BASE0_PRELIM & BR_BA_MSK) | BR_V )#define CFG_BR1_PRELIM  0x00000081  /* Chip select for SDRAM (32 Bit, UPMA) */#define CFG_OR1_PRELIM  0xfc000a00#define CFG_BR2_PRELIM  0x80000001  /* Chip select for SRAM (32 Bit, GPCM) */#define CFG_OR2_PRELIM  0xfff00d24#define CFG_BR3_PRELIM  0x80600401  /* Chip select for Display (8 Bit, GPCM) */#define CFG_OR3_PRELIM  0xffff8f44#define CFG_BR4_PRELIM  0xc05108c1  /* Chip select for Interbus MPM (16 Bit, UPMB) */#define CFG_OR4_PRELIM  0xffff0300#define CFG_BR5_PRELIM  0xc0500401  /* Chip select for Interbus Status (8 Bit, GPCM) */#define CFG_OR5_PRELIM  0xffff8db0/* * Memory Periodic Timer Prescaler * * The Divider for PTA (refresh timer) configuration is based on an * example SDRAM configuration (64 MBit, one bank). The adjustment to * the number of chip selects (NCS) and the actually needed refresh * rate is done by setting MPTPR. * * PTA is calculated from *	PTA = (gclk * Trefresh) / ((2 ^ (2 * DFBRG)) * PTP * NCS) * *	gclk	  CPU clock (not bus clock!) *	Trefresh  Refresh cycle * 4 (four word bursts used) * * 4096  Rows from SDRAM example configuration * 1000  factor s -> ms *   32  PTP (pre-divider from MPTPR) from SDRAM example configuration *    4  Number of refresh cycles per period *   64  Refresh cycle in ms per number of rows * -------------------------------------------- * Divider = 4096 * 32 * 1000 / (4 * 64) = 512000 * *  50 MHz =>  50.000.000 / Divider =  98 *  66 Mhz =>  66.000.000 / Divider = 129 *  80 Mhz =>  80.000.000 / Divider = 156 * 100 Mhz => 100.000.000 / Divider = 195 */#define CFG_PTA_PER_CLK	((4096 * 32 * 1000) / (4 * 64))#define CFG_MAMR_PTA	98/* * For 16 MBit, refresh rates could be 31.3 us * (= 64 ms / 2K = 125 / quad bursts). * For a simpler initialization, 15.6 us is used instead. * * #define CFG_MPTPR_2BK_2K	MPTPR_PTP_DIV32		for 2 banks * #define CFG_MPTPR_1BK_2K	MPTPR_PTP_DIV64		for 1 bank */#define CFG_MPTPR_2BK_4K	MPTPR_PTP_DIV16		/* setting for 2 banks	*/#define CFG_MPTPR_1BK_4K	MPTPR_PTP_DIV32		/* setting for 1 bank	*//* refresh rate 7.8 us (= 64 ms / 8K = 31.2 / quad bursts) for 256 MBit		*/#define CFG_MPTPR_2BK_8K	MPTPR_PTP_DIV8		/* setting for 2 banks	*/#define CFG_MPTPR_1BK_8K	MPTPR_PTP_DIV16		/* setting for 1 bank	*//* * MAMR settings for SDRAM *//* 8 column SDRAM */#define CFG_MAMR_8COL	((CFG_MAMR_PTA << MAMR_PTA_SHIFT)  | MAMR_PTAE	    |	\			 MAMR_AMA_TYPE_0 | MAMR_DSA_1_CYCL | MAMR_G0CLA_A11 |	\			 MAMR_RLFA_1X	 | MAMR_WLFA_1X	   | MAMR_TLFA_4X)/* 9 column SDRAM */#define CFG_MAMR_9COL	((CFG_MAMR_PTA << MAMR_PTA_SHIFT)  | MAMR_PTAE	    |	\			 MAMR_AMA_TYPE_1 | MAMR_DSA_1_CYCL | MAMR_G0CLA_A10 |	\			 MAMR_RLFA_1X	 | MAMR_WLFA_1X	   | MAMR_TLFA_4X)#define	CFG_MAMR_VAL	0x30904114	/* for SDRAM */#define	CFG_MBMR_VAL	0xff001111	/* for Interbus-MPM *//*----------------------------------------------------------------------- * I2C stuff *//* enable I2C and select the hardware/software driver */#undef	CONFIG_HARD_I2C			/* I2C with hardware support	*/#define	CONFIG_SOFT_I2C         1	/* I2C bit-banged		*/#define CFG_I2C_SPEED		93000	/* 93 kHz is supposed to work	*/#define CFG_I2C_SLAVE		0xFE#ifdef CONFIG_SOFT_I2C/* * Software (bit-bang) I2C driver configuration */#define PB_SCL		0x00000020	/* PB 26 */#define PB_SDA		0x00000010	/* PB 27 */#define I2C_INIT	(immr->im_cpm.cp_pbdir |=  PB_SCL)#define I2C_ACTIVE	(immr->im_cpm.cp_pbdir |=  PB_SDA)#define I2C_TRISTATE	(immr->im_cpm.cp_pbdir &= ~PB_SDA)#define I2C_READ	((immr->im_cpm.cp_pbdat & PB_SDA) != 0)#define I2C_SDA(bit)	if(bit) immr->im_cpm.cp_pbdat |=  PB_SDA; \			else    immr->im_cpm.cp_pbdat &= ~PB_SDA#define I2C_SCL(bit)	if(bit) immr->im_cpm.cp_pbdat |=  PB_SCL; \			else    immr->im_cpm.cp_pbdat &= ~PB_SCL#define I2C_DELAY	udelay(2)	/* 1/4 I2C clock duration */#endif	/* CONFIG_SOFT_I2C *//*----------------------------------------------------------------------- * I2C EEPROM (24C164) */#define CFG_I2C_EEPROM_ADDR	0x58	/* EEPROM AT24C164		*/#define CFG_I2C_EEPROM_ADDR_LEN	1#define CFG_EEPROM_PAGE_WRITE_DELAY_MS	10	/* takes up to 10 msec	*/#define CFG_EEPROM_PAGE_WRITE_BITS	4/* * Internal Definitions * * Boot Flags */#define	BOOTFLAG_COLD	0x01		/* Normal Power-On: Boot from FLASH	*/#define BOOTFLAG_WARM	0x02		/* Software reboot			*/#define	CONFIG_FEC_ENET		1	/* use FEC ethernet  */#define FEC_ENET#define CONFIG_MII#define CFG_DISCOVER_PHY	1#endif	/* __CONFIG_H */

⌨️ 快捷键说明

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