From owner-freebsd-questions@FreeBSD.ORG Fri Sep 17 23:03:21 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 26E6B16A4CE for ; Fri, 17 Sep 2004 23:03:21 +0000 (GMT) Received: from o2.hostbaby.com (o2.hostbaby.com [208.187.29.121]) by mx1.FreeBSD.org (Postfix) with SMTP id D0CD843D2D for ; Fri, 17 Sep 2004 23:03:20 +0000 (GMT) (envelope-from ceo@l-i-e.com) Received: (qmail 50686 invoked by uid 1001); 17 Sep 2004 23:03:24 -0000 Received: from 66.243.145.38 (SquirrelMail authenticated user ceo@l-i-e.com); by www.l-i-e.com with HTTP; Fri, 17 Sep 2004 16:03:24 -0700 (PDT) Message-ID: <1217.66.243.145.38.1095462204.squirrel@www.l-i-e.com> In-Reply-To: <1361.66.243.145.38.1094337785.squirrel@www.l-i-e.com> References: <1361.66.243.145.38.1094337785.squirrel@www.l-i-e.com> Date: Fri, 17 Sep 2004 16:03:24 -0700 (PDT) From: "Richard Lynch" To: freebsd-questions@freebsd.org User-Agent: Hostbaby Webmail X-Mailer: Hostbaby Webmail MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal cc: freebsd-mobile@freebsd.org Subject: couldn't map memory X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ceo@l-i-e.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2004 23:03:21 -0000 Richard Lynch wrote: > I have installed FreeBSD 5.2.1 on a Dell Insprion 700 m, dual boot with > the existing XP Home Edition (blech). > > Have begun posting my experience at > http://phpbootcamp.com/articles/inspiron700m.htm > > The built-in LAN NIC is a Broadcom 440x. > > It works well enough under Windows to send this message. :-^ An update, and re-title, since I've moved quite a bit forward. I'm also cc-ing -mobile, to which I'm not even subscribed at this time, cuz I can only keep up with so many lists... Hope that's not too rude. I disabled bfe in my GENERIC kernel and re-built that, so I could hack the BFE source and try it as a module without a 20-minute re-build and re-boot. So I do "make; make install:" in /usr/src/sys/modules/bfe and then "kldload /boot/kernel/if_bfe.ko" which seems to "work" -- at least well enough to print out my debugging statements, or when I'm particularly stupid, page fault and crash the machine. I added the device_id as a constant in the BFE header: --- /usr/src/sys/dev/bfe/if_bfereg.h --- #define BCOM_DEVICEID_BCM4401_B0 0x170c I added the device id to the array of known BFE devices: --- /usr/src/sys/dev/bfe/if_bfe.c --- static struct bfe_type bfe_devs[] = { { BCOM_VENDORID, BCOM_DEVICEID_BCM4401, "Broadcom BCM4401 Fast Ethernet" }, { BCOM_VENDORID, BCOM_DEVICEID_BCM4401_B0, "Broadcom BCM4401-B0 Fast Ethernet" }, { 0, 0, NULL } }; I added an id to the MII headers, even thought it's the same: --- /usr/src/sys/dev/mii/miidevs --- model BROADCOM BCM4401 0x0036 BCM4401 10/100baseTX PHY /* Michael Chan of Broadcom was kind enough to email me that 0x36 is right */ model BROADCOM BCM4401_B0 0x0036 BCM4401-B0 10/100baseTX PHY The bfe_attach function which is getting registered with the Device as a callback is being called, and eventually reaches the line where it attempts to do: sc->bfe_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, RF_ACTIVE); It is at this point that it is then printing out "Could not map memory" Now, I had already tried setting hints for maddr and msize to the values being used by Windows, in the hope that they would also be good numbers for FreeBSD. However, one thing I'm not sure of -- Do those "hints" affect a Module, or would they only apply to something built in to the kernel? Perhaps now that I've gotten the device "recognized" I should move back to using the kernel re-build with bfe enabled again. What other ways, short of hacking the source, can be used to provide good numbers for memory to bus_alloc_resource? And what magical incantations would allow me to find good numbers, as with 2 GIG of RAM, I suspect it could be a lonnnnnnng time before I stumbled on good numbers by just guessing. The is the output of "kldload /boot/kernel/if_bfe.ko" with the above alterations applied. Not quite sure why cbb0 and fwohci0 are getting in the picture... Perhaps the mere attempt to query their PCI vendor_id and device_id causes them to attempt to re-initialize?... Sep 17 00:31:09 kernel: cbb0: at device 4.0 on pci2 Sep 17 00:31:09 kernel: cbb0: pccbb.c Could not grab register memory Sep 17 00:31:09 kernel: device_probe_and_attach: cbb0 attach returned 12 Sep 17 00:31:09 kernel: cbb0: at device 4.1 on pci2 Sep 17 00:31:09 kernel: cbb0: pccbb.c Could not grab register memory Sep 17 00:31:09 kernel: device_probe_and_attach: cbb0 attach returned 12 Sep 17 00:31:09 kernel: fwohci0: vendor=104c, dev=802e Sep 17 00:31:09 kernel: fwohci0: <1394 Open Host Controller Interface> mem 0xe0200000-0xe0203fff,0xe0209000-0xe02097ff irq 10 at device 4.2 on pci2 Sep 17 00:31:09 kernel: fwohci0: Could not map memory Sep 17 00:31:09 kernel: device_probe_and_attach: fwohci0 attach returned 6 Sep 17 00:31:09 kernel: sc->bfe_miibus is NULL. Sep 17 00:31:09 kernel: bfe0: mem 0xe0206000-0xe0207fff irq 10 at device 5.0 on pci2 Sep 17 00:31:09 kernel: bfe0: couldn't map memory Sep 17 00:31:09 kernel: device_probe_and_attach: bfe0 attach returned 6 -- Like Music? http://l-i-e.com/artists.htm