modifies initcode and libwrap for new mnrs/ehrenberg vp
This commit is contained in:
7
env/ehrenberg/init.c
vendored
7
env/ehrenberg/init.c
vendored
@ -90,10 +90,9 @@ void __attribute__((weak)) handle_m_ext_interrupt(){
|
||||
}
|
||||
|
||||
void __attribute__((weak)) handle_m_time_interrupt(){
|
||||
uint64_t time = ((uint64_t)mtimer->mtimeh)<<32 || mtimer->mtime;
|
||||
time+=MTIMER_NEXT_TICK_INC;
|
||||
mtimer->mtimecmph = time>>32;
|
||||
mtimer->mtimecmp = time;
|
||||
uint64_t time = get_aclint_mtime(aclint);
|
||||
time+=MTIMER_NEXT_TICK_INC;
|
||||
set_aclint_mtime(aclint, time);
|
||||
}
|
||||
|
||||
void __attribute__((weak)) default_handler(void) {
|
||||
|
23
env/ehrenberg/platform.h
vendored
23
env/ehrenberg/platform.h
vendored
@ -10,26 +10,22 @@
|
||||
#define APB_BUS
|
||||
|
||||
#include "ehrenberg/devices/gpio.h"
|
||||
#include "ehrenberg/devices/interrupt.h"
|
||||
#include "ehrenberg/devices/timer.h"
|
||||
#include "ehrenberg/devices/uart.h"
|
||||
#include "ehrenberg/devices/timer.h"
|
||||
#include "ehrenberg/devices/aclint.h"
|
||||
#include "ehrenberg/devices/interrupt.h"
|
||||
#include "ehrenberg/devices/qspi.h"
|
||||
|
||||
#define PERIPH(TYPE, ADDR) ((volatile TYPE*) (ADDR))
|
||||
|
||||
#define APB_BASE 0xF0000000
|
||||
#define TIMER_BASE (APB_BASE+0x20000)
|
||||
|
||||
#define gpio_a PERIPH(gpio_t, APB_BASE+0x0000)
|
||||
//#define gpio_b PERIPH(gpio_t, APB_BASE+0x10000)
|
||||
#define uart PERIPH(uart_t, APB_BASE+0x1000)
|
||||
#define prescaler PERIPH(uart_t, TIMER_BASE+0x0)
|
||||
#define timer_a PERIPH(uart_t, TIMER_BASE+0x4)
|
||||
#define timer_b PERIPH(uart_t, TIMER_BASE+0x10)
|
||||
#define mtimer PERIPH(mtimer_t, APB_BASE+0x30000)
|
||||
#define irq PERIPH(irq_t, APB_BASE+0x40000)
|
||||
#define qspi PERIPH(qspi_t, APB_BASE+0x50000)
|
||||
//volatile qspi_t* const qspi = (qspi_t*)(APB_BASE+0x50000);
|
||||
#define gpio PERIPH(gpio_t, APB_BASE+0x0000)
|
||||
#define uart PERIPH(uart_t, APB_BASE+0x1000)
|
||||
#define timer PERIPH(timer_t, APB_BASE+0x20000)
|
||||
#define aclint PERIPH(aclint_t, APB_BASE+0x30000)
|
||||
#define irq PERIPH(irq_t, APB_BASE+0x40000)
|
||||
#define qspi PERIPH(qspi_t, APB_BASE+0x50000)
|
||||
|
||||
#define XIP_START_LOC 0xE0040000
|
||||
|
||||
@ -40,6 +36,5 @@
|
||||
void init_pll(void);
|
||||
unsigned long get_cpu_freq(void);
|
||||
unsigned long get_timer_freq(void);
|
||||
uint64_t get_timer_value(void);
|
||||
|
||||
#endif /* _ISS_PLATFORM_H */
|
||||
|
Reference in New Issue
Block a user