From owner-svn-src-user@FreeBSD.ORG Wed Nov 6 11:16:11 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AF39B3BE; Wed, 6 Nov 2013 11:16:11 +0000 (UTC) (envelope-from ray@FreeBSD.org) 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 9AB6425B1; Wed, 6 Nov 2013 11:16:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA6BGBpL041530; Wed, 6 Nov 2013 11:16:11 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA6BG63M041497; Wed, 6 Nov 2013 11:16:06 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201311061116.rA6BG63M041497@svn.freebsd.org> From: Aleksandr Rybalko Date: Wed, 6 Nov 2013 11:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r257741 - in user/ed/newcons: etc gnu/lib/libgcc lib/libc/string sbin/ifconfig share/man/man9 sys/arm/allwinner sys/arm/allwinner/a20 sys/arm/arm sys/arm/broadcom/bcm2835 sys/arm/freesc... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2013 11:16:11 -0000 Author: ray Date: Wed Nov 6 11:16:05 2013 New Revision: 257741 URL: http://svnweb.freebsd.org/changeset/base/257741 Log: MFC @r257740. Added: user/ed/newcons/sys/arm/arm/bus_space-v6.c - copied unchanged from r257740, head/sys/arm/arm/bus_space-v6.c Deleted: user/ed/newcons/sys/arm/allwinner/bus_space.c user/ed/newcons/sys/arm/freescale/imx/bus_space.c user/ed/newcons/sys/arm/rockchip/bus_space.c Modified: user/ed/newcons/etc/network.subr user/ed/newcons/gnu/lib/libgcc/Makefile user/ed/newcons/lib/libc/string/strlcpy.3 user/ed/newcons/sbin/ifconfig/ifconfig.c user/ed/newcons/share/man/man9/ifnet.9 user/ed/newcons/sys/arm/allwinner/a20/files.a20 user/ed/newcons/sys/arm/allwinner/files.a10 user/ed/newcons/sys/arm/arm/nexus.c user/ed/newcons/sys/arm/broadcom/bcm2835/bcm2835_fb.c user/ed/newcons/sys/arm/freescale/imx/files.imx51 user/ed/newcons/sys/arm/freescale/imx/files.imx53 user/ed/newcons/sys/arm/freescale/imx/files.imx6 user/ed/newcons/sys/arm/freescale/imx/tzic.c user/ed/newcons/sys/arm/mv/mv_localbus.c user/ed/newcons/sys/arm/mv/mv_pci.c user/ed/newcons/sys/arm/rockchip/files.rk30xx user/ed/newcons/sys/compat/linux/linux_ioctl.c user/ed/newcons/sys/compat/svr4/svr4_sockio.c user/ed/newcons/sys/conf/files user/ed/newcons/sys/conf/kern.pre.mk user/ed/newcons/sys/dev/fdt/simplebus.c user/ed/newcons/sys/dev/usb/wlan/if_run.c user/ed/newcons/sys/kern/capabilities.conf user/ed/newcons/sys/mips/cavium/std.octeon1 user/ed/newcons/sys/mips/mips/nexus.c user/ed/newcons/sys/net/if.c user/ed/newcons/sys/net/if.h user/ed/newcons/sys/netinet/in.c user/ed/newcons/sys/netpfil/pf/pf.c user/ed/newcons/sys/powerpc/mpc85xx/lbc.c user/ed/newcons/sys/powerpc/mpc85xx/pci_mpc85xx.c user/ed/newcons/tools/tools/syscall_timing/syscall_timing.c user/ed/newcons/usr.bin/dtc/fdt.cc user/ed/newcons/usr.sbin/bhyve/bhyverun.c user/ed/newcons/usr.sbin/bhyve/block_if.c user/ed/newcons/usr.sbin/bhyve/mevent.c user/ed/newcons/usr.sbin/bhyve/pci_ahci.c user/ed/newcons/usr.sbin/bhyve/pci_virtio_net.c user/ed/newcons/usr.sbin/pkg/pkg.c user/ed/newcons/usr.sbin/route6d/route6d.c Directory Properties: user/ed/newcons/ (props changed) user/ed/newcons/gnu/lib/ (props changed) user/ed/newcons/lib/libc/ (props changed) user/ed/newcons/sbin/ (props changed) user/ed/newcons/sys/ (props changed) user/ed/newcons/sys/conf/ (props changed) user/ed/newcons/usr.sbin/bhyve/ (props changed) Modified: user/ed/newcons/etc/network.subr ============================================================================== --- user/ed/newcons/etc/network.subr Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/etc/network.subr Wed Nov 6 11:16:05 2013 (r257741) @@ -1429,9 +1429,6 @@ childif_create() fi ${IFCONFIG_CMD} $i name $child && cfg=0 fi - if autoif $child; then - ifn_start $child - fi done # Create vlan interfaces @@ -1455,9 +1452,6 @@ childif_create() ${IFCONFIG_CMD} $i name $child && cfg=0 fi fi - if autoif $child; then - ifn_start $child - fi done return ${cfg} Modified: user/ed/newcons/gnu/lib/libgcc/Makefile ============================================================================== --- user/ed/newcons/gnu/lib/libgcc/Makefile Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/gnu/lib/libgcc/Makefile Wed Nov 6 11:16:05 2013 (r257741) @@ -27,19 +27,6 @@ CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_F -I${GCCDIR}/config -I${GCCDIR} -I. \ -I${.CURDIR}/../../usr.bin/cc/cc_tools -# Added to quiesce warning around gcc_assert() for an inline macro that uses -# a static variable. This code has been moved around in gcc, but is still in -# use in the latest trunk version of the compiler. -# -# gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c:208:36: -# warning: static variable 'dwarf_reg_size_table' is used in an inline -# function with external linkage [-Wstatic-in-inline] -# gcc_assert (index < (int) sizeof(dwarf_reg_size_table)); -# ^ -.if ${COMPILER_TYPE} == "clang" -CFLAGS+= -Wno-static-in-inline -.endif - LDFLAGS+= -nodefaultlibs LDADD+= -lc Modified: user/ed/newcons/lib/libc/string/strlcpy.3 ============================================================================== --- user/ed/newcons/lib/libc/string/strlcpy.3 Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/lib/libc/string/strlcpy.3 Wed Nov 6 11:16:05 2013 (r257741) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 10, 2013 +.Dd November 4, 2013 .Dt STRLCPY 3 .Os .Sh NAME Modified: user/ed/newcons/sbin/ifconfig/ifconfig.c ============================================================================== --- user/ed/newcons/sbin/ifconfig/ifconfig.c Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sbin/ifconfig/ifconfig.c Wed Nov 6 11:16:05 2013 (r257741) @@ -909,7 +909,7 @@ unsetifdescr(const char *val, int value, } #define IFFBITS \ -"\020\1UP\2BROADCAST\3DEBUG\4LOOPBACK\5POINTOPOINT\6SMART\7RUNNING" \ +"\020\1UP\2BROADCAST\3DEBUG\4LOOPBACK\5POINTOPOINT\7RUNNING" \ "\10NOARP\11PROMISC\12ALLMULTI\13OACTIVE\14SIMPLEX\15LINK0\16LINK1\17LINK2" \ "\20MULTICAST\22PPROMISC\23MONITOR\24STATICARP" Modified: user/ed/newcons/share/man/man9/ifnet.9 ============================================================================== --- user/ed/newcons/share/man/man9/ifnet.9 Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/share/man/man9/ifnet.9 Wed Nov 6 11:16:05 2013 (r257741) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2013 +.Dd November 5, 2013 .Dt IFNET 9 .Os .Sh NAME @@ -583,14 +583,6 @@ The interface is a loopback device. The interface is point-to-point; .Dq broadcast address is actually the address of the other end. -.It Dv IFF_SMART -.Aq S* -The interface manages its own routes, rather than using the generic -code in -.Fn if_up -and -.Fn if_down . -This is probably useful for serial lines. .It Dv IFF_DRV_RUNNING .Aq D* The interface has been configured and dynamic resources were Modified: user/ed/newcons/sys/arm/allwinner/a20/files.a20 ============================================================================== --- user/ed/newcons/sys/arm/allwinner/a20/files.a20 Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/arm/allwinner/a20/files.a20 Wed Nov 6 11:16:05 2013 (r257741) @@ -16,6 +16,6 @@ arm/allwinner/a10_gpio.c optional gpio arm/allwinner/a10_ehci.c optional ehci arm/allwinner/a10_wdog.c standard arm/allwinner/timer.c standard -arm/allwinner/bus_space.c standard +arm/arm/bus_space-v6.c standard arm/allwinner/common.c standard arm/allwinner/a10_machdep.c standard Modified: user/ed/newcons/sys/arm/allwinner/files.a10 ============================================================================== --- user/ed/newcons/sys/arm/allwinner/files.a10 Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/arm/allwinner/files.a10 Wed Nov 6 11:16:05 2013 (r257741) @@ -16,7 +16,7 @@ arm/allwinner/a10_ehci.c optional ehci arm/allwinner/a10_wdog.c standard arm/allwinner/timer.c standard arm/allwinner/aintc.c standard -arm/allwinner/bus_space.c standard +arm/arm/bus_space-v6.c standard arm/allwinner/common.c standard #arm/allwinner/console.c standard arm/allwinner/a10_machdep.c standard Copied: user/ed/newcons/sys/arm/arm/bus_space-v6.c (from r257740, head/sys/arm/arm/bus_space-v6.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/ed/newcons/sys/arm/arm/bus_space-v6.c Wed Nov 6 11:16:05 2013 (r257741, copy of r257740, head/sys/arm/arm/bus_space-v6.c) @@ -0,0 +1,153 @@ +/*- + * Copyright (c) 2012 Damjan Marion + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include + +/* Prototypes for all the bus_space structure functions */ +bs_protos(generic); +bs_protos(generic_armv4); + +/* + * The bus space tag. This is constant for all instances, so + * we never have to explicitly "create" it. + */ +static struct bus_space _base_tag = { + /* cookie */ + (void *) 0, + + /* mapping/unmapping */ + generic_bs_map, + generic_bs_unmap, + generic_bs_subregion, + + /* allocation/deallocation */ + generic_bs_alloc, + generic_bs_free, + + /* barrier */ + generic_bs_barrier, + + /* read (single) */ + generic_bs_r_1, + generic_armv4_bs_r_2, + generic_bs_r_4, + NULL, + + /* read multiple */ + generic_bs_rm_1, + generic_armv4_bs_rm_2, + generic_bs_rm_4, + NULL, + + /* read region */ + generic_bs_rr_1, + generic_armv4_bs_rr_2, + generic_bs_rr_4, + NULL, + + /* write (single) */ + generic_bs_w_1, + generic_armv4_bs_w_2, + generic_bs_w_4, + NULL, + + /* write multiple */ + generic_bs_wm_1, + generic_armv4_bs_wm_2, + generic_bs_wm_4, + NULL, + + /* write region */ + generic_bs_wr_1, + generic_armv4_bs_wr_2, + generic_bs_wr_4, + NULL, + + /* set multiple */ + NULL, + NULL, + NULL, + NULL, + + /* set region */ + generic_bs_sr_1, + generic_armv4_bs_sr_2, + generic_bs_sr_4, + NULL, + + /* copy */ + NULL, + generic_armv4_bs_c_2, + NULL, + NULL, + + /* read stream (single) */ + NULL, + NULL, + NULL, + NULL, + + /* read multiple stream */ + NULL, + generic_armv4_bs_rm_2, /* bus_space_read_multi_stream_2 */ + NULL, + NULL, + + /* read region stream */ + NULL, + NULL, + NULL, + NULL, + + /* write stream (single) */ + NULL, + NULL, + NULL, + NULL, + + /* write multiple stream */ + NULL, + generic_armv4_bs_wm_2, /* bus_space_write_multi_stream_2 */ + NULL, + NULL, + + /* write region stream */ + NULL, + NULL, + NULL, + NULL +}; + +bus_space_tag_t fdtbus_bs_tag = &_base_tag; Modified: user/ed/newcons/sys/arm/arm/nexus.c ============================================================================== --- user/ed/newcons/sys/arm/arm/nexus.c Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/arm/arm/nexus.c Wed Nov 6 11:16:05 2013 (r257741) @@ -60,6 +60,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include "opt_platform.h" + +#ifdef FDT +#include +#include +#else static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); struct nexus_device { @@ -76,13 +82,18 @@ static int nexus_print_child(device_t, d static device_t nexus_add_child(device_t, u_int, const char *, int); static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); +#endif static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); +static int nexus_deactivate_resource(device_t, device_t, int, int, + struct resource *); + static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep); static int nexus_teardown_intr(device_t, device_t, struct resource *, void *); static device_method_t nexus_methods[] = { +#ifndef FDT /* Device interface */ DEVMETHOD(device_probe, nexus_probe), DEVMETHOD(device_attach, nexus_attach), @@ -90,19 +101,28 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_print_child, nexus_print_child), DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), +#endif DEVMETHOD(bus_activate_resource, nexus_activate_resource), + DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), { 0, 0 } }; +static devclass_t nexus_devclass; +#ifndef FDT static driver_t nexus_driver = { "nexus", nexus_methods, 1 /* no softc */ }; -static devclass_t nexus_devclass; +#else +DEFINE_CLASS_1(nexus, nexus_driver, nexus_methods, + sizeof(struct ofw_nexus_softc), ofw_nexus_driver); +#endif +DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); +#ifndef FDT static int nexus_probe(device_t dev) { @@ -113,30 +133,6 @@ nexus_probe(device_t dev) } static int -nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, - driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) -{ - int irq; - - if ((rman_get_flags(res) & RF_SHAREABLE) == 0) - flags |= INTR_EXCL; - - for (irq = rman_get_start(res); irq <= rman_get_end(res); irq++) { - arm_setup_irqhandler(device_get_nameunit(child), - filt, intr, arg, irq, flags, cookiep); - arm_unmask_irq(irq); - } - return (0); -} - -static int -nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) -{ - - return (arm_remove_irqhandler(rman_get_start(r), ih)); -} - -static int nexus_attach(device_t dev) { @@ -156,7 +152,6 @@ nexus_attach(device_t dev) return (0); } - static int nexus_print_child(device_t bus, device_t child) { @@ -193,7 +188,6 @@ nexus_add_child(device_t bus, u_int orde * child of one of our descendants, not a direct child of nexus0. * (Exceptions include footbridge.) */ -#define ARM_BUS_SPACE_MEM 1 static struct resource * nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) @@ -204,6 +198,7 @@ nexus_alloc_resource(device_t bus, devic switch (type) { case SYS_RES_MEMORY: + case SYS_RES_IOPORT: rm = &mem_rman; break; @@ -216,7 +211,6 @@ nexus_alloc_resource(device_t bus, devic return (0); rman_set_rid(rv, *rid); - rman_set_bustag(rv, (void*)ARM_BUS_SPACE_MEM); rman_set_bushandle(rv, rman_get_start(rv)); if (needactivate) { @@ -228,6 +222,31 @@ nexus_alloc_resource(device_t bus, devic return (rv); } +#endif + +static int +nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, + driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) +{ + int irq; + + if ((rman_get_flags(res) & RF_SHAREABLE) == 0) + flags |= INTR_EXCL; + + for (irq = rman_get_start(res); irq <= rman_get_end(res); irq++) { + arm_setup_irqhandler(device_get_nameunit(child), + filt, intr, arg, irq, flags, cookiep); + arm_unmask_irq(irq); + } + return (0); +} + +static int +nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) +{ + + return (arm_remove_irqhandler(rman_get_start(r), ih)); +} static int @@ -237,7 +256,7 @@ nexus_activate_resource(device_t bus, de /* * If this is a memory resource, map it into the kernel. */ - if (rman_get_bustag(r) == (void*)ARM_BUS_SPACE_MEM) { + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { caddr_t vaddr = 0; u_int32_t paddr; u_int32_t psize; @@ -248,9 +267,21 @@ nexus_activate_resource(device_t bus, de poffs = paddr - trunc_page(paddr); vaddr = (caddr_t) pmap_mapdev(paddr-poffs, psize+poffs) + poffs; rman_set_virtual(r, vaddr); +#ifdef FDT + rman_set_bustag(r, fdtbus_bs_tag); +#else + rman_set_bustag(r, (void *)1); +#endif rman_set_bushandle(r, (bus_space_handle_t) vaddr); } return (rman_activate_resource(r)); } -DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); +static int +nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + + return (rman_deactivate_resource(res)); +} + Modified: user/ed/newcons/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- user/ed/newcons/sys/arm/broadcom/bcm2835/bcm2835_fb.c Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/arm/broadcom/bcm2835/bcm2835_fb.c Wed Nov 6 11:16:05 2013 (r257741) @@ -361,7 +361,7 @@ static driver_t bcm_fb_driver = { sizeof(struct bcmsc_softc), }; -DRIVER_MODULE(bcm2835fb, fdtbus, bcm_fb_driver, bcm_fb_devclass, 0, 0); +DRIVER_MODULE(bcm2835fb, nexus, bcm_fb_driver, bcm_fb_devclass, 0, 0); /* * Video driver routines and glue. Modified: user/ed/newcons/sys/arm/freescale/imx/files.imx51 ============================================================================== --- user/ed/newcons/sys/arm/freescale/imx/files.imx51 Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/arm/freescale/imx/files.imx51 Wed Nov 6 11:16:05 2013 (r257741) @@ -11,7 +11,7 @@ kern/kern_clocksource.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx51_machdep.c standard arm/freescale/imx/common.c standard -arm/freescale/imx/bus_space.c standard +arm/arm/bus_space-v6.c standard # Dummy serial console #arm/freescale/imx/console.c standard Modified: user/ed/newcons/sys/arm/freescale/imx/files.imx53 ============================================================================== --- user/ed/newcons/sys/arm/freescale/imx/files.imx53 Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/arm/freescale/imx/files.imx53 Wed Nov 6 11:16:05 2013 (r257741) @@ -11,7 +11,7 @@ kern/kern_clocksource.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx53_machdep.c standard arm/freescale/imx/common.c standard -arm/freescale/imx/bus_space.c standard +arm/arm/bus_space-v6.c standard # Special serial console for debuging early boot code #arm/freescale/imx/console.c standard Modified: user/ed/newcons/sys/arm/freescale/imx/files.imx6 ============================================================================== --- user/ed/newcons/sys/arm/freescale/imx/files.imx6 Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/arm/freescale/imx/files.imx6 Wed Nov 6 11:16:05 2013 (r257741) @@ -16,7 +16,7 @@ kern/kern_clocksource.c standard # arm/arm/gic.c standard arm/arm/pl310.c standard -arm/freescale/imx/bus_space.c standard +arm/arm/bus_space-v6.c standard arm/freescale/imx/common.c standard arm/freescale/imx/imx6_anatop.c standard arm/freescale/imx/imx6_ccm.c standard Modified: user/ed/newcons/sys/arm/freescale/imx/tzic.c ============================================================================== --- user/ed/newcons/sys/arm/freescale/imx/tzic.c Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/arm/freescale/imx/tzic.c Wed Nov 6 11:16:05 2013 (r257741) @@ -142,9 +142,9 @@ static devclass_t tzic_devclass; /* * Memory space of controller located outside of device range, so let him to - * attach not only to simplebus, but fdtbus also. + * attach not only to simplebus, but nexus also. */ -EARLY_DRIVER_MODULE(tzic, fdtbus, tzic_driver, tzic_devclass, 0, 0, +EARLY_DRIVER_MODULE(tzic, nexus, tzic_driver, tzic_devclass, 0, 0, BUS_PASS_INTERRUPT); EARLY_DRIVER_MODULE(tzic, simplebus, tzic_driver, tzic_devclass, 0, 0, BUS_PASS_INTERRUPT); Modified: user/ed/newcons/sys/arm/mv/mv_localbus.c ============================================================================== --- user/ed/newcons/sys/arm/mv/mv_localbus.c Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/arm/mv/mv_localbus.c Wed Nov 6 11:16:05 2013 (r257741) @@ -156,7 +156,7 @@ static struct localbus_bank localbus_ban devclass_t localbus_devclass; -DRIVER_MODULE(localbus, fdtbus, localbus_driver, localbus_devclass, 0, 0); +DRIVER_MODULE(localbus, nexus, localbus_driver, localbus_devclass, 0, 0); static int fdt_localbus_reg_decode(phandle_t node, struct localbus_softc *sc, Modified: user/ed/newcons/sys/arm/mv/mv_pci.c ============================================================================== --- user/ed/newcons/sys/arm/mv/mv_pci.c Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/arm/mv/mv_pci.c Wed Nov 6 11:16:05 2013 (r257741) @@ -230,7 +230,7 @@ static driver_t mv_pcib_driver = { devclass_t pcib_devclass; -DRIVER_MODULE(pcib, fdtbus, mv_pcib_driver, pcib_devclass, 0, 0); +DRIVER_MODULE(pcib, nexus, mv_pcib_driver, pcib_devclass, 0, 0); static struct mtx pcicfg_mtx; Modified: user/ed/newcons/sys/arm/rockchip/files.rk30xx ============================================================================== --- user/ed/newcons/sys/arm/rockchip/files.rk30xx Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/arm/rockchip/files.rk30xx Wed Nov 6 11:16:05 2013 (r257741) @@ -12,7 +12,7 @@ arm/arm/irq_dispatch.S standard arm/arm/gic.c standard arm/arm/mpcore_timer.c standard -arm/rockchip/bus_space.c standard +arm/arm/bus_space-v6.c standard arm/rockchip/common.c standard arm/rockchip/rk30xx_machdep.c standard arm/rockchip/rk30xx_pmu.c standard Modified: user/ed/newcons/sys/compat/linux/linux_ioctl.c ============================================================================== --- user/ed/newcons/sys/compat/linux/linux_ioctl.c Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/compat/linux/linux_ioctl.c Wed Nov 6 11:16:05 2013 (r257741) @@ -2287,7 +2287,7 @@ linux_gifflags(struct thread *td, struct flags = (ifp->if_flags | ifp->if_drv_flags) & 0xffff; /* these flags have no Linux equivalent */ - flags &= ~(IFF_SMART|IFF_DRV_OACTIVE|IFF_SIMPLEX| + flags &= ~(IFF_DRV_OACTIVE|IFF_SIMPLEX| IFF_LINK0|IFF_LINK1|IFF_LINK2); /* Linux' multicast flag is in a different bit */ if (flags & IFF_MULTICAST) { Modified: user/ed/newcons/sys/compat/svr4/svr4_sockio.c ============================================================================== --- user/ed/newcons/sys/compat/svr4/svr4_sockio.c Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/compat/svr4/svr4_sockio.c Wed Nov 6 11:16:05 2013 (r257741) @@ -154,15 +154,16 @@ svr4_sock_ioctl(fp, td, retval, fd, cmd, sc.svr4_ifc_len)); ifc = (struct ifconf *)≻ - ifc->ifc_req.ifr_addr.sa_family = - sc.svr4_ifc_req.svr4_ifr_addr.sa_family; - ifc->ifc_req.ifr_addr.sa_len = sizeof(struct osockaddr); + ifc->ifc_req->ifr_addr.sa_family = + sc.svr4_ifc_req->svr4_ifr_addr.sa_family; + ifc->ifc_req->ifr_addr.sa_len = + sizeof(struct osockaddr); - error = fo_ioctl(fp, SIOCGIFCONF, &sc, - td->td_ucred, td)); + error = fo_ioctl(fp, SIOCGIFCONF, &sc, td->td_ucred, + td); - sc.svr4_ifc_req.svr4_ifr_addr.sa_family = - ifc->ifc_req.ifr_addr.sa_family; + sc.svr4_ifc_req->svr4_ifr_addr.sa_family = + ifc->ifc_req->ifr_addr.sa_family; if (error != 0) return error; Modified: user/ed/newcons/sys/conf/files ============================================================================== --- user/ed/newcons/sys/conf/files Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/conf/files Wed Nov 6 11:16:05 2013 (r257741) @@ -1403,7 +1403,7 @@ dev/fdt/fdt_pci.c optional fdt pci dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ dependency "$S/boot/fdt/dts/${FDT_DTS_FILE}" -dev/fdt/fdtbus.c optional fdt +dev/fdt/fdtbus.c optional fdtbus dev/fdt/simplebus.c optional fdt dev/fe/if_fe.c optional fe dev/fe/if_fe_pccard.c optional fe pccard Modified: user/ed/newcons/sys/conf/kern.pre.mk ============================================================================== --- user/ed/newcons/sys/conf/kern.pre.mk Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/conf/kern.pre.mk Wed Nov 6 11:16:05 2013 (r257741) @@ -80,16 +80,17 @@ INCLUDES+= -I$S/dev/cxgb -I$S/dev/cxgbe CFLAGS= ${COPTFLAGS} ${C_DIALECT} ${DEBUG} ${CWARNFLAGS} CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h +CFLAGS_PARAM_INLINE_UNIT_GROWTH?=100 +CFLAGS_PARAM_LARGE_FUNCTION_GROWTH?=1000 +.if ${MACHINE_CPUARCH} == "mips" +CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 +.endif .if ${COMPILER_TYPE} != "clang" CFLAGS+= -fno-common -finline-limit=${INLINE_LIMIT} -.if ${MACHINE_CPUARCH} != "mips" -CFLAGS+= --param inline-unit-growth=100 -CFLAGS+= --param large-function-growth=1000 -.else -# XXX Actually a gross hack just for Octeon because of the Simple Executive. -CFLAGS+= --param inline-unit-growth=10000 -CFLAGS+= --param large-function-growth=100000 -CFLAGS+= --param max-inline-insns-single=10000 +CFLAGS+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH} +CFLAGS+= --param large-function-growth=${CFLAGS_PARAM_LARGE_FUNCTION_GROWTH} +.if defined(CFLAGS_ARCH_PARAMS) +CFLAGS+=${CFLAGS_ARCH_PARAMS} .endif .endif WERROR?= -Werror @@ -193,7 +194,7 @@ MKMODULESENV+= WITHOUT_MODULES="${WITHOU MKMODULESENV+= DEBUG_FLAGS="${DEBUG}" .endif -# Are various things configured? +# Detect knerel config options that force stack frames to be turned on. DDB_ENABLED!= grep DDB opt_ddb.h || true ; echo DTR_ENABLED!= grep KDTRACE_FRAME opt_kdtrace.h || true ; echo HWPMC_ENABLED!= grep HWPMC opt_hwpmc_hooks.h || true ; echo Modified: user/ed/newcons/sys/dev/fdt/simplebus.c ============================================================================== --- user/ed/newcons/sys/dev/fdt/simplebus.c Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/dev/fdt/simplebus.c Wed Nov 6 11:16:05 2013 (r257741) @@ -138,7 +138,7 @@ static driver_t simplebus_driver = { devclass_t simplebus_devclass; -DRIVER_MODULE(simplebus, fdtbus, simplebus_driver, simplebus_devclass, 0, 0); +DRIVER_MODULE(simplebus, nexus, simplebus_driver, simplebus_devclass, 0, 0); DRIVER_MODULE(simplebus, simplebus, simplebus_driver, simplebus_devclass, 0, 0); Modified: user/ed/newcons/sys/dev/usb/wlan/if_run.c ============================================================================== --- user/ed/newcons/sys/dev/usb/wlan/if_run.c Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/dev/usb/wlan/if_run.c Wed Nov 6 11:16:05 2013 (r257741) @@ -700,7 +700,7 @@ run_attach(device_t self) TASK_INIT(&sc->cmdq_task, 0, run_cmdq_cb, sc); TASK_INIT(&sc->ratectl_task, 0, run_ratectl_cb, sc); - callout_init((struct callout *)&sc->ratectl_ch, 1); + usb_callout_init_mtx(&sc->ratectl_ch, &sc->sc_mtx, 0); if (bootverbose) ieee80211_announce(ic); @@ -1010,13 +1010,12 @@ run_load_microcode(struct run_softc *sc) /* cheap sanity check */ temp = fw->data; bytes = *temp; - if (bytes != be64toh(0xffffff0210280210)) { + if (bytes != be64toh(0xffffff0210280210ULL)) { device_printf(sc->sc_dev, "firmware checksum failed\n"); error = EINVAL; goto fail; } - run_read(sc, RT2860_ASIC_VER_ID, &tmp); /* write microcode image */ run_write_region_1(sc, RT2870_FW_BASE, base, 4096); run_write(sc, RT2860_H2M_MAILBOX_CID, 0xffffffff); @@ -2237,8 +2236,10 @@ run_ratectl_cb(void *arg, int pending) ieee80211_iterate_nodes(&ic->ic_sta, run_iter_func, sc); } + RUN_LOCK(sc); if(sc->ratectl_run != RUN_RATECTL_OFF) usb_callout_reset(&sc->ratectl_ch, hz, run_ratectl_to, sc); + RUN_UNLOCK(sc); } static void Modified: user/ed/newcons/sys/kern/capabilities.conf ============================================================================== --- user/ed/newcons/sys/kern/capabilities.conf Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/kern/capabilities.conf Wed Nov 6 11:16:05 2013 (r257741) @@ -386,13 +386,6 @@ listen lseek ## -## Allow MAC label operations by file descriptor, subject to capability -## rights. -## -mac_get_fd -mac_set_fd - -## ## Allow simple VM operations on the current process. ## madvise @@ -552,7 +545,7 @@ sched_get_priority_min ## sched_getparam sched_getscheduler -sched_rr_getinterval +sched_rr_get_interval sched_setparam sched_setscheduler sched_yield Modified: user/ed/newcons/sys/mips/cavium/std.octeon1 ============================================================================== --- user/ed/newcons/sys/mips/cavium/std.octeon1 Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/mips/cavium/std.octeon1 Wed Nov 6 11:16:05 2013 (r257741) @@ -3,3 +3,7 @@ files "../cavium/files.octeon1" machine mips mips64 cpu CPU_CNMIPS + +makeoptions CFLAGS_PARAM_INLINE_UNIT_GROWTH=10000 +makeoptions CFLAGS_PARAM_LARGE_FUNCTION_GROWTH=100000 +makeoptions CFLAGS_ARCH_PARAMS="--param max-inline-insns-single=10000" Modified: user/ed/newcons/sys/mips/mips/nexus.c ============================================================================== --- user/ed/newcons/sys/mips/mips/nexus.c Wed Nov 6 10:31:52 2013 (r257740) +++ user/ed/newcons/sys/mips/mips/nexus.c Wed Nov 6 11:16:05 2013 (r257741) @@ -58,6 +58,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include "opt_platform.h" + +#ifdef FDT +#include +#endif + #undef NEXUS_DEBUG #ifdef NEXUS_DEBUG #define dprintf printf @@ -65,6 +71,9 @@ __FBSDID("$FreeBSD$"); #define dprintf(x, arg...) #endif /* NEXUS_DEBUG */ +#define NUM_MIPS_IRQS 6 + +#ifndef FDT static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); struct nexus_device { @@ -72,7 +81,6 @@ struct nexus_device { }; #define DEVTONX(dev) ((struct nexus_device *)device_get_ivars(dev)) -#define NUM_MIPS_IRQS 6 static struct rman irq_rman; static struct rman mem_rman; @@ -80,18 +88,13 @@ static struct rman mem_rman; static struct resource * nexus_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); -static int nexus_activate_resource(device_t, device_t, int, int, - struct resource *); static device_t nexus_add_child(device_t, u_int, const char *, int); static int nexus_attach(device_t); -static int nexus_deactivate_resource(device_t, device_t, int, int, - struct resource *); static void nexus_delete_resource(device_t, device_t, int, int); static struct resource_list * nexus_get_reslist(device_t, device_t); static int nexus_get_resource(device_t, device_t, int, int, u_long *, u_long *); -static void nexus_hinted_child(device_t, const char *, int); static int nexus_print_child(device_t, device_t); static int nexus_print_all_resources(device_t dev); static int nexus_probe(device_t); @@ -99,6 +102,12 @@ static int nexus_release_resource(device struct resource *); static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long); +#endif +static int nexus_activate_resource(device_t, device_t, int, int, + struct resource *); +static int nexus_deactivate_resource(device_t, device_t, int, int, + struct resource *); +static void nexus_hinted_child(device_t, const char *, int); static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep); @@ -106,35 +115,43 @@ static int nexus_teardown_intr(device_t, void *); static device_method_t nexus_methods[] = { +#ifndef FDT /* Device interface */ DEVMETHOD(device_probe, nexus_probe), DEVMETHOD(device_attach, nexus_attach), /* Bus interface */ DEVMETHOD(bus_add_child, nexus_add_child), - DEVMETHOD(bus_activate_resource,nexus_activate_resource), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), - DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_delete_resource, nexus_delete_resource), DEVMETHOD(bus_get_resource, nexus_get_resource), DEVMETHOD(bus_get_resource_list, nexus_get_reslist), - DEVMETHOD(bus_hinted_child, nexus_hinted_child), DEVMETHOD(bus_print_child, nexus_print_child), DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_set_resource, nexus_set_resource), +#endif DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), + DEVMETHOD(bus_activate_resource,nexus_activate_resource), + DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), + DEVMETHOD(bus_hinted_child, nexus_hinted_child), { 0, 0 } }; +#ifndef FDT static driver_t nexus_driver = { "nexus", nexus_methods, 1 /* no softc */ }; +#else +DEFINE_CLASS_1(nexus, nexus_driver, nexus_methods, + sizeof(struct ofw_nexus_softc), ofw_nexus_driver); +#endif static devclass_t nexus_devclass; +#ifndef FDT static int nexus_probe(device_t dev) { @@ -163,34 +180,6 @@ nexus_probe(device_t dev) } static int -nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, - driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) -{ - register_t s; - int irq; - - s = intr_disable(); - irq = rman_get_start(res); - if (irq >= NUM_MIPS_IRQS) { - intr_restore(s); - return (0); - } - - cpu_establish_hardintr(device_get_nameunit(child), filt, intr, arg, - irq, flags, cookiep); - intr_restore(s); - return (0); -} - -static int -nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) -{ - - printf("Unimplemented %s at %s:%d\n", __func__, __FILE__, __LINE__); - return (0); -} - -static int nexus_attach(device_t dev) { @@ -231,59 +220,6 @@ nexus_print_all_resources(device_t dev) return (retval); } -static void -nexus_hinted_child(device_t bus, const char *dname, int dunit) -{ - device_t child; - long maddr; - int msize; - int order; - int result; - int irq; - int mem_hints_count; - - if ((resource_int_value(dname, dunit, "order", &order)) != 0) - order = 1000; - child = BUS_ADD_CHILD(bus, order, dname, dunit); - if (child == NULL) - return; - - /* - * Set hard-wired resources for hinted child using - * specific RIDs. - */ - mem_hints_count = 0; - if (resource_long_value(dname, dunit, "maddr", &maddr) == 0) - mem_hints_count++; - if (resource_int_value(dname, dunit, "msize", &msize) == 0) - mem_hints_count++; - - /* check if all info for mem resource has been provided */ - if ((mem_hints_count > 0) && (mem_hints_count < 2)) { - printf("Either maddr or msize hint is missing for %s%d\n", - dname, dunit); - } - else if (mem_hints_count) { - dprintf("%s: discovered hinted child %s at maddr %p(%d)\n", - __func__, device_get_nameunit(child), - (void *)(intptr_t)maddr, msize); - - result = bus_set_resource(child, SYS_RES_MEMORY, 0, maddr, - msize); - if (result != 0) { - device_printf(bus, - "warning: bus_set_resource() failed\n"); - } - } - - if (resource_int_value(dname, dunit, "irq", &irq) == 0) { - result = bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1); - if (result != 0) - device_printf(bus, - "warning: bus_set_resource() failed\n"); - } -} - static device_t nexus_add_child(device_t bus, u_int order, const char *name, int unit) { @@ -381,30 +317,6 @@ nexus_alloc_resource(device_t bus, devic return (rv); } -static int -nexus_activate_resource(device_t bus, device_t child, int type, int rid, - struct resource *r) -{ - void *vaddr; - vm_paddr_t paddr; - vm_size_t psize; - - /* - * If this is a memory resource, use pmap_mapdev to map it. - */ - if (type == SYS_RES_MEMORY) { - paddr = rman_get_start(r); - psize = rman_get_size(r); - vaddr = pmap_mapdev(paddr, psize); - - rman_set_virtual(r, vaddr); - rman_set_bustag(r, mips_bus_space_generic); - rman_set_bushandle(r, (bus_space_handle_t)(uintptr_t)vaddr); - } - - return (rman_activate_resource(r)); -} - static struct resource_list * nexus_get_reslist(device_t dev, device_t child) { @@ -475,6 +387,31 @@ nexus_release_resource(device_t bus, dev return (rman_release_resource(r)); } +#endif + +static int +nexus_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + void *vaddr; + vm_paddr_t paddr; + vm_size_t psize; + + /* + * If this is a memory resource, use pmap_mapdev to map it. + */ + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { + paddr = rman_get_start(r); + psize = rman_get_size(r); + vaddr = pmap_mapdev(paddr, psize); + + rman_set_virtual(r, vaddr); + rman_set_bustag(r, mips_bus_space_generic); + rman_set_bushandle(r, (bus_space_handle_t)(uintptr_t)vaddr); + } + + return (rman_activate_resource(r)); +} static int nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, @@ -490,4 +427,85 @@ nexus_deactivate_resource(device_t bus, return (rman_deactivate_resource(r)); } +static int +nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, + driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) +{ + register_t s; + int irq; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***