svn commit: r292683 - head/sys/dev/usb/controller
Author: andrew Date: Thu Dec 24 09:40:29 2015 New Revision: 292683 URL: https://svnweb.freebsd.org/changeset/base/292683 Log: Ads support to the xhci pci attachment to use MSI-X interrupts when available. As with MSI interrupts these can be disabled by setting hw.usb.xhci.msix to 0 in the loader. MSI-X interrupts are needed on some hardware, for example the Cavium ThunderX only supports them, and with this we don't fall back to polling. PR: 204378 Reviewed by: hselasky, jhb MFC after:1 week (after r292669) Sponsored by: ABT Systems Ltd Differential Revision:https://reviews.freebsd.org/D4698 Modified: head/sys/dev/usb/controller/xhci.h head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/dev/usb/controller/xhci.h == --- head/sys/dev/usb/controller/xhci.h Thu Dec 24 06:22:41 2015 (r292682) +++ head/sys/dev/usb/controller/xhci.h Thu Dec 24 09:40:29 2015 (r292683) @@ -465,6 +465,7 @@ struct xhci_softc { struct usb_device *sc_devices[XHCI_MAX_DEVICES]; struct resource *sc_io_res; struct resource *sc_irq_res; + struct resource *sc_msix_res; void*sc_intr_hdl; bus_size_t sc_io_size; Modified: head/sys/dev/usb/controller/xhci_pci.c == --- head/sys/dev/usb/controller/xhci_pci.c Thu Dec 24 06:22:41 2015 (r292682) +++ head/sys/dev/usb/controller/xhci_pci.c Thu Dec 24 09:40:29 2015 (r292683) @@ -148,6 +148,8 @@ xhci_pci_probe(device_t self) static int xhci_use_msi = 1; TUNABLE_INT("hw.usb.xhci.msi", &xhci_use_msi); +static int xhci_use_msix = 1; +TUNABLE_INT("hw.usb.xhci.msix", &xhci_use_msix); static void xhci_interrupt_poll(void *_sc) @@ -188,7 +190,7 @@ static int xhci_pci_attach(device_t self) { struct xhci_softc *sc = device_get_softc(self); - int count, err, rid; + int count, err, msix_table, rid; uint8_t usemsi = 1; uint8_t usedma32 = 0; @@ -240,7 +242,27 @@ xhci_pci_attach(device_t self) usb_callout_init_mtx(&sc->sc_callout, &sc->sc_bus.bus_mtx, 0); rid = 0; - if (xhci_use_msi && usemsi) { + if (xhci_use_msix && (msix_table = pci_msix_table_bar(self)) >= 0) { + sc->sc_msix_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, + &msix_table, RF_ACTIVE); + if (sc->sc_msix_res == NULL) { + /* May not be enabled */ + device_printf(self, + "Unable to map MSI-X table \n"); + } else { + count = 1; + if (pci_alloc_msix(self, &count) == 0) { + if (bootverbose) + device_printf(self, "MSI-X enabled\n"); + rid = 1; + } else { + bus_release_resource(self, SYS_RES_MEMORY, + msix_table, sc->sc_msix_res); + sc->sc_msix_res = NULL; + } + } + } + if (rid == 0 && xhci_use_msi && usemsi) { count = 1; if (pci_alloc_msi(self, &count) == 0) { if (bootverbose) @@ -341,6 +363,11 @@ xhci_pci_detach(device_t self) sc->sc_io_res); sc->sc_io_res = NULL; } + if (sc->sc_msix_res) { + bus_release_resource(self, SYS_RES_MEMORY, + rman_get_rid(sc->sc_msix_res), sc->sc_msix_res); + sc->sc_msix_res = NULL; + } xhci_uninit(sc); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292684 - head/sbin/ifconfig
Author: bapt Date: Thu Dec 24 11:30:29 2015 New Revision: 292684 URL: https://svnweb.freebsd.org/changeset/base/292684 Log: Reduce overlinking ifconfig does not need libbsdxml and libsbuf only lib80211 needs it Modified: head/sbin/ifconfig/Makefile Modified: head/sbin/ifconfig/Makefile == --- head/sbin/ifconfig/Makefile Thu Dec 24 09:40:29 2015(r292683) +++ head/sbin/ifconfig/Makefile Thu Dec 24 11:30:29 2015(r292684) @@ -38,7 +38,7 @@ SRCS+=sfp.c # SFP/SFP+ information LIBADD+= m SRCS+= ifieee80211.c # SIOC[GS]IEEE80211 support -LIBADD+= bsdxml sbuf 80211 +LIBADD+= 80211 SRCS+= carp.c # SIOC[GS]VH support SRCS+= ifgroup.c # ... ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292685 - in head/cddl/sbin: zfs zpool
Author: bapt Date: Thu Dec 24 11:35:42 2015 New Revision: 292685 URL: https://svnweb.freebsd.org/changeset/base/292685 Log: Reduce overlinking Modified: head/cddl/sbin/zfs/Makefile head/cddl/sbin/zpool/Makefile Modified: head/cddl/sbin/zfs/Makefile == --- head/cddl/sbin/zfs/Makefile Thu Dec 24 11:30:29 2015(r292684) +++ head/cddl/sbin/zfs/Makefile Thu Dec 24 11:35:42 2015(r292685) @@ -22,6 +22,6 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -LIBADD=geom jail nvpair umem util uutil zfs_core zfs +LIBADD=jail nvpair uutil zfs_core zfs .include Modified: head/cddl/sbin/zpool/Makefile == --- head/cddl/sbin/zpool/Makefile Thu Dec 24 11:30:29 2015 (r292684) +++ head/cddl/sbin/zpool/Makefile Thu Dec 24 11:35:42 2015 (r292685) @@ -27,6 +27,6 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/stat/common -LIBADD=avl geom nvpair umem util uutil zfs_core zfs +LIBADD=geom nvpair uutil zfs .include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292686 - head/usr.bin/nfsstat
Author: bapt Date: Thu Dec 24 11:41:21 2015 New Revision: 292686 URL: https://svnweb.freebsd.org/changeset/base/292686 Log: Since removal of oldnfs support linking to kvm is not needed anymore Modified: head/usr.bin/nfsstat/Makefile head/usr.bin/nfsstat/nfsstat.c Modified: head/usr.bin/nfsstat/Makefile == --- head/usr.bin/nfsstat/Makefile Thu Dec 24 11:35:42 2015 (r292685) +++ head/usr.bin/nfsstat/Makefile Thu Dec 24 11:41:21 2015 (r292686) @@ -4,6 +4,4 @@ PROG= nfsstat CFLAGS+=-DNFS -LIBADD=kvm - .include Modified: head/usr.bin/nfsstat/nfsstat.c == --- head/usr.bin/nfsstat/nfsstat.c Thu Dec 24 11:35:42 2015 (r292685) +++ head/usr.bin/nfsstat/nfsstat.c Thu Dec 24 11:41:21 2015 (r292686) @@ -60,7 +60,6 @@ static const char rcsid[] = #include #include #include -#include #include #include #include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292687 - head/usr.sbin/camdd
Author: bapt Date: Thu Dec 24 11:43:32 2015 New Revision: 292687 URL: https://svnweb.freebsd.org/changeset/base/292687 Log: camadd does not require linking to libsbuf or libbsdxml directly Modified: head/usr.sbin/camdd/Makefile Modified: head/usr.sbin/camdd/Makefile == --- head/usr.sbin/camdd/MakefileThu Dec 24 11:41:21 2015 (r292686) +++ head/usr.sbin/camdd/MakefileThu Dec 24 11:43:32 2015 (r292687) @@ -3,7 +3,7 @@ PROG= camdd SRCS= camdd.c SDIR= ${.CURDIR}/../../sys -LIBADD=cam mt sbuf bsdxml util pthread +LIBADD=cam mt util pthread NO_WTHREAD_SAFETY= 1 MAN= camdd.8 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292688 - in head/cddl/usr.sbin: zdb zhack
Author: bapt Date: Thu Dec 24 11:56:37 2015 New Revision: 292688 URL: https://svnweb.freebsd.org/changeset/base/292688 Log: Reduce zfs utilities overlinking Modified: head/cddl/usr.sbin/zdb/Makefile head/cddl/usr.sbin/zhack/Makefile Modified: head/cddl/usr.sbin/zdb/Makefile == --- head/cddl/usr.sbin/zdb/Makefile Thu Dec 24 11:43:32 2015 (r292687) +++ head/cddl/usr.sbin/zdb/Makefile Thu Dec 24 11:56:37 2015 (r292688) @@ -24,7 +24,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head CFLAGS+= -I${.CURDIR}/../../lib/libumem -LIBADD=geom m nvpair pthread umem uutil zfs_core zfs zpool +LIBADD=nvpair umem uutil zfs zpool # Since there are many asserts in this program, it makes no sense to compile # it without debugging. Modified: head/cddl/usr.sbin/zhack/Makefile == --- head/cddl/usr.sbin/zhack/Makefile Thu Dec 24 11:43:32 2015 (r292687) +++ head/cddl/usr.sbin/zhack/Makefile Thu Dec 24 11:56:37 2015 (r292688) @@ -23,7 +23,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head CFLAGS+= -I${.CURDIR}/../../lib/libumem -LIBADD=geom m nvpair pthread umem uutil zfs_core zfs zpool +LIBADD=nvpair zfs zpool CFLAGS+= -DDEBUG=1 #DEBUG_FLAGS+= -g ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292689 - head/sys/netinet
Author: pluknet Date: Thu Dec 24 13:57:43 2015 New Revision: 292689 URL: https://svnweb.freebsd.org/changeset/base/292689 Log: Fixed comment placement. Before r12296, this comment described the udp_recvspace default value. Spotted by: ru Sponsored by: Nginx, Inc. Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c == --- head/sys/netinet/udp_usrreq.c Thu Dec 24 11:56:37 2015 (r292688) +++ head/sys/netinet/udp_usrreq.c Thu Dec 24 13:57:43 2015 (r292689) @@ -128,7 +128,6 @@ SYSCTL_INT(_net_inet_udp, OID_AUTO, blac "Do not send port unreachables for refused connects"); u_long udp_sendspace = 9216; /* really max datagram size */ - /* 40 1K datagrams */ SYSCTL_ULONG(_net_inet_udp, UDPCTL_MAXDGRAM, maxdgram, CTLFLAG_RW, &udp_sendspace, 0, "Maximum outgoing UDP datagram size"); @@ -138,7 +137,7 @@ u_long udp_recvspace = 40 * (1024 + #else sizeof(struct sockaddr_in) #endif - ); + );/* 40 1K datagrams */ SYSCTL_ULONG(_net_inet_udp, UDPCTL_RECVSPACE, recvspace, CTLFLAG_RW, &udp_recvspace, 0, "Maximum space for incoming UDP datagrams"); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292690 - head/sys/dev/isp
Author: mav Date: Thu Dec 24 14:53:29 2015 New Revision: 292690 URL: https://svnweb.freebsd.org/changeset/base/292690 Log: Some polishing for command timeouts handling. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/ispmbox.h Modified: head/sys/dev/isp/isp.c == --- head/sys/dev/isp/isp.c Thu Dec 24 13:57:43 2015(r292689) +++ head/sys/dev/isp/isp.c Thu Dec 24 14:53:29 2015(r292690) @@ -2446,7 +2446,8 @@ isp_plogx(ispsoftc_t *isp, int chan, uin scp = fcp->isp_scratch; isp_put_plogx(isp, plp, (isp_plogx_t *) scp); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 50); + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, + MBCMD_DEFAULT_TIMEOUT + ICB_LOGIN_TOV * 100); mbs.param[1] = QENTRY_LEN; mbs.param[2] = DMA_WD1(fcp->isp_scdma); mbs.param[3] = DMA_WD0(fcp->isp_scdma); @@ -3390,7 +3391,7 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, pt->ctp_nphdl = fcp->isp_sns_hdl; pt->ctp_cmd_cnt = 1; pt->ctp_vpidx = ISP_GET_VPIDX(isp, chan); - pt->ctp_time = 30; + pt->ctp_time = 10; pt->ctp_rsp_cnt = 1; pt->ctp_rsp_bcnt = GIDLEN; pt->ctp_cmd_bcnt = sizeof (*ct) + sizeof (uint32_t); @@ -3426,7 +3427,8 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, sizeof (*ct) + sizeof (uint32_t), &scp[XTXOFF]); } ISP_MEMZERO(&scp[ZTXOFF], QENTRY_LEN); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 50); + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, + MBCMD_DEFAULT_TIMEOUT + pt->ctp_time * 100); mbs.param[1] = QENTRY_LEN; mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); @@ -3861,7 +3863,7 @@ isp_register_fc4_type_24xx(ispsoftc_t *i pt->ctp_nphdl = fcp->isp_sns_hdl; pt->ctp_cmd_cnt = 1; pt->ctp_vpidx = ISP_GET_VPIDX(isp, chan); - pt->ctp_time = 1; + pt->ctp_time = 4; pt->ctp_rsp_cnt = 1; pt->ctp_rsp_bcnt = sizeof (ct_hdr_t); pt->ctp_cmd_bcnt = sizeof (rft_id_t); @@ -3900,7 +3902,8 @@ isp_register_fc4_type_24xx(ispsoftc_t *i ISP_MEMZERO(&scp[ZTXOFF], sizeof (ct_hdr_t)); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 100); + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, + MBCMD_DEFAULT_TIMEOUT + pt->ctp_time * 100); mbs.param[1] = QENTRY_LEN; mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); @@ -3972,7 +3975,7 @@ isp_register_fc4_features_24xx(ispsoftc_ pt->ctp_nphdl = fcp->isp_sns_hdl; pt->ctp_cmd_cnt = 1; pt->ctp_vpidx = ISP_GET_VPIDX(isp, chan); - pt->ctp_time = 1; + pt->ctp_time = 4; pt->ctp_rsp_cnt = 1; pt->ctp_rsp_bcnt = sizeof (ct_hdr_t); pt->ctp_cmd_bcnt = sizeof (rff_id_t); @@ -4016,7 +4019,8 @@ isp_register_fc4_features_24xx(ispsoftc_ ISP_MEMZERO(&scp[ZTXOFF], sizeof (ct_hdr_t)); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 100); + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, + MBCMD_DEFAULT_TIMEOUT + pt->ctp_time * 100); mbs.param[1] = QENTRY_LEN; mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); @@ -4403,10 +4407,7 @@ isp_start(XS_T *xs) } ISP_MEMCPY(cdbp, XS_CDBP(xs), cdblen); - *tptr = XS_TIME(xs) / 1000; - if (*tptr == 0 && XS_TIME(xs)) { - *tptr = 1; - } + *tptr = (XS_TIME(xs) + 999) / 1000; if (IS_24XX(isp) && *tptr > 0x1999) { *tptr = 0x1999; } @@ -4512,13 +4513,14 @@ isp_control(ispsoftc_t *isp, ispctl_t ct tmf->tmf_header.rqs_entry_count = 1; tmf->tmf_nphdl = lp->handle; tmf->tmf_delay = 2; - tmf->tmf_timeout = 2; + tmf->tmf_timeout = 4; tmf->tmf_flags = ISP24XX_TMF_TARGET_RESET; tmf->tmf_tidlo = lp->portid; tmf->tmf_tidhi = lp->portid >> 16; tmf->tmf_vpidx = ISP_GET_VPIDX(isp, chan); isp_prt(isp, ISP_LOGALL, "Chan %d Reset N-Port Handle 0x%04x @ Port 0x%06x", chan, lp->handle, lp->portid); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 500); + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, + MBCMD_DEFAULT_TIMEOUT + tmf->tmf_timeout * 100); mbs.param[1] = QENTRY_LEN; mbs.param[2] = DMA_WD1(fcp->isp_scdma); mbs.param[3] = DMA_WD0(fcp->isp_scdma); @@
Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern
On Mon, 2015-12-07 at 12:20 +, Konstantin Belousov wrote: > Author: kib > Date: Mon Dec 7 12:20:26 2015 > New Revision: 291937 > URL: https://svnweb.freebsd.org/changeset/base/291937 > > Log: > Add support for usermode (vdso-like) gettimeofday(2) and > clock_gettime(2) on ARMv7 and ARMv8 systems which have architectural > generic timer hardware. It is similar how the RDTSC timer is used in > userspace on x86. > > Fix a permission problem where generic timer access from EL0 (or > userspace on v7) was not properly initialized on APs. > > For ARMv7, mark the stack non-executable. The shared page is added for > all arms (including ARMv8 64bit), and the signal trampoline code is > moved to the page. > > Reviewed by:> > andrew > Discussed with:>> emaste, mmel > Sponsored by:> > The FreeBSD Foundation > Differential revision:> https://reviews.freebsd.org/D4209 I've just discovered this change breaks buildworld on armv4/5 systems. Those systems don't have the counter hardware that can be read from userland (they don't have any common timer hardware at all, every system is different). Also, they don't support the 'mrrc' instruction, so the buildworld fails to compile libc. -- Ian ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292691 - in head/libexec/rtld-elf: . riscv
Author: br Date: Thu Dec 24 15:47:51 2015 New Revision: 292691 URL: https://svnweb.freebsd.org/changeset/base/292691 Log: Add support for RISC-V architecture. Reviewed by: andrew, kib Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision:https://reviews.freebsd.org/D4679 Added: head/libexec/rtld-elf/riscv/ head/libexec/rtld-elf/riscv/reloc.c (contents, props changed) head/libexec/rtld-elf/riscv/rtld_machdep.h (contents, props changed) head/libexec/rtld-elf/riscv/rtld_start.S (contents, props changed) Modified: head/libexec/rtld-elf/rtld.c Added: head/libexec/rtld-elf/riscv/reloc.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rtld-elf/riscv/reloc.c Thu Dec 24 15:47:51 2015 (r292691) @@ -0,0 +1,400 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * This software was developed by the University of Cambridge Computer + * Laboratory as part of the CTSRD Project, with support from the UK Higher + * Education Innovation Fund (HEIF). + * + * 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 "debug.h" +#include "rtld.h" +#include "rtld_printf.h" + +/* + * It is possible for the compiler to emit relocations for unaligned data. + * We handle this situation with these inlines. + */ +#defineRELOC_ALIGNED_P(x) \ + (((uintptr_t)(x) & (sizeof(void *) - 1)) == 0) + +void _exit(int); + +uint64_t +set_gp(Obj_Entry *obj) +{ + uint64_t old; + SymLook req; + uint64_t gp; + int res; + + __asm __volatile("mv%0, gp" : "=r"(old)); + + symlook_init(&req, "_gp"); + req.ventry = NULL; + req.flags = SYMLOOK_EARLY; + res = symlook_obj(&req, obj); + + if (res == 0) { + gp = req.sym_out->st_value; + __asm __volatile("mvgp, %0" :: "r"(gp)); + } + + return (old); +} + +void +init_pltgot(Obj_Entry *obj) +{ + + if (obj->pltgot != NULL) { + obj->pltgot[0] = (Elf_Addr)&_rtld_bind_start; + obj->pltgot[1] = (Elf_Addr)obj; + } +} + +int +do_copy_relocations(Obj_Entry *dstobj) +{ + const Obj_Entry *srcobj, *defobj; + const Elf_Rela *relalim; + const Elf_Rela *rela; + const Elf_Sym *srcsym; + const Elf_Sym *dstsym; + const void *srcaddr; + const char *name; + void *dstaddr; + SymLook req; + size_t size; + int res; + + /* +* COPY relocs are invalid outside of the main program +*/ + assert(dstobj->mainprog); + + relalim = (const Elf_Rela *)((char *)dstobj->rela + + dstobj->relasize); + for (rela = dstobj->rela; rela < relalim; rela++) { + if (ELF_R_TYPE(rela->r_info) != R_RISCV_COPY) + continue; + + dstaddr = (void *)(dstobj->relocbase + rela->r_offset); + dstsym = dstobj->symtab + ELF_R_SYM(rela->r_info); + name = dstobj->strtab + dstsym->st_name; + size = dstsym->st_size; + + symlook_init(&req, name); + req.ventry = fetch_ventry(dstobj, ELF_R_SYM(rela->r_info)); + req.flags = SYMLOOK_EARLY; + + for (srcobj = dstobj->next; srcobj != NULL; +srcobj = srcobj->next) { + r
svn commit: r292692 - in head/sys: conf mips/include
Author: adrian Date: Thu Dec 24 15:52:21 2015 New Revision: 292692 URL: https://svnweb.freebsd.org/changeset/base/292692 Log: Begin the initial support for the mips1004kc core. * add build option; * add initial coherence manager config register bits; * use the right hazard instruction (ehb); * add page attributes. Tested: * MT7621A SoC (not yet in-tree) Submitted by: Stanislav Galabov Modified: head/sys/conf/options.mips head/sys/mips/include/cpufunc.h head/sys/mips/include/cpuregs.h Modified: head/sys/conf/options.mips == --- head/sys/conf/options.mips Thu Dec 24 15:47:51 2015(r292691) +++ head/sys/conf/options.mips Thu Dec 24 15:52:21 2015(r292692) @@ -31,6 +31,7 @@ CPU_MIPS4KCopt_global.h CPU_MIPS24KC opt_global.h CPU_MIPS74KC opt_global.h +CPU_MIPS1004KC opt_global.h CPU_MIPS32 opt_global.h CPU_MIPS64 opt_global.h CPU_SENTRY5opt_global.h Modified: head/sys/mips/include/cpufunc.h == --- head/sys/mips/include/cpufunc.h Thu Dec 24 15:47:51 2015 (r292691) +++ head/sys/mips/include/cpufunc.h Thu Dec 24 15:52:21 2015 (r292692) @@ -248,7 +248,7 @@ MIPS_RW32_COP0_SEL(config5, MIPS_COP_0_C #if defined(CPU_NLM) || defined(BERI_LARGE_TLB) MIPS_RW32_COP0_SEL(config6, MIPS_COP_0_CONFIG, 6); #endif -#ifdef CPU_NLM +#if defined(CPU_NLM) || defined(CPU_MIPS1004KC) MIPS_RW32_COP0_SEL(config7, MIPS_COP_0_CONFIG, 7); #endif MIPS_RW32_COP0(count, MIPS_COP_0_COUNT); @@ -259,6 +259,7 @@ MIPS_RW32_COP0(cause, MIPS_COP_0_CAUSE); MIPS_RW32_COP0(excpc, MIPS_COP_0_EXC_PC); #endif MIPS_RW32_COP0(status, MIPS_COP_0_STATUS); +MIPS_RW32_COP0_SEL(cmgcrbase, 15, 3); /* XXX: Some of these registers are specific to MIPS32. */ #if !defined(__mips_n64) Modified: head/sys/mips/include/cpuregs.h == --- head/sys/mips/include/cpuregs.h Thu Dec 24 15:47:51 2015 (r292691) +++ head/sys/mips/include/cpuregs.h Thu Dec 24 15:52:21 2015 (r292692) @@ -154,6 +154,11 @@ #defineMIPS_CCA_CACHED 0x03 #endif +#if defined(CPU_MIPS1004KC) +#defineMIPS_CCA_UNCACHED 0x02 +#defineMIPS_CCA_CACHED 0x05 +#endif + #ifndefMIPS_CCA_UNCACHED #defineMIPS_CCA_UNCACHED MIPS_CCA_UC #endif @@ -209,7 +214,7 @@ #defineCOP0_SYNC .word 0xc0 /* ehb */ #elif defined(CPU_SB1) #define COP0_SYNC ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop -#elif defined(CPU_MIPS74KC) +#elif defined(CPU_MIPS74KC) || defined(CPU_MIPS1004KC) #defineCOP0_SYNC.word 0xc0 /* ehb */ #else /* @@ -557,6 +562,8 @@ #define MIPS_CONFIG2_SS_SHIFT 8 /* Secondary cache sets per way */ #define MIPS_CONFIG2_SS_MASK 0xf +#define MIPS_CONFIG3_CMGCR_MASK(1 << 29) /* Coherence manager present */ + #define MIPS_CONFIG4_MMUSIZEEXT0x00FF /* bits 7.. 0 MMU Size Extension */ #define MIPS_CONFIG4_MMUEXTDEF 0xC000 /* bits 15.14 MMU Extension Definition */ #define MIPS_CONFIG4_MMUEXTDEF_MMUSIZEEXT 0x4000 /* This values denotes CONFIG4 bits */ @@ -634,4 +641,8 @@ #defineMIPS_OPCODE_SHIFT 26 #defineMIPS_OPCODE_C1 0x11 +/* Coherence manager constants */ +#defineMIPS_CMGCRB_BASE11 +#defineMIPS_CMGCRF_BASE(~((1 << MIPS_CMGCRB_BASE) - 1)) + #endif /* _MIPS_CPUREGS_H_ */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292693 - head/sys/conf
Author: adrian Date: Thu Dec 24 15:58:33 2015 New Revision: 292693 URL: https://svnweb.freebsd.org/changeset/base/292693 Log: Flesh out some build time configuration options for the realtek/mediatek ports. The sys/mips/rt305x/ code currently has these hard-coded with a comment to make them configurable; this is the first step towards that. Submitted by: Stanislav Galabov Modified: head/sys/conf/options.mips Modified: head/sys/conf/options.mips == --- head/sys/conf/options.mips Thu Dec 24 15:52:21 2015(r292692) +++ head/sys/conf/options.mips Thu Dec 24 15:58:33 2015(r292693) @@ -121,6 +121,18 @@ IF_RT_PHY_SUPPORT opt_if_rt.h IF_RT_RING_DATA_COUNT opt_if_rt.h # +# Options that control the Ralink/Mediatek SoC type. +# +MT7620 opt_rt305x.h +RT5350 opt_rt305x.h +RT305XFopt_rt305x.h +RT3052Fopt_rt305x.h +RT3050Fopt_rt305x.h +RT305X opt_rt305x.h +RT305X_UBOOT opt_rt305x.h +RT305X_USE_UARTopt_rt305x.h + +# # Options that affect the pmap. # PV_STATS opt_pmap.h ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern
> On Dec 24, 2015, at 07:40, Ian Lepore wrote: > >> On Mon, 2015-12-07 at 12:20 +, Konstantin Belousov wrote: >> Author: kib >> Date: Mon Dec 7 12:20:26 2015 >> New Revision: 291937 >> URL: https://svnweb.freebsd.org/changeset/base/291937 >> >> Log: >> Add support for usermode (vdso-like) gettimeofday(2) and >> clock_gettime(2) on ARMv7 and ARMv8 systems which have architectural >> generic timer hardware. It is similar how the RDTSC timer is used in >> userspace on x86. >> >> Fix a permission problem where generic timer access from EL0 (or >> userspace on v7) was not properly initialized on APs. >> >> For ARMv7, mark the stack non-executable. The shared page is added for >> all arms (including ARMv8 64bit), and the signal trampoline code is >> moved to the page. >> >> Reviewed by:>> andrew >> Discussed with:>> emaste, mmel >> Sponsored by:>> The FreeBSD Foundation >> Differential revision:>https://reviews.freebsd.org/D4209 > > I've just discovered this change breaks buildworld on armv4/5 systems. > Those systems don't have the counter hardware that can be read from > userland (they don't have any common timer hardware at all, every > system is different). Also, they don't support the 'mrrc' instruction, > so the buildworld fails to compile libc. +1 I ran into this on ref9-amd64. I thought it was a tool chain issue :/.. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292694 - head/etc
Author: jlh Date: Thu Dec 24 16:35:28 2015 New Revision: 292694 URL: https://svnweb.freebsd.org/changeset/base/292694 Log: Replace all whitespaces between port name and number with tabs, Modified: head/etc/services Modified: head/etc/services == --- head/etc/services Thu Dec 24 15:58:33 2015(r292693) +++ head/etc/services Thu Dec 24 16:35:28 2015(r292694) @@ -1029,7 +1029,7 @@ nntps 563/udpsnntp#nntp protocol o whoami 565/tcp whoami 565/udp streettalk 566/tcp -streettalk 566/udp +streettalk 566/udp banyan-rpc 567/tcp banyan-rpc 567/udp ms-shuttle 568/tcp#Microsoft shuttle @@ -1099,16 +1099,16 @@ acp 599/tcp#Aeolon Core Protocol acp599/udp#Aeolon Core Protocol ipcserver 600/tcp#Sun IPC server ipcserver 600/udp#Sun IPC server -syslog-conn 601/tcp#Reliable Syslog Service -syslog-conn 601/udp#Reliable Syslog Service -xmlrpc-beep 602/tcp#XML-RPC over BEEP -xmlrpc-beep 602/udp#XML-RPC over BEEP -idxp603/tcp -idxp603/udp -tunnel 604/tcp -tunnel 604/udp -soap-beep 605/tcp#SOAP over BEEP -soap-beep 605/udp#SOAP over BEEP +syslog-conn601/tcp#Reliable Syslog Service +syslog-conn601/udp#Reliable Syslog Service +xmlrpc-beep602/tcp#XML-RPC over BEEP +xmlrpc-beep602/udp#XML-RPC over BEEP +idxp 603/tcp +idxp 603/udp +tunnel 604/tcp +tunnel 604/udp +soap-beep 605/tcp#SOAP over BEEP +soap-beep 605/udp#SOAP over BEEP urm606/tcp#Cray Unified Resource Manager urm606/udp#Cray Unified Resource Manager nqs607/tcp @@ -1137,14 +1137,14 @@ dei-icda618/tcp dei-icda 618/udp compaq-evm 619/tcp#Compaq EVM compaq-evm 619/udp#Compaq EVM -sco-websrvrmgr 620/tcp#SCO WebServer Manager -sco-websrvrmgr 620/udp#SCO WebServer Manager +sco-websrvrmgr 620/tcp#SCO WebServer Manager +sco-websrvrmgr 620/udp#SCO WebServer Manager escp-ip621/tcp#ESCP escp-ip621/udp#ESCP collaborator 622/tcp collaborator 622/udp -asf-rmcp623/tcp#ASF Remote Management and Control Protocol -asf-rmcp623/udp#ASF Remote Management and Control Protocol +asf-rmcp 623/tcp#ASF Remote Management and Control Protocol +asf-rmcp 623/udp#ASF Remote Management and Control Protocol cryptoadmin624/tcp#Crypto Admin cryptoadmin624/udp#Crypto Admin dec_dlm625/tcp#DEC DLM @@ -1167,12 +1167,12 @@ servstat633/tcp#Service Status upda servstat 633/udp#Service Status update (Sterling Software) ginad 634/tcp ginad 634/udp -rlzdbase635/tcp#RLZ DBase -rlzdbase635/udp#RLZ DBase +rlzdbase 635/tcp#RLZ DBase +rlzdbase 635/udp#RLZ DBase ldaps 636/tcpsldap#ldap protocol over TLS/SSL ldaps 636/udpsldap -lanserver 637/tcp -lanserver 637/udp +lanserver 637/tcp +lanserver 637/udp mcns-sec 638/tcp mcns-sec 638/udp msdp 639/tcp @@ -1191,12 +1191,12 @@ pssc645/tcp pssc 645/udp ldp646/tcp ldp646/udp -dhcp-failover 647/tcp#DHCP Failover -dhcp-failover 647/udp#DHCP Failover -rrp 648/tcp#Registry Registrar Protocol (RRP) -rrp 648/udp#Registry Registrar Protocol (RRP) -cadview-3d 649/tcp#Cadview-3d - streaming 3d models over the internet -cadview-3d 649/udp#Cadview-3d - streaming 3d models over the internet +dhcp-failover 647/tcp#DHCP Failover +dhcp-failover 647/udp#DHCP Failover +rrp648/tcp#Registry Registrar Protocol (RRP) +rrp648/udp#Registry Registrar Protocol (RRP) +cadview-3d 649/tcp#Cadview-3d - streaming 3d models over the internet +cadview-3d 649/udp#Cadview-3d - streaming 3d models over the internet obex 650/tcp obex 650/udp ieee-mms 651/tcp#IEEE MMS @@ -1215,38 +1215,38 @@ rmc 657/tcp rmc657/udp tenfold658/tcp tenfold658/udp -mac-srvr-admin 660/tcp#MacOS Server Admin -mac-srvr-admin 660/udp#MacOS Server Admin -hap 661/tcp -hap 661/udp -pftp662/tcp -pftp662/udp -purenoise 663/tcp#PureNoise -purenoise 663/udp#PureNoise -asf-secure-rmcp 664/tcp#ASF Secure Remote Management and Control Protocol -asf-secure-rmcp 664/udp#ASF Secure Remote Management and Control Protocol -sun-dr 665/tcp#Sun DR -sun-dr 665/udp#Sun DR +mac-srvr-admin 660/tcp#MacOS Se
svn commit: r292695 - head/share/misc
Author: brnrd (ports committer) Date: Thu Dec 24 16:51:03 2015 New Revision: 292695 URL: https://svnweb.freebsd.org/changeset/base/292695 Log: Update mentors for brnrd - Remove vsevolod as mentor for brnrd - Add feld as mentor for brnrd Reviewed by: koobs (mentor), vsevolod (mentor p.t.), feld (mentor h.t.) Approved by: koobs (mentor) Differential Revision:https://reviews.freebsd.org/D4702 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot == --- head/share/misc/committers-ports.dotThu Dec 24 16:35:28 2015 (r292694) +++ head/share/misc/committers-ports.dotThu Dec 24 16:51:03 2015 (r292695) @@ -349,6 +349,7 @@ erwin -> lbr erwin -> lth erwin -> simon +feld -> brnrd feld -> junovitch fjoe -> danfe @@ -584,8 +585,6 @@ thierry -> riggs tmclaugh -> itetcu tmclaugh -> xride -vsevolod -> brnrd - wen -> cs wen -> culot wen -> pawel ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292696 - stable/10/etc
Author: jlh Date: Thu Dec 24 16:55:09 2015 New Revision: 292696 URL: https://svnweb.freebsd.org/changeset/base/292696 Log: MFC r292564: Add port for IRC over TLS/SSL, as noted in RFC 7194. PR: 192505 Submitted by: loic.b...@unix-experience.fr MFC r292694: Replace all whitespaces between port name and number with tabs. Modified: stable/10/etc/services Modified: stable/10/etc/services == --- stable/10/etc/services Thu Dec 24 16:51:03 2015(r292695) +++ stable/10/etc/services Thu Dec 24 16:55:09 2015(r292696) @@ -1029,7 +1029,7 @@ nntps 563/udpsnntp#nntp protocol o whoami 565/tcp whoami 565/udp streettalk 566/tcp -streettalk 566/udp +streettalk 566/udp banyan-rpc 567/tcp banyan-rpc 567/udp ms-shuttle 568/tcp#Microsoft shuttle @@ -1099,16 +1099,16 @@ acp 599/tcp#Aeolon Core Protocol acp599/udp#Aeolon Core Protocol ipcserver 600/tcp#Sun IPC server ipcserver 600/udp#Sun IPC server -syslog-conn 601/tcp#Reliable Syslog Service -syslog-conn 601/udp#Reliable Syslog Service -xmlrpc-beep 602/tcp#XML-RPC over BEEP -xmlrpc-beep 602/udp#XML-RPC over BEEP -idxp603/tcp -idxp603/udp -tunnel 604/tcp -tunnel 604/udp -soap-beep 605/tcp#SOAP over BEEP -soap-beep 605/udp#SOAP over BEEP +syslog-conn601/tcp#Reliable Syslog Service +syslog-conn601/udp#Reliable Syslog Service +xmlrpc-beep602/tcp#XML-RPC over BEEP +xmlrpc-beep602/udp#XML-RPC over BEEP +idxp 603/tcp +idxp 603/udp +tunnel 604/tcp +tunnel 604/udp +soap-beep 605/tcp#SOAP over BEEP +soap-beep 605/udp#SOAP over BEEP urm606/tcp#Cray Unified Resource Manager urm606/udp#Cray Unified Resource Manager nqs607/tcp @@ -1137,14 +1137,14 @@ dei-icda618/tcp dei-icda 618/udp compaq-evm 619/tcp#Compaq EVM compaq-evm 619/udp#Compaq EVM -sco-websrvrmgr 620/tcp#SCO WebServer Manager -sco-websrvrmgr 620/udp#SCO WebServer Manager +sco-websrvrmgr 620/tcp#SCO WebServer Manager +sco-websrvrmgr 620/udp#SCO WebServer Manager escp-ip621/tcp#ESCP escp-ip621/udp#ESCP collaborator 622/tcp collaborator 622/udp -asf-rmcp623/tcp#ASF Remote Management and Control Protocol -asf-rmcp623/udp#ASF Remote Management and Control Protocol +asf-rmcp 623/tcp#ASF Remote Management and Control Protocol +asf-rmcp 623/udp#ASF Remote Management and Control Protocol cryptoadmin624/tcp#Crypto Admin cryptoadmin624/udp#Crypto Admin dec_dlm625/tcp#DEC DLM @@ -1167,12 +1167,12 @@ servstat633/tcp#Service Status upda servstat 633/udp#Service Status update (Sterling Software) ginad 634/tcp ginad 634/udp -rlzdbase635/tcp#RLZ DBase -rlzdbase635/udp#RLZ DBase +rlzdbase 635/tcp#RLZ DBase +rlzdbase 635/udp#RLZ DBase ldaps 636/tcpsldap#ldap protocol over TLS/SSL ldaps 636/udpsldap -lanserver 637/tcp -lanserver 637/udp +lanserver 637/tcp +lanserver 637/udp mcns-sec 638/tcp mcns-sec 638/udp msdp 639/tcp @@ -1191,12 +1191,12 @@ pssc645/tcp pssc 645/udp ldp646/tcp ldp646/udp -dhcp-failover 647/tcp#DHCP Failover -dhcp-failover 647/udp#DHCP Failover -rrp 648/tcp#Registry Registrar Protocol (RRP) -rrp 648/udp#Registry Registrar Protocol (RRP) -cadview-3d 649/tcp#Cadview-3d - streaming 3d models over the internet -cadview-3d 649/udp#Cadview-3d - streaming 3d models over the internet +dhcp-failover 647/tcp#DHCP Failover +dhcp-failover 647/udp#DHCP Failover +rrp648/tcp#Registry Registrar Protocol (RRP) +rrp648/udp#Registry Registrar Protocol (RRP) +cadview-3d 649/tcp#Cadview-3d - streaming 3d models over the internet +cadview-3d 649/udp#Cadview-3d - streaming 3d models over the internet obex 650/tcp obex 650/udp ieee-mms 651/tcp#IEEE MMS @@ -1215,38 +1215,38 @@ rmc 657/tcp rmc657/udp tenfold658/tcp tenfold658/udp -mac-srvr-admin 660/tcp#MacOS Server Admin -mac-srvr-admin 660/udp#MacOS Server Admin -hap 661/tcp -hap 661/udp -pftp662/tcp -pftp662/udp -purenoise 663/tcp#PureNoise -purenoise 663/udp#PureNoise -asf-secure-rmcp 664/tcp#ASF Secure Remote Ma
svn commit: r292697 - head/sys/dev/ixgbe
Author: sbruno Date: Thu Dec 24 17:05:25 2015 New Revision: 292697 URL: https://svnweb.freebsd.org/changeset/base/292697 Log: Fix NO INET6 build broken at svn r292674 Reported by: ohart...@zedat.fu-berlin.de Modified: head/sys/dev/ixgbe/ix_txrx.c Modified: head/sys/dev/ixgbe/ix_txrx.c == --- head/sys/dev/ixgbe/ix_txrx.cThu Dec 24 16:55:09 2015 (r292696) +++ head/sys/dev/ixgbe/ix_txrx.cThu Dec 24 17:05:25 2015 (r292697) @@ -808,12 +808,14 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, *olinfo_status |= IXGBE_TXD_POPTS_IXSM << 8; } break; +#ifdef INET6 case ETHERTYPE_IPV6: ip6 = (struct ip6_hdr *)(l3d); ip_hlen = sizeof(struct ip6_hdr); ipproto = ip6->ip6_nxt; type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV6; break; +#endif default: offload = FALSE; break; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern
On Thu, Dec 24, 2015 at 08:40:42AM -0700, Ian Lepore wrote: > On Mon, 2015-12-07 at 12:20 +, Konstantin Belousov wrote: > > Author: kib > > Date: Mon Dec 7 12:20:26 2015 > > New Revision: 291937 > > URL: https://svnweb.freebsd.org/changeset/base/291937 > > > > Log: > > Add support for usermode (vdso-like) gettimeofday(2) and > > clock_gettime(2) on ARMv7 and ARMv8 systems which have architectural > > generic timer hardware. It is similar how the RDTSC timer is used in > > userspace on x86. > > > > Fix a permission problem where generic timer access from EL0 (or > > userspace on v7) was not properly initialized on APs. > > > > For ARMv7, mark the stack non-executable. The shared page is added for > > all arms (including ARMv8 64bit), and the signal trampoline code is > > moved to the page. > > > > Reviewed by:> > andrew > > Discussed with:> > emaste, mmel > > Sponsored by:>> The FreeBSD Foundation > > Differential revision:> https://reviews.freebsd.org/D4209 > > I've just discovered this change breaks buildworld on armv4/5 systems. > Those systems don't have the counter hardware that can be read from > userland (they don't have any common timer hardware at all, every > system is different). Also, they don't support the 'mrrc' instruction, > so the buildworld fails to compile libc. I tested the change with make universe. Is the armv5 world included into the make ? If yes, there is something even more broken. That said, the code in __vdso_gettime.c is unused om armv4/v5 since kernel never directs libc to use a fast timecounter. The routines could be left undefined since they are declared weak, or the bodies could be stubbed out. Anyway, to test, I should be able to compile libc for the target. And, BTW, what is exactly your error message ? ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292698 - head/sys/mips/conf
Author: adrian Date: Thu Dec 24 18:30:04 2015 New Revision: 292698 URL: https://svnweb.freebsd.org/changeset/base/292698 Log: [rt305x] Prepare for the upcoming regime change - add RT305x options. Submitted by: Stanislav Galabov Modified: head/sys/mips/conf/RT305X Modified: head/sys/mips/conf/RT305X == --- head/sys/mips/conf/RT305X Thu Dec 24 17:05:25 2015(r292697) +++ head/sys/mips/conf/RT305X Thu Dec 24 18:30:04 2015(r292698) @@ -33,6 +33,9 @@ hints "RT305X.hints" #Default places t #makeoptions DEBUG=-g#Build kernel with gdb(1) debug symbols +optionsRT3052F +optionsRT305X_UBOOT + # Debugging for use in -current #options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292699 - head/sys/mips/rt305x
Author: adrian Date: Thu Dec 24 18:31:55 2015 New Revision: 292699 URL: https://svnweb.freebsd.org/changeset/base/292699 Log: [rt305x] add register space definitions for later generation chips. This adds definitions for the MT5350 and MT7620 SoCs. Submitted by: Stanislav Galabov Modified: head/sys/mips/rt305x/rt305xreg.h Modified: head/sys/mips/rt305x/rt305xreg.h == --- head/sys/mips/rt305x/rt305xreg.hThu Dec 24 18:30:04 2015 (r292698) +++ head/sys/mips/rt305x/rt305xreg.hThu Dec 24 18:31:55 2015 (r292699) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2015 Stanislav Galabov. * Copyright (c) 2010 Aleksandr Rybalko. * All rights reserved. * @@ -29,12 +30,7 @@ #ifndef _RT305XREG_H_ #define _RT305XREG_H_ -/* XXX: must move to config */ -#define RT305X 1 -#define RT305XF1 -#define RT3052F1 -#define __U_BOOT__ 1 -/* XXX: must move to config */ +#include "opt_rt305x.h" #ifdef RT3052F #define PLATFORM_COUNTER_FREQ (384 * 1000 * 1000) @@ -42,12 +38,19 @@ #ifdef RT3050F #define PLATFORM_COUNTER_FREQ (320 * 1000 * 1000) #endif +#ifdef MT7620 +#define PLATFORM_COUNTER_FREQ (580 * 1000 * 1000) +#endif +#ifdef RT5350 +#define PLATFORM_COUNTER_FREQ (360 * 1000 * 1000) +#endif #ifndef PLATFORM_COUNTER_FREQ -#error "Nor RT3052F nor RT3050F defined" +#error "No platform selected" #endif -#define SYSTEM_CLOCK (PLATFORM_COUNTER_FREQ/3) +#ifndef MT7620 +#define SYSTEM_CLOCK (PLATFORM_COUNTER_FREQ/3) #define SDRAM_BASE 0x #define SDRAM_END 0x03FF @@ -60,16 +63,26 @@ #define INTCTL_END 0x12FF #define MEMCTRL_BASE 0x1300 #define MEMCTRL_END0x13FF /* SDRAM & Flash/SRAM */ +#ifndef RT5350 #define PCM_BASE 0x1400 #define PCM_END0x14FF +#else +#define PCM_BASE 0x10002000 +#define PCM_END0x100027FF +#endif #define UART_BASE 0x1500 #define UART_END 0x15FF #define PIO_BASE 0x1600 #define PIO_END0x16FF +#ifndef RT5350 #define GDMA_BASE 0x1700 #define GDMA_END 0x17FF /* Generic DMA */ #define NANDFC_BASE0x1800 #define NANDFC_END 0x18FF /* NAND Flash Controller */ +#else +#define GDMA_BASE 0x10002800 +#define GDMA_END 0x10002FFF +#endif #define I2C_BASE 0x1900 #define I2C_END0x19FF #define I2S_BASE 0x1A00 @@ -87,23 +100,110 @@ #define ROM_END0x10119FFF #define WLAN_BASE 0x1018 #define WLAN_END 0x101B /* 802.11n MAC/BBP */ +#ifndef RT5350 #define USB_OTG_BASE 0x101C #define USB_OTG_END0x101F +#else +#define USB_OTG_BASE 0x101C +#define USB_OTG_END0x101C0FFF +#define USB_OHCI_BASE 0x101C1000 +#define USB_OHCI_END 0x101C1FFF +#endif #define EMEM_BASE 0x1B00 #define EMEM_END 0x1BFF /* External SRAM/Flash */ +#ifdef RT5350 +#define BOOT_ROM_BASE 0x1C00 +#define BOOT_ROM_END 0x1C003FFF +#endif +#ifndef RT5350 #define FLASH_BASE 0x1F00 #define FLASH_END 0x1FFF /* Flash window */ +#endif #define OBIO_MEM_BASE SYSCTL_BASE #define OBIO_MEM_START OBIO_MEM_BASE +#ifndef RT5350 #define OBIO_MEM_END FLASH_END +#else +#define OBIO_MEM_END BOOT_ROM_END +#endif + +#else /* MT7620 */ +#define SYSTEM_CLOCK (40 * 1000 * 1000) +#define SDRAM_BASE 0x +#define SDRAM_END 0x0FFF + +#define SYSCTL_BASE0x1000 +#define SYSCTL_END 0x10FF +#define TIMER_BASE 0x1100 +#define TIMER_END 0x11FF +#define INTCTL_BASE0x1200 +#define INTCTL_END 0x12FF +#define MEMCTRL_BASE 0x1300 +#define MEMCTRL_END0x13FF /* SDRAM & Flash/SRAM */ +#define PCM_BASE 0x10002000 +#define PCM_END0x100027FF +#define UART_BASE 0x1500 +#define UART_END 0x15FF +#define PIO_BASE 0x1600 +#define PIO_END0x16FF +#define GDMA_BASE 0x10002800 +#define GDMA_END 0x10002FFF /* Generic DMA */ +#define NANDFC_BASE0x1800 +#define NANDFC_END 0x18FF /* NAND Flash Controller */ +#define I2C_BASE 0x1900 +#define I2C_END0x19FF +#define I2S_BASE 0x1A00 +#define I2S_END0x1AFF +#define SPI_BASE 0x1B00 +#define SPI_END0x1BFF +#define UARTLITE_BASE 0x1C00 +#define UARTLITE_END 0x1CFF + +#define FRENG_BASE 0x1010 +#define FRENG_END 0x1010 /* Frame Engine */ +#define ETHSW_BASE 0x1011 +#define ETHSW_END 0x10117FFF /* Ethernet Switch */ +#define ROM_BASE 0x10118000 +#define ROM_END0x1011 +#define WLAN_BASE 0x1018 +#define WLAN_END 0x101B /* 802.11n MAC/BBP */ +#define USB_OTG_BASE 0x101C +#define USB_OTG_END0x101C0FFF +#define USB_OHCI_BASE
svn commit: r292700 - head/sys/mips/rt305x
Author: adrian Date: Thu Dec 24 18:33:08 2015 New Revision: 292700 URL: https://svnweb.freebsd.org/changeset/base/292700 Log: [rt305x] add PCI bus / resource allocation code for the MT7620. This is based on the sys/arm/mv/ pci resource/allocation code. Submitted by: Stanislav Galabov Added: head/sys/mips/rt305x/rt305x_pci.c (contents, props changed) head/sys/mips/rt305x/rt305x_pcireg.h (contents, props changed) Added: head/sys/mips/rt305x/rt305x_pci.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/rt305x/rt305x_pci.c Thu Dec 24 18:33:08 2015 (r292700) @@ -0,0 +1,955 @@ +/*- + * Copyright (c) 2015 Stanislav Galabov. + * + * 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. + * + * This is based on the pci allocator code from sys/dev/arm/mv/: + * + * Copyright (c) 2008 MARVELL INTERNATIONAL LTD. + * Copyright (c) 2010 The FreeBSD Foundation + * Copyright (c) 2010-2012 Semihalf + * All rights reserved. + * + * Developed by Semihalf. + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include "pcib_if.h" + +#include +#include +#include + +struct mtx rt305x_pci_mtx; +MTX_SYSINIT(rt305x_pci_mtx, &rt305x_pci_mtx, "rt305x PCI/PCIe mutex", MTX_SPIN); + +struct rt305x_pci_softc { + device_tsc_dev; + + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + + int sc_busno; + + struct rman sc_mem_rman; + struct rman sc_io_rman; + struct rman sc_irq_rman; + + bus_addr_t sc_mem_base; + bus_addr_t sc_mem_size; + uint32_tsc_mem_map[(256*1024*1024) / + (PCI_MIN_MEM_ALLOC * BITS_PER_UINT32)]; + + bus_addr_t sc_io_base; + bus_addr_t sc_io_size; + uint32_tsc_io_map[(16*1024*1024) / + (PCI_MIN_IO_ALLOC * BITS_PER_UINT32)]; + + struct intr_event *sc_eventstab[RT305X_PCI_NIRQS]; + mips_intrcnt_t sc_intr_counter[RT305X_PCI_NIRQS]; + + int pcie_link_status; +}; + +static void rt305x_pci_phy_init(device_t); +static void rt305x_pci_init(device_t); +static int rt305x_pcib_init(device_t, int, int); +static int rt305x_pci_intr(void *); + +static void rt305x_pci_dump_regs(device_t); + +static struct rt305x_pci_softc *rt_sc = NULL; + +static int +rt305x_pci_probe(device_t dev) +{ + + return (BUS_PROBE_NOWILDCARD); +} + +static int +rt305x_pci_attach(device_t dev) +{ + struct rt305x_pci_softc *sc = device_get_softc(dev); + + rt_sc = sc; + + sc->sc_dev = dev; + sc->sc_mem_base = PCIE_MEM_BASE; + sc->sc_mem_size = 0x1000; + sc->sc_io_base = PCIE_IO_BASE; + sc->sc_io_size = 0x1; + + sc->sc_bsh = MIPS_PHYS_TO_KSEG1(PCIE_BASE); + sc->sc_bst = mips_bus_space_generic; + + sc->sc_mem_rman.rm_type = RMAN_ARRAY; + sc->sc_mem_rman.rm_descr = "rt305x pci memory window"; + if (rman_init(&sc->sc_mem_rman) != 0 || + rman_manage_region(&sc->sc_mem_rman, sc->sc_mem_base, + sc->sc_mem_base + sc->sc_mem_size - 1) != 0) { + panic("%s: failed to set up memory rman", __FUNCTION__); + } + + sc->sc_io_rman.rm_type = RMAN_ARRAY; + sc->sc_io_rman.rm_descr = "rt305x
svn commit: r292701 - head/sys/mips/rt305x
Author: adrian Date: Thu Dec 24 18:34:46 2015 New Revision: 292701 URL: https://svnweb.freebsd.org/changeset/base/292701 Log: [MT7620] add SPI device support. Submitted by: Alexander A. Mityaev Added: head/sys/mips/rt305x/rt305x_spi.c (contents, props changed) Added: head/sys/mips/rt305x/rt305x_spi.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/rt305x/rt305x_spi.c Thu Dec 24 18:34:46 2015 (r292701) @@ -0,0 +1,350 @@ +/*- + * Copyright (c) 2009, Oleksandr Tymoshenko + * Copyright (c) 2011, Aleksandr Rybalko + * Copyright (c) 2013, Alexander A. Mityaev + * 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 unmodified, 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 +#include +#include + +#include +#include +//#include + +#include +#include +#include "spibus_if.h" + +#include "opt_platform.h" + +#ifdef FDT +#include +#include +#include +#endif + +#include +#include + +#undef RT305X_SPI_DEBUG +#ifdef RT305X_SPI_DEBUG +#define dprintf printf +#else +#define dprintf(x, arg...) +#endif + +/* + * register space access macros + */ +#define SPI_WRITE(sc, reg, val)do {\ + bus_write_4(sc->sc_mem_res, (reg), (val)); \ + } while (0) + +#define SPI_READ(sc, reg) bus_read_4(sc->sc_mem_res, (reg)) + +#define SPI_SET_BITS(sc, reg, bits)\ + SPI_WRITE(sc, reg, SPI_READ(sc, (reg)) | (bits)) + +#define SPI_CLEAR_BITS(sc, reg, bits) \ + SPI_WRITE(sc, reg, SPI_READ(sc, (reg)) & ~(bits)) + +struct rt305x_spi_softc { + device_tsc_dev; + struct resource *sc_mem_res; +}; + +static int rt305x_spi_probe(device_t); +static int rt305x_spi_attach(device_t); +static int rt305x_spi_detach(device_t); +static int rt305x_spi_wait(struct rt305x_spi_softc *); +static voidrt305x_spi_chip_activate(struct rt305x_spi_softc *); +static voidrt305x_spi_chip_deactivate(struct rt305x_spi_softc *); +static uint8_t rt305x_spi_txrx(struct rt305x_spi_softc *, uint8_t *, int); +static int rt305x_spi_transfer(device_t, device_t, struct spi_command *); +#ifdef FDT +static phandle_t rt305x_spi_get_node(device_t, device_t); +#endif + +static int +rt305x_spi_probe(device_t dev) +{ +#ifdef FDT +if (!ofw_bus_is_compatible(dev, "ralink,rt305x-spi")) +return(ENXIO); +#endif + device_set_desc(dev, "RT305X SPI"); + return (0); +} + +static int +rt305x_spi_attach(device_t dev) +{ + struct rt305x_spi_softc *sc = device_get_softc(dev); + int rid; + + sc->sc_dev = dev; +rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_mem_res) { + device_printf(dev, "Could not map memory\n"); + return (ENXIO); + } + + if (rt305x_spi_wait(sc)) { + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + return (EBUSY); + } + + SPI_WRITE(sc, RT305X_SPICFG, MSBFIRST | SPICLKPOL | TX_ON_CLK_FALL | + SPI_CLK_DIV8); /* XXX: make it configurable */ + /* +* W25Q64CV max 104MHz, bus 120-192 MHz, so divide by 2. +* Update: divide by 4, DEV2 to fast for flash. +*/ + + device_add_child(dev, "spibus", 0); + return (bus_generic_attach(dev)); +} + +static int +rt305x_spi_detach(device_t dev) +{ + struct rt305x_spi_softc *sc = device_get_softc(dev); + + SPI_SET_BITS(sc, RT305X_SPICTL, HIZSMOSI | CS_HIGH); + +
svn commit: r292702 - head/sys/mips/rt305x
Author: adrian Date: Thu Dec 24 18:36:08 2015 New Revision: 292702 URL: https://svnweb.freebsd.org/changeset/base/292702 Log: [MT7620] add ehci/ohci USB support. The newer chips don't use OTG; they're more traditional USB. Submitted by: Stanislav Galabov Added: head/sys/mips/rt305x/rt305x_ehci.c (contents, props changed) head/sys/mips/rt305x/rt305x_ohci.c (contents, props changed) Added: head/sys/mips/rt305x/rt305x_ehci.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/rt305x/rt305x_ehci.c Thu Dec 24 18:36:08 2015 (r292702) @@ -0,0 +1,245 @@ +#include +__FBSDID("$FreeBSD$"); + +/*- + * Copyright (c) 2015 Stanislav Galabov. All rights reserved. + * Copyright (c) 2010,2011 Aleksandr Rybalko. All rights reserved. + * Copyright (c) 2007-2008 Hans Petter Selasky. 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include + +#define EHCI_HC_DEVSTR "Ralink integrated USB 2.0 controller" + +static device_probe_t ehci_obio_probe; +static device_attach_t ehci_obio_attach; +static device_detach_t ehci_obio_detach; + +static int +ehci_obio_probe(device_t self) +{ + device_set_desc(self, EHCI_HC_DEVSTR); + + return (BUS_PROBE_DEFAULT); +} + +static int +ehci_obio_attach(device_t self) +{ + ehci_softc_t *sc = device_get_softc(self); + uint32_t reg; + int err; + int rid; + + /* setup controller interface softc */ + reg = rt305x_sysctl_get(SYSCTL_SYSCFG1); + reg |= SYSCTL_SYSCFG1_USB0_HOST_MODE; + rt305x_sysctl_set(SYSCTL_SYSCFG1, reg); + + reg = rt305x_sysctl_get(SYSCTL_CLKCFG1); + reg |= SYSCTL_CLKCFG1_UPHY0_CLK_EN; +#ifdef MT7620 + reg |= SYSCTL_CLKCFG1_UPHY1_CLK_EN; +#endif + rt305x_sysctl_set(SYSCTL_CLKCFG1, reg); + + reg = rt305x_sysctl_get(SYSCTL_RSTCTRL); + reg |= SYSCTL_RSTCTRL_UPHY0 | SYSCTL_RSTCTRL_UPHY1; + rt305x_sysctl_set(SYSCTL_RSTCTRL, reg); + reg &= ~(SYSCTL_RSTCTRL_UPHY0 | SYSCTL_RSTCTRL_UPHY1); + DELAY(10); + rt305x_sysctl_set(SYSCTL_RSTCTRL, reg); + DELAY(10); + + /* initialise some bus fields */ + sc->sc_bus.parent = self; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = EHCI_MAX_DEVICES; + sc->sc_bus.dma_bits = 32; + + /* get all DMA memory */ + if (usb_bus_mem_alloc_all(&sc->sc_bus, + USB_GET_DMA_TAG(self), &ehci_iterate_hw_softc)) { + printf("No mem\n"); + return (ENOMEM); + } + + rid = 0; + sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_io_res) { + device_printf(self, "Could not map memory\n"); + goto error; + } + sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); + sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); + sc->sc_io_size = rman_get_size(sc->sc_io_res); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); + if (sc->sc_irq_res == NULL) { + device_printf(self, "Could not allocate irq\n"); + goto error; + } + + sc->sc_bus.bdev = device_add_child(self, "us
svn commit: r292703 - head/sys/mips/rt305x
Author: adrian Date: Thu Dec 24 18:40:10 2015 New Revision: 292703 URL: https://svnweb.freebsd.org/changeset/base/292703 Log: [rt305x] Add initial RT5350 and MT7620 glue. * Add in chipset awareness to the obio bus layout (ie, which devices are where); * Add in some USB OTG changes to be aware of the newer stuff; * Add in a configurable primary console - some chips use the normal UART, some use UARTLITE. Tested (by Stanislav); * RT3050 (NFS) * RT5350 (NFS, MFS) * MT7620 (USB) Submitted by: Stanislav Galabov Modified: head/sys/mips/rt305x/files.rt305x head/sys/mips/rt305x/obio.c head/sys/mips/rt305x/rt305x_dotg.c head/sys/mips/rt305x/rt305x_machdep.c head/sys/mips/rt305x/rt305x_sysctl.c head/sys/mips/rt305x/uart_bus_rt305x.c head/sys/mips/rt305x/uart_cpu_rt305x.c Modified: head/sys/mips/rt305x/files.rt305x == --- head/sys/mips/rt305x/files.rt305x Thu Dec 24 18:36:08 2015 (r292702) +++ head/sys/mips/rt305x/files.rt305x Thu Dec 24 18:40:10 2015 (r292703) @@ -9,6 +9,11 @@ mips/rt305x/rt305x_gpio.c optional gpio mips/rt305x/uart_bus_rt305x.c optional uart mips/rt305x/uart_cpu_rt305x.c optional uart mips/rt305x/uart_dev_rt305x.c optional uart +mips/rt305x/rt305x_dotg.c optional dwcotg +mips/rt305x/rt305x_ehci.c optional ehci +mips/rt305x/rt305x_ohci.c optional ohci +mips/rt305x/rt305x_spi.c optional spibus +mips/rt305x/rt305x_pci.c optional pci mips/mips/intr_machdep.cstandard mips/mips/tick.c standard dev/rt/if_rt.c optional rt Modified: head/sys/mips/rt305x/obio.c == --- head/sys/mips/rt305x/obio.c Thu Dec 24 18:36:08 2015(r292702) +++ head/sys/mips/rt305x/obio.c Thu Dec 24 18:40:10 2015(r292703) @@ -221,10 +221,10 @@ obio_attach(device_t dev) obio_add_res_child(dev, "pcm", 0, PCM_BASE, (PCM_END - PCM_BASE + 1), IC_PCM); +#endif obio_add_res_child(dev, "uart", 0, UART_BASE, (UART_END - UART_BASE + 1), IC_UART); -#endif obio_add_res_child(dev, "gpio", 0, PIO_BASE, (PIO_END - PIO_BASE + 1), IC_PIO); @@ -241,19 +241,28 @@ obio_attach(device_t dev) obio_add_res_child(dev, "i2s", 0, I2S_BASE, (I2S_END - I2S_BASE + 1), IC_I2S); +#endif obio_add_res_child(dev, "spi", 0, SPI_BASE, (SPI_END - SPI_BASE + 1), -1); -#endif obio_add_res_child(dev, "uart", 1, UARTLITE_BASE, (UARTLITE_END - UARTLITE_BASE + 1), IC_UARTLITE); +#if !defined(RT5350) && !defined(MT7620) obio_add_res_child(dev, "cfi", 0, FLASH_BASE, (FLASH_END - FLASH_BASE + 1), -1); - obio_add_res_child(dev, "dotg", 0, + obio_add_res_child(dev, "dwcotg", 0, USB_OTG_BASE, (USB_OTG_END - USB_OTG_BASE + 1), IC_OTG); +#else + obio_add_res_child(dev, "ehci", 0, + USB_OTG_BASE, (USB_OTG_END - USB_OTG_BASE + 1), + IC_OTG); + obio_add_res_child(dev, "ohci", 0, + USB_OHCI_BASE, (USB_OHCI_END - USB_OHCI_BASE + 1), + IC_OTG); +#endif obio_add_res_child(dev, "switch", 0, ETHSW_BASE, (ETHSW_END - ETHSW_BASE + 1), IC_ETHSW); Modified: head/sys/mips/rt305x/rt305x_dotg.c == --- head/sys/mips/rt305x/rt305x_dotg.c Thu Dec 24 18:36:08 2015 (r292702) +++ head/sys/mips/rt305x/rt305x_dotg.c Thu Dec 24 18:40:10 2015 (r292703) @@ -2,6 +2,7 @@ __FBSDID("$FreeBSD$"); /*- + * Copyright (c) 2015 Stanislav Galabov. All rights reserved. * Copyright (c) 2010,2011 Aleksandr Rybalko. All rights reserved. * Copyright (c) 2007-2008 Hans Petter Selasky. All rights reserved. * @@ -58,7 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include @@ -68,10 +69,6 @@ static device_probe_t dotg_obio_probe; static device_attach_t dotg_obio_attach; static device_detach_t dotg_obio_detach; -struct dotg_obio_softc { - struct dotg_softc sc_dci; /* must be first */ -}; - static int dotg_obio_probe(device_t dev) { @@ -82,61 +79,63 @@ dotg_obio_probe(device_t dev) static int dotg_obio_attach(device_t dev) { - struct dotg_obio_softc *sc = device_get_softc(dev); - int err; + struct dwc_otg_softc *sc = device_get_softc(dev); + uint32_t tmp; + int err, rid; /* setup controller interface softc */ /* initialise some bus fields */ - sc->sc_dci.sc_dev = dev; - sc->sc_dci.sc_bus.parent = dev; - sc->sc_dci.sc_bus.devices = sc->sc_dci.sc_devices; - sc->sc_dci.sc_bus.devices_max = DOTG_MAX_DEVICES; - sc->sc_dci.
svn commit: r292704 - head/sys/dev/rt
Author: adrian Date: Thu Dec 24 18:41:16 2015 New Revision: 292704 URL: https://svnweb.freebsd.org/changeset/base/292704 Log: [rt] add support for the RT5350 and MT7620 SoCs. This is a work in progress; bringing the interface down stops further use. It only happens on RT5350/MT7620. This is based on work by Alexander A. Mityaev . Submitted by: Stanislav Galabov Modified: head/sys/dev/rt/if_rt.c head/sys/dev/rt/if_rtreg.h head/sys/dev/rt/if_rtvar.h Modified: head/sys/dev/rt/if_rt.c == --- head/sys/dev/rt/if_rt.c Thu Dec 24 18:40:10 2015(r292703) +++ head/sys/dev/rt/if_rt.c Thu Dec 24 18:41:16 2015(r292704) @@ -1,4 +1,6 @@ /*- + * Copyright (c) 2015, Stanislav Galabov + * Copyright (c) 2014, Aleksandr A. Mityaev * Copyright (c) 2011, Aleksandr Rybalko * based on hard work * by Alexander Egorenkov @@ -56,6 +58,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include "opt_platform.h" +#include "opt_rt305x.h" + +#ifdef FDT +#include +#include +#include +#endif + #include #include @@ -78,6 +89,23 @@ __FBSDID("$FreeBSD$"); #defineRT_TX_WATCHDOG_TIMEOUT 5 +#define RT_CHIPID_RT3050 0x3050 +#define RT_CHIPID_RT3052 0x3052 +#define RT_CHIPID_RT5350 0x5350 +#define RT_CHIPID_RT6855 0x6855 +#define RT_CHIPID_MT7620 0x7620 + +#ifdef FDT +/* more specific and new models should go first */ +static const struct ofw_compat_data rt_compat_data[] = { + { "ralink,rt6855-eth", (uintptr_t)RT_CHIPID_RT6855 }, + { "ralink,rt5350-eth", (uintptr_t)RT_CHIPID_RT5350 }, + { "ralink,rt3052-eth", (uintptr_t)RT_CHIPID_RT3052 }, + { "ralink,rt305x-eth", (uintptr_t)RT_CHIPID_RT3050 }, + { NULL, (uintptr_t)NULL } +}; +#endif + /* * Static function prototypes */ @@ -96,16 +124,18 @@ static int rt_ioctl(struct ifnet *ifp, u static voidrt_periodic(void *arg); static voidrt_tx_watchdog(void *arg); static voidrt_intr(void *arg); +static voidrt_rt5350_intr(void *arg); static voidrt_tx_coherent_intr(struct rt_softc *sc); static voidrt_rx_coherent_intr(struct rt_softc *sc); static voidrt_rx_delay_intr(struct rt_softc *sc); static voidrt_tx_delay_intr(struct rt_softc *sc); -static voidrt_rx_intr(struct rt_softc *sc); +static voidrt_rx_intr(struct rt_softc *sc, int qid); static voidrt_tx_intr(struct rt_softc *sc, int qid); static voidrt_rx_done_task(void *context, int pending); static voidrt_tx_done_task(void *context, int pending); static voidrt_periodic_task(void *context, int pending); -static int rt_rx_eof(struct rt_softc *sc, int limit); +static int rt_rx_eof(struct rt_softc *sc, + struct rt_softc_rx_ring *ring, int limit); static voidrt_tx_eof(struct rt_softc *sc, struct rt_softc_tx_ring *ring); static voidrt_update_stats(struct rt_softc *sc); @@ -115,7 +145,7 @@ static void rt_intr_enable(struct rt_sof static voidrt_intr_disable(struct rt_softc *sc, uint32_t intr_mask); static int rt_txrx_enable(struct rt_softc *sc); static int rt_alloc_rx_ring(struct rt_softc *sc, - struct rt_softc_rx_ring *ring); + struct rt_softc_rx_ring *ring, int qid); static voidrt_reset_rx_ring(struct rt_softc *sc, struct rt_softc_rx_ring *ring); static voidrt_free_rx_ring(struct rt_softc *sc, @@ -147,8 +177,29 @@ SYSCTL_INT(_hw_rt, OID_AUTO, debug, CTLF static int rt_probe(device_t dev) { - device_set_desc(dev, "Ralink RT305XF onChip Ethernet MAC"); - return (BUS_PROBE_NOWILDCARD); + struct rt_softc *sc = device_get_softc(dev); + char buf[80]; +#ifdef FDT + const struct ofw_compat_data * cd; + + cd = ofw_bus_search_compatible(dev, rt_compat_data); + if (cd->ocd_data == (uintptr_t)NULL) + return (ENXIO); + + sc->rt_chipid = (unsigned int)(cd->ocd_data); +#else +#if defined(MT7620) + sc->rt_chipid = RT_CHIPID_MT7620; +#elif defined(RT5350) + sc->rt_chipid = RT_CHIPID_RT5350; +#else + sc->rt_chipid = RT_CHIPID_RT3050; +#endif +#endif + snprintf(buf, sizeof(buf), "Ralink RT%x onChip Ethernet driver", + sc->rt_chipid); + device_set_desc_copy(dev, buf); + return (BUS_PROBE_GENERIC); } /* @@ -240,7 +291,7 @@ ether_request_mac(device_t dev, uint8_t * "ethaddr" is passed via envp on RedBoot platforms * "kmac" is passed via argv on RouterBOOT platforms */ -#if defined(__U_BOOT__) || defined(__REDBOOT__) || defined(__ROUTERBOOT__) +#if defined(RT305X_UBOOT) || defined(__REDBOOT__) || defined(__ROUTERBOOT__) if ((var = kern_getenv("ethaddr")) != NULL || (var = kern_getenv("kmac")) != NULL ) { @@ -288,6 +339,16 @@ ether_request_mac(device_t dev, uint8_t return (0); } +/* + * Reset h
svn commit: r292705 - head/libexec/rtld-elf
Author: emaste Date: Thu Dec 24 18:53:17 2015 New Revision: 292705 URL: https://svnweb.freebsd.org/changeset/base/292705 Log: rtld: remove old XXX comment missed in r35529 Sponsored by: The FreeBSD Foundation Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c == --- head/libexec/rtld-elf/rtld.cThu Dec 24 18:41:16 2015 (r292704) +++ head/libexec/rtld-elf/rtld.cThu Dec 24 18:53:17 2015 (r292705) @@ -1126,7 +1126,6 @@ digest_dynamic1(Obj_Entry *obj, int earl #ifndef __mips__ case DT_DEBUG: - /* XXX - not implemented yet */ if (!early) dbg("Filling in DT_DEBUG entry"); ((Elf_Dyn*)dynp)->d_un.d_ptr = (Elf_Addr) &r_debug; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292706 - in head/sys: conf netinet
Author: pkelsey Date: Thu Dec 24 19:09:48 2015 New Revision: 292706 URL: https://svnweb.freebsd.org/changeset/base/292706 Log: Implementation of server-side TCP Fast Open (TFO) [RFC7413]. TFO is disabled by default in the kernel build. See the top comment in sys/netinet/tcp_fastopen.c for implementation particulars. Reviewed by: gnn, jch, stas MFC after:3 days Sponsored by: Verisign, Inc. Differential Revision:https://reviews.freebsd.org/D4350 Added: head/sys/netinet/tcp_fastopen.c (contents, props changed) head/sys/netinet/tcp_fastopen.h (contents, props changed) Modified: head/sys/conf/files head/sys/conf/options head/sys/netinet/tcp.h head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_syncache.h head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h Modified: head/sys/conf/files == --- head/sys/conf/files Thu Dec 24 18:53:17 2015(r292705) +++ head/sys/conf/files Thu Dec 24 19:09:48 2015(r292706) @@ -3688,6 +3688,7 @@ netinet/sctp_usrreq.c optional inet sct netinet/sctputil.c optional inet sctp | inet6 sctp netinet/siftr.coptional inet siftr alq | inet6 siftr alq netinet/tcp_debug.coptional tcpdebug +netinet/tcp_fastopen.c optional inet tcp_rfc7413 | inet6 tcp_rfc7413 netinet/tcp_hostcache.coptional inet | inet6 netinet/tcp_input.coptional inet | inet6 netinet/tcp_lro.c optional inet | inet6 Modified: head/sys/conf/options == --- head/sys/conf/options Thu Dec 24 18:53:17 2015(r292705) +++ head/sys/conf/options Thu Dec 24 19:09:48 2015(r292706) @@ -440,6 +440,8 @@ TCPDEBUG TCPPCAPopt_global.h SIFTR TCP_OFFLOADopt_inet.h # Enable code to dispatch TCP offloading +TCP_RFC7413opt_inet.h +TCP_RFC7413_MAX_KEYS opt_inet.h TCP_SIGNATURE opt_inet.h VLAN_ARRAY opt_vlan.h XBONEHACK Modified: head/sys/netinet/tcp.h == --- head/sys/netinet/tcp.h Thu Dec 24 18:53:17 2015(r292705) +++ head/sys/netinet/tcp.h Thu Dec 24 19:09:48 2015(r292706) @@ -97,6 +97,10 @@ struct tcphdr { #defineTCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ #defineTCPOPT_SIGNATURE19 /* Keyed MD5: RFC 2385 */ #define TCPOLEN_SIGNATURE18 +#defineTCPOPT_FAST_OPEN34 +#define TCPOLEN_FAST_OPEN_EMPTY 2 +#define TCPOLEN_FAST_OPEN_MIN6 +#define TCPOLEN_FAST_OPEN_MAX18 /* Miscellaneous constants */ #defineMAX_SACK_BLKS 6 /* Max # SACK blocks stored at receiver side */ @@ -165,6 +169,7 @@ struct tcphdr { #defineTCP_KEEPIDLE256 /* L,N,X start keeplives after this period */ #defineTCP_KEEPINTVL 512 /* L,N interval between keepalives */ #defineTCP_KEEPCNT 1024/* L,N number of keepalives before close */ +#defineTCP_FASTOPEN1025/* enable TFO / was created via TFO */ #defineTCP_PCAP_OUT2048/* number of output packets to keep */ #defineTCP_PCAP_IN 4096/* number of input packets to keep */ #define TCP_FUNCTION_BLK 8192 /* Set the tcp function pointers to the specified stack */ Added: head/sys/netinet/tcp_fastopen.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/tcp_fastopen.c Thu Dec 24 19:09:48 2015 (r292706) @@ -0,0 +1,442 @@ +/*- + * Copyright (c) 2015 Patrick Kelsey + * 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,
Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern
I'm running Atmel hardware with this change built on amd64. I'm not sure what the issue here is. Warner On Dec 24, 2015 8:40 AM, "Ian Lepore" wrote: > On Mon, 2015-12-07 at 12:20 +, Konstantin Belousov wrote: > > Author: kib > > Date: Mon Dec 7 12:20:26 2015 > > New Revision: 291937 > > URL: https://svnweb.freebsd.org/changeset/base/291937 > > > > Log: > > Add support for usermode (vdso-like) gettimeofday(2) and > > clock_gettime(2) on ARMv7 and ARMv8 systems which have architectural > > generic timer hardware. It is similar how the RDTSC timer is used in > > userspace on x86. > > > > Fix a permission problem where generic timer access from EL0 (or > > userspace on v7) was not properly initialized on APs. > > > > For ARMv7, mark the stack non-executable. The shared page is added for > > all arms (including ARMv8 64bit), and the signal trampoline code is > > moved to the page. > > > > Reviewed by:> > andrew > > Discussed with:>> emaste, mmel > > Sponsored by:> > The FreeBSD Foundation > > Differential revision:> https://reviews.freebsd.org/D4209 > > I've just discovered this change breaks buildworld on armv4/5 systems. > Those systems don't have the counter hardware that can be read from > userland (they don't have any common timer hardware at all, every > system is different). Also, they don't support the 'mrrc' instruction, > so the buildworld fails to compile libc. > > -- Ian > > ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern
On Thu, Dec 24, 2015 at 12:34:57PM -0700, Warner Losh wrote: > I'm running Atmel hardware with this change built on amd64. > I'm not sure what the issue here is. I suspect that either clang for cross-build is misconfigured for armv6, or universe uses wrong clang (again, for armv6, instead of for arm). I.e. there are two issues to fix, one is wrong native (or cross) clang, and another is the use of the mrrc instruction on ARM v5 in libc (but the code should not be executed, it is only compiled). For later, see how I encoded isb in the same file. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern
> On Dec 24, 2015, at 10:00, Konstantin Belousov wrote: > >> On Thu, Dec 24, 2015 at 08:40:42AM -0700, Ian Lepore wrote: >>> On Mon, 2015-12-07 at 12:20 +, Konstantin Belousov wrote: >>> Author: kib >>> Date: Mon Dec 7 12:20:26 2015 >>> New Revision: 291937 >>> URL: https://svnweb.freebsd.org/changeset/base/291937 >>> >>> Log: >>> Add support for usermode (vdso-like) gettimeofday(2) and >>> clock_gettime(2) on ARMv7 and ARMv8 systems which have architectural >>> generic timer hardware. It is similar how the RDTSC timer is used in >>> userspace on x86. >>> >>> Fix a permission problem where generic timer access from EL0 (or >>> userspace on v7) was not properly initialized on APs. >>> >>> For ARMv7, mark the stack non-executable. The shared page is added for >>> all arms (including ARMv8 64bit), and the signal trampoline code is >>> moved to the page. >>> >>> Reviewed by:>> andrew >>> Discussed with:>> emaste, mmel >>> Sponsored by:>> The FreeBSD Foundation >>> Differential revision:>https://reviews.freebsd.org/D4209 >> >> I've just discovered this change breaks buildworld on armv4/5 systems. >> Those systems don't have the counter hardware that can be read from >> userland (they don't have any common timer hardware at all, every >> system is different). Also, they don't support the 'mrrc' instruction, >> so the buildworld fails to compile libc. > > I tested the change with make universe. Is the armv5 world included > into the make ? If yes, there is something even more broken. > > That said, the code in __vdso_gettime.c is unused om armv4/v5 since kernel > never directs libc to use a fast timecounter. The routines could be left > undefined since they are declared weak, or the bodies could be stubbed out. > Anyway, to test, I should be able to compile libc for the target. > > And, BTW, what is exactly your error message ? It was an assembler error on stable/9 at least... ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292707 - in stable/10: contrib/smbfs tools/debugscripts
Author: brueffer Date: Thu Dec 24 20:15:14 2015 New Revision: 292707 URL: https://svnweb.freebsd.org/changeset/base/292707 Log: MFH: r292263 Assorted grammar, spelling and punctuation fixes. PR: 203336, 203339 Submitted by: esp...@rpi.edu, theme...@gmail.com Modified: stable/10/contrib/smbfs/README stable/10/tools/debugscripts/README Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/smbfs/README == --- stable/10/contrib/smbfs/README Thu Dec 24 19:09:48 2015 (r292706) +++ stable/10/contrib/smbfs/README Thu Dec 24 20:15:14 2015 (r292707) @@ -15,7 +15,7 @@ It is a complete, kernel side implementa Darwin maintained in the Darwin's tree. -I'm would be very grateful for any feedback, bug reports etc. +I would be very grateful for any feedback, bug reports etc. Supported SMB servers: Samba @@ -23,14 +23,14 @@ It is a complete, kernel side implementa IBM LanManager NetApp -An updated versions of this package can be retrieved from ftp server: +An updated version of this package can be retrieved from ftp server: ftp://ftp.butya.kz/pub/smbfs/smbfs.tar.gz -Perfomance +Performance == -There is some perfomance benchmarks over 10Mbit network: +These are some performance benchmarks over a 10Mbit network: Win95 machine as server: IOZONE: auto-test mode Modified: stable/10/tools/debugscripts/README == --- stable/10/tools/debugscripts/README Thu Dec 24 19:09:48 2015 (r292706) +++ stable/10/tools/debugscripts/README Thu Dec 24 20:15:14 2015 (r292707) @@ -14,8 +14,8 @@ perform kernel debugging, you would do: (kgdb) -This directory also contains a kgdb script that given a crash dump number -automatically extract the path to the kernel source, run gdb to extract -information about kernel modules loaded, and then rerun gdb loading the +This directory also contains a kgdb script that, given a crash dump number, +automatically extracts the path to the kernel source, runs gdb to extract +information about kernel modules loaded, and then reruns gdb loading the necessary symbols for the modules. You need to make sure you build the modules w/ debugging symbols separately to get things to work. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern
On Thu, 2015-12-24 at 20:00 +0200, Konstantin Belousov wrote: > On Thu, Dec 24, 2015 at 08:40:42AM -0700, Ian Lepore wrote: > > On Mon, 2015-12-07 at 12:20 +, Konstantin Belousov wrote: > > > Author: kib > > > Date: Mon Dec 7 12:20:26 2015 > > > New Revision: 291937 > > > URL: https://svnweb.freebsd.org/changeset/base/291937 > > > > > > Log: > > > Add support for usermode (vdso-like) gettimeofday(2) and > > > clock_gettime(2) on ARMv7 and ARMv8 systems which have > > > architectural > > > generic timer hardware. It is similar how the RDTSC timer is > > > used in > > > userspace on x86. > > > > > > Fix a permission problem where generic timer access from EL0 > > > (or > > > userspace on v7) was not properly initialized on APs. > > > > > > For ARMv7, mark the stack non-executable. The shared page is > > > added for > > > all arms (including ARMv8 64bit), and the signal trampoline > > > code is > > > moved to the page. > > > > > > Reviewed by:> > andrew > > > Discussed with:>> emaste, mmel > > > Sponsored by:> > The FreeBSD Foundation > > > Differential revision:> > > > https://reviews.freebsd.org/D4209 > > > > I've just discovered this change breaks buildworld on armv4/5 > > systems. > > Those systems don't have the counter hardware that can be read > > from > > userland (they don't have any common timer hardware at all, every > > system is different). Also, they don't support the 'mrrc' > > instruction, > > so the buildworld fails to compile libc. > > I tested the change with make universe. Is the armv5 world included > into the make ? If yes, there is something even more broken. > > That said, the code in __vdso_gettime.c is unused om armv4/v5 since > kernel > never directs libc to use a fast timecounter. The routines could be > left > undefined since they are declared weak, or the bodies could be > stubbed out. > Anyway, to test, I should be able to compile libc for the target. > > And, BTW, what is exactly your error message ? > Oh, I know what's likely at the heart of this... I'm using gcc 4.2.1 for arm v4/v5, because clang 3.7 is broken (works to crossbuild, but fails to run native). The mrrc instruction was introduced at arm arch 5E, I'll bet clang is defaulting to 5E and gcc defaults to 4. This is what's in my make.conf for the build that failed: WITH_GCC=yes WITH_GNUCXX=yes WITH_GCC_BOOTSTRAP=yes WITHOUT_CLANG=yes WITHOUT_CLANG_IS_CC=yes WITHOUT_CLANG_BOOTSTRAP=yes Yep, just confirmed it, switched back to clang 3.7 for crossbuild and no errors. -- Ian ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292708 - in stable/9: contrib/smbfs tools/debugscripts
Author: brueffer Date: Thu Dec 24 20:19:49 2015 New Revision: 292708 URL: https://svnweb.freebsd.org/changeset/base/292708 Log: MFH: r292263 Assorted grammar, spelling and punctuation fixes. PR: 203336, 203339 Submitted by: esp...@rpi.edu, theme...@gmail.com Modified: stable/9/contrib/smbfs/README stable/9/tools/debugscripts/README Directory Properties: stable/9/contrib/smbfs/ (props changed) stable/9/tools/ (props changed) Modified: stable/9/contrib/smbfs/README == --- stable/9/contrib/smbfs/README Thu Dec 24 20:15:14 2015 (r292707) +++ stable/9/contrib/smbfs/README Thu Dec 24 20:19:49 2015 (r292708) @@ -15,7 +15,7 @@ It is a complete, kernel side implementa Darwin maintained in the Darwin's tree. -I'm would be very grateful for any feedback, bug reports etc. +I would be very grateful for any feedback, bug reports etc. Supported SMB servers: Samba @@ -23,14 +23,14 @@ It is a complete, kernel side implementa IBM LanManager NetApp -An updated versions of this package can be retrieved from ftp server: +An updated version of this package can be retrieved from ftp server: ftp://ftp.butya.kz/pub/smbfs/smbfs.tar.gz -Perfomance +Performance == -There is some perfomance benchmarks over 10Mbit network: +These are some performance benchmarks over a 10Mbit network: Win95 machine as server: IOZONE: auto-test mode Modified: stable/9/tools/debugscripts/README == --- stable/9/tools/debugscripts/README Thu Dec 24 20:15:14 2015 (r292707) +++ stable/9/tools/debugscripts/README Thu Dec 24 20:19:49 2015 (r292708) @@ -14,8 +14,8 @@ perform kernel debugging, you would do: (kgdb) -This directory also contains a kgdb script that given a crash dump number -automatically extract the path to the kernel source, run gdb to extract -information about kernel modules loaded, and then rerun gdb loading the +This directory also contains a kgdb script that, given a crash dump number, +automatically extracts the path to the kernel source, runs gdb to extract +information about kernel modules loaded, and then reruns gdb loading the necessary symbols for the modules. You need to make sure you build the modules w/ debugging symbols separately to get things to work. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r292620 - head/sys/kern
On Wed, Dec 23, 2015 at 08:02:10AM +1100, Bruce Evans wrote: > On Tue, 22 Dec 2015, Konstantin Belousov wrote: > > > Log: > > If we annoy user with the terminal output due to failed load of > > interpreter, also show the actual error code instead of some > > interpretation. > > This and nearby messages are of annoyingly low quality. They don't > even print the program name(s). > > I use the following partial fixes. I forget if they print the program > name or the interpeter name. > > X Index: imgact_elf.c > X === > X RCS file: /home/ncvs/src/sys/kern/imgact_elf.c,v > X retrieving revision 1.151 > X diff -u -2 -r1.151 imgact_elf.c > X --- imgact_elf.c5 Jun 2004 02:18:28 - 1.151 > X +++ imgact_elf.c5 Jun 2004 06:51:25 - > X @@ -694,6 +693,6 @@ > X brand_info = __elfN(get_brandinfo)(hdr, interp); > X if (brand_info == NULL) { > X - uprintf("ELF binary type \"%u\" not known.\n", > X - hdr->e_ident[EI_OSABI]); > X + uprintf("%s: ELF binary type \"%u\" not known.\n", > X + imgp->stringbase, hdr->e_ident[EI_OSABI]); This cannot be a fix. there is no stringbase member in struct imgact. In fact, there is no available path to the executable in the image activation routine, and due to things like fexecve(2), it may have been not passed to the kernel at all. The present structure of the messages is forced by this fact, and it is usually obvious what is the image kernel complained about, since it is the image that was just executed. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern
On Thu, Dec 24, 2015 at 01:18:53PM -0700, Ian Lepore wrote: > Oh, I know what's likely at the heart of this... I'm using gcc 4.2.1 > for arm v4/v5, because clang 3.7 is broken (works to crossbuild, but > fails to run native). The mrrc instruction was introduced at arm arch > 5E, I'll bet clang is defaulting to 5E and gcc defaults to 4. > > This is what's in my make.conf for the build that failed: > > WITH_GCC=yes > WITH_GNUCXX=yes > WITH_GCC_BOOTSTRAP=yes > WITHOUT_CLANG=yes > WITHOUT_CLANG_IS_CC=yes > WITHOUT_CLANG_BOOTSTRAP=yes > > Yep, just confirmed it, switched back to clang 3.7 for crossbuild and > no errors. I think that the following is the least intrusive change. I built it with your make.conf successfully (and make.conf seems to take effect judging by the build time). If you are fine with the change, I will commit right after confirming that ARMv6 build still results in correct code (building right now). diff --git a/lib/libc/arm/sys/__vdso_gettc.c b/lib/libc/arm/sys/__vdso_gettc.c index d75d866..1f43e72 100644 --- a/lib/libc/arm/sys/__vdso_gettc.c +++ b/lib/libc/arm/sys/__vdso_gettc.c @@ -34,8 +34,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "libc_private.h" +#if __ARM_ARCH >= 6 static inline uint64_t cp15_cntvct_get(void) { @@ -53,6 +55,7 @@ cp15_cntpct_get(void) __asm __volatile("mrrc\tp15, 0, %Q0, %R0, c14" : "=r" (reg)); return (reg); } +#endif #pragma weak __vdso_gettc u_int @@ -60,6 +63,7 @@ __vdso_gettc(const struct vdso_timehands *th) { uint64_t val; +#if __ARM_ARCH >= 6 /* * Userspace gettimeofday() is only enabled on ARMv7 CPUs, but * libc is compiled for ARMv6. Due to clang issues, .arch @@ -67,6 +71,9 @@ __vdso_gettc(const struct vdso_timehands *th) */ __asm __volatile(".word\t0xf57ff06f" : : : "memory"); /* isb */ val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); +#else + val = 0; +#endif return (val); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern
On Thu, 2015-12-24 at 23:10 +0200, Konstantin Belousov wrote: > On Thu, Dec 24, 2015 at 01:18:53PM -0700, Ian Lepore wrote: > > Oh, I know what's likely at the heart of this... I'm using gcc > > 4.2.1 > > for arm v4/v5, because clang 3.7 is broken (works to crossbuild, > > but > > fails to run native). The mrrc instruction was introduced at arm > > arch > > 5E, I'll bet clang is defaulting to 5E and gcc defaults to 4. > > > > This is what's in my make.conf for the build that failed: > > > > WITH_GCC=yes > > WITH_GNUCXX=yes > > WITH_GCC_BOOTSTRAP=yes > > WITHOUT_CLANG=yes > > WITHOUT_CLANG_IS_CC=yes > > WITHOUT_CLANG_BOOTSTRAP=yes > > > > Yep, just confirmed it, switched back to clang 3.7 for crossbuild > > and > > no errors. > > I think that the following is the least intrusive change. I built it > with your make.conf successfully (and make.conf seems to take effect > judging > by the build time). > > If you are fine with the change, I will commit right after confirming > that > ARMv6 build still results in correct code (building right now). yeah, gcc sure builds fast compared to clang. :) The change looks good to me. -- Ian ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r290383 - in head/sys: net netinet
On 20 Dec 2015, at 13:02, Cy Schubert wrote: Cy Schubert writes: In message <201511050726.ta57qxlu074...@repo.freebsd.org>, "George V. Neville-N eil" writes: Author: gnn Date: Thu Nov 5 07:26:32 2015 New Revision: 290383 URL: https://svnweb.freebsd.org/changeset/base/290383 Log: Replace the fastforward path with tryforward which does not require a sysctl and will always be on. The former split between default and fast forwarding is removed by this commit while preserving the ability to use all network stack features. Differential Revision: https://reviews.freebsd.org/D4042 Reviewed by:ae, melifaro, olivier, rwatson MFC after: 1 month Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/net/if_arcsubr.c head/sys/net/if_ethersubr.c head/sys/net/if_fddisubr.c head/sys/net/if_fwsubr.c head/sys/net/if_iso88025subr.c head/sys/netinet/in_var.h head/sys/netinet/ip_fastfwd.c head/sys/netinet/ip_input.c Modified: head/sys/net/if_arcsubr.c === == = --- head/sys/net/if_arcsubr.c Thu Nov 5 04:16:03 2015(r29038 2) +++ head/sys/net/if_arcsubr.c Thu Nov 5 07:26:32 2015(r29038 3) @@ -550,15 +550,11 @@ arc_input(struct ifnet *ifp, struct mbuf #ifdef INET case ARCTYPE_IP: m_adj(m, ARC_HDRNEWLEN); - if ((m = ip_fastforward(m)) == NULL) - return; isr = NETISR_IP; break; case ARCTYPE_IP_OLD: m_adj(m, ARC_HDRLEN); - if ((m = ip_fastforward(m)) == NULL) - return; isr = NETISR_IP; break; Modified: head/sys/net/if_ethersubr.c === == = --- head/sys/net/if_ethersubr.c Thu Nov 5 04:16:03 2015(r29038 2) +++ head/sys/net/if_ethersubr.c Thu Nov 5 07:26:32 2015(r29038 3) @@ -722,8 +722,6 @@ ether_demux(struct ifnet *ifp, struct mb switch (ether_type) { #ifdef INET case ETHERTYPE_IP: - if ((m = ip_fastforward(m)) == NULL) - return; isr = NETISR_IP; break; Modified: head/sys/net/if_fddisubr.c === == = --- head/sys/net/if_fddisubr.c Thu Nov 5 04:16:03 2015(r29038 2) +++ head/sys/net/if_fddisubr.c Thu Nov 5 07:26:32 2015(r29038 3) @@ -429,8 +429,6 @@ fddi_input(ifp, m) switch (type) { #ifdef INET case ETHERTYPE_IP: - if ((m = ip_fastforward(m)) == NULL) - return; isr = NETISR_IP; break; Modified: head/sys/net/if_fwsubr.c === == = --- head/sys/net/if_fwsubr.cThu Nov 5 04:16:03 2015(r29038 2) +++ head/sys/net/if_fwsubr.cThu Nov 5 07:26:32 2015(r29038 3) @@ -605,8 +605,6 @@ firewire_input(struct ifnet *ifp, struct switch (type) { #ifdef INET case ETHERTYPE_IP: - if ((m = ip_fastforward(m)) == NULL) - return; isr = NETISR_IP; break; Modified: head/sys/net/if_iso88025subr.c === == = --- head/sys/net/if_iso88025subr.c Thu Nov 5 04:16:03 2015(r29038 2) +++ head/sys/net/if_iso88025subr.c Thu Nov 5 07:26:32 2015(r29038 3) @@ -519,8 +519,6 @@ iso88025_input(ifp, m) #ifdef INET case ETHERTYPE_IP: th->iso88025_shost[0] &= ~(TR_RII); - if ((m = ip_fastforward(m)) == NULL) - return; isr = NETISR_IP; break; Modified: head/sys/netinet/in_var.h === == = --- head/sys/netinet/in_var.h Thu Nov 5 04:16:03 2015(r29038 2) +++ head/sys/netinet/in_var.h Thu Nov 5 07:26:32 2015(r29038 3) @@ -380,7 +380,7 @@ int in_scrubprefix(struct in_ifaddr *, u voidip_input(struct mbuf *); voidip_direct_input(struct mbuf *); voidin_ifadown(struct ifaddr *ifa, int); -struct mbuf*ip_fastforward(struct mbuf *); +struct mbuf*ip_tryforward(struct mbuf *); void*in_domifattach(struct ifnet *); voidin_domifdetach(struct ifnet *, void *); Modified: head/sys/netinet/ip_fastfwd.c === == = --- head/sys/netinet/ip_fastfwd.c Thu Nov 5 04:16:03 2015(r29038 2) +++ head/sys/netinet/ip_fastfwd.c Thu Nov 5 07:26:32 2015(r29038 3) @@ -108,12 +108,6 @@ __FBSDID("$FreeBSD$"); #include -static VNET_DEFINE(int, ipfastforward_ac
Re: svn commit: r292620 - head/sys/kern
On Thu, 24 Dec 2015, Konstantin Belousov wrote: On Wed, Dec 23, 2015 at 08:02:10AM +1100, Bruce Evans wrote: On Tue, 22 Dec 2015, Konstantin Belousov wrote: Log: If we annoy user with the terminal output due to failed load of interpreter, also show the actual error code instead of some interpretation. This and nearby messages are of annoyingly low quality. They don't even print the program name(s). I use the following partial fixes. I forget if they print the program name or the interpeter name. X Index: imgact_elf.c X === X RCS file: /home/ncvs/src/sys/kern/imgact_elf.c,v X retrieving revision 1.151 X diff -u -2 -r1.151 imgact_elf.c X --- imgact_elf.c 5 Jun 2004 02:18:28 - 1.151 X +++ imgact_elf.c 5 Jun 2004 06:51:25 - X @@ -694,6 +693,6 @@ X brand_info = __elfN(get_brandinfo)(hdr, interp); X if (brand_info == NULL) { X - uprintf("ELF binary type \"%u\" not known.\n", X - hdr->e_ident[EI_OSABI]); X + uprintf("%s: ELF binary type \"%u\" not known.\n", X + imgp->stringbase, hdr->e_ident[EI_OSABI]); This cannot be a fix. there is no stringbase member in struct imgact. There was in FreeBSD-5. In fact, there is no available path to the executable in the image activation routine, and due to things like fexecve(2), it may have been not passed to the kernel at all. argv[0] and the string being interpreted must be known at some point. The present structure of the messages is forced by this fact, and it is usually obvious what is the image kernel complained about, since it is the image that was just executed. Not if it is one of many commands in a script. Bruce ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292709 - head/lib/libc/arm/sys
Author: kib Date: Thu Dec 24 22:13:52 2015 New Revision: 292709 URL: https://svnweb.freebsd.org/changeset/base/292709 Log: Do not compile ARMv6 instructions on ARMv4/v5. Although clang is fine with mrrc, gcc is not. The disabled code is not executed on ARMv4 anyway. Reported and reviewed by: ian Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/arm/sys/__vdso_gettc.c Modified: head/lib/libc/arm/sys/__vdso_gettc.c == --- head/lib/libc/arm/sys/__vdso_gettc.cThu Dec 24 20:19:49 2015 (r292708) +++ head/lib/libc/arm/sys/__vdso_gettc.cThu Dec 24 22:13:52 2015 (r292709) @@ -34,8 +34,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "libc_private.h" +#if __ARM_ARCH >= 6 static inline uint64_t cp15_cntvct_get(void) { @@ -53,6 +55,7 @@ cp15_cntpct_get(void) __asm __volatile("mrrc\tp15, 0, %Q0, %R0, c14" : "=r" (reg)); return (reg); } +#endif #pragma weak __vdso_gettc u_int @@ -60,6 +63,7 @@ __vdso_gettc(const struct vdso_timehands { uint64_t val; +#if __ARM_ARCH >= 6 /* * Userspace gettimeofday() is only enabled on ARMv7 CPUs, but * libc is compiled for ARMv6. Due to clang issues, .arch @@ -67,6 +71,9 @@ __vdso_gettc(const struct vdso_timehands */ __asm __volatile(".word\t0xf57ff06f" : : : "memory"); /* isb */ val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); +#else + val = 0; +#endif return (val); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292710 - head/contrib/bsnmp/snmpd
Author: ngie Date: Thu Dec 24 22:22:02 2015 New Revision: 292710 URL: https://svnweb.freebsd.org/changeset/base/292710 Log: Remove unused function `act_getkernstring` This fixes a clang -Wunused warning Differential Revision: https://reviews.freebsd.org/D4697 MFC after: 1 week Reported by: Jenkins Reviewed by: araujo, bapt Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/bsnmp/snmpd/action.c Modified: head/contrib/bsnmp/snmpd/action.c == --- head/contrib/bsnmp/snmpd/action.c Thu Dec 24 22:13:52 2015 (r292709) +++ head/contrib/bsnmp/snmpd/action.c Thu Dec 24 22:22:02 2015 (r292710) @@ -60,29 +60,6 @@ static const struct asn_oid #endif /* - * Get a string value from the KERN sysctl subtree. - */ -static char * -act_getkernstring(int id) -{ - int mib[2]; - size_t len; - char *string; - - mib[0] = CTL_KERN; - mib[1] = id; - if (sysctl(mib, 2, NULL, &len, NULL, 0) != 0) - return (NULL); - if ((string = malloc(len)) == NULL) - return (NULL); - if (sysctl(mib, 2, string, &len, NULL, 0) != 0) { - free(string); - return (NULL); - } - return (string); -} - -/* * Get an integer value from the KERN sysctl subtree. */ static char * ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292711 - head/sys/mips/conf
Author: adrian Date: Thu Dec 24 22:27:00 2015 New Revision: 292711 URL: https://svnweb.freebsd.org/changeset/base/292711 Log: Add missing device rename. Modified: head/sys/mips/conf/RT305X Modified: head/sys/mips/conf/RT305X == --- head/sys/mips/conf/RT305X Thu Dec 24 22:22:02 2015(r292710) +++ head/sys/mips/conf/RT305X Thu Dec 24 22:27:00 2015(r292711) @@ -118,7 +118,7 @@ device cfid device nvram2env device usb -#devicedotg# DWC like USB OTG Controller driver +#devicedwcotg # DWC like USB OTG Controller driver #deviceu3g #deviceumodem #deviceuplcom ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r292712 - head/sys/mips/conf
Author: adrian Date: Fri Dec 25 00:58:41 2015 New Revision: 292712 URL: https://svnweb.freebsd.org/changeset/base/292712 Log: Add initial configuration files for the MT7620 and RT5350 SoCs. These are all works in progress. Notably - no wifi support just yet! I've booted the MT7620 on a TP-Link Archer C2 via tftpboot. Submitted by: Stanislav Galabov Added: head/sys/mips/conf/MT7620 (contents, props changed) head/sys/mips/conf/MT7620.hints (contents, props changed) head/sys/mips/conf/RT5350 (contents, props changed) head/sys/mips/conf/RT5350.hints (contents, props changed) Added: head/sys/mips/conf/MT7620 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/MT7620 Fri Dec 25 00:58:41 2015(r292712) @@ -0,0 +1,149 @@ +# MT7620 -- Kernel configuration file for FreeBSD/mips for Ralink MT7620 systems +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident MT7620 + +machinemips mipsel +makeoptionsMIPS_LITTLE_ENDIAN=defined +makeoptionsKERNLOADADDR=0x8001 + +# Don't build any modules yet. +#makeoptions MODULES_OVERRIDE="wlan_xauth wlan_wep wlan_tkip wlan_acl wlan_amrr wlan_ccmp wlan_rssadapt if_bridge bridgestp msdosfs md ipfw dummynet libalias geom/geom_label ufs usb/uplcom usb/u3g usb/umodem usb/umass usb/ucom cam zlib" +makeoptionsMODULES_OVERRIDE="" +makeoptionsMT7620 + +include"../rt305x/std.rt305x" + +hints "MT7620.hints" #Default places to look for devices. + +#makeoptions DEBUG=-g#Build kernel with gdb(1) debug symbols + +optionsMT7620 +optionsRT305X_UBOOT + +# Debugging for use in -current +optionsDEADLKRES #Enable the deadlock resolver +optionsINVARIANTS #Enable calls of extra sanity checking +optionsINVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +optionsWITNESS #Enable checks to detect deadlocks and cycles +optionsWITNESS_SKIPSPIN#Don't run witness on spinlocks for speed +#options DIAGNOSTIC +#options DEBUG_LOCKS +#options DEBUG_VFS_LOCKS +#options GDB +optionsDDB +optionsKDB + +optionsSCHED_ULE +#options SCHED_4BSD #4BSD scheduler +#options COMPAT_43 +optionsINET#InterNETworking +optionsNFSCL #Network Filesystem Client +optionsNFS_ROOT#NFS usable as /, requires NFSCL +optionsPSEUDOFS#Pseudo-filesystem framework +#options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +#options BOOTP +#options BOOTP_NFSROOT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=rt0 +#options BOOTP_COMPAT +#options CD9660 # ISO 9660 Filesystem +#options ROOTDEVNAME=\"cd9660:/dev/map/rootfs.uncompress\" +#options TMPFS # TMP Memory Filesystem + +optionsFFS #Berkeley Fast Filesystem +#options SOFTUPDATES #Enable FFS soft updates support +#options UFS_ACL #Support for access control lists +#options UFS_DIRHASH #Improve performance on big directories +#options ROOTDEVNAME=\"nfs:10.0.0.1:/mnt/bsd\" + +# Options for making kernel less hangry +#makeoptions INLINE_LIMIT=1024 +#options MAXUSERS=3 +#options MAXFILES=512 +#options NSFBUFS=256 +#options SHMALL=128 +#options MSGBUF_SIZE=65536 + +# Options for making kernel smallest +#options NO_SYSCTL_DESCR # No description string of sysctl +#options NO_FFS_SNAPSHOT # Disable Snapshot supporting +#options SCSI_NO_SENSE_STRINGS +#options SCSI_NO_OP_STRINGS +#options RWLOCK_NOINLINE +#options SX_NOINLINE +#options NO_SWAPPING +options MROUTING# Multicast routing +optionsIPFIREWALL_DEFAULT_TO_ACCEPT + +optionsGEOM_UNCOMPRESS +optionsMD_ROOT +optionsROOTDEVNAME=\"ufs:da0s1\" + +device md + +dev
svn commit: r292715 - head/sys/dev/isp
Author: mav Date: Fri Dec 25 03:44:29 2015 New Revision: 292715 URL: https://svnweb.freebsd.org/changeset/base/292715 Log: Clear virtual port's port database when disabling it. Previously it was done only on full chip reinit, that caused old ports resurrect in case of virtual port reenabling. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_library.c head/sys/dev/isp/isp_library.h Modified: head/sys/dev/isp/isp.c == --- head/sys/dev/isp/isp.c Fri Dec 25 02:15:26 2015(r292714) +++ head/sys/dev/isp/isp.c Fri Dec 25 03:44:29 2015(r292715) @@ -2344,6 +2344,159 @@ isp_fibre_init_2400(ispsoftc_t *isp) isp->isp_state = ISP_RUNSTATE; } +static int +isp_fc_enable_vp(ispsoftc_t *isp, int chan) +{ + fcparam *fcp = FCPARAM(isp, chan); + mbreg_t mbs; + vp_modify_t *vp; + uint8_t qe[QENTRY_LEN], *scp; + + ISP_MEMZERO(qe, QENTRY_LEN); + if (FC_SCRATCH_ACQUIRE(isp, chan)) { + return (EBUSY); + } + scp = fcp->isp_scratch; + + /* Build a VP MODIFY command in memory */ + vp = (vp_modify_t *) qe; + vp->vp_mod_hdr.rqs_entry_type = RQSTYPE_VP_MODIFY; + vp->vp_mod_hdr.rqs_entry_count = 1; + vp->vp_mod_cnt = 1; + vp->vp_mod_idx0 = chan; + vp->vp_mod_cmd = VP_MODIFY_ENA; + vp->vp_mod_ports[0].options = ICB2400_VPOPT_ENABLED | + ICB2400_VPOPT_ENA_SNSLOGIN; + if (fcp->role & ISP_ROLE_INITIATOR) { + vp->vp_mod_ports[0].options |= ICB2400_VPOPT_INI_ENABLE; + } + if ((fcp->role & ISP_ROLE_TARGET) == 0) { + vp->vp_mod_ports[0].options |= ICB2400_VPOPT_TGT_DISABLE; + } + if (fcp->isp_loopid < LOCAL_LOOP_LIM) { + vp->vp_mod_ports[0].loopid = fcp->isp_loopid; + if (isp->isp_confopts & ISP_CFG_OWNLOOPID) + vp->vp_mod_ports[0].options |= + ICB2400_VPOPT_HARD_ADDRESS; + else + vp->vp_mod_ports[0].options |= + ICB2400_VPOPT_PREV_ADDRESS; + } + MAKE_NODE_NAME_FROM_WWN(vp->vp_mod_ports[0].wwpn, fcp->isp_wwpn); + MAKE_NODE_NAME_FROM_WWN(vp->vp_mod_ports[0].wwnn, fcp->isp_wwnn); + isp_put_vp_modify(isp, vp, (vp_modify_t *) scp); + + /* Build a EXEC IOCB A64 command that points to the VP MODIFY command */ + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 0); + mbs.param[1] = QENTRY_LEN; + mbs.param[2] = DMA_WD1(fcp->isp_scdma); + mbs.param[3] = DMA_WD0(fcp->isp_scdma); + mbs.param[6] = DMA_WD3(fcp->isp_scdma); + mbs.param[7] = DMA_WD2(fcp->isp_scdma); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); + isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + FC_SCRATCH_RELEASE(isp, chan); + return (EIO); + } + MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); + isp_get_vp_modify(isp, (vp_modify_t *)&scp[QENTRY_LEN], vp); + + FC_SCRATCH_RELEASE(isp, chan); + + if (vp->vp_mod_status != VP_STS_OK) { + isp_prt(isp, ISP_LOGERR, "%s: VP_MODIFY of Chan %d failed with status %d", __func__, chan, vp->vp_mod_status); + return (EIO); + } + return (0); +} + +static int +isp_fc_disable_vp(ispsoftc_t *isp, int chan) +{ + fcparam *fcp = FCPARAM(isp, chan); + mbreg_t mbs; + vp_ctrl_info_t *vp; + uint8_t qe[QENTRY_LEN], *scp; + + ISP_MEMZERO(qe, QENTRY_LEN); + if (FC_SCRATCH_ACQUIRE(isp, chan)) { + return (EBUSY); + } + scp = fcp->isp_scratch; + + /* Build a VP CTRL command in memory */ + vp = (vp_ctrl_info_t *) qe; + vp->vp_ctrl_hdr.rqs_entry_type = RQSTYPE_VP_CTRL; + vp->vp_ctrl_hdr.rqs_entry_count = 1; + if (ISP_CAP_VP0(isp)) { + vp->vp_ctrl_status = 1; + } else { + vp->vp_ctrl_status = 0; + chan--; /* VP0 can not be controlled in this case. */ + } + vp->vp_ctrl_command = VP_CTRL_CMD_DISABLE_VP_LOGO_ALL; + vp->vp_ctrl_vp_count = 1; + vp->vp_ctrl_idmap[chan / 16] |= (1 << chan % 16); + isp_put_vp_ctrl_info(isp, vp, (vp_ctrl_info_t *) scp); + + /* Build a EXEC IOCB A64 command that points to the VP CTRL command */ + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 0); + mbs.param[1] = QENTRY_LEN; + mbs.param[2] = DMA_WD1(fcp->isp_scdma); + mbs.param[3] = DMA_WD0(fcp->isp_scdma); + mbs.param[6] = DMA_WD3(fcp->isp_scdma); + mbs.param[7] = DMA_WD2(fcp->isp_scdma); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); + isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + FC_SCRATCH_RELEASE(is