forked from Imagelibrary/rtems
mpc83xx: Add and use mpc83xx_reset()
The inline version makes it possible to use this code in different memory areas.
This commit is contained in:
@@ -14,21 +14,9 @@
|
|||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
#include <bsp/bootcard.h>
|
#include <bsp/bootcard.h>
|
||||||
|
|
||||||
|
#include <mpc83xx/mpc83xx.h>
|
||||||
|
|
||||||
void bsp_reset(void)
|
void bsp_reset(void)
|
||||||
{
|
{
|
||||||
_ISR_Set_level( 0 );
|
mpc83xx_reset();
|
||||||
|
|
||||||
/* Set Reset Protection Register (RPR) to "RSTE" */
|
|
||||||
mpc83xx.res.rpr = 0x52535445;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Wait for Control Register Enabled in the
|
|
||||||
* Reset Control Enable Register (RCER).
|
|
||||||
*/
|
|
||||||
while (mpc83xx.res.rcer != 0x00000001) {
|
|
||||||
/* Wait */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set Software Hard Reset in the Reset Control Register (RCR) */
|
|
||||||
mpc83xx.res.rcr = 0x00000002;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -820,6 +820,25 @@ typedef struct m83xxRegisters_ {
|
|||||||
|
|
||||||
extern m83xxRegisters_t mpc83xx;
|
extern m83xxRegisters_t mpc83xx;
|
||||||
|
|
||||||
|
static inline void mpc83xx_reset(void)
|
||||||
|
{
|
||||||
|
_ISR_Set_level( 0 );
|
||||||
|
|
||||||
|
/* Set Reset Protection Register (RPR) to "RSTE" */
|
||||||
|
mpc83xx.res.rpr = 0x52535445;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Wait for Control Register Enabled in the
|
||||||
|
* Reset Control Enable Register (RCER).
|
||||||
|
*/
|
||||||
|
while (mpc83xx.res.rcer != 0x00000001) {
|
||||||
|
/* Wait */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set Software Hard Reset in the Reset Control Register (RCR) */
|
||||||
|
mpc83xx.res.rcr = 0x00000002;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* !defined ASM */
|
#endif /* !defined ASM */
|
||||||
/*
|
/*
|
||||||
* some definitions used in assembler startup
|
* some definitions used in assembler startup
|
||||||
|
|||||||
Reference in New Issue
Block a user