From owner-p4-projects@FreeBSD.ORG Tue Jul 18 23:10:58 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 2209616A4E0; Tue, 18 Jul 2006 23:10:58 +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 00E5E16A4DA for ; Tue, 18 Jul 2006 23:10:58 +0000 (UTC) (envelope-from cognet@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C157C43D45 for ; Tue, 18 Jul 2006 23:10:57 +0000 (GMT) (envelope-from cognet@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 k6INAvgm042935 for ; Tue, 18 Jul 2006 23:10:57 GMT (envelope-from cognet@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k6INAvqm042932 for perforce@freebsd.org; Tue, 18 Jul 2006 23:10:57 GMT (envelope-from cognet@freebsd.org) Date: Tue, 18 Jul 2006 23:10:57 GMT Message-Id: <200607182310.k6INAvqm042932@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to cognet@freebsd.org using -f From: Olivier Houchard To: Perforce Change Reviews Cc: Subject: PERFORCE change 101889 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, 18 Jul 2006 23:10:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=101889 Change 101889 by cognet@cognet on 2006/07/18 23:10:11 Add some code to use rman to manage the memory mapped registers from the IXP425. This code is untested, we will need it for the ethernet driver as the ethernet adapter is directly on the chip. Affected files ... .. //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425.c#3 edit .. //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425var.h#2 edit Differences ... ==== //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425.c#3 (text+ko) ==== @@ -121,6 +121,12 @@ rman_manage_region(&sc->sc_irq_rman, 0, 31) != 0) panic("ixp425_attach: failed to set up IRQ rman"); + sc->sc_sysmem_rman.rm_type = RMAN_ARRAY; + sc->sc_sysmem_rman.rm_descr = "IXP425 System memory"; + if (rman_init(&sc->sc_sysmem_rman) != 0 || + rman_manage_region(&sc->sc_sysmem_rman, IXP425_IO_VBASE, + IXP425_IO_VBASE + IXP425_IO_SIZE) != 0) + panic("ixp425_attach: failed to set up sys mem rman"); device_add_child(dev, "ixpclk", 0); bus_generic_probe(dev); bus_generic_attach(dev); @@ -204,6 +210,15 @@ rman_set_rid(rv, *rid); return (rv); } + if (type == SYS_RES_MEMORY) { + rv = rman_reserve_resource(&sc->sc_sysmem_rman, + start, end, count, flags, child); + if (rv != NULL) { + rman_set_bustag(rv, &ixp425_bs_tag); + rman_set_bushandle(rv, start); + return (rv); + } + } return (NULL); } ==== //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425var.h#2 (text+ko) ==== @@ -80,6 +80,7 @@ struct bus_space sc_pci_memt; vm_offset_t sc_pci_va; struct rman sc_irq_rman; + struct rman sc_sysmem_rman; /* GPIO configuration */ u_int32_t sc_gpio_out;