Deleted Added
full compact
psycho.c (247914) psycho.c (257066)
1/*-
2 * Copyright (c) 1999, 2000 Matthew R. Green
3 * Copyright (c) 2001 - 2003 by Thomas Moestl <tmm@FreeBSD.org>
4 * Copyright (c) 2005 - 2006 Marius Strobl <marius@FreeBSD.org>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 *
30 * from: NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1999, 2000 Matthew R. Green
3 * Copyright (c) 2001 - 2003 by Thomas Moestl <tmm@FreeBSD.org>
4 * Copyright (c) 2005 - 2006 Marius Strobl <marius@FreeBSD.org>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 *
30 * from: NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/sparc64/pci/psycho.c 247914 2013-03-07 13:24:49Z gavin $");
34__FBSDID("$FreeBSD: head/sys/sparc64/pci/psycho.c 257066 2013-10-24 17:06:41Z marius $");
35
36/*
37 * Support for `Hummingbird' (UltraSPARC IIe), `Psycho' and `Psycho+'
38 * (UltraSPARC II) and `Sabre' (UltraSPARC IIi) UPA to PCI bridges.
39 */
40
41#include "opt_ofw_pci.h"
42#include "opt_psycho.h"

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

568 sc->sc_dma_methods = &iommu_dma_methods;
569 sc->sc_is = osc->sc_is;
570 if (OF_getproplen(node, "no-streaming-cache") < 0)
571 sc->sc_is->is_sb[1] = sc->sc_pcictl + PCR_STRBUF;
572 iommu_reset(sc->sc_is);
573 }
574
575 /* Allocate our tags. */
35
36/*
37 * Support for `Hummingbird' (UltraSPARC IIe), `Psycho' and `Psycho+'
38 * (UltraSPARC II) and `Sabre' (UltraSPARC IIi) UPA to PCI bridges.
39 */
40
41#include "opt_ofw_pci.h"
42#include "opt_psycho.h"

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

568 sc->sc_dma_methods = &iommu_dma_methods;
569 sc->sc_is = osc->sc_is;
570 if (OF_getproplen(node, "no-streaming-cache") < 0)
571 sc->sc_is->is_sb[1] = sc->sc_pcictl + PCR_STRBUF;
572 iommu_reset(sc->sc_is);
573 }
574
575 /* Allocate our tags. */
576 sc->sc_pci_iot = sparc64_alloc_bus_tag(NULL, rman_get_bustag(
577 sc->sc_mem_res), PCI_IO_BUS_SPACE, NULL);
576 sc->sc_pci_iot = sparc64_alloc_bus_tag(NULL, PCI_IO_BUS_SPACE);
578 if (sc->sc_pci_iot == NULL)
579 panic("%s: could not allocate PCI I/O tag", __func__);
577 if (sc->sc_pci_iot == NULL)
578 panic("%s: could not allocate PCI I/O tag", __func__);
580 sc->sc_pci_cfgt = sparc64_alloc_bus_tag(NULL, rman_get_bustag(
581 sc->sc_mem_res), PCI_CONFIG_BUS_SPACE, NULL);
579 sc->sc_pci_cfgt = sparc64_alloc_bus_tag(NULL, PCI_CONFIG_BUS_SPACE);
582 if (sc->sc_pci_cfgt == NULL)
583 panic("%s: could not allocate PCI configuration space tag",
584 __func__);
585 if (bus_dma_tag_create(bus_get_dma_tag(dev), 8, 0,
586 sc->sc_is->is_pmaxaddr, ~0, NULL, NULL, sc->sc_is->is_pmaxaddr,
587 0xff, 0xffffffff, 0, NULL, NULL, &sc->sc_pci_dmat) != 0)
588 panic("%s: could not create PCI DMA tag", __func__);
589 /* Customize the tag. */

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

1231 struct bus_space_tag *tag;
1232
1233 sc = device_get_softc(bus);
1234 switch (type) {
1235 case SYS_RES_IRQ:
1236 return (bus_generic_activate_resource(bus, child, type, rid,
1237 r));
1238 case SYS_RES_MEMORY:
580 if (sc->sc_pci_cfgt == NULL)
581 panic("%s: could not allocate PCI configuration space tag",
582 __func__);
583 if (bus_dma_tag_create(bus_get_dma_tag(dev), 8, 0,
584 sc->sc_is->is_pmaxaddr, ~0, NULL, NULL, sc->sc_is->is_pmaxaddr,
585 0xff, 0xffffffff, 0, NULL, NULL, &sc->sc_pci_dmat) != 0)
586 panic("%s: could not create PCI DMA tag", __func__);
587 /* Customize the tag. */

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

1229 struct bus_space_tag *tag;
1230
1231 sc = device_get_softc(bus);
1232 switch (type) {
1233 case SYS_RES_IRQ:
1234 return (bus_generic_activate_resource(bus, child, type, rid,
1235 r));
1236 case SYS_RES_MEMORY:
1239 tag = sparc64_alloc_bus_tag(r, rman_get_bustag(
1240 sc->sc_mem_res), PCI_MEMORY_BUS_SPACE, NULL);
1237 tag = sparc64_alloc_bus_tag(r, PCI_MEMORY_BUS_SPACE);
1241 if (tag == NULL)
1242 return (ENOMEM);
1243 rman_set_bustag(r, tag);
1244 rman_set_bushandle(r, sc->sc_pci_bh[OFW_PCI_CS_MEM32] +
1245 rman_get_start(r));
1246 break;
1247 case SYS_RES_IOPORT:
1248 rman_set_bustag(r, sc->sc_pci_iot);

--- 70 unchanged lines hidden ---
1238 if (tag == NULL)
1239 return (ENOMEM);
1240 rman_set_bustag(r, tag);
1241 rman_set_bushandle(r, sc->sc_pci_bh[OFW_PCI_CS_MEM32] +
1242 rman_get_start(r));
1243 break;
1244 case SYS_RES_IOPORT:
1245 rman_set_bustag(r, sc->sc_pci_iot);

--- 70 unchanged lines hidden ---