commit 249aeb61f4978f5c05562959185b42a888d6aaa8 from: Aleksey Ryndin date: Thu Mar 14 13:56:09 2024 UTC Rename: pinephone -> a64 commit - 3aafaddfe3d82356a4da5dd04a0069154f8b7c5a commit + 249aeb61f4978f5c05562959185b42a888d6aaa8 blob - cde9eed566c633a40598b137177401ace35cc6ba blob + f4649a5ecc71247a92e21f9608f9735e811e7aff --- Makefile +++ Makefile @@ -7,7 +7,7 @@ ARCH = aarch64 TARGET = ${ARCH}-none-elf -include config.mk #BOARD ?= virt -BOARD ?= pinephone +BOARD ?= a64 ASFLAGS = -target ${TARGET} ASFILES += boot.S blob - ef9378c6b991cf1258d646018265cfeca686cf45 (mode 644) blob + /dev/null --- uart_pinephone.cc +++ /dev/null @@ -1,44 +0,0 @@ -// uart_virt.cc -// QEMU `virt` generic virtual platform - - -#include -#include - - -namespace Board { -namespace Uart { - - -namespace { - -constexpr uintptr_t UART_BASE = 0x01c28000; - -} // anonymous namespace - - -void initialize() -{ - /* TBD! */ - (void)UART_BASE; - // Hw::write32(UART_BASE + Pl011::CONTROL_REGISTER, ControlRegister.m_u.m_nValue); -} - - -void send(uint8_t nValue) -{ - (void)nValue; - /* TBD! */ - // Hw::write32(UART_BASE + Pl011::DATA_REGISTER, nValue); -} - - -uint8_t recv() -{ - // return Hw::read32(UART_BASE + Pl011::DATA_REGISTER) & 0xff; - return 0; -} - - -} // namespace Uart -} // namespace Board blob - /dev/null blob + cf061cf874ec74861f86f7ca16b8792d77eb3546 (mode 644) --- /dev/null +++ uart_a64.cc @@ -0,0 +1,48 @@ +// uart_a64.cc +// Allwinner A64 UART (16550) + + +#include +#include + + +namespace Board { +namespace Uart { + + +namespace { + +constexpr uintptr_t UART0_BASE = 0x01c28000; + +constexpr auto BAUDRATE = 115200; + + +} // anonymous namespace + + +void initialize() +{ + /* TBD! */ + (void)UART0_BASE; + (void)BAUDRATE; + // Hw::write32(UART_BASE + Pl011::CONTROL_REGISTER, ControlRegister.m_u.m_nValue); +} + + +void send(uint8_t nValue) +{ + (void)nValue; + /* TBD! */ + // Hw::write32(UART_BASE + Pl011::DATA_REGISTER, nValue); +} + + +uint8_t recv() +{ + // return Hw::read32(UART_BASE + Pl011::DATA_REGISTER) & 0xff; + return 0; +} + + +} // namespace Uart +} // namespace Board