diff options
author | Ian Lepore <ian@FreeBSD.org> | 2013-04-01 00:44:20 +0000 |
---|---|---|
committer | Ian Lepore <ian@FreeBSD.org> | 2013-04-01 00:44:20 +0000 |
commit | 4d7abca0576b034bbe0c4ac8d723ff15d36f4323 (patch) | |
tree | 7e8822165fb7859a3446e9b064f7645e377504e3 /sys/sparc64/pci/sbbc.c | |
parent | 5ea561e03a8777c14c6a8caa4b3e607dc1a41fbd (diff) | |
download | src-4d7abca0576b034bbe0c4ac8d723ff15d36f4323.tar.gz src-4d7abca0576b034bbe0c4ac8d723ff15d36f4323.zip |
Fix low-level uart drivers that set their fifo sizes in the softc too late.
uart(4) allocates send and receiver buffers in attach() before it calls
the low-level driver's attach routine. Many low-level drivers set the
fifo sizes in their attach routine, which is too late. Other drivers set
them in the probe() routine, so that they're available when uart(4)
allocates buffers. This fixes the ones that were setting the values too
late by moving the code to probe().
Notes
Notes:
svn path=/head/; revision=248965
Diffstat (limited to 'sys/sparc64/pci/sbbc.c')
-rw-r--r-- | sys/sparc64/pci/sbbc.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sys/sparc64/pci/sbbc.c b/sys/sparc64/pci/sbbc.c index 218093fcbc61..c19fb71b0bb3 100644 --- a/sys/sparc64/pci/sbbc.c +++ b/sys/sparc64/pci/sbbc.c @@ -835,13 +835,6 @@ sbbc_uart_bus_attach(struct uart_softc *sc) bst = bas->bst; bsh = bas->bsh; - sc->sc_rxfifosz = SBBC_SRAM_READ_4(sbbc_solcons + - SBBC_CONS_OFF(cons_in_end)) - SBBC_SRAM_READ_4(sbbc_solcons + - SBBC_CONS_OFF(cons_in_begin)) - 1; - sc->sc_txfifosz = SBBC_SRAM_READ_4(sbbc_solcons + - SBBC_CONS_OFF(cons_out_end)) - SBBC_SRAM_READ_4(sbbc_solcons + - SBBC_CONS_OFF(cons_out_begin)) - 1; - uart_lock(sc->sc_hwmtx); /* @@ -995,11 +988,24 @@ sbbc_uart_bus_param(struct uart_softc *sc __unused, int baudrate __unused, } static int -sbbc_uart_bus_probe(struct uart_softc *sc __unused) +sbbc_uart_bus_probe(struct uart_softc *sc) { + struct uart_bas *bas; + bus_space_tag_t bst; + bus_space_handle_t bsh; - if (sbbc_console != 0) + if (sbbc_console != 0) { + bas = &sc->sc_bas; + bst = bas->bst; + bsh = bas->bsh; + sc->sc_rxfifosz = SBBC_SRAM_READ_4(sbbc_solcons + + SBBC_CONS_OFF(cons_in_end)) - SBBC_SRAM_READ_4(sbbc_solcons + + SBBC_CONS_OFF(cons_in_begin)) - 1; + sc->sc_txfifosz = SBBC_SRAM_READ_4(sbbc_solcons + + SBBC_CONS_OFF(cons_out_end)) - SBBC_SRAM_READ_4(sbbc_solcons + + SBBC_CONS_OFF(cons_out_begin)) - 1; return (0); + } return (ENXIO); } |