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

📄 mcf5407.h

📁 motorola 针对coldfire 5275 评估板的Dbug bootloader源程序
💻 H
📖 第 1 页 / 共 5 页
字号:
#define MCF5407_CS_CSCR_PS_16   (0x0080)        /* Port Size:  16-bit */        
#define MCF5407_CS_CSCR_PS_32   (0x0000)        /* Port Size:  32-bit */        
#define MCF5407_CS_CSCR_BEM     (0x0020)        /* Byte Module Enable */        
#define MCF5407_CS_CSCR_BSTR    (0x0010)        /* Burst Read Enable */     
#define MCF5407_CS_CSCR_BSTW    (0x0008)        /* Burst Write Enable */        

/**********************************************************************/
/*  Parallel Port (General Purpose I/O) Module, PP                    */
/**********************************************************************/

/* Offsets of the registers from the MBAR */ 
#define MCF5407_PP_PADDR        (0x0244)
#define MCF5407_PP_PADAT        (0x0248)

/* Read access macros for general use */ 
#define MCF5407_RD_PP_PADDR(IMMP)   Mcf5407_iord(IMMP,MCF5407_PP_PADDR,16)
#define MCF5407_RD_PP_PADAT(IMMP)   Mcf5407_iord(IMMP,MCF5407_PP_PADAT,16)

/* Write access macros for general use */
#define MCF5407_WR_PP_PADDR(IMMP,DATA)  \
    Mcf5407_iowr(IMMP,MCF5407_PP_PADDR,16,DATA)
#define MCF5407_WR_PP_PADAT(IMMP,DATA)  \
    Mcf5407_iowr(IMMP,MCF5407_PP_PADAT,16,DATA)

#define MCF5407_PP_PADDR_15 (0x8000)    /* Bit 15 General I/O Output */ 
#define MCF5407_PP_PADDR_14 (0x4000)    /* Bit 14 General I/O Output */ 
#define MCF5407_PP_PADDR_13 (0x2000)    /* Bit 13 General I/O Output */ 
#define MCF5407_PP_PADDR_12 (0x1000)    /* Bit 12 General I/O Output */ 
#define MCF5407_PP_PADDR_11 (0x0800)    /* Bit 11 General I/O Output */ 
#define MCF5407_PP_PADDR_10 (0x0400)    /* Bit 10 General I/O Output */ 
#define MCF5407_PP_PADDR_9  (0x0200)    /* Bit  9 General I/O Output */ 
#define MCF5407_PP_PADDR_8  (0x0100)    /* Bit  8 General I/O Output */ 
#define MCF5407_PP_PADDR_7  (0x0080)    /* Bit  7 General I/O Output */ 
#define MCF5407_PP_PADDR_6  (0x0040)    /* Bit  6 General I/O Output */ 
#define MCF5407_PP_PADDR_5  (0x0020)    /* Bit  5 General I/O Output */ 
#define MCF5407_PP_PADDR_4  (0x0010)    /* Bit  4 General I/O Output */ 
#define MCF5407_PP_PADDR_3  (0x0008)    /* Bit  3 General I/O Output */ 
#define MCF5407_PP_PADDR_2  (0x0004)    /* Bit  2 General I/O Output */ 
#define MCF5407_PP_PADDR_1  (0x0002)    /* Bit  1 General I/O Output */ 
#define MCF5407_PP_PADDR_0  (0x0001)    /* Bit  0 General I/O Output */ 

