Deleted Added
full compact
sbbc.c (247574) sbbc.c (248965)
1/* $OpenBSD: sbbc.c,v 1.7 2009/11/09 17:53:39 nicm Exp $ */
2/*-
3 * Copyright (c) 2008 Mark Kettenis
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *

--- 27 unchanged lines hidden (view full) ---

36 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 * SUCH DAMAGE.
41 */
42
43#include <sys/cdefs.h>
1/* $OpenBSD: sbbc.c,v 1.7 2009/11/09 17:53:39 nicm Exp $ */
2/*-
3 * Copyright (c) 2008 Mark Kettenis
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *

--- 27 unchanged lines hidden (view full) ---

36 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 * SUCH DAMAGE.
41 */
42
43#include <sys/cdefs.h>
44__FBSDID("$FreeBSD: head/sys/sparc64/pci/sbbc.c 247574 2013-03-01 20:36:59Z marius $");
44__FBSDID("$FreeBSD: head/sys/sparc64/pci/sbbc.c 248965 2013-04-01 00:44:20Z ian $");
45
46#include <sys/param.h>
47#include <sys/systm.h>
48#include <sys/bus.h>
49#include <sys/clock.h>
50#include <sys/endian.h>
51#include <sys/kernel.h>
52#include <sys/lock.h>

--- 777 unchanged lines hidden (view full) ---

830 bus_space_tag_t bst;
831 bus_space_handle_t bsh;
832 uint32_t wrptr;
833
834 bas = &sc->sc_bas;
835 bst = bas->bst;
836 bsh = bas->bsh;
837
45
46#include <sys/param.h>
47#include <sys/systm.h>
48#include <sys/bus.h>
49#include <sys/clock.h>
50#include <sys/endian.h>
51#include <sys/kernel.h>
52#include <sys/lock.h>

--- 777 unchanged lines hidden (view full) ---

830 bus_space_tag_t bst;
831 bus_space_handle_t bsh;
832 uint32_t wrptr;
833
834 bas = &sc->sc_bas;
835 bst = bas->bst;
836 bsh = bas->bsh;
837
838 sc->sc_rxfifosz = SBBC_SRAM_READ_4(sbbc_solcons +
839 SBBC_CONS_OFF(cons_in_end)) - SBBC_SRAM_READ_4(sbbc_solcons +
840 SBBC_CONS_OFF(cons_in_begin)) - 1;
841 sc->sc_txfifosz = SBBC_SRAM_READ_4(sbbc_solcons +
842 SBBC_CONS_OFF(cons_out_end)) - SBBC_SRAM_READ_4(sbbc_solcons +
843 SBBC_CONS_OFF(cons_out_begin)) - 1;
844
845 uart_lock(sc->sc_hwmtx);
846
847 /*
848 * Let the current output drain before enabling interrupts. Not
849 * doing so tends to cause lost output when turning them on.
850 */
851 wrptr = SBBC_SRAM_READ_4(sbbc_solcons +
852 SBBC_CONS_OFF(cons_out_wrptr));

--- 137 unchanged lines hidden (view full) ---

990sbbc_uart_bus_param(struct uart_softc *sc __unused, int baudrate __unused,
991 int databits __unused, int stopbits __unused, int parity __unused)
992{
993
994 return (0);
995}
996
997static int
838 uart_lock(sc->sc_hwmtx);
839
840 /*
841 * Let the current output drain before enabling interrupts. Not
842 * doing so tends to cause lost output when turning them on.
843 */
844 wrptr = SBBC_SRAM_READ_4(sbbc_solcons +
845 SBBC_CONS_OFF(cons_out_wrptr));

--- 137 unchanged lines hidden (view full) ---

983sbbc_uart_bus_param(struct uart_softc *sc __unused, int baudrate __unused,
984 int databits __unused, int stopbits __unused, int parity __unused)
985{
986
987 return (0);
988}
989
990static int
998sbbc_uart_bus_probe(struct uart_softc *sc __unused)
991sbbc_uart_bus_probe(struct uart_softc *sc)
999{
992{
993 struct uart_bas *bas;
994 bus_space_tag_t bst;
995 bus_space_handle_t bsh;
1000
996
1001 if (sbbc_console != 0)
997 if (sbbc_console != 0) {
998 bas = &sc->sc_bas;
999 bst = bas->bst;
1000 bsh = bas->bsh;
1001 sc->sc_rxfifosz = SBBC_SRAM_READ_4(sbbc_solcons +
1002 SBBC_CONS_OFF(cons_in_end)) - SBBC_SRAM_READ_4(sbbc_solcons +
1003 SBBC_CONS_OFF(cons_in_begin)) - 1;
1004 sc->sc_txfifosz = SBBC_SRAM_READ_4(sbbc_solcons +
1005 SBBC_CONS_OFF(cons_out_end)) - SBBC_SRAM_READ_4(sbbc_solcons +
1006 SBBC_CONS_OFF(cons_out_begin)) - 1;
1002 return (0);
1007 return (0);
1008 }
1003 return (ENXIO);
1004}
1005
1006static int
1007sbbc_uart_bus_receive(struct uart_softc *sc)
1008{
1009 struct uart_bas *bas;
1010 bus_space_tag_t bst;

--- 94 unchanged lines hidden ---
1009 return (ENXIO);
1010}
1011
1012static int
1013sbbc_uart_bus_receive(struct uart_softc *sc)
1014{
1015 struct uart_bas *bas;
1016 bus_space_tag_t bst;

--- 94 unchanged lines hidden ---