2024-01-13 23:06:01 +01:00
|
|
|
// See LICENSE for license details.
|
|
|
|
|
|
|
|
#ifndef _ISS_PLATFORM_H
|
|
|
|
#define _ISS_PLATFORM_H
|
|
|
|
|
2024-03-02 12:18:38 +01:00
|
|
|
#if __riscv_xlen == 32
|
|
|
|
#define MCAUSE_INT 0x80000000UL
|
|
|
|
#define MCAUSE_CAUSE 0x000003FFUL
|
|
|
|
#else
|
|
|
|
#define MCAUSE_INT 0x8000000000000000UL
|
|
|
|
#define MCAUSE_CAUSE 0x00000000000003FFUL
|
|
|
|
#endif
|
2024-01-13 23:06:01 +01:00
|
|
|
|
2024-01-14 08:14:57 +01:00
|
|
|
#define APB_BUS
|
2024-01-13 23:06:01 +01:00
|
|
|
|
2024-01-14 20:35:05 +01:00
|
|
|
#include "ehrenberg/devices/gpio.h"
|
|
|
|
#include "ehrenberg/devices/uart.h"
|
2024-02-22 17:10:49 +01:00
|
|
|
#include "ehrenberg/devices/timer.h"
|
|
|
|
#include "ehrenberg/devices/aclint.h"
|
2024-01-14 20:35:05 +01:00
|
|
|
#include "ehrenberg/devices/qspi.h"
|
2024-06-10 12:21:20 +02:00
|
|
|
#include "ehrenberg/devices/i2s.h"
|
|
|
|
#include "ehrenberg/devices/camera.h"
|
|
|
|
#include "ehrenberg/devices/dma.h"
|
2024-11-05 13:01:57 +01:00
|
|
|
#include "ehrenberg/devices/msg_if.h"
|
2024-01-13 23:06:01 +01:00
|
|
|
|
2024-01-14 08:14:57 +01:00
|
|
|
#define PERIPH(TYPE, ADDR) ((volatile TYPE*) (ADDR))
|
2024-01-13 23:06:01 +01:00
|
|
|
|
2024-01-14 08:14:57 +01:00
|
|
|
#define APB_BASE 0xF0000000
|
2024-02-22 17:10:49 +01:00
|
|
|
|
2024-11-06 11:24:09 +01:00
|
|
|
#define gpio PERIPH(gpio_t, APB_BASE+0x0000)
|
|
|
|
#define uart PERIPH(uart_t, APB_BASE+0x1000)
|
|
|
|
#define timer PERIPH(timercounter_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 i2s PERIPH(i2s_t, APB_BASE+0x90000)
|
|
|
|
#define camera PERIPH(camera_t, APB_BASE+0xA0000)
|
|
|
|
#define dma PERIPH(dma_t, APB_BASE+0xB0000)
|
|
|
|
#define msgif PERIPH(msgif_t, APB_BASE+0xC0000)
|
2024-06-10 12:21:20 +02:00
|
|
|
|
2024-01-13 23:06:01 +01:00
|
|
|
|
2024-01-14 08:14:57 +01:00
|
|
|
#define XIP_START_LOC 0xE0040000
|
2024-08-18 20:27:41 +02:00
|
|
|
#define RAM_START_LOC 0x80000000
|
2024-01-13 23:06:01 +01:00
|
|
|
|
|
|
|
// Misc
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
void init_pll(void);
|
|
|
|
unsigned long get_cpu_freq(void);
|
|
|
|
unsigned long get_timer_freq(void);
|
|
|
|
|
|
|
|
#endif /* _ISS_PLATFORM_H */
|