Squash commits for public release

This commit is contained in:
2025-02-12 09:54:05 -05:00
commit 7118adc514
1108 changed files with 80873 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
#include "uart.h"
volatile uint32_t* output = NULL;
#define UART 0x10000000
#define UART_THR (char*)(UART + 0x00) // THR:transmitter holding register
#define UART_LSR (char*)(UART + 0x05) // LSR:line status register
#define UART_LSR_EMPTY_MASK 0x40 // LSR Bit 6: Transmitter empty; both the THR and LSR are empty
void uart_init()
{
output = (uint32_t*)UART;
}
int uart_write(uint8_t data)
{
if (!output) {
return 1;
}
while ((*UART_LSR & UART_LSR_EMPTY_MASK) == 0) { }
*output = data;
return 0;
}

View File

@@ -0,0 +1,9 @@
#ifndef _BOOT_DRIVERS_UART_H
#define _BOOT_DRIVERS_UART_H
#include <libboot/types.h>
void uart_init();
int uart_write(uint8_t data);
#endif // _BOOT_DRIVERS_UART_H