From e9f623e7540c180b492699bb10383a82e0edd495 Mon Sep 17 00:00:00 2001 From: Paul Mathieu Date: Tue, 17 May 2022 09:23:11 -0700 Subject: [PATCH] arm: cut bootloader dependency on uart stuff --- arm/bootloader.cc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/arm/bootloader.cc b/arm/bootloader.cc index 5d81f72..cbe56e1 100644 --- a/arm/bootloader.cc +++ b/arm/bootloader.cc @@ -1,9 +1,24 @@ #include #include "gpio.h" -#include "uart.h" +#include "xuartlite.h" namespace { +constexpr uintptr_t kUart0BaseAddress = 0x40001000; +XUartLite uart0_inst; +XUartLite_Config uart0_config = { + .DeviceId = 0, + .RegBaseAddr = kUart0BaseAddress, + .BaudRate = 115200, + .UseParity = false, + .DataBits = 8, +}; + +XUartLite* uart0 = &uart0_inst; + +void InitUarts() { + XUartLite_CfgInitialize(uart0, &uart0_config, uart0_config.RegBaseAddr); +} uint8_t UartRead() { uint8_t c; @@ -25,7 +40,6 @@ uint32_t UartRead32() { return val; } - } // namespace int main() {