uart: patch for early putc ns8250 on arm/aarch64
Hi, @bsdimp This is patch for early putc ns8250 on arm/aarch64 I tested on bananapi-r64
Thank you for taking the time to contribute to FreeBSD! There is an issue that needs to be fixed:
- Missing Signed-off-by lines (737714d3a08b1cddd160f59ad98cfa1cd8824ecf)
Please review CONTRIBUTING.md, then update and push your branch again.
I think this is ready. There's no socdev_va/pa on other platofrms, so arm and arm64 is the complete list.
Ok. Thank you.
Unfortunately, this only works for some UART implementations. It does not take into account the register layout and access restrictions of different UARTs ("reg-shift", "reg-io-width"). These are not available at an early stage, which is why we do not yet have the early_putc() function implemented. It should not be commited in this form.
Unfortunately, this only works for some UART implementations. It does not take into account the register layout and access restrictions of different UARTs ("reg-shift", "reg-io-width"). These are not available at an early stage, which is why we do not yet have the early_putc() function implemented. It should not be commited in this form.
Ok. I thought it was okay.
We could add options to set them, e.g. options EARLY_PRINTF_REG_SHIFT=2.
We could add options to set them, e.g.
options EARLY_PRINTF_REG_SHIFT=2.
Couldn't we just read the SPCR table to get these values as well?
I would prefer to not depend on the SPCR/FDT so printf works before we parse them, e.g. we may need to call printf from within the parsing code to debug it.
I would prefer to not depend on the SPCR/FDT so printf works before we parse them, e.g. we may need to call printf from within the parsing code to debug it.
Since we parse it in the boot loader, maybe it could provide adequate hints? Or do we have the same issue?
IMHO, early_putc() should work from the first line of initarm(). I am afraid that the only viable solution is #define at compile time, runtime detection looks impossible.
hi! Would someone please give @Martinfx a more concrete example of how we did this compile time stuff for other platforms? That way we can get this finished and landed. Thanks!