From owner-svn-src-all@FreeBSD.ORG Sat Jan 12 16:09:34 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 67E0A561; Sat, 12 Jan 2013 16:09:34 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4357DE81; Sat, 12 Jan 2013 16:09:34 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CG9YMP084614; Sat, 12 Jan 2013 16:09:34 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CG9YD1084613; Sat, 12 Jan 2013 16:09:34 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301121609.r0CG9YD1084613@svn.freebsd.org> From: Robert Watson Date: Sat, 12 Jan 2013 16:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245335 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Sat, 12 Jan 2013 16:09:34 -0000 Author: rwatson Date: Sat Jan 12 16:09:33 2013 New Revision: 245335 URL: http://svnweb.freebsd.org/changeset/base/245335 Log: Merge Perforce changeset 219933 and portions of 219962 (omits changes to unmerged BERI DTS files) to head: Use the OFW compatible string "mips,mips4k" rather than "mips4k,cp0" for interrupt control using MIPS4k CP0. Suggested by: thompsa Implement a MIPS FDT PIC decode routine to use when no PIC has been configured, which assumes a cascade back to the nexus bus (e.g., the on-board CP0 interrupt management parts on the MIPS). If the soc bus in a MIPS DTS file is declared as "mips4k,cp0"-compatible, then this will be enabled. This is sufficient to allow IRQs to be configured on BERI. Sponsored by: DARPA, AFRL Modified: head/sys/dev/fdt/fdt_mips.c Modified: head/sys/dev/fdt/fdt_mips.c ============================================================================== --- head/sys/dev/fdt/fdt_mips.c Sat Jan 12 16:05:55 2013 (r245334) +++ head/sys/dev/fdt/fdt_mips.c Sat Jan 12 16:09:33 2013 (r245335) @@ -49,8 +49,26 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; +/* + * For PIC-free boards, provide a PIC decoder to be used with mips4k CP0 + * interrupt control directly. + */ +static int +fdt_pic_decode_mips4k_cp0(phandle_t node, pcell_t *intr, int *interrupt, + int *trig, int *pol) +{ + + if (!fdt_is_compatible(node, "mips,mips4k")) + return (ENXIO); + + *interrupt = fdt32_to_cpu(intr[0]); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + + return (0); +} + fdt_pic_decode_t fdt_pic_table[] = { - NULL, - NULL, + &fdt_pic_decode_mips4k_cp0, NULL };