
28.5.4.2.5 Access Check Evaluation
The flash controller FAC provides a cycle-by-cycle evaluation of the access rights for
each data transaction routed to the on-chip flash memory.
The entire flash storage capacity is partitioned into equal sized segments. Two registers
include a supervisor-only access control indicator and a execute-only access control
indicator for each segment.
The FAC logic performs the required access control evaluation using the reference
address and a 2-bit attribute (or "protection" field) as inputs from the bus cycle plus the
contents of the programming model registers.
The following code example illustrates C code for FAC evaluation:
unsigned long long sacc; // supervisor-only map
unsigned long long xacc; // execute-only map
unsigned int seg_size; // 8-bit segment size
unsigned int fac_error;
fac_evaluation (addr, prot)
unsigned int addr; // access address
unsigned int hprot; // encoded 2-bit "protection" field {supv, data}
{
unsigned int sacc_flag; // sacc flag for this segment
unsigned int xacc_flag; // xacc flag for this segment
unsigned int i; // segment index
i = (addr >> (8 + seg_size & 0x0f)) & 0x3f; // form 6-bit segment index
sacc_flag = (sacc >> i) & 1; // extract sacc bit for this segment
xacc_flag = (xacc >> i) & 1; // extract xacc bit for this segment
// create a 4-tuple concatenating the 2-bit protection field + {sacc, xacc} flags
switch ((hprot & 3) << 2 | (sacc_flag << 1) | xacc_flag) {
// all these combinations are allowed accesses
case 0x2: // {user, ifetch} && {supv+user, ifetch-only}
case 0x3: // {user, ifetch} && {supv+user, data}
case 0x7: // {user, data} && {supv+user, data}
case 0x8: // {supv, ifetch} && {supv-only, ifetch-only}
case 0x9: // {supv, ifetch} && {supv-only, data}
case 0xa: // {supv, ifetch} && {supv+user, ifetch-only}
case 0xb: // {supv, ifetch} && {supv+user, data}
case 0xd: // {supv, data} && {supv-only, data}
case 0xf: // {supv, data} && {supv+user, data}
fac_error = 00;
break;
// all these combinations are unallowed, that is, errored accesses
case 0x0: // {user, ifetch} && {supv-only, ifetch-only}
case 0x1: // {user, ifetch} && {supv-only, data}
case 0x4: // {user, data} && {supv-only, ifetch-only}
case 0x5: // {user, data} && {supv-only, data}
case 0x6: // {user, data} && {supv+user, ifetch-only}
case 0xc: // {supv, data} && {supv-only, ifetch-only}
case 0xe: // {supv, data} && {supv+user, ifetch-only}
fac_error = 1;
break;
} // switch()
} // fac_evaluation()
Functional description
K22F Sub-Family Reference Manual, Rev. 4, 08/2016
626
NXP Semiconductors
Содержание K22F series
Страница 2: ...K22F Sub Family Reference Manual Rev 4 08 2016 2 NXP Semiconductors...
Страница 150: ...Private Peripheral Bus PPB memory map K22F Sub Family Reference Manual Rev 4 08 2016 150 NXP Semiconductors...
Страница 168: ...Module clocks K22F Sub Family Reference Manual Rev 4 08 2016 168 NXP Semiconductors...
Страница 198: ...Security Interactions with other Modules K22F Sub Family Reference Manual Rev 4 08 2016 198 NXP Semiconductors...
Страница 258: ...Functional description K22F Sub Family Reference Manual Rev 4 08 2016 258 NXP Semiconductors...
Страница 292: ...Functional description K22F Sub Family Reference Manual Rev 4 08 2016 292 NXP Semiconductors...
Страница 398: ...Functional description K22F Sub Family Reference Manual Rev 4 08 2016 398 NXP Semiconductors...
Страница 628: ...Initialization and application information K22F Sub Family Reference Manual Rev 4 08 2016 628 NXP Semiconductors...
Страница 740: ...Initialization Application Information K22F Sub Family Reference Manual Rev 4 08 2016 740 NXP Semiconductors...
Страница 750: ...Functional description K22F Sub Family Reference Manual Rev 4 08 2016 750 NXP Semiconductors...
Страница 816: ...Application information K22F Sub Family Reference Manual Rev 4 08 2016 816 NXP Semiconductors...
Страница 866: ...Initialization Application Information K22F Sub Family Reference Manual Rev 4 08 2016 866 NXP Semiconductors...
Страница 890: ...Application information K22F Sub Family Reference Manual Rev 4 08 2016 890 NXP Semiconductors...
Страница 1028: ...Initialization Procedure K22F Sub Family Reference Manual Rev 4 08 2016 1028 NXP Semiconductors...
Страница 1040: ...Example configuration for chained timers K22F Sub Family Reference Manual Rev 4 08 2016 1040 NXP Semiconductors...
Страница 1118: ...Device mode IRC48 operation K22F Sub Family Reference Manual Rev 4 08 2016 1118 NXP Semiconductors...
Страница 1122: ...USB Voltage Regulator Module Signal Descriptions K22F Sub Family Reference Manual Rev 4 08 2016 1122 NXP Semiconductors...
Страница 1180: ...Initialization application information K22F Sub Family Reference Manual Rev 4 08 2016 1180 NXP Semiconductors...
Страница 1302: ...Application information K22F Sub Family Reference Manual Rev 4 08 2016 1302 NXP Semiconductors...
Страница 1374: ...Functional description K22F Sub Family Reference Manual Rev 4 08 2016 1374 NXP Semiconductors...