Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/demo imx8mp verdin #8

Open
wants to merge 3 commits into
base: demo
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/arch/riscv/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#include "task.h"
#include "portmacro.h"
#include <csrs.h>
#include <sbi.h>
#include <timer.h>

/* Standard includes. */
#include "string.h"
Expand Down Expand Up @@ -223,3 +225,7 @@ void freertos_risc_v_application_interrupt_handler( void ) {
extern void plic_handle();
plic_handle();
}

void riscv_timer_interrupt_handler( void ) {
timer_set(uxTimerIncrementsForOneTick);
}
10 changes: 1 addition & 9 deletions src/arch/riscv/portASM.S
Original file line number Diff line number Diff line change
Expand Up @@ -384,15 +384,7 @@ handle_interrupt:
addi t1, t0, 5 /* 0x8000[]0005 == sueprvisor timer interrupt. */
bne a0, t1, application_interrupt_handler

csrr t1, time
ld a0, uxTimerIncrementsForOneTick
#define SBI_EXTID_TIME (0x54494D45)
#define SBI_SET_TIMER_FID (0x0)
/* ecall to sbi_set_timer */
add a0, a0, t1
li a6, SBI_SET_TIMER_FID
li a7, SBI_EXTID_TIME
ecall
jal riscv_timer_interrupt_handler

jal xTaskIncrementTick
beqz a0, processed_source /* Don't switch context if incrementing tick didn't unblock a task. */
Expand Down