From owner-svn-src-projects@FreeBSD.ORG Sat Feb 21 03:14:44 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BA82106566B; Sat, 21 Feb 2009 03:14:44 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A4408FC1B; Sat, 21 Feb 2009 03:14:44 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1L3EiV2046791; Sat, 21 Feb 2009 03:14:44 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1L3EiS9046789; Sat, 21 Feb 2009 03:14:44 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200902210314.n1L3EiS9046789@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 21 Feb 2009 03:14:44 +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: r188883 - projects/mips/sys/mips/atheros 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: Sat, 21 Feb 2009 03:14:44 -0000 Author: gonzo Date: Sat Feb 21 03:14:44 2009 New Revision: 188883 URL: http://svn.freebsd.org/changeset/base/188883 Log: - Add some debug output - Do not manage memory, it's not neccessary. Just pass request up to nexus to map it to KSEG1 Modified: projects/mips/sys/mips/atheros/apb.c projects/mips/sys/mips/atheros/apbvar.h Modified: projects/mips/sys/mips/atheros/apb.c ============================================================================== --- projects/mips/sys/mips/atheros/apb.c Sat Feb 21 03:13:10 2009 (r188882) +++ projects/mips/sys/mips/atheros/apb.c Sat Feb 21 03:14:44 2009 (r188883) @@ -42,6 +42,13 @@ __FBSDID("$FreeBSD$"); #include #include +#undef APB_DEBUG +#ifdef APB_DEBUG +#define dprintf printf +#else +#define dprintf(x, arg...) +#endif /* APB_DEBUG */ + static int apb_activate_resource(device_t, device_t, int, int, struct resource *); static device_t apb_add_child(device_t, int, const char *, int); @@ -94,13 +101,6 @@ apb_attach(device_t dev) int rid = 0; device_set_desc(dev, "APB Bus bridge"); - sc->apb_mem_rman.rm_type = RMAN_ARRAY; - sc->apb_mem_rman.rm_descr = "APB memory"; - if (rman_init(&sc->apb_mem_rman) != 0 || - rman_manage_region(&sc->apb_mem_rman, APB_MEM_START, - APB_MEM_END) != 0) - panic("apb_attach: failed to set up I/O rman"); - sc->apb_irq_rman.rm_type = RMAN_ARRAY; sc->apb_irq_rman.rm_descr = "APB IRQ"; @@ -142,9 +142,17 @@ apb_alloc_resource(device_t bus, device_ isdefault = (start == 0UL && end == ~0UL); needactivate = flags & RF_ACTIVE; - passthrough = (device_get_parent(child) != bus); + /* + * Pass memory requests to nexus device + */ + passthrough = (device_get_parent(child) != bus) || + (type == SYS_RES_MEMORY); rle = NULL; + dprintf("%s: entry (%p, %p, %d, %p, %p, %p, %ld, %d)\n", + __func__, bus, child, type, rid, (void *)(intptr_t)start, + (void *)(intptr_t)end, count, flags); + if (passthrough) return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, rid, start, end, count, flags)); @@ -157,6 +165,7 @@ apb_alloc_resource(device_t bus, device_ if (isdefault) { rle = resource_list_find(&ivar->resources, type, *rid); + printf("DEFAULT: %d, %p\n", *rid, rle); if (rle == NULL) { return (NULL); } @@ -167,15 +176,16 @@ apb_alloc_resource(device_t bus, device_ start = rle->start; end = rle->end; count = rle->count; + + dprintf("%s: default resource (%p, %p, %ld)\n", + __func__, (void *)(intptr_t)start, + (void *)(intptr_t)end, count); } switch (type) { case SYS_RES_IRQ: rm = &sc->apb_irq_rman; break; - case SYS_RES_MEMORY: - rm = &sc->apb_mem_rman; - break; default: printf("%s: unknown resource type %d\n", __func__, type); return (0); Modified: projects/mips/sys/mips/atheros/apbvar.h ============================================================================== --- projects/mips/sys/mips/atheros/apbvar.h Sat Feb 21 03:13:10 2009 (r188882) +++ projects/mips/sys/mips/atheros/apbvar.h Sat Feb 21 03:14:44 2009 (r188883) @@ -28,15 +28,11 @@ #ifndef _APBVAR_H_ #define _APBVAR_H_ -#define APB_MEM_START 0x18000000 -#define APB_MEM_END 0x18ffffff - #define APB_IRQ_BASE 0 #define APB_IRQ_END 7 #define APB_NIRQS 8 struct apb_softc { - struct rman apb_mem_rman; struct rman apb_irq_rman; /* IRQ events structs for child devices */ struct intr_event *sc_eventstab[APB_NIRQS];