File tree Expand file tree Collapse file tree 4 files changed +28
-50
lines changed Expand file tree Collapse file tree 4 files changed +28
-50
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1616#include "exception.h"
1717#include "drv_uart.h"
1818#include "board.h"
19+ #include "ls2k1000.h"
20+
1921/**
2022 * this function will reset CPU
2123 *
@@ -28,6 +30,8 @@ void rt_hw_cpu_reset(void)
2830 rt_kprintf ("reboot system...\n" );
2931 while (1 );
3032}
33+ MSH_CMD_EXPORT_ALIAS (rt_hw_cpu_reset , reboot , reset cpu );
34+
3135
3236/**
3337 * this function will shutdown CPU
@@ -41,6 +45,7 @@ void rt_hw_cpu_shutdown(void)
4145
4246 while (1 );
4347}
48+ MSH_CMD_EXPORT_ALIAS (rt_hw_cpu_shutdown , poweroff , shutdown cpu );
4449
4550
4651/**
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"
1715
1816extern unsigned char __bss_end ;
1917
2018#define CPU_HZ (1000 * 1000 * 1000) //QEMU 200*1000*1000
2119#define RT_HW_HEAP_BEGIN (void*)&__bss_end
2220#define RT_HW_HEAP_END (void*)(RT_HW_HEAP_BEGIN + 64 * 1024 * 1024)
2321
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-
4622void rt_hw_board_init (void );
4723
4824#endif
Original file line number Diff line number Diff line change 33
44#include <mips.h>
55#include "interrupt.h"
6+ #include <rthw.h>
67
78#define APB_BASE CKSEG1ADDR(0xbfe00000)
89
2425
2526#define GEN_CONFIG0_REG (0xFFFFFFFFBfe10420)
2627
28+
29+ /*
30+ * General PM Configuration Register
31+ */
32+ #define PMCON_BASE (APB_BASE | (0x7 << 12))
33+
34+ /*
35+ * Power Management1 Configuration Registers
36+ */
37+ #define PM1_BASE (PMCON_BASE + 0x0C)
38+ #define PM1_STS HWREG32(PM1_BASE)
39+ #define PM1_EN HWREG32(PM1_BASE + 0x04)
40+ #define PM1_CNT HWREG32(PM1_BASE + 0x08)
41+
42+ /*
43+ * Watch Dog Configuration Registers
44+ */
45+ #define WDT_BASE (PMCON_BASE + 0x30)
46+ #define WDT_EN HWREG32(WDT_BASE)
47+ #define WDT_SET HWREG32(WDT_BASE + 0x04)
48+ #define WDT_TIMER HWREG32(WDT_BASE + 0x08)
49+
2750void rt_hw_timer_handler (void );
2851void rt_hw_uart_init (void );
2952
You can’t perform that action at this time.
0 commit comments