From owner-freebsd-current Sat Mar 30 20:46: 6 2002 Delivered-To: freebsd-current@freebsd.org Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by hub.freebsd.org (Postfix) with ESMTP id 8BE1F37B400; Sat, 30 Mar 2002 20:45:58 -0800 (PST) Received: by elvis.mu.org (Postfix, from userid 1192) id 63653AE03F; Sat, 30 Mar 2002 20:45:58 -0800 (PST) Date: Sat, 30 Mar 2002 20:45:58 -0800 From: Alfred Perlstein To: scott_long@btc.adaptec.com, mark_salyzyn@adaptec.com, obrien@freebsd.org Cc: current@freebsd.org Subject: asr can not map memory? Message-ID: <20020331044558.GD93885@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.27i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I just got the Adaptec 4 port IDE raid card 2400A. It doesn't probe right: asr0: could not map memory I added some debug printouts to the asr driver and pci code. asr0: mem 0xf6000000-0xf7ffffff irq 5 at device 5.1 on pci2 pcib2: device asr0 requested unsupported memory range 0xf6000000-0xf6400000 pcib2: device asr0 requested unsupported memory range 0x0-0xec9fffff (decoding 0xec900000-0xec9fffff, 0xf6000000-0xfbffffff) asr: map failed at: 2602 p:f6000000 f6400000 l:00400000 asr0: could not map memory device_probe_and_attach: asr0 attach returned 6 wtf is going on here? ? pci/.pci_pci.c.swp cvs server: Diffing pci Index: pci/pci_pci.c =================================================================== RCS file: /home/ncvs/src/sys/dev/pci/pci_pci.c,v retrieving revision 1.12 diff -u -r1.12 pci_pci.c --- pci/pci_pci.c 26 Feb 2002 03:31:35 -0000 1.12 +++ pci/pci_pci.c 31 Mar 2002 04:44:57 -0000 @@ -345,6 +345,12 @@ case SYS_RES_MEMORY: if (!pcib_is_isa_mem(start)) { #ifndef PCI_ALLOW_UNSUPPORTED_IO_RANGE + if (bootverbose) + device_printf(dev, + "device %s%d requested unsupported memory range " + "0x%lx-0x%lx\n", + device_get_name(child), device_get_unit(child), start, + end); if (start < sc->membase && end > sc->membase) start = sc->membase; if (end > sc->memlimit) cvs server: Diffing asr Index: asr/asr.c =================================================================== RCS file: /home/ncvs/src/sys/dev/asr/asr.c,v retrieving revision 1.18 diff -u -r1.18 asr.c --- asr/asr.c 20 Mar 2002 02:02:35 -0000 1.18 +++ asr/asr.c 31 Mar 2002 04:45:12 -0000 @@ -2598,16 +2598,20 @@ sc->ha_mem_res = bus_alloc_resource(tag, SYS_RES_MEMORY, &rid, p, p + l, l, RF_ACTIVE); if (sc->ha_mem_res == (struct resource *)NULL) { + printf("asr: map failed at: %d p:%08x %08x l:%08x\n", + __LINE__, p, p+l, l); return (0); } sc->ha_Base = (void *)rman_get_start(sc->ha_mem_res); if (sc->ha_Base == (void *)NULL) { + printf("map failed at: %d\n", __LINE__); return (0); } sc->ha_Virt = (i2oRegs_t *) rman_get_virtual(sc->ha_mem_res); if (s == 0xA5111044) { /* Split BAR Raptor Daptor */ if ((rid += sizeof(u_int32_t)) >= (PCIR_MAPS + 4 * sizeof(u_int32_t))) { + printf("map failed at: %d\n", __LINE__); return (0); } p = pci_read_config(tag, rid, sizeof(p)); @@ -2621,9 +2625,11 @@ sc->ha_mes_res = bus_alloc_resource(tag, SYS_RES_MEMORY, &rid, p, p + l, l, RF_ACTIVE); if (sc->ha_mes_res == (struct resource *)NULL) { + printf("map failed at: %d\n", __LINE__); return (0); } if ((void *)rman_get_start(sc->ha_mes_res) == (void *)NULL) { + printf("map failed at: %d\n", __LINE__); return (0); } sc->ha_Fvirt = (U8 *) rman_get_virtual(sc->ha_mes_res); @@ -2671,6 +2677,7 @@ debug_asr_printf ( "asr_pci_map_mem failed: bad memory type=0x%x\n", (unsigned) l); + printf("map failed at: %d\n", __LINE__); return (0); }; @@ -2703,6 +2710,7 @@ if ((sc->ha_Base == (void *)NULL) || (sc->ha_Base == (void *)PCI_MAP_MEMORY_ADDRESS_MASK)) { debug_asr_printf ("asr_pci_map_mem: not configured by bios.\n"); + printf("map failed at: %d\n", __LINE__); return (0); }; @@ -2716,6 +2724,7 @@ psize + poffs); if (sc->ha_Virt == (i2oRegs_t *)NULL) { + printf("map failed at: %d\n", __LINE__); return (0); } @@ -2723,6 +2732,7 @@ if (s == 0xA5111044) { if ((rid += sizeof(u_int32_t)) >= (PCI_MAP_REG_START + 4 * sizeof(u_int32_t))) { + printf("map failed at: %d\n", __LINE__); return (0); } @@ -2757,6 +2767,7 @@ debug_asr_printf ( "asr_pci_map_mem failed: bad memory type=0x%x\n", (unsigned) l); + printf("map failed at: %d\n", __LINE__); return (0); }; @@ -2778,6 +2789,7 @@ sc->ha_Fvirt = (U8 *)pmap_mapdev (p - poffs, psize + poffs); if (sc->ha_Fvirt == (U8 *)NULL) { + printf("map failed at: %d\n", __LINE__); return (0); } @@ -2786,6 +2798,7 @@ sc->ha_Fvirt = (U8 *)(sc->ha_Virt); } #endif + printf("map ok at: %d\n", __LINE__); return (1); } /* asr_pci_map_mem */ -- -Alfred Perlstein [alfred@freebsd.org] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' Tax deductible donations for FreeBSD: http://www.freebsdfoundation.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message