From owner-svn-src-all@FreeBSD.ORG Fri Jan 4 18:11:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CA0B5B44; Fri, 4 Jan 2013 18:11:06 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id A4F06C7; Fri, 4 Jan 2013 18:11:06 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from wanderer.tachypleus.net (dhcp107-17-54-205.hil-sfofhhh.sfo.wayport.net [107.17.54.205]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0MG4003ND2E6KM20@smtpauth3.wiscmail.wisc.edu>; Fri, 04 Jan 2013 11:11:00 -0600 (CST) X-Spam-PmxInfo: Server=avs-3, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.1.4.165714, SenderIP=107.17.54.205 X-Spam-Report: AuthenticatedSender=yes, SenderIP=107.17.54.205 X-Wisc-Sender: whitehorn@wisc.edu Message-id: <50E70D1E.5060208@freebsd.org> Date: Fri, 04 Jan 2013 12:10:54 -0500 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 To: Andrew Turner Subject: Re: svn commit: r244899 - head/sys/mips/beri References: <201212311106.qBVB6chM016661@svn.freebsd.org> <20130102081746.5435db05@fubar.geek.nz> <20130102110856.7c280fd5@fubar.geek.nz> <0E1E1A5C-BB34-4B82-828F-6FEE770A6037@FreeBSD.org> <20130103100258.2e22763f@fubar.geek.nz> In-reply-to: <20130103100258.2e22763f@fubar.geek.nz> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "Robert N. M. Watson" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 18:11:06 -0000 On 01/02/13 16:02, Andrew Turner wrote: > On Wed, 2 Jan 2013 11:01:27 +0000 > "Robert N. M. Watson" wrote: > >> On 1 Jan 2013, at 22:08, Andrew Turner wrote: >> >>>> On a semi-related note: the current obstacle to moving more devices >>>> over to using FDT on BERI is that our FDT implementation appears to >>>> require a PIC to be configured. We're not actually using a PIC on >>>> BERI currently. It works fine attached to nexus, as the implied >>>> fallback for not having a PIC is to simply use the suitably >>>> numbered interrupt wires direct into the MIPS. However, trying the >>>> same setup described using FDT leads to an interrupt-related >>>> warning at boot, and no interrupt being provided to the driver. I >>>> suspect I need to provide a PIC-alike software component as a >>>> fall-back for the non-PIC case. From a brief e-mail exchange with >>>> JC, it sounds like the XLP FDT setup is actually not using >>>> interrupts either, currently. >>> I'm not sure if a PIC is required. From my reading of the code it >>> appears not. By the look of it if you are using the nexus to >>> handle interrupts you need to put an interrupts property in the >>> device and "#interrupt-cells = <1>;" in the soc node. >>> >>> You will also need to implement an interrupt decode function and >>> add it to the fdt_pic_table array. ARM has a number of almost >>> identical copies of this function you can use for inspration. >> >> This seemed to do the trick; what do you think of the attached? This >> isn't a board-specific change, so I dropped it into the common >> fdt_mips.c code. On the other hand, this left it a bit open as to >> what the right compatible= line to use was, so feedback there most >> welcome. > The patch looks good. From my reading of [1] the compatible value > should be something like "mips,mips4k" as it's value is of the form > ",". > > I have been thinking the best way of merging these almost identical > decode functions. Linux appears to do it by providing a per-controller > function that can translate between the interrupt spec and the > configuration allowing them to have a generic parsing function that > doesn't need to check if the controller is compatible. I would like us > to have something similar as it will remove the duplicate function. > > Andrew > > [1] http://www.devicetree.org/Device_Tree_Usage PowerPC does something very much like this currently in the real OF case. Looking at the contents of /sys/dev/fdt, it seems like there is a lot of code duplication in particular with interrupts and PCI handling compared to the equivalent parts of /sys/dev/ofw (and a few extra things that are actually MI like /sys/powerpc/ofw_pci*). It would be very nice if we could make FDT follow the normal OF codepaths instead of (partially) reinventing the wheel. -Nathan