diff options
author | Uros Majstorovic <majstor@majstor.org> | 2021-12-09 23:50:58 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2021-12-09 23:50:58 +0100 |
commit | 7d03a941be6e9226e71cb5f5b4f7949e06bbfb02 (patch) | |
tree | cde9218dbe97837f972c426552c463f5f2a6a256 /fw/fe310/bsp | |
parent | 9c8f5a5e8f11e4a5012d55b96afae290242b8fdd (diff) |
improved init process
Diffstat (limited to 'fw/fe310/bsp')
-rw-r--r-- | fw/fe310/bsp/metal/metal.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/fw/fe310/bsp/metal/metal.c b/fw/fe310/bsp/metal/metal.c index 00849b9..9e1bb3f 100644 --- a/fw/fe310/bsp/metal/metal.c +++ b/fw/fe310/bsp/metal/metal.c @@ -6,21 +6,12 @@ extern void eos_trap_entry(); -static void uart_init(size_t baud_rate) { - GPIO_REG(GPIO_IOF_SEL) &= ~IOF0_UART0_MASK; - GPIO_REG(GPIO_IOF_EN) |= IOF0_UART0_MASK; - UART0_REG(UART_REG_DIV) = PRCI_get_cpu_freq() / baud_rate - 1; - UART0_REG(UART_REG_TXCTRL) |= UART_TXEN; - UART0_REG(UART_REG_RXCTRL) |= UART_RXEN; -} - __attribute__((constructor)) void metal_init(void) { SPI0_REG(SPI_REG_SCKDIV) = 8; PRCI_use_default_clocks(); PRCI_use_pll(PLL_REFSEL_HFXOSC, 0, 1, 31, 1, -1, -1, -1); - uart_init(115200); write_csr(mtvec, &eos_trap_entry); if (read_csr(misa) & (1 << ('F' - 'A'))) { // if F extension is present |