1 /* Coldfire C Header File
2 * Copyright Freescale Semiconductor Inc
5 * 2008/05/23 Revision: 0.95
7 * (c) Copyright UNIS, a.s. 1997-2008
12 * http : www.processorexpert.com
13 * mail : info@processorexpert.com
16 #ifndef __MCF52221_CFM_H__
17 #define __MCF52221_CFM_H__
20 /*********************************************************************
22 * ColdFire Flash Module (CFM)
24 *********************************************************************/
26 /* Register read/write macros */
27 #define MCF_CFM_CFMMCR (*(vuint16*)(0x401D0000))
28 #define MCF_CFM_CFMCLKD (*(vuint8 *)(0x401D0002))
29 #define MCF_CFM_CFMSEC (*(vuint32*)(0x401D0008))
30 #define MCF_CFM_CFMPROT (*(vuint32*)(0x401D0010))
31 #define MCF_CFM_CFMSACC (*(vuint32*)(0x401D0014))
32 #define MCF_CFM_CFMDACC (*(vuint32*)(0x401D0018))
33 #define MCF_CFM_CFMUSTAT (*(vuint8 *)(0x401D0020))
34 #define MCF_CFM_CFMCMD (*(vuint8 *)(0x401D0024))
35 #define MCF_CFM_CFMCLKSEL (*(vuint16*)(0x401D004A))
38 /* Bit definitions and macros for MCF_CFM_CFMMCR */
39 #define MCF_CFM_CFMMCR_KEYACC (0x20)
40 #define MCF_CFM_CFMMCR_CCIE (0x40)
41 #define MCF_CFM_CFMMCR_CBEIE (0x80)
42 #define MCF_CFM_CFMMCR_AEIE (0x100)
43 #define MCF_CFM_CFMMCR_PVIE (0x200)
44 #define MCF_CFM_CFMMCR_LOCK (0x400)
46 /* Bit definitions and macros for MCF_CFM_CFMCLKD */
47 #define MCF_CFM_CFMCLKD_DIV(x) (((x)&0x3F)<<0)
48 #define MCF_CFM_CFMCLKD_PRDIV8 (0x40)
49 #define MCF_CFM_CFMCLKD_DIVLD (0x80)
51 /* Bit definitions and macros for MCF_CFM_CFMSEC */
52 #define MCF_CFM_CFMSEC_SEC(x) (((x)&0xFFFF)<<0)
53 #define MCF_CFM_CFMSEC_SECSTAT (0x40000000)
54 #define MCF_CFM_CFMSEC_KEYEN (0x80000000)
56 /* Bit definitions and macros for MCF_CFM_CFMPROT */
57 #define MCF_CFM_CFMPROT_PROTECT(x) (((x)&0xFFFFFFFF)<<0)
59 /* Bit definitions and macros for MCF_CFM_CFMSACC */
60 #define MCF_CFM_CFMSACC_SUPV(x) (((x)&0xFFFFFFFF)<<0)
62 /* Bit definitions and macros for MCF_CFM_CFMDACC */
63 #define MCF_CFM_CFMDACC_DACC(x) (((x)&0xFFFFFFFF)<<0)
65 /* Bit definitions and macros for MCF_CFM_CFMUSTAT */
66 #define MCF_CFM_CFMUSTAT_BLANK (0x4)
67 #define MCF_CFM_CFMUSTAT_ACCERR (0x10)
68 #define MCF_CFM_CFMUSTAT_PVIOL (0x20)
69 #define MCF_CFM_CFMUSTAT_CCIF (0x40)
70 #define MCF_CFM_CFMUSTAT_CBEIF (0x80)
72 /* Bit definitions and macros for MCF_CFM_CFMCMD */
73 #define MCF_CFM_CFMCMD_CMD(x) (((x)&0x7F)<<0)
74 #define MCF_CFM_CFMCMD_BLANK_CHECK (0x5)
75 #define MCF_CFM_CFMCMD_PAGE_ERASE_VERIFY (0x6)
76 #define MCF_CFM_CFMCMD_WORD_PROGRAM (0x20)
77 #define MCF_CFM_CFMCMD_PAGE_ERASE (0x40)
78 #define MCF_CFM_CFMCMD_MASS_ERASE (0x41)
80 /* Bit definitions and macros for MCF_CFM_CFMCLKSEL */
81 #define MCF_CFM_CFMCLKSEL_CLKSEL(x) (((x)&0x3)<<0)
84 #endif /* __MCF52221_CFM_H__ */