From owner-p4-projects@FreeBSD.ORG Sat Nov 11 04:52:54 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 18DDD16A415; Sat, 11 Nov 2006 04:52:54 +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 E350416A407 for ; Sat, 11 Nov 2006 04:52:53 +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 0355343D73 for ; Sat, 11 Nov 2006 04:52:49 +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 kAB4qnQl038644 for ; Sat, 11 Nov 2006 04:52:49 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kAB4qnOG038640 for perforce@freebsd.org; Sat, 11 Nov 2006 04:52:49 GMT (envelope-from sam@freebsd.org) Date: Sat, 11 Nov 2006 04:52:49 GMT Message-Id: <200611110452.kAB4qnOG038640@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 109720 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: Sat, 11 Nov 2006 04:52:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=109720 Change 109720 by sam@sam_ebb on 2006/11/11 04:51:49 o must setup ALTSTAT for ata_generic_status o setup IREASON just in case; looks to only be required for ATAPI which'll never exist on this board o change some useless code into assertions Affected files ... .. //depot/projects/arm/src/sys/arm/xscale/ixp425/avila_ata.c#6 edit Differences ... ==== //depot/projects/arm/src/sys/arm/xscale/ixp425/avila_ata.c#6 (text+ko) ==== @@ -191,9 +191,6 @@ { struct ata_avila_softc *sc = xsc; -#if 0 -printf("%s: cb %p arg %p\n", __func__, sc->sc_intr[0].cb, sc->sc_intr[0].arg);/*XXX*/ -#endif if (sc->sc_intr[0].cb != NULL) sc->sc_intr[0].cb(sc->sc_intr[0].arg); } @@ -204,20 +201,21 @@ { struct ata_avila_softc *sc = device_get_softc(dev); - if (type == SYS_RES_IRQ && *rid == ATA_IRQ_RID) { - /* doesn't matter what we return so reuse the real thing */ - return sc->sc_irq; - } - return NULL; + KASSERT(type == SYS_RES_IRQ && *rid == ATA_IRQ_RID, + ("type %u rid %u start %lu end %lu count %lu flags %u", + type, *rid, start, end, count, flags)); + + /* doesn't matter what we return so reuse the real thing */ + return sc->sc_irq; } static int ata_avila_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { - if (type == SYS_RES_IRQ) - return rid != ATA_IRQ_RID ? ENOENT : 0; - return EINVAL; + KASSERT(type == SYS_RES_IRQ && rid == ATA_IRQ_RID, + ("type %u rid %u", type, rid)); + return 0; } static int @@ -424,6 +422,11 @@ ch->r_io[ATA_IDX_ADDR].res = &sc->sc_ata; ch->r_io[ATA_IDX_ADDR].offset = 0; + /* NB: should be used only for ATAPI devices */ + ch->r_io[ATA_IREASON] = ch->r_io[ATA_COUNT]; + /* alias this; required by ata_generic_status */ + ch->r_io[ATA_ALTSTAT] = ch->r_io[ATA_CONTROL]; + ata_generic_hw(dev); return ata_attach(dev); }