CVS commit: src/sys/dev/ofisa
Module Name:src Committed By: jdolecek Date: Tue Oct 10 05:35:15 UTC 2017 Modified Files: src/sys/dev/ofisa: wdc_ofisa.c Log Message: fix wdc_init_shadow_regs() arg To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/dev/ofisa/wdc_ofisa.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ofisa/wdc_ofisa.c diff -u src/sys/dev/ofisa/wdc_ofisa.c:1.34 src/sys/dev/ofisa/wdc_ofisa.c:1.35 --- src/sys/dev/ofisa/wdc_ofisa.c:1.34 Sat Oct 7 19:52:11 2017 +++ src/sys/dev/ofisa/wdc_ofisa.c Tue Oct 10 05:35:15 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: wdc_ofisa.c,v 1.34 2017/10/07 19:52:11 jdolecek Exp $ */ +/* $NetBSD: wdc_ofisa.c,v 1.35 2017/10/10 05:35:15 jdolecek Exp $ */ /* * Copyright 1997, 1998 @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wdc_ofisa.c,v 1.34 2017/10/07 19:52:11 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wdc_ofisa.c,v 1.35 2017/10/10 05:35:15 jdolecek Exp $"); #include #include @@ -161,7 +161,7 @@ wdc_ofisa_attach(device_t parent, device sc->sc_channel.ch_channel = 0; sc->sc_channel.ch_atac = &sc->sc_wdcdev.sc_atac; sc->sc_channel.ch_queue = ata_queue_alloc(1); - wdc_init_shadow_regs(&sc->sc_channel); + wdc_init_shadow_regs(wdr); wdcattach(&sc->sc_channel);
CVS commit: src/sys/dev/pci
Module Name:src Committed By: msaitoh Date: Tue Oct 10 03:11:01 UTC 2017 Modified Files: src/sys/dev/pci: pci_subr.c pcireg.h Log Message: Decode IOMMU capability of PCI secure device capability. From "AMD I/O Virtualization Technology(IOMMU) Specification (#48882) Revision 3.00". To generate a diff of this commit: cvs rdiff -u -r1.191 -r1.192 src/sys/dev/pci/pci_subr.c cvs rdiff -u -r1.133 -r1.134 src/sys/dev/pci/pcireg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/pci_subr.c diff -u src/sys/dev/pci/pci_subr.c:1.191 src/sys/dev/pci/pci_subr.c:1.192 --- src/sys/dev/pci/pci_subr.c:1.191 Thu Oct 5 06:14:30 2017 +++ src/sys/dev/pci/pci_subr.c Tue Oct 10 03:11:01 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: pci_subr.c,v 1.191 2017/10/05 06:14:30 msaitoh Exp $ */ +/* $NetBSD: pci_subr.c,v 1.192 2017/10/10 03:11:01 msaitoh Exp $ */ /* * Copyright (c) 1997 Zubin D. Dittia. All rights reserved. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.191 2017/10/05 06:14:30 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.192 2017/10/10 03:11:01 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_pci.h" @@ -1530,7 +1530,90 @@ pci_conf_print_subsystem_cap(const pcire } /* XXX pci_conf_print_agp8_cap */ -/* XXX pci_conf_print_secure_cap */ +static void +pci_conf_print_secure_cap(const pcireg_t *regs, int capoff) +{ + pcireg_t reg, reg2, val; + bool havemisc1; + + printf("\n Secure Capability Register\n"); + reg = regs[o2i(capoff + PCI_SECURE_CAP)]; + val = __SHIFTOUT(reg, PCI_SECURE_CAP_TYPE); + printf("Capability block type: "); + /* I know IOMMU Only */ + if (val == PCI_SECURE_CAP_TYPE_IOMMU) + printf("IOMMU\n"); + else { + printf("0x%x(unknown)\n", val); + return; + } + + val = __SHIFTOUT(reg, PCI_SECURE_CAP_REV); + printf("Capability revision: 0x%02x", val); + if (val == PCI_SECURE_CAP_REV_IOMMU) + printf("IOMMU\n"); + else { + printf("(unknown)\n"); + return; + } + onoff("IOTLB support", reg, PCI_SECURE_CAP_IOTLBSUP); + onoff("HyperTransport tunnel translation support", reg, + PCI_SECURE_CAP_HTTUNNEL); + onoff("Not present table entries cahced", reg, PCI_SECURE_CAP_NPCACHE); + onoff("IOMMU Extended Feature Register support", reg, + PCI_SECURE_CAP_EFRSUP); + onoff("IOMMU Miscellaneous Information Register 1", reg, + PCI_SECURE_CAP_EXT); + havemisc1 = reg & PCI_SECURE_CAP_EXT; + + reg = regs[o2i(capoff + PCI_SECURE_IOMMU_BAL)]; + printf("Base Address Low Register: 0x%08x\n", reg); + onoff("Enable", reg, PCI_SECURE_IOMMU_BAL_EN); + reg2 = regs[o2i(capoff + PCI_SECURE_IOMMU_BAH)]; + printf("Base Address High Register: 0x%08x\n", reg2); + printf(" Base Address : 0x%016" PRIx64 "\n", + ((uint64_t)reg2 << 32) + | (reg & (PCI_SECURE_IOMMU_BAL_H | PCI_SECURE_IOMMU_BAL_L))); + + reg = regs[o2i(capoff + PCI_SECURE_IOMMU_RANGE)]; + printf("IOMMU Range Register: 0x%08x\n", reg); + printf(" HyperTransport UnitID: 0x%02x\n", + (uint32_t)__SHIFTOUT(reg, PCI_SECURE_IOMMU_RANGE_UNITID)); + onoff("Range valid", reg, PCI_SECURE_IOMMU_RANGE_RNGVALID); + printf(" Device range bus number: 0x%02x\n", + (uint32_t)__SHIFTOUT(reg, PCI_SECURE_IOMMU_RANGE_BUSNUM)); + printf(" First device: 0x%04x\n", + (uint32_t)__SHIFTOUT(reg, PCI_SECURE_IOMMU_RANGE_FIRSTDEV)); + printf(" Last device: 0x%04x\n", + (uint32_t)__SHIFTOUT(reg, PCI_SECURE_IOMMU_RANGE_LASTDEV)); + + reg = regs[o2i(capoff + PCI_SECURE_IOMMU_MISC0)]; + printf("Miscellaneous Information Register 0: 0x%08x\n", reg); + printf(" MSI Message number: 0x%04x\n", + (uint32_t)__SHIFTOUT(reg, PCI_SECURE_IOMMU_MISC0_MSINUM)); + val = __SHIFTOUT(reg, PCI_SECURE_IOMMU_MISC0_GVASIZE); + printf(" Guest Virtual Address size: "); + if (val == PCI_SECURE_IOMMU_MISC0_GVASIZE_48B) + printf("48bits\n"); + else + printf("0x%x(unknown)\n", val); + val = __SHIFTOUT(reg, PCI_SECURE_IOMMU_MISC0_PASIZE); + printf(" Physical Address size: %dbits\n", val); + val = __SHIFTOUT(reg, PCI_SECURE_IOMMU_MISC0_VASIZE); + printf(" Virtual Address size: %dbits\n", val); + onoff("ATS response address range reserved", reg, + PCI_SECURE_IOMMU_MISC0_ATSRESV); + printf(" Peripheral Page Request MSI Message number: 0x%02x\n", + (uint32_t)__SHIFTOUT(reg, PCI_SECURE_IOMMU_MISC0_MISNPPR)); + + if (!havemisc1) + return; + + reg = regs[o2i(capoff + PCI_SECURE_IOMMU_MISC1)]; + printf("Miscellaneous Information Register 1: 0x%08x\n", reg); + printf(" MSI Message number (GA): 0x%02x\n", + (uint32_t)__SHIFTOUT(reg, PCI_SECURE_IOMMU_MISC1_MSINUM)); +} static void pci_print_pcie_L0s_latency(uint32_t val) @@ -2352,7 +2435,7 @@ static struct { { PCI_CAP_SUBVENDOR, "Subsystem vendor ID", pci_conf_print_subsystem_cap }, { PCI_CAP_AGP8, "AGP 8x", NULL }, - { PCI_CAP_SECURE, "Secure Device", NULL }, + { PCI_CAP
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: msaitoh Date: Tue Oct 10 03:05:29 UTC 2017 Modified Files: src/sys/arch/x86/x86: procfs_machdep.c Log Message: Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for finding this bug. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x86/x86/procfs_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/procfs_machdep.c diff -u src/sys/arch/x86/x86/procfs_machdep.c:1.19 src/sys/arch/x86/x86/procfs_machdep.c:1.20 --- src/sys/arch/x86/x86/procfs_machdep.c:1.19 Mon Oct 9 17:49:28 2017 +++ src/sys/arch/x86/x86/procfs_machdep.c Tue Oct 10 03:05:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: procfs_machdep.c,v 1.19 2017/10/09 17:49:28 maya Exp $ */ +/* $NetBSD: procfs_machdep.c,v 1.20 2017/10/10 03:05:29 msaitoh Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.19 2017/10/09 17:49:28 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.20 2017/10/10 03:05:29 msaitoh Exp $"); #include #include @@ -179,7 +179,7 @@ static const char * const x86_features[] NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, { /* (17) 0x8007 ebx */ - "overflow_recov", "succor", "smca", NULL, NULL, NULL, NULL, NULL, + "overflow_recov", "succor", NULL, "smca", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
CVS commit: src/sys/dev/pci/n8
Module Name:src Committed By: maya Date: Mon Oct 9 23:42:40 UTC 2017 Modified Files: src/sys/dev/pci/n8: nsp.c Log Message: Delete bogus NULL test. We deref session just above, and all callers already have session != NULL already. suggested by riastradh, spotted by coccinelle To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/n8/nsp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/n8/nsp.c diff -u src/sys/dev/pci/n8/nsp.c:1.12 src/sys/dev/pci/n8/nsp.c:1.13 --- src/sys/dev/pci/n8/nsp.c:1.12 Mon Apr 13 16:33:25 2015 +++ src/sys/dev/pci/n8/nsp.c Mon Oct 9 23:42:40 2017 @@ -701,12 +701,6 @@ n8_session_free(struct nsp_softc *sc, ns } mutex_enter(&sc->sc_intrlock); - if (session == NULL) { - DBG(("n8_session_free: attempt to free NULL\n")); - mutex_exit(&sc->sc_intrlock); - return; - } - session->next = sc->freesession; sc->freesession = session; session->magic = 0xFEED;
CVS commit: src/sys/dev/pci
Module Name:src Committed By: maya Date: Mon Oct 9 23:24:22 UTC 2017 Modified Files: src/sys/dev/pci: mpii.c Log Message: Reorder to avoid null deref before null test To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/mpii.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/mpii.c diff -u src/sys/dev/pci/mpii.c:1.9 src/sys/dev/pci/mpii.c:1.10 --- src/sys/dev/pci/mpii.c:1.9 Sun Jun 25 15:56:32 2017 +++ src/sys/dev/pci/mpii.c Mon Oct 9 23:24:22 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: mpii.c,v 1.9 2017/06/25 15:56:32 christos Exp $ */ +/* $NetBSD: mpii.c,v 1.10 2017/10/09 23:24:22 maya Exp $ */ /* OpenBSD: mpii.c,v 1.51 2012/04/11 13:29:14 naddy Exp */ /* * Copyright (c) 2010 Mike Belopuhov @@ -20,7 +20,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.9 2017/06/25 15:56:32 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.10 2017/10/09 23:24:22 maya Exp $"); #include "bio.h" @@ -4108,10 +4108,12 @@ mpii_alloc_dev(struct mpii_softc *sc) static int mpii_insert_dev(struct mpii_softc *sc, struct mpii_device *dev) { - int slot = dev->slot; /* initial hint */ - if (!dev || slot < 0) + if (!dev || dev->slot < 0) return (1); + + int slot = dev->slot; /* initial hint */ + while (slot < sc->sc_max_devices && sc->sc_devs[slot] != NULL) slot++; if (slot >= sc->sc_max_devices)
CVS commit: [netbsd-8] src/doc
Module Name:src Committed By: snj Date: Mon Oct 9 18:09:09 UTC 2017 Modified Files: src/doc [netbsd-8]: CHANGES-8.0 Log Message: 312, 313 To generate a diff of this commit: cvs rdiff -u -r1.1.2.63 -r1.1.2.64 src/doc/CHANGES-8.0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-8.0 diff -u src/doc/CHANGES-8.0:1.1.2.63 src/doc/CHANGES-8.0:1.1.2.64 --- src/doc/CHANGES-8.0:1.1.2.63 Mon Oct 2 13:37:05 2017 +++ src/doc/CHANGES-8.0 Mon Oct 9 18:09:09 2017 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-8.0,v 1.1.2.63 2017/10/02 13:37:05 martin Exp $ +# $NetBSD: CHANGES-8.0,v 1.1.2.64 2017/10/09 18:09:09 snj Exp $ A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04 until the 8.0 release: @@ -6092,3 +6092,15 @@ sys/net/if_bridge.c1.135 It can be called in a thread context via tap (tap_dev_write). [ozaki-r, ticket #297] +tools/gcc/Makefilepatch +tools/gcc/mknative-gcc patch + + disable dual libstdc++ abi + [christos, ticket #312] + +distrib/sets/lists/comp/mi 1.2148 +external/gpl3/gcc/usr.bin/include/Makefile patch + + Add stdatomic.h + [christos, ticket #313] +
CVS commit: [netbsd-8] src
Module Name:src Committed By: snj Date: Mon Oct 9 18:05:12 UTC 2017 Modified Files: src/distrib/sets/lists/comp [netbsd-8]: mi src/external/gpl3/gcc/usr.bin/include [netbsd-8]: Makefile Log Message: Pull up following revision(s) (requested by christos in ticket #313): distrib/sets/lists/comp/mi: 1.2148 external/gpl3/gcc/usr.bin/include/Makefile: patch Add stdatomic.h To generate a diff of this commit: cvs rdiff -u -r1.2138.2.1 -r1.2138.2.2 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.8 -r1.8.8.1 src/external/gpl3/gcc/usr.bin/include/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.2138.2.1 src/distrib/sets/lists/comp/mi:1.2138.2.2 --- src/distrib/sets/lists/comp/mi:1.2138.2.1 Tue Jul 18 17:32:50 2017 +++ src/distrib/sets/lists/comp/mi Mon Oct 9 18:05:11 2017 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.2138.2.1 2017/07/18 17:32:50 snj Exp $ +# $NetBSD: mi,v 1.2138.2.2 2017/10/09 18:05:11 snj Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. ./etc/mtree/set.compcomp-sys-root @@ -1989,6 +1989,7 @@ ./usr/include/gcc-4.8/omp.h comp-gcc-include gcc=48 ./usr/include/gcc-5/omp.h comp-gcc-include gcc=53 ./usr/include/gcc-5/openacc.h comp-gcc-include gcc=53 +./usr/include/gcc-5/stdatomic.h comp-gcc-include gcc=53 ./usr/include/gelf.hcomp-c-include ./usr/include/getopt.hcomp-c-include ./usr/include/glob.hcomp-c-include Index: src/external/gpl3/gcc/usr.bin/include/Makefile diff -u src/external/gpl3/gcc/usr.bin/include/Makefile:1.8 src/external/gpl3/gcc/usr.bin/include/Makefile:1.8.8.1 --- src/external/gpl3/gcc/usr.bin/include/Makefile:1.8 Sat Mar 12 23:07:05 2016 +++ src/external/gpl3/gcc/usr.bin/include/Makefile Mon Oct 9 18:05:11 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.8 2016/03/12 23:07:05 mrg Exp $ +# $NetBSD: Makefile,v 1.8.8.1 2017/10/09 18:05:11 snj Exp $ .include "../Makefile.inc" @@ -8,6 +8,9 @@ INCS= ${G_EXTRA_HEADERS:T} +# Part of the standard headers, the rest of which we replace. +INCS+= stdatomic.h + # XXX missed some how .if ${GCC_MACHINE_ARCH} == "i386" || ${GCC_MACHINE_ARCH} == "x86_64" INCS+= mm_malloc.h
CVS commit: [netbsd-8] src/tools/gcc
Module Name:src Committed By: snj Date: Mon Oct 9 17:59:16 UTC 2017 Modified Files: src/tools/gcc [netbsd-8]: Makefile mknative-gcc Log Message: Apply patch (requested by christos in ticket #312): disable dual libstdc++ abi To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.81.4.1 src/tools/gcc/Makefile cvs rdiff -u -r1.89 -r1.89.6.1 src/tools/gcc/mknative-gcc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/gcc/Makefile diff -u src/tools/gcc/Makefile:1.81 src/tools/gcc/Makefile:1.81.4.1 --- src/tools/gcc/Makefile:1.81 Wed Mar 22 23:11:10 2017 +++ src/tools/gcc/Makefile Mon Oct 9 17:59:16 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.81 2017/03/22 23:11:10 chs Exp $ +# $NetBSD: Makefile,v 1.81.4.1 2017/10/09 17:59:16 snj Exp $ .include @@ -35,6 +35,7 @@ COMMON_CONFIGURE_ARGS= --target=${MACHIN --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html \ --with-pkgversion="NetBSD ${NETBSD_GCC_VERSION}" \ --with-system-zlib \ + --disable-libstdcxx-dual-abi \ --enable-__cxa_atexit \ --enable-libstdcxx-time=rt \ --enable-libstdcxx-threads @@ -190,6 +191,7 @@ NATIVE_CONFIGURE_ARGS+= \ --disable-multilib \ --disable-symvers \ --disable-libstdcxx-pch \ + --disable-libstdcxx-dual-abi \ --build=`${GCCDIST}/config.guess` \ --host=${MACHINE_GNU_PLATFORM} \ --with-sysroot=${DESTDIR} Index: src/tools/gcc/mknative-gcc diff -u src/tools/gcc/mknative-gcc:1.89 src/tools/gcc/mknative-gcc:1.89.6.1 --- src/tools/gcc/mknative-gcc:1.89 Wed Oct 5 19:25:49 2016 +++ src/tools/gcc/mknative-gcc Mon Oct 9 17:59:16 2017 @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: mknative-gcc,v 1.89 2016/10/05 19:25:49 christos Exp $ +# $NetBSD: mknative-gcc,v 1.89.6.1 2017/10/09 17:59:16 snj Exp $ # # Shell script for generating all the constants needed for a native # platform build of gcc. @@ -380,7 +380,7 @@ __EOF__ # special transforms for f in gtyp-input.list; do - sed -e 's/^.*external\/gpl3\/gcc\/dist/SRCDIR/' < $_TMPDIR/gcc/$f > $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f + sed -e "s@^.*$_OUTDIRBASE/dist@SRCDIR@" < $_TMPDIR/gcc/$f > $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f done # special platforms
CVS commit: src/sys/arch
Module Name:src Committed By: maya Date: Mon Oct 9 17:49:28 UTC 2017 Modified Files: src/sys/arch/i386/i386: machdep.c src/sys/arch/x86/include: cpu.h src/sys/arch/x86/x86: fpu.c identcpu.c procfs_machdep.c x86_machdep.c Log Message: GC i386_fpu_present. no FPU x86 is not supported. Also delete newly unused send_sigill To generate a diff of this commit: cvs rdiff -u -r1.795 -r1.796 src/sys/arch/i386/i386/machdep.c cvs rdiff -u -r1.79 -r1.80 src/sys/arch/x86/include/cpu.h cvs rdiff -u -r1.13 -r1.14 src/sys/arch/x86/x86/fpu.c cvs rdiff -u -r1.59 -r1.60 src/sys/arch/x86/x86/identcpu.c cvs rdiff -u -r1.18 -r1.19 src/sys/arch/x86/x86/procfs_machdep.c cvs rdiff -u -r1.97 -r1.98 src/sys/arch/x86/x86/x86_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/i386/machdep.c diff -u src/sys/arch/i386/i386/machdep.c:1.795 src/sys/arch/i386/i386/machdep.c:1.796 --- src/sys/arch/i386/i386/machdep.c:1.795 Sat Sep 30 11:43:57 2017 +++ src/sys/arch/i386/i386/machdep.c Mon Oct 9 17:49:27 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.795 2017/09/30 11:43:57 maxv Exp $ */ +/* $NetBSD: machdep.c,v 1.796 2017/10/09 17:49:27 maya Exp $ */ /* * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009, 2017 @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.795 2017/09/30 11:43:57 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.796 2017/10/09 17:49:27 maya Exp $"); #include "opt_beep.h" #include "opt_compat_freebsd.h" @@ -212,7 +212,6 @@ struct mtrr_funcs *mtrr_funcs; int cpu_class; int use_pae; -int i386_fpu_present = 1; int i386_fpu_fdivbug; int i386_use_fxsave; Index: src/sys/arch/x86/include/cpu.h diff -u src/sys/arch/x86/include/cpu.h:1.79 src/sys/arch/x86/include/cpu.h:1.80 --- src/sys/arch/x86/include/cpu.h:1.79 Sat Sep 16 09:28:38 2017 +++ src/sys/arch/x86/include/cpu.h Mon Oct 9 17:49:27 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.79 2017/09/16 09:28:38 maxv Exp $ */ +/* $NetBSD: cpu.h,v 1.80 2017/10/09 17:49:27 maya Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -381,14 +381,12 @@ extern char cpu_brand_string[]; extern int use_pae; #ifdef __i386__ -extern int i386_fpu_present; int npx586bug1(int, int); extern int i386_fpu_fdivbug; extern int i386_use_fxsave; extern int i386_has_sse; extern int i386_has_sse2; #else -#define i386_fpu_present 1 #define i386_fpu_fdivbug 0 #define i386_use_fxsave 1 #define i386_has_sse 1 Index: src/sys/arch/x86/x86/fpu.c diff -u src/sys/arch/x86/x86/fpu.c:1.13 src/sys/arch/x86/x86/fpu.c:1.14 --- src/sys/arch/x86/x86/fpu.c:1.13 Sun Sep 17 09:41:35 2017 +++ src/sys/arch/x86/x86/fpu.c Mon Oct 9 17:49:28 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: fpu.c,v 1.13 2017/09/17 09:41:35 maxv Exp $ */ +/* $NetBSD: fpu.c,v 1.14 2017/10/09 17:49:28 maya Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. All @@ -96,7 +96,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.13 2017/09/17 09:41:35 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.14 2017/10/09 17:49:28 maya Exp $"); #include "opt_multiprocessor.h" @@ -219,28 +219,12 @@ static const uint8_t fpetable[128] = { void fpuinit(struct cpu_info *ci) { - if (!i386_fpu_present) - return; clts(); fninit(); stts(); } -static void -send_sigill(void *rip) -{ - /* No fpu (486SX) - send SIGILL */ - ksiginfo_t ksi; - - x86_enable_intr(); - KSI_INIT_TRAP(&ksi); - ksi.ksi_signo = SIGILL; - ksi.ksi_addr = rip; - (*curlwp->l_proc->p_emul->e_trapsignal)(curlwp, &ksi); - return; -} - /* * This is a synchronous trap on either an x87 instruction (due to an * unmasked error on the previous x87 instruction) or on an SSE/SSE2 etc @@ -276,11 +260,6 @@ fputrap(struct trapframe *frame) if (!USERMODE(frame->tf_cs)) panic("fpu trap from kernel, trapframe %p\n", frame); - if (i386_fpu_present == 0) { - send_sigill((void *)X86_TF_RIP(frame)); - return; - } - /* * At this point, fpcurlwp should be curlwp. If it wasn't, the TS bit * should be set, and we should have gotten a DNA exception. @@ -343,11 +322,6 @@ fpudna(struct trapframe *frame) panic("fpudna from kernel, ip %p, trapframe %p\n", (void *)X86_TF_RIP(frame), frame); - if (i386_fpu_present == 0) { - send_sigill((void *)X86_TF_RIP(frame)); - return; - } - ci = curcpu(); /* Save soft spl level - interrupts are hard disabled */ Index: src/sys/arch/x86/x86/identcpu.c diff -u src/sys/arch/x86/x86/identcpu.c:1.59 src/sys/arch/x86/x86/identcpu.c:1.60 --- src/sys/arch/x86/x86/identcpu.c:1.59 Mon Oct 9 17:41:18 2017 +++ src/sys/arch/x86/x86/identcpu.c Mon Oct 9 17:49:28 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu.c,v 1.59 2017/10/09 17:41:18 maya Exp $ */ +/* $NetBSD: identcpu.c,v 1.60 2017/10/09 17:49:28 maya Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2006, 2007, 20
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: maya Date: Mon Oct 9 17:41:18 UTC 2017 Modified Files: src/sys/arch/x86/x86: identcpu.c Log Message: Don't probe for the no FPU case. it's not supported To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/arch/x86/x86/identcpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/identcpu.c diff -u src/sys/arch/x86/x86/identcpu.c:1.58 src/sys/arch/x86/x86/identcpu.c:1.59 --- src/sys/arch/x86/x86/identcpu.c:1.58 Mon Oct 9 17:39:33 2017 +++ src/sys/arch/x86/x86/identcpu.c Mon Oct 9 17:41:18 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu.c,v 1.58 2017/10/09 17:39:33 maya Exp $ */ +/* $NetBSD: identcpu.c,v 1.59 2017/10/09 17:41:18 maya Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.58 2017/10/09 17:39:33 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.59 2017/10/09 17:41:18 maya Exp $"); #include "opt_xen.h" @@ -705,19 +705,9 @@ static void cpu_probe_old_fpu(struct cpu_info *ci) { #if defined(__i386__) && !defined(XEN) - uint16_t control; - /* Check that there really is an fpu (496SX) */ clts(); fninit(); - /* Read default control word */ - fnstcw(&control); - if (control != __INITIAL_NPXCW__) { - /* Must be a 486SX, trap FP instructions */ - lcr0((rcr0() & ~CR0_MP) | CR0_EM); - i386_fpu_present = 0; - return; - } /* Check for 'FDIV' bug on the original Pentium */ if (npx586bug1(4195835, 3145727) != 0)
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: maya Date: Mon Oct 9 17:39:33 UTC 2017 Modified Files: src/sys/arch/x86/x86: identcpu.c Log Message: Simplify macro logic of cpu_probe_old_fpu To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/arch/x86/x86/identcpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/identcpu.c diff -u src/sys/arch/x86/x86/identcpu.c:1.57 src/sys/arch/x86/x86/identcpu.c:1.58 --- src/sys/arch/x86/x86/identcpu.c:1.57 Tue Sep 12 07:19:36 2017 +++ src/sys/arch/x86/x86/identcpu.c Mon Oct 9 17:39:33 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu.c,v 1.57 2017/09/12 07:19:36 msaitoh Exp $ */ +/* $NetBSD: identcpu.c,v 1.58 2017/10/09 17:39:33 maya Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.57 2017/09/12 07:19:36 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.58 2017/10/09 17:39:33 maya Exp $"); #include "opt_xen.h" @@ -701,12 +701,10 @@ cpu_probe_vortex86(struct cpu_info *ci) #undef PCI_MODE1_DATA_REG } -#if !defined(__i386__) || defined(XEN) -#define cpu_probe_old_fpu(ci) -#else static void cpu_probe_old_fpu(struct cpu_info *ci) { +#if defined(__i386__) && !defined(XEN) uint16_t control; /* Check that there really is an fpu (496SX) */ @@ -727,8 +725,8 @@ cpu_probe_old_fpu(struct cpu_info *ci) i386_fpu_fdivbug = 1; stts(); -} #endif +} static void cpu_probe_fpu(struct cpu_info *ci)
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jmcneill Date: Mon Oct 9 15:53:45 UTC 2017 Modified Files: src/sys/arch/evbarm/conf: SUNXI Log Message: add sunxisramc To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/arch/evbarm/conf/SUNXI Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/SUNXI diff -u src/sys/arch/evbarm/conf/SUNXI:1.40 src/sys/arch/evbarm/conf/SUNXI:1.41 --- src/sys/arch/evbarm/conf/SUNXI:1.40 Sun Oct 8 18:00:59 2017 +++ src/sys/arch/evbarm/conf/SUNXI Mon Oct 9 15:53:45 2017 @@ -1,5 +1,5 @@ # -# $NetBSD: SUNXI,v 1.40 2017/10/08 18:00:59 jmcneill Exp $ +# $NetBSD: SUNXI,v 1.41 2017/10/09 15:53:45 jmcneill Exp $ # # Allwinner sunxi family # @@ -122,6 +122,9 @@ gregulator* at fdt? pass 4 gpiokeys* at fdt? gpioleds* at fdt? +# SRAM controller +sunxisramc* at fdt? pass 4 # SRAM controller + # Timer gtmr* at fdt? pass 1 # ARM Generic Timer armgtmr0 at gtmr?
CVS commit: src/sys/arch/arm/sunxi
Module Name:src Committed By: jmcneill Date: Mon Oct 9 15:53:28 UTC 2017 Modified Files: src/sys/arch/arm/sunxi: files.sunxi Added Files: src/sys/arch/arm/sunxi: sunxi_sramc.c sunxi_sramc.h Log Message: Add driver for sun4i SRAM controller. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/sunxi/files.sunxi cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/sunxi/sunxi_sramc.c \ src/sys/arch/arm/sunxi/sunxi_sramc.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/sunxi/files.sunxi diff -u src/sys/arch/arm/sunxi/files.sunxi:1.33 src/sys/arch/arm/sunxi/files.sunxi:1.34 --- src/sys/arch/arm/sunxi/files.sunxi:1.33 Mon Oct 9 14:55:31 2017 +++ src/sys/arch/arm/sunxi/files.sunxi Mon Oct 9 15:53:28 2017 @@ -1,4 +1,4 @@ -# $NetBSD: files.sunxi,v 1.33 2017/10/09 14:55:31 jmcneill Exp $ +# $NetBSD: files.sunxi,v 1.34 2017/10/09 15:53:28 jmcneill Exp $ # # Configuration info for Allwinner sunxi family SoCs # @@ -211,6 +211,11 @@ file arch/arm/sunxi/sunxi_thermal.c sun attach ahcisata at fdt with sunxi_sata file arch/arm/sunxi/sunxi_sata.c sunxi_sata +# SRAM Controller +device sunxisramc +attach sunxisramc at fdt with sunxi_sramc +file arch/arm/sunxi/sunxi_sramc.c sunxi_sramc + # SOC parameters defflag opt_soc.h SOC_SUNXI defflag opt_soc.h SOC_SUN4I: SOC_SUNXI Added files: Index: src/sys/arch/arm/sunxi/sunxi_sramc.c diff -u /dev/null src/sys/arch/arm/sunxi/sunxi_sramc.c:1.1 --- /dev/null Mon Oct 9 15:53:28 2017 +++ src/sys/arch/arm/sunxi/sunxi_sramc.c Mon Oct 9 15:53:28 2017 @@ -0,0 +1,199 @@ +/* $NetBSD: sunxi_sramc.c,v 1.1 2017/10/09 15:53:28 jmcneill Exp $ */ + +/*- + * Copyright (c) 2017 Jared McNeill + * 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 ``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 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 +__KERNEL_RCSID(0, "$NetBSD: sunxi_sramc.c,v 1.1 2017/10/09 15:53:28 jmcneill Exp $"); + +#include +#include +#include +#include +#include +#include + +#include + +#include + +static const char * compatible[] = { + "allwinner,sun4i-a10-sram-controller", + NULL +}; + +static const struct sunxi_sramc_area { + const char *compatible; + const char *desc; + bus_size_t reg; + uint32_t mask; +} sunxi_sramc_areas[] = { + { "allwinner,sun4i-a10-sram-a3-a4", + "SRAM A3/A4", + 0x04, __BITS(5,4) }, + { "allwinner,sun4i-a10-sram-d", + "SRAM D", + 0x04, __BIT(0) } +}; + +struct sunxi_sramc_node { + intphandle; + const struct sunxi_sramc_area *area; + TAILQ_ENTRY(sunxi_sramc_node) nodes; +}; + +struct sunxi_sramc_softc { + device_t sc_dev; + intsc_phandle; + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + TAILQ_HEAD(, sunxi_sramc_node) sc_nodes; +}; + +static struct sunxi_sramc_softc *sramc_softc = NULL; + +#define SRAMC_READ(sc, reg) \ + bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (reg)) +#define SRAMC_WRITE(sc, reg, val) \ + bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val)) + +static void +sunxi_sramc_init_mmio(struct sunxi_sramc_softc *sc, int phandle) +{ + struct sunxi_sramc_node *node; + int child, i; + + for (child = OF_child(phandle); child; child = OF_peer(child)) + for (i = 0; i < __arraycount(sunxi_sramc_areas); i++) { + const char * area_compatible[] = { sunxi_sramc_areas[i].compatible, NULL }; + if (of_match_compatible(child, area_compatible)) { +node = kmem_alloc(sizeof(*node), KM_SLEEP); +node->phandle = child; +node->area = &sunxi_sramc_areas[i]; +TAILQ_INSERT_TAIL(&sc->sc_nodes, node, nodes); +aprint_verbose_dev(sc->sc_dev, "area: %s\n", node->area->desc); +break; + } + } +} + +static void +sunxi_sramc_init(struct sunxi_sramc_softc *sc) +{ + const char * m
CVS commit: src/sys/arch/arm/sunxi
Module Name:src Committed By: jmcneill Date: Mon Oct 9 14:55:32 UTC 2017 Modified Files: src/sys/arch/arm/sunxi: files.sunxi Log Message: sunxits needs sysmon_envsys To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/sunxi/files.sunxi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/sunxi/files.sunxi diff -u src/sys/arch/arm/sunxi/files.sunxi:1.32 src/sys/arch/arm/sunxi/files.sunxi:1.33 --- src/sys/arch/arm/sunxi/files.sunxi:1.32 Sun Oct 8 18:00:36 2017 +++ src/sys/arch/arm/sunxi/files.sunxi Mon Oct 9 14:55:31 2017 @@ -1,4 +1,4 @@ -# $NetBSD: files.sunxi,v 1.32 2017/10/08 18:00:36 jmcneill Exp $ +# $NetBSD: files.sunxi,v 1.33 2017/10/09 14:55:31 jmcneill Exp $ # # Configuration info for Allwinner sunxi family SoCs # @@ -189,7 +189,7 @@ attach genfb at fdt with simplefb file dev/fdt/simplefb.c simplefb # Touch Screen controller -device sunxits: wsmousedev, tpcalib +device sunxits: wsmousedev, tpcalib, sysmon_envsys attach sunxits at fdt with sunxi_ts file arch/arm/sunxi/sunxi_ts.c sunxi_ts
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: jmcneill Date: Mon Oct 9 14:52:43 UTC 2017 Modified Files: src/sys/dev/i2c: axp20x.c Log Message: Change aprint_verbose on voltage change to aprint_debug to prevent dmesg spam when running estd. While here, remove ": " prefix on aprint_*_dev format strings. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/dev/i2c/axp20x.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/i2c/axp20x.c diff -u src/sys/dev/i2c/axp20x.c:1.8 src/sys/dev/i2c/axp20x.c:1.9 --- src/sys/dev/i2c/axp20x.c:1.8 Sat Oct 7 18:22:06 2017 +++ src/sys/dev/i2c/axp20x.c Mon Oct 9 14:52:43 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: axp20x.c,v 1.8 2017/10/07 18:22:06 jmcneill Exp $ */ +/* $NetBSD: axp20x.c,v 1.9 2017/10/09 14:52:43 jmcneill Exp $ */ /*- * Copyright (c) 2014-2017 Jared McNeill @@ -29,7 +29,7 @@ #include "opt_fdt.h" #include -__KERNEL_RCSID(0, "$NetBSD: axp20x.c,v 1.8 2017/10/07 18:22:06 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: axp20x.c,v 1.9 2017/10/09 14:52:43 jmcneill Exp $"); #include #include @@ -377,15 +377,15 @@ axp20x_attach(device_t parent, device_t sysmon_envsys_register(sc->sc_sme); if (axp20x_read(sc, AXP_DCDC2, &value, 1, I2C_F_POLL) == 0) { - aprint_verbose_dev(sc->sc_dev, ": DCDC2 %dmV\n", + aprint_verbose_dev(sc->sc_dev, "DCDC2 %dmV\n", (int)(700 + (value & AXP_DCDC2_VOLT_MASK) * 25)); } if (axp20x_read(sc, AXP_DCDC3, &value, 1, I2C_F_POLL) == 0) { - aprint_verbose_dev(sc->sc_dev, ": DCDC3 %dmV\n", + aprint_verbose_dev(sc->sc_dev, "DCDC3 %dmV\n", (int)(700 + (value & AXP_DCDC3_VOLT_MASK) * 25)); } if (axp20x_read(sc, AXP_LDO2_4, &value, 1, I2C_F_POLL) == 0) { - aprint_verbose_dev(sc->sc_dev, ": LDO2 %dmV, LDO4 %dmV\n", + aprint_verbose_dev(sc->sc_dev, "LDO2 %dmV, LDO4 %dmV\n", (int)(1800 + ((value & AXP_LDO2_VOLT_MASK) >> AXP_LDO2_VOLT_SHIFT) * 100 ), @@ -393,9 +393,9 @@ axp20x_attach(device_t parent, device_t } if (axp20x_read(sc, AXP_LDO3, &value, 1, I2C_F_POLL) == 0) { if (value & AXP_LDO3_TRACK) { - aprint_verbose_dev(sc->sc_dev, ": LDO3: tracking\n"); + aprint_verbose_dev(sc->sc_dev, "LDO3: tracking\n"); } else { - aprint_verbose_dev(sc->sc_dev, ": LDO3 %dmV\n", + aprint_verbose_dev(sc->sc_dev, "LDO3 %dmV\n", (int)(700 + (value & AXP_LDO3_VOLT_MASK) * 25)); } } @@ -552,7 +552,7 @@ axp20x_sensors_refresh(struct sysmon_env } return; default: - aprint_error_dev(sc->sc_dev, ": invalid sensor %d\n", + aprint_error_dev(sc->sc_dev, "invalid sensor %d\n", edata->sensor); } } @@ -604,8 +604,8 @@ axp20x_set_dcdc(device_t dev, int dcdc, return ret; if (axp20x_read(sc, AXP_DCDC2, ®, 1, poll ? I2C_F_POLL : 0) == 0) { - aprint_verbose_dev(sc->sc_dev, - ": DCDC2 changed to %dmV\n", + aprint_debug_dev(sc->sc_dev, + "DCDC2 changed to %dmV\n", (int)(700 + (reg & AXP_DCDC2_VOLT_MASK) * 25)); } return 0; @@ -621,8 +621,8 @@ axp20x_set_dcdc(device_t dev, int dcdc, return ret; if (axp20x_read(sc, AXP_DCDC3, ®, 1, poll ? I2C_F_POLL : 0) == 0) { - aprint_verbose_dev(sc->sc_dev, - ": DCDC3 changed to %dmV\n", + aprint_debug_dev(sc->sc_dev, + "DCDC3 changed to %dmV\n", (int)(700 + (reg & AXP_DCDC3_VOLT_MASK) * 25)); } return 0;
CVS commit: src/sys/arch/arm/sunxi
Module Name:src Committed By: jmcneill Date: Mon Oct 9 14:28:01 UTC 2017 Modified Files: src/sys/arch/arm/sunxi: sunxi_ts.c Log Message: Add support for sun4i and sun6i, and enable temperature sensor support. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sunxi_ts.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/sunxi/sunxi_ts.c diff -u src/sys/arch/arm/sunxi/sunxi_ts.c:1.1 src/sys/arch/arm/sunxi/sunxi_ts.c:1.2 --- src/sys/arch/arm/sunxi/sunxi_ts.c:1.1 Sun Aug 27 02:19:46 2017 +++ src/sys/arch/arm/sunxi/sunxi_ts.c Mon Oct 9 14:28:01 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_ts.c,v 1.1 2017/08/27 02:19:46 jmcneill Exp $ */ +/* $NetBSD: sunxi_ts.c,v 1.2 2017/10/09 14:28:01 jmcneill Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_ts.c,v 1.1 2017/08/27 02:19:46 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_ts.c,v 1.2 2017/10/09 14:28:01 jmcneill Exp $"); #include #include @@ -39,6 +39,8 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_ts.c,v #include +#include + #include #include #include @@ -70,6 +72,7 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_ts.c,v #define TP_CTRL3_FILTER_EN __BIT(2) #define TP_CTRL3_FILTER_TYPE __BITS(1,0) #define TP_INT 0x10 +#define TP_INT_TEMP_IRQ_EN __BIT(18) #define TP_INT_OVERRUN_IRQ_EN __BIT(17) #define TP_INT_DATA_IRQ_EN __BIT(16) #define TP_INT_DATA_XY_CHANGE __BIT(13) @@ -79,26 +82,60 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_ts.c,v #define TP_INT_UP_IRQ_EN __BIT(1) #define TP_INT_DOWN_IRQ_EN __BIT(0) #define TP_FIFOCS 0x14 +#define TP_FIFOCS_TEMP_IRQ_PENDING __BIT(18) #define TP_FIFOCS_OVERRUN_PENDING __BIT(17) #define TP_FIFOCS_DATA_PENDING __BIT(16) #define TP_FIFOCS_RXA_CNT __BITS(12,8) #define TP_FIFOCS_IDLE_FLG __BIT(2) #define TP_FIFOCS_UP_PENDING __BIT(1) #define TP_FIFOCS_DOWN_PENDING __BIT(0) +#define TP_TPR 0x18 +#define TP_TPR_TEMP_EN __BIT(16) +#define TP_TPR_TEMP_PER __BITS(15,0) #define TP_CDAT 0x1c #define TP_CDAT_MASK __BITS(11,0) +#define TEMP_DATA 0x20 +#define TEMP_DATA_MASK __BITS(11,0) #define TP_DATA 0x24 #define TP_DATA_MASK __BITS(11,0) #define TP_IO_CONFIG 0x28 #define TP_PORT_DATA 0x2c #define TP_PORT_DATA_MASK __BITS(3,0) +#define TEMP_C_TO_K 27315 + static int sunxi_ts_match(device_t, cfdata_t, void *); static void sunxi_ts_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "allwinner,sun5i-a13-ts", - NULL +struct sunxi_ts_config { + int64_t temp_offset; + int64_t temp_step; + uint32_t tp_mode_en_mask; +}; + +static const struct sunxi_ts_config sun4i_a10_ts_config = { + .temp_offset = 25700, + .temp_step = 133000, + .tp_mode_en_mask = TP_CTRL1_TP_MODE_EN, +}; + +static const struct sunxi_ts_config sun5i_a13_ts_config = { + .temp_offset = 14470, + .temp_step = 10, + .tp_mode_en_mask = TP_CTRL1_TP_MODE_EN, +}; + +static const struct sunxi_ts_config sun6i_a31_ts_config = { + .temp_offset = 27100, + .temp_step = 167000, + .tp_mode_en_mask = TP_CTRL1_TP_DUAL_EN, +}; + +static const struct of_compat_data compat_data[] = { + { "allwinner,sun4i-a10-ts", (uintptr_t)&sun4i_a10_ts_config }, + { "allwinner,sun5i-a13-ts", (uintptr_t)&sun5i_a13_ts_config }, + { "allwinner,sun6i-a31-ts", (uintptr_t)&sun6i_a31_ts_config }, + { NULL } }; static struct wsmouse_calibcoords sunxi_ts_default_calib = { @@ -115,6 +152,8 @@ struct sunxi_ts_softc { bus_space_tag_t sc_bst; bus_space_handle_t sc_bsh; + const struct sunxi_ts_config *sc_conf; + bool sc_ts_attached; bool sc_ts_inverted_x; bool sc_ts_inverted_y; @@ -126,6 +165,9 @@ struct sunxi_ts_softc { u_int sc_tp_x; u_int sc_tp_y; u_int sc_tp_btns; + + struct sysmon_envsys *sc_sme; + envsys_data_t sc_temp_data; }; CFATTACH_DECL_NEW(sunxi_ts, sizeof(struct sunxi_ts_softc), @@ -140,6 +182,7 @@ static int sunxi_ts_enable(void *v) { struct sunxi_ts_softc * const sc = v; + uint32_t val; /* reset state */ sc->sc_ignoredata = true; @@ -148,9 +191,11 @@ sunxi_ts_enable(void *v) sc->sc_tp_btns = 0; /* Enable touchpanel IRQs */ - TS_WRITE(sc, TP_INT, - TP_INT_DATA_IRQ_EN | TP_INT_FIFO_FLUSH | TP_INT_UP_IRQ_EN | - __SHIFTIN(1, TP_INT_FIFO_TRIG_LEVEL)); + val = TS_READ(sc, TP_INT); + val |= TP_INT_DATA_IRQ_EN | TP_INT_FIFO_FLUSH | TP_INT_UP_IRQ_EN; + val &= ~TP_INT_FIFO_TRIG_LEVEL; + val |= __SHIFTIN(1, TP_INT_FIFO_TRIG_LEVEL); + TS_WRITE(sc, TP_INT, val); return 0; } @@ -159,9 +204,12 @@ static void sunxi_ts_disable(void *v) { struct sunxi_ts_softc * const sc = v; + uint32_t val; /* Disable touchpanel IRQs */ - TS_WRITE(sc, TP_INT, 0); + val = TS_READ(sc, TP_INT); + val &= ~(TP_INT_DATA_IRQ_EN | TP_INT_FIFO_FLUSH | TP_INT_UP_IRQ_EN); + TS_WRITE(sc, TP_INT, val); } static int @@ -207,6 +255,13 @@ su
CVS commit: src/sys/arch/arm/sunxi
Module Name:src Committed By: jmcneill Date: Mon Oct 9 14:01:59 UTC 2017 Modified Files: src/sys/arch/arm/sunxi: sun4i_a10_ccu.c sunxi_ccu.h sunxi_ccu_div.c Log Message: Add A10/A20 cpufreq scaling support To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/sunxi/sun4i_a10_ccu.c \ src/sys/arch/arm/sunxi/sunxi_ccu_div.c cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/sunxi/sunxi_ccu.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/sunxi/sun4i_a10_ccu.c diff -u src/sys/arch/arm/sunxi/sun4i_a10_ccu.c:1.3 src/sys/arch/arm/sunxi/sun4i_a10_ccu.c:1.4 --- src/sys/arch/arm/sunxi/sun4i_a10_ccu.c:1.3 Sat Oct 7 15:12:35 2017 +++ src/sys/arch/arm/sunxi/sun4i_a10_ccu.c Mon Oct 9 14:01:59 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sun4i_a10_ccu.c,v 1.3 2017/10/07 15:12:35 jmcneill Exp $ */ +/* $NetBSD: sun4i_a10_ccu.c,v 1.4 2017/10/09 14:01:59 jmcneill Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sun4i_a10_ccu.c,v 1.3 2017/10/07 15:12:35 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun4i_a10_ccu.c,v 1.4 2017/10/09 14:01:59 jmcneill Exp $"); #include #include @@ -96,6 +96,18 @@ static const char *apb1_parents[] = { "o static const char *mod_parents[] = { "osc24m", "pll_periph", "pll_ddr" }; static const char *sata_parents[] = { "pll6_periph_sata", "external" }; +static const struct sunxi_ccu_nkmp_tbl sun4i_a10_pll1_table[] = { + { 100800, 21, 1, 0, 0 }, + { 96000, 20, 1, 0, 0 }, + { 91200, 19, 1, 0, 0 }, + { 86400, 18, 1, 0, 0 }, + { 72000, 30, 0, 0, 0 }, + { 52800, 22, 0, 0, 0 }, + { 31200, 13, 0, 0, 0 }, + { 14400, 12, 0, 0, 1 }, + { 0 } +}; + static const struct sunxi_ccu_nkmp_tbl sun4i_a10_ac_dig_table[] = { { 24576000, 86, 0, 21, 3 }, { 0 } @@ -105,15 +117,17 @@ static struct sunxi_ccu_clk sun4i_a10_cc SUNXI_CCU_GATE(A10_CLK_HOSC, "osc24m", "hosc", OSC24M_CFG_REG, 0), - SUNXI_CCU_NKMP(A10_CLK_PLL_CORE, "pll_core", "osc24m", + SUNXI_CCU_NKMP_TABLE(A10_CLK_PLL_CORE, "pll_core", "osc24m", PLL1_CFG_REG, /* reg */ __BITS(12,8), /* n */ __BITS(5,4), /* k */ __BITS(1,0), /* m */ __BITS(17,16), /* p */ __BIT(31), /* enable */ + 0,/* lock */ + sun4i_a10_pll1_table, /* table */ SUNXI_CCU_NKMP_FACTOR_P_POW2 | SUNXI_CCU_NKMP_FACTOR_N_EXACT | - SUNXI_CCU_NKMP_FACTOR_N_ZERO_IS_ONE), + SUNXI_CCU_NKMP_FACTOR_N_ZERO_IS_ONE | SUNXI_CCU_NKMP_SCALE_CLOCK), SUNXI_CCU_NKMP_TABLE(A10_CLK_PLL_AUDIO_BASE, "pll_audio", "osc24m", PLL2_CFG_REG, /* reg */ @@ -158,7 +172,7 @@ static struct sunxi_ccu_clk sun4i_a10_cc CPU_AHB_APB0_CFG_REG, /* reg */ 0,/* div */ __BITS(17,16), /* sel */ - 0), + SUNXI_CCU_DIV_SET_RATE_PARENT), SUNXI_CCU_DIV(A10_CLK_AXI, "axi", axi_parents, CPU_AHB_APB0_CFG_REG, /* reg */ Index: src/sys/arch/arm/sunxi/sunxi_ccu_div.c diff -u src/sys/arch/arm/sunxi/sunxi_ccu_div.c:1.3 src/sys/arch/arm/sunxi/sunxi_ccu_div.c:1.4 --- src/sys/arch/arm/sunxi/sunxi_ccu_div.c:1.3 Thu Oct 5 01:28:47 2017 +++ src/sys/arch/arm/sunxi/sunxi_ccu_div.c Mon Oct 9 14:01:59 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_ccu_div.c,v 1.3 2017/10/05 01:28:47 jmcneill Exp $ */ +/* $NetBSD: sunxi_ccu_div.c,v 1.4 2017/10/09 14:01:59 jmcneill Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_ccu_div.c,v 1.3 2017/10/05 01:28:47 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_ccu_div.c,v 1.4 2017/10/09 14:01:59 jmcneill Exp $"); #include #include @@ -114,8 +114,12 @@ sunxi_ccu_div_set_rate(struct sunxi_ccu_ if (clkp_parent == NULL) return ENXIO; - if (div->div == 0) - return ENXIO; + if (div->div == 0) { + if ((div->flags & SUNXI_CCU_DIV_SET_RATE_PARENT) != 0) + return clk_set_rate(clkp_parent, new_rate); + else + return ENXIO; + } val = CCU_READ(sc, div->reg); Index: src/sys/arch/arm/sunxi/sunxi_ccu.h diff -u src/sys/arch/arm/sunxi/sunxi_ccu.h:1.13 src/sys/arch/arm/sunxi/sunxi_ccu.h:1.14 --- src/sys/arch/arm/sunxi/sunxi_ccu.h:1.13 Fri Oct 6 21:09:21 2017 +++ src/sys/arch/arm/sunxi/sunxi_ccu.h Mon Oct 9 14:01:59 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_ccu.h,v 1.13 2017/10/06 21:09:21 jmcneill Exp $ */ +/* $NetBSD: sunxi_ccu.h,v 1.14 2017/10/09 14:01:59 jmcneill Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -206,6 +206,7 @@ struct sunxi_ccu_div { #define SUNXI_CCU_DIV_POWER_OF_TWO __BIT(0) #define SUNXI_CCU_DIV_ZERO_IS_ONE __BIT(1) #define SUNXI_CCU_DIV_TIMES_TWO __BIT(2) +#define SUNXI_CCU_DIV_SET_RATE_PARENT __BIT(3) }; int sunxi_ccu_div_enable(struct sunxi_ccu_softc *,
CVS commit: src/crypto/external/bsd/openssh/dist
Module Name:src Committed By: christos Date: Mon Oct 9 12:07:03 UTC 2017 Modified Files: src/crypto/external/bsd/openssh/dist: channels.c packet.c Log Message: PR/52604: Tatoku Ogaito: Fix x11 session forwarding. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/crypto/external/bsd/openssh/dist/channels.c cvs rdiff -u -r1.28 -r1.29 src/crypto/external/bsd/openssh/dist/packet.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/external/bsd/openssh/dist/channels.c diff -u src/crypto/external/bsd/openssh/dist/channels.c:1.19 src/crypto/external/bsd/openssh/dist/channels.c:1.20 --- src/crypto/external/bsd/openssh/dist/channels.c:1.19 Sat Oct 7 15:39:19 2017 +++ src/crypto/external/bsd/openssh/dist/channels.c Mon Oct 9 08:07:03 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: channels.c,v 1.19 2017/10/07 19:39:19 christos Exp $ */ +/* $NetBSD: channels.c,v 1.20 2017/10/09 12:07:03 christos Exp $ */ /* $OpenBSD: channels.c,v 1.375 2017/09/24 13:45:34 djm Exp $ */ /* * Author: Tatu Ylonen @@ -41,7 +41,7 @@ */ #include "includes.h" -__RCSID("$NetBSD: channels.c,v 1.19 2017/10/07 19:39:19 christos Exp $"); +__RCSID("$NetBSD: channels.c,v 1.20 2017/10/09 12:07:03 christos Exp $"); #include #include #include @@ -3733,10 +3733,11 @@ channel_request_remote_forwarding(struct "streamlocal-forw...@openssh.com")) != 0 || (r = sshpkt_put_u8(ssh, 1)) != 0 || /* want reply */ (r = sshpkt_put_cstring(ssh, fwd->listen_path)) != 0 || - (r = sshpkt_send(ssh)) != 0 || - (r = ssh_packet_write_wait(ssh)) != 0) + (r = sshpkt_send(ssh)) != 0) fatal("%s: request streamlocal: %s", __func__, ssh_err(r)); + if ((r = ssh_packet_write_wait(ssh)) < 0) + sshpkt_fatal(ssh, __func__, r); } else { if ((r = sshpkt_start(ssh, SSH2_MSG_GLOBAL_REQUEST)) != 0 || (r = sshpkt_put_cstring(ssh, "tcpip-forward")) != 0 || @@ -3744,10 +3745,11 @@ channel_request_remote_forwarding(struct (r = sshpkt_put_cstring(ssh, channel_rfwd_bind_host(fwd->listen_host))) != 0 || (r = sshpkt_put_u32(ssh, fwd->listen_port)) != 0 || - (r = sshpkt_send(ssh)) != 0 || - (r = ssh_packet_write_wait(ssh)) != 0) + (r = sshpkt_send(ssh)) != 0) fatal("%s: request tcpip-forward: %s", __func__, ssh_err(r)); + if ((r = ssh_packet_write_wait(ssh)) < 0) + sshpkt_fatal(ssh, __func__, r); } /* Assume that server accepts the request */ success = 1; @@ -4691,8 +4693,11 @@ x11_request_forwarding_with_spoofing(str (r = sshpkt_put_cstring(ssh, proto)) != 0 || (r = sshpkt_put_cstring(ssh, new_data)) != 0 || (r = sshpkt_put_u32(ssh, screen_number)) != 0 || - (r = sshpkt_send(ssh)) != 0 || - (r = ssh_packet_write_wait(ssh)) != 0) + (r = sshpkt_send(ssh)) != 0) fatal("%s: send x11-req: %s", __func__, ssh_err(r)); + + if ((r = ssh_packet_write_wait(ssh)) < 0) + sshpkt_fatal(ssh, __func__, r); + free(new_data); } Index: src/crypto/external/bsd/openssh/dist/packet.c diff -u src/crypto/external/bsd/openssh/dist/packet.c:1.28 src/crypto/external/bsd/openssh/dist/packet.c:1.29 --- src/crypto/external/bsd/openssh/dist/packet.c:1.28 Sat Oct 7 15:39:19 2017 +++ src/crypto/external/bsd/openssh/dist/packet.c Mon Oct 9 08:07:03 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: packet.c,v 1.28 2017/10/07 19:39:19 christos Exp $ */ +/* $NetBSD: packet.c,v 1.29 2017/10/09 12:07:03 christos Exp $ */ /* $OpenBSD: packet.c,v 1.264 2017/09/12 06:32:07 djm Exp $ */ /* * Author: Tatu Ylonen @@ -39,7 +39,7 @@ */ #include "includes.h" -__RCSID("$NetBSD: packet.c,v 1.28 2017/10/07 19:39:19 christos Exp $"); +__RCSID("$NetBSD: packet.c,v 1.29 2017/10/09 12:07:03 christos Exp $"); #include /* MIN roundup */ #include @@ -1779,9 +1779,10 @@ ssh_packet_send_debug(struct ssh *ssh, c (r = sshpkt_put_u8(ssh, 0)) != 0 || /* always display */ (r = sshpkt_put_cstring(ssh, buf)) != 0 || (r = sshpkt_put_cstring(ssh, "")) != 0 || - (r = sshpkt_send(ssh)) != 0 || - (r = ssh_packet_write_wait(ssh)) != 0) + (r = sshpkt_send(ssh)) != 0) fatal("%s: %s", __func__, ssh_err(r)); + if ((r = ssh_packet_write_wait(ssh)) < 0) + sshpkt_fatal(ssh, __func__, r); } static void
CVS commit: src/usr.bin/crunch/crunchgen
Module Name:src Committed By: wiz Date: Mon Oct 9 10:31:50 UTC 2017 Modified Files: src/usr.bin/crunch/crunchgen: crunchgen.1 Log Message: New sentence, new line. Remove superfluous Pps. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/usr.bin/crunch/crunchgen/crunchgen.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/crunch/crunchgen/crunchgen.1 diff -u src/usr.bin/crunch/crunchgen/crunchgen.1:1.33 src/usr.bin/crunch/crunchgen/crunchgen.1:1.34 --- src/usr.bin/crunch/crunchgen/crunchgen.1:1.33 Sun Oct 8 15:06:17 2017 +++ src/usr.bin/crunch/crunchgen/crunchgen.1 Mon Oct 9 10:31:50 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: crunchgen.1,v 1.33 2017/10/08 15:06:17 christos Exp $ +.\" $NetBSD: crunchgen.1,v 1.34 2017/10/09 10:31:50 wiz Exp $ .\" .\" Copyright (c) 1994 University of Maryland .\" All Rights Reserved. @@ -334,7 +334,6 @@ Here is an example .Em crunchgen input conf file, named .Dq Pa kcopy.conf : -.Pp .Bd -literal -offset indent srcdirs /usr/src/bin /usr/src/sbin @@ -358,7 +357,6 @@ line. The crunched binary .Dq kcopy can be built as follows: -.Pp .Bd -literal -offset indent % crunchgen -m Makefile kcopy.conf# gen Makefile and kcopy.c % make objs # build the component programs' .o files @@ -379,7 +377,8 @@ and hard-linked to the names of the comp was written by .An James da Silva Aq Mt j...@cs.umd.edu . .Pp -Copyright (c) 1994 University of Maryland. All Rights Reserved. +Copyright (c) 1994 University of Maryland. +All Rights Reserved. .Sh BUGS While .Nm @@ -402,7 +401,6 @@ some other arrangements made. If a program directory being searched for is found, but contains no objects, other directories are not searched. This causes the following directive to fail: -.Pp .Bd -literal -offset indent srcdirs /usr/src/usr.bin /usr/src/usr.bin/less progs less gzip @@ -420,7 +418,6 @@ fails to find objects for the program. To avoid this problem, list specific srcdirs first, and the more general ones later, for e.g.: -.Pp .Bd -literal -offset indent srcdirs /usr/src/usr.bin/less /usr/src/usr.bin progs less gzip
CVS commit: src/sys/conf
Module Name:src Committed By: kre Date: Mon Oct 9 10:28:33 UTC 2017 Modified Files: src/sys/conf: files Log Message: (untested) attempt to fix b5 evbarm-earmv7hf build - please revert if this is incorrect, or harms anything else... To generate a diff of this commit: cvs rdiff -u -r1.1181 -r1.1182 src/sys/conf/files Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/conf/files diff -u src/sys/conf/files:1.1181 src/sys/conf/files:1.1182 --- src/sys/conf/files:1.1181 Wed Sep 13 22:24:46 2017 +++ src/sys/conf/files Mon Oct 9 10:28:33 2017 @@ -1,4 +1,4 @@ -# $NetBSD: files,v 1.1181 2017/09/13 22:24:46 sevan Exp $ +# $NetBSD: files,v 1.1182 2017/10/09 10:28:33 kre Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 version 20170615 @@ -1037,7 +1037,7 @@ device siisata: ata, ata_dma, ata_udma, # Marvell Serial-ATA Host Controller define mvsata file dev/ic/mvsata.c mvsata -device mvsata: ata, ata_dma, ata_udma, wdc_common, sata, sata_pmp, mvsata +device mvsata: ata, ata_dma, ata_udma, wdc_common, sata, sata_fis, sata_pmp, mvsata defflag opt_mvsata.h MVSATA_WITHOUTDMA # DECchip 21x4x Ethernet controller family, and assorted clones.