initial commit

This commit is contained in:
2025-08-02 06:09:31 +03:00
commit 00015ffc03
85 changed files with 62051 additions and 0 deletions

22
FIRMWARE/putchar.S Normal file
View File

@@ -0,0 +1,22 @@
# Base address of memory-mapped IO,
# Loaded into gp at startup
.equ IO_BASE, 0x400000
# IO-reg offsets. To read or write one of them,
# use IO_XXX(gp)
.equ IO_LEDS, 4
.equ IO_UART_DAT, 8
.equ IO_UART_CNTL, 16
.section .text
.globl putchar
putchar:
sw a0, IO_UART_DAT(gp)
li t0, 1<<9
.L0:
lw t1, IO_UART_CNTL(gp)
and t1, t1, t0
bnez t1, .L0
ret