#define MCF5407_PP_PADAT_15 (0x8000)    /* Bit 15 Current Status */
#define MCF5407_PP_PADAT_14 (0x4000)    /* Bit 14 Current Status */ 
#define MCF5407_PP_PADAT_13 (0x2000)    /* Bit 13 Current Status */ 
#define MCF5407_PP_PADAT_12 (0x1000)    /* Bit 12 Current Status */ 
#define MCF5407_PP_PADAT_11 (0x0800)    /* Bit 11 Current Status */ 
#define MCF5407_PP_PADAT_10 (0x0400)    /* Bit 10 Current Status */ 
#define MCF5407_PP_PADAT_9  (0x0200)    /* Bit  9 Current Status */ 
#define MCF5407_PP_PADAT_8  (0x0100)    /* Bit  8 Current Status */ 
#define MCF5407_PP_PADAT_7  (0x0080)    /* Bit  7 Current Status */ 
#define MCF5407_PP_PADAT_6  (0x0040)    /* Bit  6 Current Status */ 
#define MCF5407_PP_PADAT_5  (0x0020)    /* Bit  5 Current Status */ 
#define MCF5407_PP_PADAT_4  (0x0010)    /* Bit  4 Current Status */ 
#define MCF5407_PP_PADAT_3  (0x0008)    /* Bit  3 Current Status */ 
#define MCF5407_PP_PADAT_2  (0x0004)    /* Bit  2 Current Status */ 
#define MCF5407_PP_PADAT_1  (0x0002)    /* Bit  1 Current Status */ 
#define MCF5407_PP_PADAT_0  (0x0001)    /* Bit  0 Current Status */ 

/**********************************************************************/
/*  DRAM Controller Module, DRAMC                                     */
/**********************************************************************/

/* Offsets of the registers from the MBAR */
#define MCF5407_DRAMC_DCR   (0x0100)
#define MCF5407_DRAMC_DACR0 (0x0108)
#define MCF5407_DRAMC_DMR0  (0x010C)
#define MCF5407_DRAMC_DACR1 (0x0110)
#define MCF5407_DRAMC_DMR1  (0x0114)

/* Read access macros for general use */
#define MCF5407_RD_DRAMC_DCR(IMMP)      \
    Mcf5407_iord(IMMP,MCF5407_DRAMC_DCR,16)
#define MCF5407_RD_DRAMC_DACR0(IMMP)    \
    Mcf5407_iord(IMMP,MCF5407_DRAMC_DACR0,32)
#define MCF5407_RD_DRAMC_DMR0(IMMP)     \
    Mcf5407_iord(IMMP,MCF5407_DRAMC_DMR0,32)
#define MCF5407_RD_DRAMC_DACR1(IMMP)    \
    Mcf5407_iord(IMMP,MCF5407_DRAMC_DACR1,32)
#define MCF5407_RD_DRAMC_DMR1(IMMP)     \
    Mcf5407_iord(IMMP,MCF5407_DRAMC_DMR1,32)

/* Write access macros for general use */
#define MCF5407_WR_DRAMC_DCR(IMMP,DATA)     \
    Mcf5407_iowr(IMMP,MCF5407_DRAMC_DCR,16,DATA)
#define MCF5407_WR_DRAMC_DACR0(IMMP,DATA)   \
    Mcf5407_iowr(IMMP,MCF5407_DRAMC_DACR0,32,DATA)
#define MCF5407_WR_DRAMC_DMR0(IMMP,DATA)    \
    Mcf5407_iowr(IMMP,MCF5407_DRAMC_DMR0,32,DATA)
#define MCF5407_WR_DRAMC_DACR1(IMMP,DATA)   \
    Mcf5407_iowr(IMMP,MCF5407_DRAMC_DACR1,32,DATA)
#define MCF5407_WR_DRAMC_DMR1(IMMP,DATA)    \
    Mcf5407_iowr(IMMP,MCF5407_DRAMC_DMR1,32,DATA)

/* Controls used by both Synchronous and Asynchronous DRAM */           
#define MCF5407_DRAMC_DCR_SO            (0x8000)        /* Synchronous Operation */ 
#define MCF5407_DRAMC_DCR_NAM           (0x2000)        /* No Address Multiplexing */   
#define MCF5407_DRAMC_DCR_RC(a)         ((a)&0x01FF)    /* Refresh Count */         

