Changeset View
Standalone View
sys/dev/uart/uart_dev_pl011.c
Show First 20 Lines • Show All 605 Lines • ▼ Show 20 Lines | uart_pl011_bus_ungrab(struct uart_softc *sc) | ||||
psc = (struct uart_pl011_softc *)sc; | psc = (struct uart_pl011_softc *)sc; | ||||
bas = &sc->sc_bas; | bas = &sc->sc_bas; | ||||
/* Switch to using interrupts while not grabbed */ | /* Switch to using interrupts while not grabbed */ | ||||
uart_lock(sc->sc_hwmtx); | uart_lock(sc->sc_hwmtx); | ||||
__uart_setreg(bas, UART_IMSC, psc->imsc); | __uart_setreg(bas, UART_IMSC, psc->imsc); | ||||
uart_unlock(sc->sc_hwmtx); | uart_unlock(sc->sc_hwmtx); | ||||
} | } | ||||
#ifdef EARLY_PRINTF | |||||
andrew: Unfortunately we can't just have this, it needs to be (for anything that might be in `GENERIC`… | |||||
jchandraAuthorUnsubmitted Done Inline ActionsYes, it was a bad idea. Additionally, on arm64 we seem to do a 1G mapping for the address space. I will drop the patches until both of the problems are fixed. jchandra: Yes, it was a bad idea.
This would cause duplicate symbol for early_putc in case other drivers… | |||||
ianUnsubmitted Not Done Inline ActionsIt is seriously not worth complicating the EARLY_PRINTF code with any kind of scheme for avoiding symbol clashes. By design, this code is turned off all the time, and it should be. The need for it is so rare, and the implementations of it are so machine/board/chip-specific, that by design you build a custom kernel with the right things enabled to use it for the target you're working on just when you need it. ian: It is seriously not worth complicating the EARLY_PRINTF code with any kind of scheme for… | |||||
jchandraAuthorUnsubmitted Done Inline ActionsProbably calling it "problems" was not accurate. EARLY_PRINTF was really useful to figure out a memory region setup failure I saw. Having to edit source files to enable a conf option somehow seems strange to me, that is why I was not keen on checking it in. jchandra: Probably calling it "problems" was not accurate. EARLY_PRINTF was really useful to figure out… | |||||
static void | |||||
uart_pl011_early_putc(int c) | |||||
{ | |||||
u_int *base = (void *)(uintptr_t)SOCDEV_VA; | |||||
volatile u_int *tx = base + UART_DR; | |||||
volatile u_int *fr = base + UART_FR; | |||||
while ((*fr & FR_TXFF) != 0) | |||||
; | |||||
*tx = c; | |||||
} | |||||
early_putc_t *early_putc = uart_pl011_early_putc; | |||||
#endif |
Unfortunately we can't just have this, it needs to be (for anything that might be in GENERIC on arm or arm64):