From owner-svn-src-projects@FreeBSD.ORG Fri Apr 30 13:43:21 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 19DBD106566B; Fri, 30 Apr 2010 13:43:21 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 0B14B8FC0A; Fri, 30 Apr 2010 13:43:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3UDhKT1081898; Fri, 30 Apr 2010 13:43:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3UDhKFT081897; Fri, 30 Apr 2010 13:43:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201004301343.o3UDhKFT081897@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 30 Apr 2010 13:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207434 - projects/ppc64/sys/powerpc/powermac X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 13:43:21 -0000 Author: nwhitehorn Date: Fri Apr 30 13:43:20 2010 New Revision: 207434 URL: http://svn.freebsd.org/changeset/base/207434 Log: Fix SATA on PowerMac 11,2 by disabling interrupt configuration in the remote IO-APIC so it does get set to edge triggered, which was a hack to deal with the (similar) way the K2 OpenPIC was connected to HT interrupts in earlier pure HT1000 systems. USB is still borked. Modified: projects/ppc64/sys/powerpc/powermac/cpcht.c Modified: projects/ppc64/sys/powerpc/powermac/cpcht.c ============================================================================== --- projects/ppc64/sys/powerpc/powermac/cpcht.c Fri Apr 30 08:57:03 2010 (r207433) +++ projects/ppc64/sys/powerpc/powermac/cpcht.c Fri Apr 30 13:43:20 2010 (r207434) @@ -131,6 +131,7 @@ struct cpcht_irq { vm_offset_t ht_base; vm_offset_t apple_eoi; uint32_t eoi_data; + int edge; }; static struct cpcht_irq *cpcht_irqmap = NULL; @@ -437,6 +438,10 @@ cpcht_alloc_resource(device_t bus, devic err = 0; switch (type) { + case SYS_RES_IOPORT: + end = min(end, start + count); + + /* FALLTHROUGH */ case SYS_RES_MEMORY: rm = &sc->sc_mem_rman; err = rman_manage_region(&sc->sc_mem_rman, start, end); @@ -620,6 +625,7 @@ static void openpic_cpcht_config(device_t dev, u_int irq, enum intr_trigger trig, enum intr_polarity pol) { +#ifdef NOTYET uint32_t ht_irq; /* @@ -629,7 +635,8 @@ openpic_cpcht_config(device_t dev, u_int * link. */ - if (cpcht_irqmap != NULL && irq < 128 && cpcht_irqmap[irq].ht_base > 0) { + if (cpcht_irqmap != NULL && irq < 128 && + cpcht_irqmap[irq].ht_base > 0) { /* Program the data port */ out8rb(cpcht_irqmap[irq].ht_base + PCIR_HT_COMMAND, 0x10 + (cpcht_irqmap[irq].ht_source << 1)); @@ -637,11 +644,14 @@ openpic_cpcht_config(device_t dev, u_int /* Grab the IRQ config register */ ht_irq = in32rb(cpcht_irqmap[irq].ht_base + 4) & ~23; - if (trig != INTR_TRIGGER_EDGE) - ht_irq |= 0x02; + if (trig == INTR_TRIGGER_EDGE) + cpcht_irqmap[irq].edge = 1; + else + ht_irq |= 0x22; out32rb(cpcht_irqmap[irq].ht_base + 4, ht_irq); } +#endif } @@ -667,7 +677,8 @@ openpic_cpcht_eoi(device_t dev, u_int ir if (irq == 255) return; - if (cpcht_irqmap != NULL && irq < 128 && cpcht_irqmap[irq].ht_base > 0) { + if (cpcht_irqmap != NULL && irq < 128 && + cpcht_irqmap[irq].ht_base > 0 && !cpcht_irqmap[irq].edge) { /* If this is an HT IRQ, acknowledge it at the remote APIC */ if (cpcht_irqmap[irq].apple_eoi) {