#define MCF5407_DRAMC_DACR_BASE(a)      ((a)&0xFFFC0000) /* Base Address */         
#define MCF5407_DRAMC_DACR_RE           (0x00008000)    /* Refresh Enable */            
#define MCF5407_DRAMC_DACR_PS_32        (0x00000000)    /* Port Size:  32-bit */        
#define MCF5407_DRAMC_DACR_PS_8         (0x00000010)    /* Port Size:   8-bit */        
#define MCF5407_DRAMC_DACR_PS_16        (0x00000020)    /* Port Size:  16-bit */        

#define MCF5407_DRAMC_DCMR_MASK_4G      (0xFFFC0000)    /* DRAM Size of 4G */           
#define MCF5407_DRAMC_DCMR_MASK_2G      (0x7FFC0000)    /* DRAM Size of 2G */           
#define MCF5407_DRAMC_DCMR_MASK_1G      (0x3FFC0000)    /* DRAM Size of 1G */           
#define MCF5407_DRAMC_DCMR_MASK_1024M   (0x3FFC0000)    /* DRAM Size of 1024M */    
#define MCF5407_DRAMC_DCMR_MASK_512M    (0x1FFC0000)    /* DRAM Size of 512M */ 
#define MCF5407_DRAMC_DCMR_MASK_256M    (0x0FFC0000)    /* DRAM Size of 256M */ 
#define MCF5407_DRAMC_DCMR_MASK_128M    (0x07FC0000)    /* DRAM Size of 128M */ 
#define MCF5407_DRAMC_DCMR_MASK_64M     (0x03FC0000)    /* DRAM Size of 64M */          
#define MCF5407_DRAMC_DCMR_MASK_32M     (0x01FC0000)    /* DRAM Size of 32M */          
#define MCF5407_DRAMC_DCMR_MASK_16M     (0x00FC0000)    /* DRAM Size of 16M */      
#define MCF5407_DRAMC_DCMR_MASK_8M      (0x007C0000)    /* DRAM Size of 8M */           
#define MCF5407_DRAMC_DCMR_MASK_4M      (0x003C0000)    /* DRAM Size of 4M */           
#define MCF5407_DRAMC_DCMR_MASK_2M      (0x001C0000)    /* DRAM Size of 2M */           
#define MCF5407_DRAMC_DCMR_MASK_1M      (0x000C0000)    /* DRAM Size of 1M */           
#define MCF5407_DRAMC_DCMR_MASK_1024K   (0x00040000)    /* DRAM Size of 1024K */        
#define MCF5407_DRAMC_DCMR_MASK_512K    (0x00000000)    /* DRAM Size of 512K */     
#define MCF5407_DRAMC_DCMR_WP           (0x00000100)    /* Write Protect */     
#define MCF5407_DRAMC_DCMR_CPU          (0x00000040)    /* CPU Space Ignored */     
#define MCF5407_DRAMC_DCMR_AM           (0x00000020)    /* Alternate Master Ignored */  
#define MCF5407_DRAMC_DCMR_SC           (0x00000010)    /* Supervisor Code Ignored */   
#define MCF5407_DRAMC_DCMR_SD           (0x00000008)    /* Supervisor Data Ignored */   
#define MCF5407_DRAMC_DCMR_UC           (0x00000004)    /* User Code Ignored */     
#define MCF5407_DRAMC_DCMR_UD           (0x00000002)    /* User Data Ignored */     
#define MCF5407_DRAMC_DCMR_V            (0x00000001)    /* Valid Register */        

/* Controls used only by Asynchronous DRAM*/                
#define MCF5407_DRAMC_DCR_RRA_2         (0x0000)        /* Refresh RAS Asserted 2 Clocks */ 
#define MCF5407_DRAMC_DCR_RRA_3         (0x0800)        /* Refresh RAS Asserted 3 Clocks */ 
#define MCF5407_DRAMC_DCR_RRA_4         (0x1000)        /* Refresh RAS Asserted 4 Clocks */ 
#define MCF5407_DRAMC_DCR_RRA_5         (0x1800)        /* Refresh RAS Asserted 5 Clocks */ 
#define MCF5407_DRAMC_DCR_RRP_1         (0x0000)        /* Refresh RAS Precharged 3 Clks */ 
#define MCF5407_DRAMC_DCR_RRP_2         (0x0200)        /* Refresh RAS Precharged 3 Clks */ 
#define MCF5407_DRAMC_DCR_RRP_3         (0x0400)        /* Refresh RAS Precharged 3 Clks */ 
#define MCF5407_DRAMC_DCR_RRP_4         (0x0600)        /* Refresh RAS Precharged 3 Clks */ 

