File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 2222 */
2323void rt_hw_cpu_reset (void )
2424{
25+ WDT_EN = 0x01 ;
26+ WDT_TIMER = 0x01 ;
27+ WDT_SET = 0x01 ;
2528 rt_kprintf ("reboot system...\n" );
2629 while (1 );
2730}
@@ -32,6 +35,8 @@ void rt_hw_cpu_reset(void)
3235 */
3336void rt_hw_cpu_shutdown (void )
3437{
38+ PM1_STS &= 0xffffffff ;
39+ PM1_CNT = 0x3c00 ;
3540 rt_kprintf ("shutdown...\n" );
3641
3742 while (1 );
Original file line number Diff line number Diff line change 1212#define BOARD_H__
1313
1414#include <stdint.h>
15+ #include <rthw.h>
16+ #include "ls2k1000.h"
1517
1618extern unsigned char __bss_end ;
1719
1820#define CPU_HZ (1000 * 1000 * 1000) //QEMU 200*1000*1000
1921#define RT_HW_HEAP_BEGIN (void*)&__bss_end
2022#define RT_HW_HEAP_END (void*)(RT_HW_HEAP_BEGIN + 64 * 1024 * 1024)
2123
24+ /*
25+ * General PM Configuration Register
26+ */
27+ #define PMCON_BASE (APB_BASE | (0x7 << 12))
28+
29+ /*
30+ * Power Management1 Configuration Registers
31+ */
32+ #define PM1_BASE (PMCON_BASE + 0x0C)
33+ #define PM1_STS HWREG32(PM1_BASE)
34+ #define PM1_EN HWREG32(PM1_BASE + 0x04)
35+ #define PM1_CNT HWREG32(PM1_BASE + 0x08)
36+
37+ /*
38+ * Watch Dog Configuration Registers
39+ */
40+ #define WDT_BASE (PMCON_BASE + 0x30)
41+ #define WDT_EN HWREG32(WDT_BASE)
42+ #define WDT_SET HWREG32(WDT_BASE + 0x04)
43+ #define WDT_TIMER HWREG32(WDT_BASE + 0x08)
44+
45+
2246void rt_hw_board_init (void );
2347
2448#endif
You can’t perform that action at this time.
0 commit comments