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

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

23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * from: NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp
30 *
1/*
2 * Copyright (c) 1999, 2000 Matthew R. Green
3 * All rights reserved.
4 * Copyright 2001 by Thomas Moestl <tmm@FreeBSD.org>. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * from: NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp
30 *
31 * $FreeBSD: head/sys/sparc64/pci/psycho.c 111119 2003-02-19 05:47:46Z imp $
31 * $FreeBSD: head/sys/sparc64/pci/psycho.c 113238 2003-04-08 06:35:09Z jake $
32 */
33
34/*
35 * Support for `psycho' and `psycho+' UPA to PCI bridge and
36 * UltraSPARC IIi and IIe `sabre' PCI controllers.
37 */
38
39#include "opt_psycho.h"

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

335psycho_attach(device_t dev)
336{
337 struct psycho_softc *sc;
338 struct psycho_softc *osc = NULL;
339 struct psycho_softc *asc;
340 struct upa_regs *reg;
341 struct ofw_pci_bdesc obd;
342 struct psycho_desc *desc;
32 */
33
34/*
35 * Support for `psycho' and `psycho+' UPA to PCI bridge and
36 * UltraSPARC IIi and IIe `sabre' PCI controllers.
37 */
38
39#include "opt_psycho.h"

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

335psycho_attach(device_t dev)
336{
337 struct psycho_softc *sc;
338 struct psycho_softc *osc = NULL;
339 struct psycho_softc *asc;
340 struct upa_regs *reg;
341 struct ofw_pci_bdesc obd;
342 struct psycho_desc *desc;
343 vm_paddr_t pcictl_offs;
343 phandle_t node;
344 u_int64_t csr;
344 phandle_t node;
345 u_int64_t csr;
345 u_long pcictl_offs, mlen;
346 u_long mlen;
346 int psycho_br[2];
347 int n, i, nreg, rid;
348#if defined(PSYCHO_DEBUG) || defined(PSYCHO_STRAY)
349 bus_addr_t map, clr;
350 u_int64_t mr;
351#endif
352#ifdef PSYCHO_STRAY
353 struct psycho_strayclr *sclr;

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

370 * (2) the shared psycho configuration registers (struct psychoreg)
371 */
372 reg = nexus_get_reg(dev);
373 nreg = nexus_get_nreg(dev);
374 /* Register layouts are different. stuupid. */
375 if (sc->sc_mode == PSYCHO_MODE_PSYCHO) {
376 if (nreg <= 2)
377 panic("psycho_attach: %d not enough registers", nreg);
347 int psycho_br[2];
348 int n, i, nreg, rid;
349#if defined(PSYCHO_DEBUG) || defined(PSYCHO_STRAY)
350 bus_addr_t map, clr;
351 u_int64_t mr;
352#endif
353#ifdef PSYCHO_STRAY
354 struct psycho_strayclr *sclr;

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

371 * (2) the shared psycho configuration registers (struct psychoreg)
372 */
373 reg = nexus_get_reg(dev);
374 nreg = nexus_get_nreg(dev);
375 /* Register layouts are different. stuupid. */
376 if (sc->sc_mode == PSYCHO_MODE_PSYCHO) {
377 if (nreg <= 2)
378 panic("psycho_attach: %d not enough registers", nreg);
378 sc->sc_basepaddr = (vm_offset_t)UPA_REG_PHYS(&reg[2]);
379 sc->sc_basepaddr = (vm_paddr_t)UPA_REG_PHYS(&reg[2]);
379 mlen = UPA_REG_SIZE(&reg[2]);
380 pcictl_offs = UPA_REG_PHYS(&reg[0]);
381 } else {
382 if (nreg <= 0)
383 panic("psycho_attach: %d not enough registers", nreg);
380 mlen = UPA_REG_SIZE(&reg[2]);
381 pcictl_offs = UPA_REG_PHYS(&reg[0]);
382 } else {
383 if (nreg <= 0)
384 panic("psycho_attach: %d not enough registers", nreg);
384 sc->sc_basepaddr = (vm_offset_t)UPA_REG_PHYS(&reg[0]);
385 sc->sc_basepaddr = (vm_paddr_t)UPA_REG_PHYS(&reg[0]);
385 mlen = UPA_REG_SIZE(reg);
386 pcictl_offs = sc->sc_basepaddr + PSR_PCICTL0;
387 }
388
389 /*
390 * Match other psycho's that are already configured against
391 * the base physical address. This will be the same for a
392 * pair of devices that share register space.

--- 1046 unchanged lines hidden ---
386 mlen = UPA_REG_SIZE(reg);
387 pcictl_offs = sc->sc_basepaddr + PSR_PCICTL0;
388 }
389
390 /*
391 * Match other psycho's that are already configured against
392 * the base physical address. This will be the same for a
393 * pair of devices that share register space.

--- 1046 unchanged lines hidden ---