uart_getenv sets di->bas.bst = uart_bus_space_mem;
uart_cpu_getdev sets uart_bus_space_mem = di->bas.bst;
So it was passing the garbage uninitialized value back and forth… and I was wondering why the manually configured PCI UART on the AWS EC2 a1 (Graviton) was not working. (The UART there should be configured via ACPI, but to debug that, I needed a UART in the first place.)
Let's initialize the correct value for the memory space, similar to bus_space_tag_t uart_bus_space_mem = X86_BUS_SPACE_MEM; on amd64.