fix raspi2 timer

This commit is contained in:
bigmagic 2020-06-03 23:58:34 +08:00
parent 997c652784
commit 587e50dc1c
3 changed files with 10 additions and 2 deletions

View File

@ -6,6 +6,7 @@ unsigned long rt_cpu_get_smp_id(void);
void rt_cpu_mmu_disable(void); void rt_cpu_mmu_disable(void);
void rt_cpu_mmu_enable(void); void rt_cpu_mmu_enable(void);
void rt_cpu_tlb_set(volatile unsigned long*); void rt_cpu_tlb_set(volatile unsigned long*);
void rt_hw_vector_init(void);
void rt_cpu_vector_set_base(unsigned int addr); void rt_cpu_vector_set_base(unsigned int addr);

View File

@ -29,8 +29,14 @@ rt_uint32_t rt_interrupt_from_thread;
rt_uint32_t rt_interrupt_to_thread; rt_uint32_t rt_interrupt_to_thread;
rt_uint32_t rt_thread_switch_interrupt_flag; rt_uint32_t rt_thread_switch_interrupt_flag;
extern void rt_cpu_vector_set_base(unsigned int addr);
extern int system_vectors; extern int system_vectors;
void rt_hw_vector_init(void)
{
rt_cpu_vector_set_base((unsigned int)&system_vectors);
}
static void default_isr_handler(int vector, void *param) static void default_isr_handler(int vector, void *param)
{ {
rt_kprintf("unhandled irq: %d\n", vector); rt_kprintf("unhandled irq: %d\n", vector);

View File

@ -26,6 +26,7 @@
#include "board.h" #include "board.h"
#include "drv_uart.h" #include "drv_uart.h"
#include "cp15.h"
void rt_hw_timer_isr(int vector, void *parameter) void rt_hw_timer_isr(int vector, void *parameter)
{ {
@ -65,7 +66,7 @@ void rt_hw_board_init(void)
{ {
/* initialize hardware interrupt */ /* initialize hardware interrupt */
rt_hw_interrupt_init(); rt_hw_interrupt_init();
vector_copy(); rt_hw_vector_init();
/* initialize uart */ /* initialize uart */
rt_hw_uart_init(); rt_hw_uart_init();
@ -82,7 +83,7 @@ void rt_hw_board_init(void)
#endif #endif
/* initialize timer for os tick */ /* initialize timer for os tick */
// rt_hw_timer_init(); rt_hw_timer_init();
#ifdef RT_USING_COMPONENTS_INIT #ifdef RT_USING_COMPONENTS_INIT
rt_components_board_init(); rt_components_board_init();