From owner-svn-src-all@FreeBSD.ORG Sun Jan 5 18:47:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10E8D52F; Sun, 5 Jan 2014 18:47:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E4EC11991; Sun, 5 Jan 2014 18:47:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s05Il1pO022500; Sun, 5 Jan 2014 18:47:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s05IkwE3022468; Sun, 5 Jan 2014 18:46:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201401051846.s05IkwE3022468@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Jan 2014 18:46:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260327 - in head/sys: arm/arm arm/include arm/mv dev/fdt dev/uart mips/include powerpc/include x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2014 18:47:02 -0000 Author: nwhitehorn Date: Sun Jan 5 18:46:58 2014 New Revision: 260327 URL: http://svnweb.freebsd.org/changeset/base/260327 Log: Retire machine/fdt.h as a header used by MI code, as its function is now obsolete. This involves the following pieces: - Remove it entirely on PowerPC, where it is not used by MD code either - Remove all references to machine/fdt.h in non-architecture-specific code (aside from uart_cpu_fdt.c, shared by ARM and MIPS, and so is somewhat non-arch-specific). - Fix code relying on header pollution from machine/fdt.h includes - Legacy fdtbus.c (still used on x86 FDT systems) now passes resource requests to its parent (nexus). This allows x86 FDT devices to allocate both memory and IO requests and removes the last notionally MI use of fdtbus_bs_tag. - On those architectures that retain a machine/fdt.h, unused bits like FDT_MAP_IRQ and FDT_INTR_MAX have been removed. Deleted: head/sys/powerpc/include/fdt.h Modified: head/sys/arm/arm/machdep.c head/sys/arm/include/fdt.h head/sys/arm/include/ofw_machdep.h head/sys/arm/mv/mv_machdep.c head/sys/arm/mv/mv_pci.c head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/fdt_common.h head/sys/dev/fdt/fdt_pci.c head/sys/dev/fdt/fdtbus.c head/sys/dev/fdt/simplebus.c head/sys/dev/uart/uart_bus_fdt.c head/sys/mips/include/fdt.h head/sys/x86/include/fdt.h head/sys/x86/include/ofw_machdep.h Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sun Jan 5 18:40:06 2014 (r260326) +++ head/sys/arm/arm/machdep.c Sun Jan 5 18:46:58 2014 (r260327) @@ -92,6 +92,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/arm/include/fdt.h ============================================================================== --- head/sys/arm/include/fdt.h Sun Jan 5 18:40:06 2014 (r260326) +++ head/sys/arm/include/fdt.h Sun Jan 5 18:46:58 2014 (r260327) @@ -51,11 +51,6 @@ */ extern bus_space_tag_t fdtbus_bs_tag; -struct mem_region { - vm_offset_t mr_start; - vm_size_t mr_size; -}; - struct arm_devmap_entry; int fdt_localbus_devmap(phandle_t, struct arm_devmap_entry *, int, int *); Modified: head/sys/arm/include/ofw_machdep.h ============================================================================== --- head/sys/arm/include/ofw_machdep.h Sun Jan 5 18:40:06 2014 (r260326) +++ head/sys/arm/include/ofw_machdep.h Sun Jan 5 18:46:58 2014 (r260327) @@ -32,6 +32,13 @@ #ifndef _MACHINE_OFW_MACHDEP_H_ #define _MACHINE_OFW_MACHDEP_H_ +#include + typedef uint32_t cell_t; +struct mem_region { + vm_offset_t mr_start; + vm_size_t mr_size; +}; + #endif /* _MACHINE_OFW_MACHDEP_H_ */ Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Sun Jan 5 18:40:06 2014 (r260326) +++ head/sys/arm/mv/mv_machdep.c Sun Jan 5 18:46:58 2014 (r260327) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include /* XXX */ Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Sun Jan 5 18:40:06 2014 (r260326) +++ head/sys/arm/mv/mv_pci.c Sun Jan 5 18:46:58 2014 (r260327) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Sun Jan 5 18:40:06 2014 (r260326) +++ head/sys/dev/fdt/fdt_common.c Sun Jan 5 18:46:58 2014 (r260327) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/dev/fdt/fdt_common.h ============================================================================== --- head/sys/dev/fdt/fdt_common.h Sun Jan 5 18:40:06 2014 (r260326) +++ head/sys/dev/fdt/fdt_common.h Sun Jan 5 18:46:58 2014 (r260327) @@ -35,7 +35,6 @@ #include #include #include -#include #define FDT_MEM_REGIONS 8 Modified: head/sys/dev/fdt/fdt_pci.c ============================================================================== --- head/sys/dev/fdt/fdt_pci.c Sun Jan 5 18:40:06 2014 (r260326) +++ head/sys/dev/fdt/fdt_pci.c Sun Jan 5 18:46:58 2014 (r260327) @@ -41,9 +41,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include #if defined(__arm__) +#include +#include #include +#include #endif #include "ofw_bus_if.h" Modified: head/sys/dev/fdt/fdtbus.c ============================================================================== --- head/sys/dev/fdt/fdtbus.c Sun Jan 5 18:40:06 2014 (r260326) +++ head/sys/dev/fdt/fdtbus.c Sun Jan 5 18:46:58 2014 (r260327) @@ -39,8 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include @@ -52,11 +50,6 @@ __FBSDID("$FreeBSD$"); static void fdtbus_identify(driver_t *, device_t); static int fdtbus_probe(device_t); -static int fdtbus_activate_resource(device_t, device_t, int, int, - struct resource *); -static int fdtbus_deactivate_resource(device_t, device_t, int, int, - struct resource *); - /* * Bus interface definition. */ @@ -66,8 +59,8 @@ static device_method_t fdtbus_methods[] DEVMETHOD(device_probe, fdtbus_probe), /* Bus interface */ - DEVMETHOD(bus_activate_resource, fdtbus_activate_resource), - DEVMETHOD(bus_deactivate_resource, fdtbus_deactivate_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_config_intr, bus_generic_config_intr), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -96,33 +89,3 @@ fdtbus_probe(device_t dev) return (BUS_PROBE_NOWILDCARD); } -static int -fdtbus_activate_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) -{ - bus_space_handle_t p; - int error; - - if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { - /* XXX endianess should be set based on SOC node */ - rman_set_bustag(res, fdtbus_bs_tag); - rman_set_bushandle(res, rman_get_start(res)); - - error = bus_space_map(rman_get_bustag(res), - rman_get_bushandle(res), rman_get_size(res), 0, &p); - if (error) - return (error); - rman_set_bushandle(res, p); - } - - return (rman_activate_resource(res)); -} - -static int -fdtbus_deactivate_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) -{ - - return (rman_deactivate_resource(res)); -} - Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Sun Jan 5 18:40:06 2014 (r260326) +++ head/sys/dev/fdt/simplebus.c Sun Jan 5 18:46:58 2014 (r260327) @@ -40,8 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Sun Jan 5 18:40:06 2014 (r260326) +++ head/sys/dev/uart/uart_bus_fdt.c Sun Jan 5 18:46:58 2014 (r260327) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/mips/include/fdt.h ============================================================================== --- head/sys/mips/include/fdt.h Sun Jan 5 18:40:06 2014 (r260326) +++ head/sys/mips/include/fdt.h Sun Jan 5 18:46:58 2014 (r260327) @@ -33,17 +33,6 @@ #define _MACHINE_FDT_H_ #include -#include - -/* Max interrupt number */ -#if defined(CPU_RMI) || defined(CPU_NLM) -#define FDT_INTR_MAX XLR_MAX_INTR -#else -#define FDT_INTR_MAX (NHARD_IRQS + NSOFT_IRQS) -#endif - -/* Map phandle/intpin pair to global IRQ number */ -#define FDT_MAP_IRQ(node, pin) (pin) /* * Bus space tag. XXX endianess info needs to be derived from the blob. Modified: head/sys/x86/include/fdt.h ============================================================================== --- head/sys/x86/include/fdt.h Sun Jan 5 18:40:06 2014 (r260326) +++ head/sys/x86/include/fdt.h Sun Jan 5 18:46:58 2014 (r260327) @@ -29,24 +29,6 @@ #ifndef _MACHINE_FDT_H_ #define _MACHINE_FDT_H_ -#include -#include - -/* Max interrupt number. */ -#define FDT_INTR_MAX NUM_IO_INTS - -/* Map phandle/intpin pair to global IRQ number */ -#define FDT_MAP_IRQ(node, pin) \ - (panic("%s: FDT_MAP_IRQ(%#x, %#x)", __func__, node, pin), -1) - -/* Bus space tag. XXX we only support I/O port space this way. */ -#define fdtbus_bs_tag X86_BUS_SPACE_IO - -struct mem_region { - vm_offset_t mr_start; - vm_size_t mr_size; -}; - __BEGIN_DECLS int x86_init_fdt(void); __END_DECLS Modified: head/sys/x86/include/ofw_machdep.h ============================================================================== --- head/sys/x86/include/ofw_machdep.h Sun Jan 5 18:40:06 2014 (r260326) +++ head/sys/x86/include/ofw_machdep.h Sun Jan 5 18:46:58 2014 (r260327) @@ -30,7 +30,13 @@ #define _MACHINE_OFW_MACHDEP_H_ #include +#include typedef uint32_t cell_t; +struct mem_region { + vm_offset_t mr_start; + vm_size_t mr_size; +}; + #endif /* _MACHINE_OFW_MACHDEP_H_ */