From owner-p4-projects@FreeBSD.ORG Wed May 9 22:34:09 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D317016A407; Wed, 9 May 2007 22:34:08 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9196716A405 for ; Wed, 9 May 2007 22:34:08 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 82CFA13C469 for ; Wed, 9 May 2007 22:34:08 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l49MY8e3089811 for ; Wed, 9 May 2007 22:34:08 GMT (envelope-from bms@incunabulum.net) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l49MY8F6089808 for perforce@freebsd.org; Wed, 9 May 2007 22:34:08 GMT (envelope-from bms@incunabulum.net) Date: Wed, 9 May 2007 22:34:08 GMT Message-Id: <200705092234.l49MY8F6089808@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bms@incunabulum.net using -f From: Bruce M Simpson To: Perforce Change Reviews Cc: Subject: PERFORCE change 119604 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 May 2007 22:34:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=119604 Change 119604 by bms@bms_anglepoise on 2007/05/09 22:33:20 Try to route an interrupt. It looks like this request got proxied to nexus. I haven't tested this to make sure if it worked or not yet. Affected files ... .. //depot/projects/mips2/src/sys/mips/mips32/sentry5/siba_cc.c#4 edit Differences ... ==== //depot/projects/mips2/src/sys/mips/mips32/sentry5/siba_cc.c#4 (text+ko) ==== @@ -47,6 +47,7 @@ static int siba_cc_attach(device_t); static int siba_cc_probe(device_t); +static void siba_cc_intr(void *v); static int siba_cc_probe(device_t dev) @@ -70,6 +71,7 @@ { //struct siba_cc_softc *sc = device_get_softc(dev); struct resource *mem; + struct resource *irq; int rid; /* @@ -79,22 +81,47 @@ */ #define MIPS_MEM_RID 0x20 rid = MIPS_MEM_RID; - mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, - RF_ACTIVE); + mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (mem == NULL) { device_printf(dev, "unable to allocate memory\n"); return (ENXIO); } -#if 0 - device_printf(dev, "start %08lx size %04lx\n", - rman_get_start(mem), rman_get_size(mem)); -#endif + + rid = 0; + irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, 0); + if (irq == NULL) { + device_printf(dev, "unable to allocate irq\n"); + return (ENXIO); + } + + /* now setup the interrupt */ + /* may be fast, exclusive or mpsafe at a later date */ + + /* + * XXX is this interrupt line in ChipCommon used for anything + * other than the uart? in that case we shouldn't hog it ourselves + * and let uart claim it to avoid polled mode. + */ + int err; + void *cookie; + err = bus_setup_intr(dev, irq, INTR_TYPE_TTY, NULL, siba_cc_intr, NULL, + &cookie); + if (err != 0) { + device_printf(dev, "unable to setup intr\n"); + return (ENXIO); + } /* TODO: attach uart child */ return (0); } +static void +siba_cc_intr(void *v) +{ + +} + static device_method_t siba_cc_methods[] = { /* Device interface */ DEVMETHOD(device_attach, siba_cc_attach),