summaryrefslogtreecommitdiff
path: root/bsp
diff options
context:
space:
mode:
Diffstat (limited to 'bsp')
-rw-r--r--bsp/ls1cdev/drivers/board.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/bsp/ls1cdev/drivers/board.c b/bsp/ls1cdev/drivers/board.c
index f9c7454a16..29d7fa7142 100644
--- a/bsp/ls1cdev/drivers/board.c
+++ b/bsp/ls1cdev/drivers/board.c
@@ -51,6 +51,31 @@ void rt_hw_timer_init(void)
write_c0_count(0);
}
+
+/**
+ * init hardware FPU
+ */
+void rt_hw_fpu_init(void)
+{
+ rt_uint32_t c0_status = 0;
+ rt_uint32_t c1_status = 0;
+
+ // ʹ��Э������1--FPU
+ c0_status = read_c0_status();
+ c0_status |= (ST0_CU1 | ST0_FR);
+ write_c0_status(c0_status);
+
+ // ����FPU
+ c1_status = read_c1_status();
+ c1_status |= (FPU_CSR_FS | FPU_CSR_FO | FPU_CSR_FN); // set FS, FO, FN
+ c1_status &= ~(FPU_CSR_ALL_E); // disable exception
+ c1_status = (c1_status & (~FPU_CSR_RM)) | FPU_CSR_RN; // set RN
+ write_c1_status(c1_status);
+
+ return ;
+}
+
+
/**
* This function will initial sam7s64 board.
*/
@@ -69,6 +94,9 @@ void rt_hw_board_init(void)
/* init operating system timer */
rt_hw_timer_init();
+ /* init hardware fpu */
+ rt_hw_fpu_init();
+
rt_kprintf("current sr: 0x%08x\n", read_c0_status());
}