![Freescale Semiconductor MPC5632M Скачать руководство пользователя страница 955](http://html.mh-extra.com/html/freescale-semiconductor/mpc5632m/mpc5632m_manual_2330659955.webp)
MPC563XM Reference Manual, Rev. 1
Freescale Semiconductor
955
Preliminary—Subject to Change Without Notice
23.6.4
MISC Algorithm
The MISC generator is based on the following polynomial:
G(x) = 1 + x
1
+ x
2
+ x
22
+ x
31
(equivalent to feedback mask = 0x80400007)
The MISC signature generation starts by clearing the MISC Accumulator value to 0 and preloading the
MISC Counter with the highest SCM address. It then steps through each address decrementing the counter,
reading 32 bit values and following the algorithm below:
If the least significant bit in MISC is 1 then
MISC = MISC right shifted by 1 bit
MISC = MISC XOR 0x80400007
else
MISC = MISC right shifted by 1 bit
end if
MISC = MISC XOR RAM data
The code example below shows an excerpt of C code that calculates the MISC signature for a given array
of data, based on the previous algorithm:
#define SCM_size (MAX_SCM_ADDRESS / 4) /* last byte address - converted to 32-bit word */
#define POLY 0x80400007 /* G(x) = 1 + x
1
+ x
2
+ x
22
+ x
31
*/
/*******************************************************************************
FUNCTION : void calc_misc()
PURPOSE : This function calculates the MISC value.
INPUTS NOTES : none
RETURNS NOTES : MISC value
GENERAL NOTES : the array ’unsigned int data[]’ represents the actual memory
array, organized in 32-bit words.
*******************************************************************************/
unsigned int calc_misc (void)
{
int j; /* loop counter */
unsigned int misc = 0;
for (j = (SCM_size-1); j >= 0 ; j--) { /* SCM_size has the number of 32-bit words in SCM */
if (misc & 0x1) {
misc >>= 1;
misc ^= POLY;
}
else {
misc >>= 1;
}
misc ^= data[j]; /* data[j] is the actual 32-bit word taken from the SCM array */
}
return (misc); /* final signature calculated */
};
The value calculated by this algorithm must be loaded into register ETPUMISCCMPR prior to activating
the SCM MISC calculator in eTPU. Once the MISC calculator is activated (bit SCMMISEN in register
Содержание MPC5632M
Страница 22: ...MPC563XM Reference Manual Rev 1 22 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 62: ...MPC563XM Reference Manual Rev 1 62 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 92: ...MPC563XM Reference Manual Rev 1 92 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 168: ...MPC563XM Reference Manual Rev 1 168 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 242: ...MPC563XM Reference Manual Rev 1 242 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 302: ...MPC563XM Reference Manual Rev 1 302 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 410: ...MPC563XM Reference Manual Rev 1 410 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 440: ...MPC563XM Reference Manual Rev 1 440 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 464: ...MPC563XM Reference Manual Rev 1 464 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 554: ...MPC563XM Reference Manual Rev 1 554 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 590: ...MPC563XM Reference Manual Rev 1 590 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 622: ...MPC563XM Reference Manual Rev 1 622 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 716: ...MPC563XM Reference Manual Rev 1 716 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 1114: ...MPC563XM Reference Manual Rev 1 1114 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 1144: ...MPC563XM Reference Manual Rev 1 1144 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 1266: ...MPC563XM Reference Manual Rev 1 1266 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 1316: ...MPC563XM Reference Manual Rev 1 1316 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 1348: ...MPC563XM Reference Manual Rev 1 1348 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 1362: ...MPC563XM Reference Manual Rev 1 1362 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 1382: ...MPC563XM Reference Manual Rev 1 1382 Freescale Semiconductor Preliminary Subject to Change Without Notice ...