Adding bootlimit/bootcount feature for MPC5XXX on TQM5200 Boards
PATCH 1/1 Adding bootlimit/bootcount feature for MPC5XXX on TQM5200 Boards
Tested with TQM5200S on STK52XX.200 Board
Signed-off-by Axel Beierlein <[email protected]>
--- cpu/mpc5xxx/cpu.c | 20 ++++++++++++++++++++ include/configs/TQM5200.h | 1 + include/mpc5xxx.h | 1 + 3 files changed, 22 insertions(+), 0 deletions(-)
cpu/mpc5xxx/cpu.c +20 -0
@@ -135,3 +135,23 @@ void ft_cpu_setup(void *blob, bd_t *bd) #endif }#endif + +#ifdef CONFIG_BOOTCOUNT_LIMIT + +void bootcount_store (ulong a) +{ +volatile ulong *save_addr = (volatile ulong *)(MPC5XXX_CDM_BRDCRMB ); + + *save_addr = (BOOTCOUNT_MAGIC &0xffff0000 ) | a; +} + +ulong bootcount_load (void ) +{ +volatile ulong *save_addr = (volatile ulong *)(MPC5XXX_CDM_BRDCRMB ); + +if ((*save_addr &0xffff0000 ) != (BOOTCOUNT_MAGIC &0xffff0000 )) +return 0 ; +else +return (*save_addr &0x0000ffff ); +} +#endif /* CONFIG_BOOTCOUNT_LIMIT */
include/configs/TQM5200.h +1 -0
@@ -55,6 +55,7 @@#define CONFIG_PSC_CONSOLE 1/* console is on PSC1 */ #define CONFIG_BAUDRATE 115200/* ... at 115200 bps */ #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 } +#define CONFIG_BOOTCOUNT_LIMIT 1#ifdef CONFIG_FO300 #define CFG_DEVICE_NULLDEV 1/* enable null device */
include/mpc5xxx.h +1 -0
@@ -137,6 +137,7 @@/* Clock Distribution Module */ #define MPC5XXX_CDM_JTAGID (MPC5XXX_CDM + 0x0000)#define MPC5XXX_CDM_PORCFG (MPC5XXX_CDM + 0x0004) +#define MPC5XXX_CDM_BRDCRMB (MPC5XXX_CDM + 0x0008)#define MPC5XXX_CDM_CFG (MPC5XXX_CDM + 0x000c)#define MPC5XXX_CDM_48_FDC (MPC5XXX_CDM + 0x0010)#define MPC5XXX_CDM_SRESET (MPC5XXX_CDM + 0x0020)
Signature · 1 line
1.5.4.3
Wolfgang Denk
AppliedPATCH 1/1 Adding bootlimit/bootcount feature for MPC5XXX on TQM5200 Boards
Dear Axel Beierlein,
Quoted 8 lines · In message <[email protected]> you wrote:
Tested with TQM5200S on STK52XX.200 Board
Signed-off-by Axel Beierlein <[email protected]>--- cpu/mpc5xxx/cpu.c | 20 ++++++++++++++++++++ include/configs/TQM5200.h | 1 + include/mpc5xxx.h | 1 + 3 files changed, 22 insertions(+), 0 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "May the forces of evil become confused on the way to your house." - George Carlin