From owner-p4-projects@FreeBSD.ORG Tue Nov 7 01:29:42 2006 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 8994F16A412; Tue, 7 Nov 2006 01:29:42 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A0AC16A403 for ; Tue, 7 Nov 2006 01:29:42 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0811D43D55 for ; Tue, 7 Nov 2006 01:29:42 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kA71Tf8p088998 for ; Tue, 7 Nov 2006 01:29:41 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kA71TfHc088995 for perforce@freebsd.org; Tue, 7 Nov 2006 01:29:41 GMT (envelope-from sam@freebsd.org) Date: Tue, 7 Nov 2006 01:29:41 GMT Message-Id: <200611070129.kA71TfHc088995@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 109408 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: Tue, 07 Nov 2006 01:29:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=109408 Change 109408 by sam@sam_ebb on 2006/11/07 01:29:23 o add comments o be pedantic and cleanup resources in detach Affected files ... .. //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425_qmgr.c#2 edit Differences ... ==== //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425_qmgr.c#2 (text+ko) ==== @@ -59,6 +59,20 @@ #include __FBSDID("$FreeBSD$"); +/* + * Intel XScale Queue Manager support. + * + * Each IXP4XXX device has a hardware block that implements a priority + * queue manager that is shared between the XScale cpu and the backend + * devices (such as the NPE). Queues are accessed by reading/writing + * special memory locations. The queue contents are mapped into a shared + * SRAM region with entries managed in a circular buffer. The XScale + * processor can receive interrupts based on queue contents (a condition + * code determines when interrupts should be delivered). + * + * The code here basically replaces the qmgr class in the Intel Access + * Library (IAL). + */ #include #include #include @@ -121,6 +135,7 @@ bus_space_handle_t sc_ioh; struct resource *sc_irq; /* IRQ resource */ void *sc_ih; /* interrupt handler */ + int sc_rid; /* resource id for irq */ struct qmgrInfo qinfo[IX_QMGR_MAX_NUM_QUEUES]; /* @@ -193,7 +208,7 @@ { struct ixpqmgr_softc *sc = device_get_softc(dev); struct ixp425_softc *sa = device_get_softc(device_get_parent(dev)); - int rid, i; + int i; ixpqmgr_sc = sc; @@ -204,7 +219,7 @@ panic("%s: Cannot map registers", device_get_name(dev)); /* NB: we only use the lower 32 q's */ - sc->sc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, + sc->sc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->sc_rid, IXP425_INT_QUE1_32, IXP425_INT_QUE33_64, 2, RF_ACTIVE); if (!sc->sc_irq) panic("Unable to allocate the qmgr irqs.\n"); @@ -288,8 +303,9 @@ struct ixpqmgr_softc *sc = device_get_softc(dev); aqm_reset(sc); /* disable interrupts */ - /* XXX unmap memory */ - /* XXX free irq */ + bus_teardown_intr(dev, sc->sc_irq, sc->sc_ih); + bus_release_resource(dev, SYS_RES_IRQ, sc->sc_rid, sc->sc_irq); + bus_space_unmap(sc->sc_iot, sc->sc_ioh, IXP425_QMGR_SIZE); } int