Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/xscale Clear the Master Abort after reading con...



details:   https://anonhg.NetBSD.org/src/rev/530877e6054e
branches:  trunk
changeset: 517262:530877e6054e
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Nov 09 18:04:10 2001 +0000

description:
Clear the Master Abort after reading config space for a non-existent
PCI device.  Disable debugging messages, as PCI config space works now.

diffstat:

 sys/arch/arm/xscale/i80312_pci.c |  17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diffs (54 lines):

diff -r 2a417861de94 -r 530877e6054e sys/arch/arm/xscale/i80312_pci.c
--- a/sys/arch/arm/xscale/i80312_pci.c  Fri Nov 09 17:58:00 2001 +0000
+++ b/sys/arch/arm/xscale/i80312_pci.c  Fri Nov 09 18:04:10 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i80312_pci.c,v 1.1 2001/11/09 03:27:51 thorpej Exp $   */
+/*     $NetBSD: i80312_pci.c,v 1.2 2001/11/09 18:04:10 thorpej Exp $   */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -114,6 +114,7 @@
 struct pciconf_state {
        bus_addr_t ps_addr_reg;
        bus_addr_t ps_data_reg;
+       bus_addr_t ps_csr_reg;
        uint32_t ps_addr_val;
 
        int ps_b, ps_d, ps_f;
@@ -140,9 +141,11 @@
        if (ps->ps_b == pbus) {
                ps->ps_addr_reg = I80312_ATU_POCCA;
                ps->ps_data_reg = I80312_ATU_POCCD;
+               ps->ps_csr_reg = PCI_COMMAND_STATUS_REG;
        } else {
                ps->ps_addr_reg = I80312_ATU_SOCCA;
                ps->ps_data_reg = I80312_ATU_SOCCD;
+               ps->ps_csr_reg = I80312_ATU_SACS;
        }
 
        /*
@@ -182,16 +185,20 @@
        bus_space_write_4(sc->sc_st, sc->sc_atu_sh, ps.ps_addr_reg,
            ps.ps_addr_val);
 
-#if 1
        va = (vaddr_t) bus_space_vaddr(sc->sc_st, sc->sc_atu_sh);
        if (badaddr_read((void *) (va + ps.ps_data_reg), sizeof(rv), &rv)) {
+               /*
+                * Clear the Master Abort by reading the PCI
+                * Status Register.
+                */
+               (void) bus_space_read_4(sc->sc_st, sc->sc_atu_sh,
+                   ps.ps_csr_reg);
+#if 0
                printf("conf_read: %d/%d/%d bad address\n",
                    ps.ps_b, ps.ps_d, ps.ps_f);
+#endif
                rv = (pcireg_t) -1;
        }
-#else
-       rv = bus_space_read_4(sc->sc_st, sc->sc_atu_sh, ps.ps_data_reg);
-#endif
 
        PCI_CONF_UNLOCK(s);
 



Home | Main Index | Thread Index | Old Index