Squash commits for public release
This commit is contained in:
23
boot/arm64/prekernel/drivers/uart.c
Normal file
23
boot/arm64/prekernel/drivers/uart.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "uart.h"
|
||||
#include <libboot/devtree/devtree.h>
|
||||
|
||||
volatile uint32_t* output = NULL;
|
||||
|
||||
void uart_init()
|
||||
{
|
||||
devtree_entry_t* dev = devtree_find_device("uart");
|
||||
if (!dev) {
|
||||
return;
|
||||
}
|
||||
output = (uint32_t*)dev->region_base;
|
||||
}
|
||||
|
||||
int uart_write(uint8_t data)
|
||||
{
|
||||
if (!output) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
*output = data;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user