📄 hymod.h
字号:
#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)#ifdef DEBUG#define CFG_HID0_FINAL 0#else#define CFG_HID0_FINAL (HID0_ICE|HID0_IFEM|HID0_ABE)#endif#define CFG_HID2 0/*----------------------------------------------------------------------- * RMR - Reset Mode Register 5-5 *----------------------------------------------------------------------- * turn on Checkstop Reset Enable */#ifdef DEBUG#define CFG_RMR 0#else#define CFG_RMR RMR_CSRE#endif/*----------------------------------------------------------------------- * BCR - Bus Configuration 4-25 *----------------------------------------------------------------------- */#define CFG_BCR (BCR_ETM)/*----------------------------------------------------------------------- * SIUMCR - SIU Module Configuration 4-31 *----------------------------------------------------------------------- */#define CFG_SIUMCR (SIUMCR_DPPC10|SIUMCR_L2CPC01|\ SIUMCR_APPC10|SIUMCR_MMR11)/*----------------------------------------------------------------------- * SYPCR - System Protection Control 4-35 * SYPCR can only be written once after reset! *----------------------------------------------------------------------- * Watchdog & Bus Monitor Timer max, 60x & Local Bus Monitor enable */#if defined(CONFIG_WATCHDOG)#define CFG_SYPCR (SYPCR_SWTC|SYPCR_BMT|SYPCR_PBME|SYPCR_LBME|\ SYPCR_SWRI|SYPCR_SWP|SYPCR_SWE)#else#define CFG_SYPCR (SYPCR_SWTC|SYPCR_BMT|SYPCR_PBME|SYPCR_LBME|\ SYPCR_SWRI|SYPCR_SWP)#endif /* CONFIG_WATCHDOG *//*----------------------------------------------------------------------- * 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 *----------------------------------------------------------------------- * Ensure DFBRG is Divide by 16 */#define CFG_SCCR (SCCR_DFBRG01)/*----------------------------------------------------------------------- * RCCR - RISC Controller Configuration 13-7 *----------------------------------------------------------------------- */#define CFG_RCCR 0/* * Init Memory Controller: * * Bank Bus Machine PortSz Device * ---- --- ------- ------ ------ * 0 60x GPCM 32 bit FLASH * 1 60x GPCM 32 bit FLASH (same as 0 - unused for now) * 2 60x SDRAM 64 bit SDRAM * 3 Local UPMC 8 bit Main Xilinx configuration * 4 Local GPCM 32 bit Main Xilinx register mode * 5 Local UPMB 32 bit Main Xilinx port mode * 6 Local UPMC 8 bit Mezz Xilinx configuration *//* * Bank 0 - FLASH * * Quotes from the HYMOD IO Board Reference manual: * * "The flash memory is two Intel StrataFlash chips, each configured for * 16 bit operation and connected to give a 32 bit wide port." * * "The chip select logic is configured to respond to both *CS0 and *CS1. * Therefore the FLASH memory will be mapped to both bank 0 and bank 1. * It is suggested that bank 0 be read-only and bank 1 be read/write. The * FLASH will then appear as ROM during boot." * * Initially, we are only going to use bank 0 in read/write mode. *//* 32 bit, read-write, GPCM on 60x bus */#define CFG_BR0_PRELIM ((CFG_FLASH_BASE&BRx_BA_MSK)|\ BRx_PS_32|BRx_MS_GPCM_P|BRx_V)/* up to 32 Mb */#define CFG_OR0_PRELIM (MEG_TO_AM(32)|ORxG_CSNT|ORxG_ACS_DIV2|ORxG_SCY_10_CLK)/* * Bank 2 - SDRAM * * Quotes from the HYMOD IO Board Reference manual: * * "The main memory is implemented using TC59SM716FTL-10 SDRAM and has a * fixed size of 64 Mbytes. The Toshiba TC59SM716FTL-10 is a CMOS synchronous * dynamic random access memory organised as 4 banks by 4096 rows by 512 * columns by 16 bits. Four chips provide a 64-bit port on the 60x bus." * * "The locations in SDRAM are accessed using multiplexed address pins to * specify row and column. The pins also act to specify commands. The state * of the inputs *RAS, *CAS and *WE defines the required action. The a10/AP * pin may function as a row address or as the AUTO PRECHARGE control line, * depending on the cycle type. The 60x bus SDRAM machine allows the MPC8260 * address lines to be configured to the required multiplexing scheme." */#define CFG_SDRAM_SIZE 64/* 64 bit, read-write, SDRAM on 60x bus */#define CFG_BR2_PRELIM ((CFG_SDRAM_BASE&BRx_BA_MSK)|\ BRx_PS_64|BRx_MS_SDRAM_P|BRx_V)/* 64 Mb, 4 int banks per dev, row start addr bit = A6, 12 row addr lines */#define CFG_OR2_PRELIM (MEG_TO_AM(CFG_SDRAM_SIZE)|\ ORxS_BPD_4|ORxS_ROWST_PBI1_A6|ORxS_NUMR_12)/* * The 60x Bus SDRAM Mode Register (PDSMR) is set as follows: * * Page Based Interleaving, Refresh Enable, Address Multiplexing where A5 * is output on A16 pin (A6 on A17, and so on), use address pins A14-A16 * as bank select, A7 is output on SDA10 during an ACTIVATE command, * earliest timing for ACTIVATE command after REFRESH command is 6 clocks, * earliest timing for ACTIVATE or REFRESH command after PRECHARGE command * is 2 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_PBI|PSDMR_SDAM_A16_IS_A5|\ PSDMR_BSMA_A14_A16|PSDMR_SDA10_PBI1_A7|\ PSDMR_RFRC_6_CLK|PSDMR_PRETOACT_2W|\ PSDMR_ACTTORW_2W|PSDMR_LDOTOPRE_1C|\ PSDMR_WRC_1C|PSDMR_CL_2)/* * The 60x bus-assigned SDRAM Refresh Timer (PSRT) (10-31) and the Refresh * Timers Prescale (PTP) value in the Memory Refresh Timer Prescaler Register * (MPTPR) (10-32) must also be set up (it used to be called the Periodic Timer * Prescaler, hence the P instead of the R). The refresh timer period is given * by (note that there was a change in the 8260 UM Errata): * * TimerPeriod = (PSRT + 1) / Fmptc * * where Fmptc is the BusClock divided by PTP. i.e. * * TimerPeriod = (PSRT + 1) / (BusClock / PTP) * * or * * TImerPeriod = (PTP * (PSRT + 1)) / BusClock * * The requirement for the Toshiba TC59SM716FTL-10 is that there must be * 4K refresh cycles every 64 ms. i.e. one refresh cycle every 64000/4096 * = 15.625 usecs. * * So PTP * (PSRT + 1) <= 15.625 * BusClock. At 66.666MHz, PSRT=31 and PTP=32 * appear to be reasonable. */#ifdef DEBUG#define CFG_PSRT 39#define CFG_MPTPR MPTPR_PTP_DIV8#else#define CFG_PSRT 31#define CFG_MPTPR MPTPR_PTP_DIV32#endif/* * Banks 3,4,5 and 6 - FPGA access * * Quotes from the HYMOD IO Board Reference manual: * * "The IO Board is fitted with a Xilinx XCV300E main FPGA. Provision is made * for configuring an optional FPGA on the mezzanine interface. * * Access to the FPGAs may be divided into several catagories: * * 1. Configuration * 2. Register mode access * 3. Port mode access * * The main FPGA is supported for modes 1, 2 and 3. The mezzanine FPGA can be * configured only (mode 1). Consequently there are four access types. * * To improve interface performance and simplify software design, the four * possible access types are separately mapped to different memory banks. * * All are accessed using the local bus." * * Device Mode Memory Bank Machine Port Size Access * * Main Configuration 3 UPMC 8bit R/W * Main Register 4 GPCM 32bit R/W * Main Port 5 UPMB 32bit R/W * Mezzanine Configuration 6 UPMC 8bit W/O * * "Note that mezzanine mode 1 access is write-only." *//* all the bank sizes must be a power of two, greater or equal to 32768 */#define FPGA_MAIN_CFG_BASE (CFG_FPGA_BASE)#define FPGA_MAIN_CFG_SIZE 32768#define FPGA_MAIN_REG_BASE (FPGA_MAIN_CFG_BASE + FPGA_MAIN_CFG_SIZE)#define FPGA_MAIN_REG_SIZE 32768#define FPGA_MAIN_PORT_BASE (FPGA_MAIN_REG_BASE + FPGA_MAIN_REG_SIZE)#define FPGA_MAIN_PORT_SIZE 32768#define FPGA_MEZZ_CFG_BASE (FPGA_MAIN_PORT_BASE + FPGA_MAIN_PORT_SIZE)#define FPGA_MEZZ_CFG_SIZE 32768/* 8 bit, read-write, UPMC */#define CFG_BR3_PRELIM (FPGA_MAIN_CFG_BASE|BRx_PS_8|BRx_MS_UPMC|BRx_V)/* up to 32Kbyte, burst inhibit */#define CFG_OR3_PRELIM (P2SZ_TO_AM(FPGA_MAIN_CFG_SIZE)|ORxU_BI)/* 32 bit, read-write, GPCM */#define CFG_BR4_PRELIM (FPGA_MAIN_REG_BASE|BRx_PS_32|BRx_MS_GPCM_L|BRx_V)/* up to 32Kbyte */#define CFG_OR4_PRELIM (P2SZ_TO_AM(FPGA_MAIN_REG_SIZE))/* 32 bit, read-write, UPMB */#define CFG_BR5_PRELIM (FPGA_MAIN_PORT_BASE|BRx_PS_32|BRx_MS_UPMB|BRx_V)/* up to 32Kbyte */#define CFG_OR5_PRELIM (P2SZ_TO_AM(FPGA_MAIN_PORT_SIZE)|ORxU_BI)/* 8 bit, write-only, UPMC */#define CFG_BR6_PRELIM (FPGA_MEZZ_CFG_BASE|BRx_PS_8|BRx_MS_UPMC|BRx_V)/* up to 32Kbyte, burst inhibit */#define CFG_OR6_PRELIM (P2SZ_TO_AM(FPGA_MEZZ_CFG_SIZE)|ORxU_BI)/*----------------------------------------------------------------------- * MBMR - Machine B Mode 10-27 *----------------------------------------------------------------------- */#define CFG_MBMR (MxMR_BSEL|MxMR_OP_NORM) /* XXX - needs more *//*----------------------------------------------------------------------- * MCMR - Machine C Mode 10-27 *----------------------------------------------------------------------- */#define CFG_MCMR (MxMR_BSEL|MxMR_DSx_2_CYCL) /* XXX - needs more *//* * FPGA I/O Port/Bit information */#define FPGA_MAIN_PROG_PORT IOPIN_PORTA#define FPGA_MAIN_PROG_PIN 4 /* PA4 */#define FPGA_MAIN_INIT_PORT IOPIN_PORTA#define FPGA_MAIN_INIT_PIN 5 /* PA5 */#define FPGA_MAIN_DONE_PORT IOPIN_PORTA#define FPGA_MAIN_DONE_PIN 6 /* PA6 */#define FPGA_MEZZ_PROG_PORT IOPIN_PORTA#define FPGA_MEZZ_PROG_PIN 0 /* PA0 */#define FPGA_MEZZ_INIT_PORT IOPIN_PORTA#define FPGA_MEZZ_INIT_PIN 1 /* PA1 */#define FPGA_MEZZ_DONE_PORT IOPIN_PORTA#define FPGA_MEZZ_DONE_PIN 2 /* PA2 */#define FPGA_MEZZ_ENABLE_PORT IOPIN_PORTA#define FPGA_MEZZ_ENABLE_PIN 3 /* PA3 *//* * 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 + -