From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 29 09:38:01 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1017F1065670 for ; Tue, 29 Sep 2009 09:38:01 +0000 (UTC) (envelope-from mlfbsd@kanar.ci0.org) Received: from kanar.ci0.org (kanar.ci0.org [88.191.50.96]) by mx1.freebsd.org (Postfix) with ESMTP id B425A8FC17 for ; Tue, 29 Sep 2009 09:38:00 +0000 (UTC) Received: from kanar.ci0.org (pluxor@localhost [127.0.0.1]) by kanar.ci0.org (8.14.2/8.14.3) with ESMTP id n8T9cPag026721; Tue, 29 Sep 2009 11:38:25 +0200 (CEST) (envelope-from mlfbsd@kanar.ci0.org) Received: (from mlfbsd@localhost) by kanar.ci0.org (8.14.2/8.14.3/Submit) id n8T9cP7k026720; Tue, 29 Sep 2009 11:38:25 +0200 (CEST) (envelope-from mlfbsd) Date: Tue, 29 Sep 2009 11:38:25 +0200 From: Olivier Houchard To: Tom Judge Message-ID: <20090929093825.GA26424@ci0.org> References: <4AC106AA.9000305@tomjudge.com> <20090928202132.GA15236@ci0.org> <4AC16B5A.8090407@tomjudge.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="qDbXVdCdHGoSgWSk" Content-Disposition: inline In-Reply-To: <4AC16B5A.8090407@tomjudge.com> User-Agent: Mutt/1.4.2.1i X-Mailman-Approved-At: Tue, 29 Sep 2009 11:36:53 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: Help debugging: Fatal kernel mode data abort: 'External Linefetch Abort (P)' X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2009 09:38:01 -0000 --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Sep 29, 2009 at 02:05:14AM +0000, Tom Judge wrote: > Olivier Houchard wrote: > >On Mon, Sep 28, 2009 at 06:55:38PM +0000, Tom Judge wrote: > > > >>Hi, > >> > >>I am working on getting FreeBSD to boot on a new ARM based board, and am > >>hitting this issue any time I load a driver for the PCI based devices on > >>the board. > >> > >>My current code can be found here: > >> > >>http://www.tomjudge.com/tmp/em7210.patch > >> > >> > > > >Hi Tom, > > > >My guess is, you should include std.i80219 instead of std.i80321 in > >std.em7210. > >If you do not, CPU_XSCALE_80219 won't be defined, and the 80321 code to > >check if the board is host or not will be used, and will wrongly assume > >it is not, and thus won't map the PCI mem correctly. > > > > > Hi Olivier, > > I have switched out the std file and am now using std.i80219 but am > still having issues. > > I think the problems are the pci memory mappings in the controller devices. > > On linux em0 gets mapped as follows: > > cd 0000\:00\:01.0/ > # ls > class device local_cpus subsystem_device > config driver resource subsystem_vendor > detach_state irq rom vendor > # cat resource > 0x0000000080000000 0x000000008001ffff 0x0000000000000200 > 0x0000000080020000 0x000000008003ffff 0x0000000000000200 > 0x00000000fe000000 0x00000000fe00003f 0x0000000000000101 > 0x0000000000000000 0x0000000000000000 0x0000000000000000 > 0x0000000000000000 0x0000000000000000 0x0000000000000000 > 0x0000000000000000 0x0000000000000000 0x0000000000000000 > 0x0000000080040000 0x000000008005ffff 0x0000000000007200 > # > > > > Where as on FreeBSD I am seeing this: > em0: port > 0xfe400000-0xfe40003f mem 0-0x1ffff,0x20000-0x3ffff irq 29 at device 1.0 > on pci0 > > Seems that I am missing the 0x800 off the front of the PCI memory mappings. > Ok I'm a bit confused about this code, it's been too long since I haven't read it :) Could you try the attached patch ? Thanks ! If it doesn't help, you can print adapter->osdep.mem_bus_space_handle in if_em.c to make sure it is the same as in linux. Regards, Olivier --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="i80321_pci.c.diff" Index: arm/xscale/i80321/i80321_pci.c =================================================================== --- arm/xscale/i80321/i80321_pci.c (revision 196158) +++ arm/xscale/i80321/i80321_pci.c (working copy) @@ -92,8 +92,7 @@ sc->sc_busno = busno; sc->sc_pciio = &i80321_softc->sc_pci_iot; sc->sc_pcimem = &i80321_softc->sc_pci_memt; - sc->sc_mem = i80321_softc->sc_owin[0].owin_xlate_lo + - VERDE_OUT_XLATE_MEM_WIN_SIZE; + sc->sc_mem = i80321_softc->sc_owin[0].owin_xlate_lo; sc->sc_io = i80321_softc->sc_iow_vaddr; /* Initialize memory and i/o rmans. */ --qDbXVdCdHGoSgWSk--