#define MCF5407_DRAMC_DACR_CAS_1        (0x00000000)    /* CAS Active 1 Clock */        
#define MCF5407_DRAMC_DACR_CAS_2        (0x00001000)    /* CAS Active 2 Clocks */       
#define MCF5407_DRAMC_DACR_CAS_3        (0x00002000)    /* CAS Active 3 Clocks */       
#define MCF5407_DRAMC_DACR_CAS_4        (0x00003000)    /* CAS Active 4 Clocks */       
#define MCF5407_DRAMC_DACR_RP_1         (0x00000000)    /* RAS Precharge 1 Clock */     
#define MCF5407_DRAMC_DACR_RP_2         (0x00000400)    /* RAS Precharge 2 Clocks */    
#define MCF5407_DRAMC_DACR_RP_3         (0x00000800)    /* RAS Precharge 3 Clocks */
#define MCF5407_DRAMC_DACR_RP_4         (0x00000C00)    /* RAS Precharge 4 Clocks */    
#define MCF5407_DRAMC_DACR_RNCN         (0x00000200)    /* RAS Negate to CAS Negate  */
#define MCF5407_DRAMC_DACR_RCD_1        (0x00000000)    /* 1 Clock Between RAS and CAS */   
#define MCF5407_DRAMC_DACR_RCD_2        (0x00000100)    /* 2 Clocks Between RAS and CAS */
#define MCF5407_DRAMC_DACR_EDO          (0x00000040)    /* Extended Data Out */
#define MCF5407_DRAMC_DACR_PM_OFF       (0x00000000)    /* No Page Mode */  
#define MCF5407_DRAMC_DACR_PM_BURST     (0x00000004)    /* Page Mode on Burst Only */
#define MCF5407_DRAMC_DACR_PM_ON        (0x0000000C)    /* Continuous Page Mode */

/*  Controls used only by Synchronous DRAM */
#define MCF5407_DRAMC_DCR_COC       (0x1000) /* Command on Clock Enable */
#define MCF5407_DRAMC_DCR_IS        (0x0800) /* Initiate Self Refresh Command */
#define MCF5407_DRAMC_DCR_RTIM_3    (0x0000) /* 3 Clocks Between REF and ACTV Cmds */
#define MCF5407_DRAMC_DCR_RTIM_6    (0x0200) /* 6 Clocks Between REF and ACTV Cmds */
#define MCF5407_DRAMC_DCR_RTIM_9    (0x0400) /* 9 Clocks Between REF and ACTV Cmds */

#define MCF5407_DRAMC_DACR_CASL_1   (0x00000000) /* 1 Clock From CAS to Data */
#define MCF5407_DRAMC_DACR_CASL_2   (0x00001000) /* 2 Clock From CAS to Data */ 
#define MCF5407_DRAMC_DACR_CASL_3   (0x00002000) /* 3 Clock From CAS to Data */ 
#define MCF5407_DRAMC_DACR_CBM(a)   (((a)&0x00000007)<<8) /* Command and Bank Mux */
#define MCF5407_DRAMC_DACR_IMRS     (0x00000040) /* Initiate Mode Register Set Cmd */
#define MCF5407_DRAMC_DACR_IP       (0x00000008) /* Initiate Precharge All Command */
#define MCF5407_DRAMC_DACR_PM       (0x00000004) /* Continuous Page Mode */

/**********************************************************************/
/*  UART Module, UART                                                 */
/**********************************************************************/

#define MCF5407_UART0_UMR       (0x01C0)
#define MCF5407_UART0_USR       (0x01C4)
#define MCF5407_UART0_UCSR      (0x01C4)
#define MCF5407_UART0_UCR       (0x01C8)
#define MCF5407_UART0_URB       (0x01CC)
#define MCF5407_UART0_UTB       (0x01CC)
#define MCF5407_UART0_UIPCR     (0x01D0)
#define MCF5407_UART0_UACR      (0x01D0)
#define MCF5407_UART0_UISR      (0x01D4)
#define MCF5407_UART0_UIMR      (0x01D4)
#define MCF5407_UART0_UBG1      (0x01D8)
#define MCF5407_UART0_UBG2      (0x01DC)
#define MCF5407_UART0_UIVR      (0x01F0)
#define MCF5407_UART0_UIP       (0x01F4)
#define MCF5407_UART0_UOP1      (0x01F8)
#define MCF5407_UART0_UOP0      (0x01FC)

#define MCF5407_UART1_UMR       (0x0200)
#define MCF5407_UART1_RXLVL     (0x0201)   
#define MCF5407_UART1_MODCTL    (0x0202)   
#define MCF5407_UART1_TXLVL     (0x0203)   
#define MCF5407_UART1_USR       (0x0204)
#define MCF5407_UART1_UCSR      (0x0204)
#define MCF5407_UART1_RSMP      (0x0206)   
#define MCF5407_UART1_TSPC      (0x0207)   
#define MCF5407_UART1_UCR       (0x0208)
#define MCF5407_UART1_URB       (0x020C)
#define MCF5407_UART1_UTB       (0x020C)
#define MCF5407_UART1_UIPCR     (0x0210)
#define MCF5407_UART1_UACR      (0x0210)
#define MCF5407_UART1_UISR      (0x0214)
#define MCF5407_UART1_UIMR      (0x0214)
#define MCF5407_UART1_UBG1      (0x0218)
#define MCF5407_UART1_UBG2      (0x021C)
#define MCF5407_UART1_UIVR      (0x0230)
#define MCF5407_UART1_UIP       (0x0234)
#define MCF5407_UART1_UOP1      (0x0238)
#define MCF5407_UART1_UOP0      (0x023C)

/* Read access macros for general use */
#define MCF5407_RD_UART0_UMR(IMMP)      Mcf5407_iord(IMMP,MCF5407_UART0_UMR,8)
#define MCF5407_RD_UART0_USR(IMMP)      Mcf5407_iord(IMMP,MCF5407_UART0_USR,8)
#define MCF5407_RD_UART0_URB(IMMP)      Mcf5407_iord(IMMP,MCF5407_UART0_URB,8)
#define MCF5407_RD_UART0_UIPCR(IMMP)    Mcf5407_iord(IMMP,MCF5407_UART0_UIPCR,8)
#define MCF5407_RD_UART0_UISR(IMMP)     Mcf5407_iord(IMMP,MCF5407_UART0_UISR,8)
#define MCF5407_RD_UART0_UBG1(IMMP)     Mcf5407_iord(IMMP,MCF5407_UART0_UBG1,8)
#define MCF5407_RD_UART0_UBG2(IMMP)     Mcf5407_iord(IMMP,MCF5407_UART0_UBG2,8)
#define MCF5407_RD_UART0_UIVR(IMMP)     Mcf5407_iord(IMMP,MCF5407_UART0_UIVR,8)
#define MCF5407_RD_UART0_UIP(IMMP)      Mcf5407_iord(IMMP,MCF5407_UART0_UIP,8)

#define MCF5407_RD_UART1_UMR(IMMP)      Mcf5407_iord(IMMP,MCF5407_UART1_UMR,8)
#define MCF5407_RD_UART1_RXLVL(IMMP)    Mcf5407_iord(IMMP,MCF5407_UART1_RXLVL,8)   

⌨️ 快捷键说明

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