svn commit: r368293 - head/sys/kern

2020-12-02 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Dec  3 05:39:27 2020
New Revision: 368293
URL: https://svnweb.freebsd.org/changeset/base/368293

Log:
  Add support for hw.physmem tunable for ARM/ARM64/RISC-V platforms
  
  hw.physmem tunable allows to limit number of physical memory available to the
  system. It's handled in machdep files for x86 and PowerPC. This patch adds
  required logic to the consolidated physmem management interface that is used 
by
  ARM, ARM64, and RISC-V.
  
  Submitted by: Klara, Inc.
  Reviewed by:  mhorne
  Sponsored by: Ampere Computing
  Differential Revision:https://reviews.freebsd.org/D27152

Modified:
  head/sys/kern/subr_physmem.c

Modified: head/sys/kern/subr_physmem.c
==
--- head/sys/kern/subr_physmem.cThu Dec  3 02:22:05 2020
(r368292)
+++ head/sys/kern/subr_physmem.cThu Dec  3 05:39:27 2020
(r368293)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -141,6 +142,10 @@ physmem_print_tables(void)
 /*
  * Walk the list of hardware regions, processing it against the list of
  * exclusions that contain the given exflags, and generating an "avail list".
+ * 
+ * If maxphyssz is not zero it sets upper limit, in bytes, for the total
+ * "avail list" size. Walk stops once the limit is reached and the last region
+ * is cut short if necessary.
  *
  * Updates the value at *pavail with the sum of all pages in all hw regions.
  *
@@ -148,15 +153,17 @@ physmem_print_tables(void)
  */
 static size_t
 regions_to_avail(vm_paddr_t *avail, uint32_t exflags, size_t maxavail,
-long *pavail, long *prealmem)
+uint64_t maxphyssz, long *pavail, long *prealmem)
 {
size_t acnt, exi, hwi;
uint64_t end, start, xend, xstart;
long availmem, totalmem;
const struct region *exp, *hwp;
+   uint64_t availsz;
 
totalmem = 0;
availmem = 0;
+   availsz = 0;
acnt = 0;
for (hwi = 0, hwp = hwregions; hwi < hwcnt; ++hwi, ++hwp) {
start = hwp->addr;
@@ -202,6 +209,13 @@ regions_to_avail(vm_paddr_t *avail, uint32_t exflags, 
 * could affect the remainder of this hw region.
 */
if ((xstart > start) && (xend < end)) {
+
+   if ((maxphyssz != 0) &&
+   (availsz + xstart - start > maxphyssz)) {
+   xstart = maxphyssz + start - availsz;
+   }
+   if (xstart <= start)
+   continue;
if (acnt > 0 &&
avail[acnt - 1] == (vm_paddr_t)start) {
avail[acnt - 1] = (vm_paddr_t)xstart;
@@ -209,6 +223,7 @@ regions_to_avail(vm_paddr_t *avail, uint32_t exflags, 
avail[acnt++] = (vm_paddr_t)start;
avail[acnt++] = (vm_paddr_t)xstart;
}
+   availsz += (xstart - start);
availmem += atop((vm_offset_t)(xstart - start));
start = xend;
continue;
@@ -228,12 +243,20 @@ regions_to_avail(vm_paddr_t *avail, uint32_t exflags, 
 * available entry for it.
 */
if (end > start) {
+   if ((maxphyssz != 0) &&
+   (availsz + end - start > maxphyssz)) {
+   end = maxphyssz + start - availsz;
+   }
+   if (end <= start)
+   break;
+
if (acnt > 0 && avail[acnt - 1] == (vm_paddr_t)start) {
avail[acnt - 1] = (vm_paddr_t)end;
} else {
avail[acnt++] = (vm_paddr_t)start;
avail[acnt++] = (vm_paddr_t)end;
}
+   availsz += end - start;
availmem += atop((vm_offset_t)(end - start));
}
if (acnt >= maxavail)
@@ -362,7 +385,7 @@ size_t
 physmem_avail(vm_paddr_t *avail, size_t maxavail)
 {
 
-   return (regions_to_avail(avail, EXFLAG_NOALLOC, maxavail, NULL, NULL));
+   return (regions_to_avail(avail, EXFLAG_NOALLOC, maxavail, 0, NULL, 
NULL));
 }
 
 /*
@@ -378,11 +401,15 @@ void
 physmem_init_kernel_globals(void)
 {
size_t nextidx;
+   u_long hwphyssz;
 
-   regions_to_avail(dump_avail, EXFLAG_NODUMP, PHYS_AVAIL_ENTRIES, NULL,
-   NULL);
+   hwphyssz = 0;
+   TUNABLE_ULONG_FETCH("hw.physmem", &hwphyssz);
+
+   regions_to_avail(dump_avail, EXFLAG_NODUMP, PHYS_AVAIL

svn commit: r368259 - head/sys/dev/acpica

2020-12-01 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Dec  1 20:27:06 2020
New Revision: 368259
URL: https://svnweb.freebsd.org/changeset/base/368259

Log:
  [arm64] Parse ACPI _PXM property on ARM64 platform
  
  Enable devices' NUMA proximity infromation parsing on ARM64 systems
  
  Sponsored by: Ampere Computing
  Submitted by: Klara, Inc.

Modified:
  head/sys/dev/acpica/acpi.c

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Tue Dec  1 20:10:55 2020(r368258)
+++ head/sys/dev/acpica/acpi.c  Tue Dec  1 20:27:06 2020(r368259)
@@ -1122,7 +1122,7 @@ static int
 acpi_parse_pxm(device_t dev)
 {
 #ifdef NUMA
-#if defined(__i386__) || defined(__amd64__)
+#if defined(__i386__) || defined(__amd64__) || defined(__aarch64__)
ACPI_HANDLE handle;
ACPI_STATUS status;
int pxm;
___
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: r368258 - head/sys/arm64/include

2020-12-01 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Dec  1 20:10:55 2020
New Revision: 368258
URL: https://svnweb.freebsd.org/changeset/base/368258

Log:
  [arm64] Bump MAXMEMDOM value to 8 to match amd64
  
  On some of the server-grade ARM64 machines the number of NUMA domains is 
higher
  than 2. When booting GENERIC kernel on such machines the SRAT parser fails
  leaving the system with a single domain. To make GENERIC kernel usable on 
those
  server, match the parameter value with the one for amd64 arch.
  
  Reviewed by:  allanjude
  Differential Revision:https://reviews.freebsd.org/D27368
  Sponsored by: Ampere Computing
  Submitted by: Klara, Inc.

Modified:
  head/sys/arm64/include/param.h

Modified: head/sys/arm64/include/param.h
==
--- head/sys/arm64/include/param.h  Tue Dec  1 19:40:58 2020
(r368257)
+++ head/sys/arm64/include/param.h  Tue Dec  1 20:10:55 2020
(r368258)
@@ -63,7 +63,7 @@
 #endif
 
 #ifndef MAXMEMDOM
-#defineMAXMEMDOM   2
+#defineMAXMEMDOM   8
 #endif
 
 #defineALIGNBYTES  _ALIGNBYTES
___
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: r366924 - head/sys/arm64/include

2020-10-21 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Oct 22 05:07:25 2020
New Revision: 366924
URL: https://svnweb.freebsd.org/changeset/base/366924

Log:
  [hwpmc] Fix call chain capture for ARM64
  
  Use ELR register value instead of LR for PMC_TRAPFRAME_TO_PC macro since
  it's the former that indicates PC if the interrupted execution thread.
  
  This fixes a bug where pmcstat lost the leaf function of the call chain
  and started with the second function in the chain.
  
  Although this change is an improvement over the previous logic there is still
  posibility for incomplete data: if the leaf function does not have stack
  variables and does not call any other functions compiler would not generate
  a stack frame for it and the FP value would point to the caller's frame, so
  instead of the actual "caller1 -> caller2 -> leaf" chain only
  "caller1 -> leaf" would be captured.
  
  Sponsored by: Ampere Computing
  Submitted by: Klara, Inc.

Modified:
  head/sys/arm64/include/pmc_mdep.h

Modified: head/sys/arm64/include/pmc_mdep.h
==
--- head/sys/arm64/include/pmc_mdep.h   Thu Oct 22 04:49:14 2020
(r366923)
+++ head/sys/arm64/include/pmc_mdep.h   Thu Oct 22 05:07:25 2020
(r366924)
@@ -54,7 +54,7 @@ union pmc_md_pmc {
((S) >= (START) && (S) < (END))
 #definePMC_IN_KERNEL(va)   INKERNEL((va))
 #definePMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS)
-#definePMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_lr)
+#definePMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_elr)
 #definePMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_x[29])
 
 /*
___
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: r366923 - head/sys/crypto/armv8

2020-10-21 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Oct 22 04:49:14 2020
New Revision: 366923
URL: https://svnweb.freebsd.org/changeset/base/366923

Log:
  [armv8crypto] Fix cryptodev probe logic in armv8crypto
  
  Add missing break to prevent falling through to the default case statement
  and returning EINVAL for all session configs.
  
  Sponsored by: Ampere Computing
  Submitted by: Klara, Inc.

Modified:
  head/sys/crypto/armv8/armv8_crypto.c

Modified: head/sys/crypto/armv8/armv8_crypto.c
==
--- head/sys/crypto/armv8/armv8_crypto.cThu Oct 22 03:30:39 2020
(r366922)
+++ head/sys/crypto/armv8/armv8_crypto.cThu Oct 22 04:49:14 2020
(r366923)
@@ -207,6 +207,7 @@ armv8_crypto_probesession(device_t dev,
default:
return (EINVAL);
}
+   break;
default:
return (EINVAL);
}
___
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: r365425 - stable/12/release/tools

2020-09-07 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Sep  7 18:47:25 2020
New Revision: 365425
URL: https://svnweb.freebsd.org/changeset/base/365425

Log:
  Revert r364939 and add a stable/12 approach for populating the ESP
  
  make_esp_file is not available in stable/12 so r364939 broke VM-related 
targets.
  Revert offending commit and use pre-r342283 approach to populate ESP 
partition.
  
  PR:   249168
  Tested on:VirtualBox, Hyper-V v2 VM

Modified:
  stable/12/release/tools/vmimage.subr

Modified: stable/12/release/tools/vmimage.subr
==
--- stable/12/release/tools/vmimage.subrMon Sep  7 18:15:58 2020
(r365424)
+++ stable/12/release/tools/vmimage.subrMon Sep  7 18:47:25 2020
(r365425)
@@ -21,17 +21,13 @@ write_partition_layout() {
 
case "${TARGET}:${TARGET_ARCH}" in
amd64:amd64 | i386:i386)
-   # Create an ESP
-   espfilename=$(mktemp /tmp/efiboot.XX)
-   make_esp_file ${espfilename} ${fat32min} 
${BOOTFILES}/efi/loader_lua/loader_lua.efi
mkimg -s gpt -f ${VMFORMAT} \
-b ${BOOTFILES}/i386/pmbr/pmbr \
-p 
freebsd-boot/bootfs:=${BOOTFILES}/i386/gptboot/gptboot \
-   -p efi:=${espfilename} \
+   -p efi:=${BOOTFILES}/efi/boot1/boot1.efifat \
${SWAPOPT} \
-p freebsd-ufs/rootfs:=${VMBASE} \
-o ${VMIMAGE}
-   rm ${espfilename}
;;
arm64:aarch64)
mkimg -s mbr -f ${VMFORMAT} \
___
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: r365390 - stable/12/sys/dev/dwc

2020-09-06 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Sep  6 20:03:13 2020
New Revision: 365390
URL: https://svnweb.freebsd.org/changeset/base/365390

Log:
  MFC r364098 by lwhsu:
  
  Fix armv{6,7} build after r364088
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/12/sys/dev/dwc/if_dwc.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/dwc/if_dwc.c
==
--- stable/12/sys/dev/dwc/if_dwc.c  Sun Sep  6 19:25:31 2020
(r365389)
+++ stable/12/sys/dev/dwc/if_dwc.c  Sun Sep  6 20:03:13 2020
(r365390)
@@ -1220,7 +1220,8 @@ dwc_clock_init(device_t dev)
}
if (bootverbose) {
clk_get_freq(clk, &freq);
-   device_printf(dev, "MAC clock(%s) freq: %ld\n",  
clk_get_name(clk), freq);
+   device_printf(dev, "MAC clock(%s) freq: %jd\n",
+   clk_get_name(clk), (intmax_t)freq);
}
}
else {
___
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: r364098 - head/sys/dev/dwc

2020-09-06 Thread Oleksandr Tymoshenko
Li-Wen Hsu (lw...@freebsd.org) wrote:
> Author: lwhsu
> Date: Tue Aug 11 05:17:10 2020
> New Revision: 364098
> URL: https://svnweb.freebsd.org/changeset/base/364098
> 
> Log:
>   Fix armv{6,7} build after r364088
>   
>   Sponsored by:   The FreeBSD Foundation

I overlooked this change when it was committed. Thanks for fixing and
sorry for the breakage.

-- 
gonzo
___
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: r365388 - in stable/12/sys: arm64/rockchip dev/dwc

2020-09-06 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Sep  6 19:03:19 2020
New Revision: 365388
URL: https://svnweb.freebsd.org/changeset/base/365388

Log:
  MFC r362736, r364088
  
  r362736:
  Configure rx_delay/tx_delay values for RK3399/RK3328 GMAC
  
  For 1000Mb mode to work reliably TX/RX delays need to be configured
  between the TX/RX clock and the respective signals on the PHY
  to compensate for differing trace lengths on the PCB.
  
  Reviewed by:  manu
  
  r364088:
  Improve Rockchip's integration of if_dwc
  
  - Do not rely on U-Boot for clocks configuration, enable and set frequencies
  in the driver's attach method.
  - Adjust MAC settings according to detected linespeed on RK3399 and RK3328.
  - Add support for RMII PHY mode on RK3328.
  
  Reviewed by:  manu
  Differential Revision:https://reviews.freebsd.org/D26006

Modified:
  stable/12/sys/arm64/rockchip/if_dwc_rk.c
  stable/12/sys/dev/dwc/if_dwc.c
  stable/12/sys/dev/dwc/if_dwc.h
  stable/12/sys/dev/dwc/if_dwc_if.m
  stable/12/sys/dev/dwc/if_dwcvar.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm64/rockchip/if_dwc_rk.c
==
--- stable/12/sys/arm64/rockchip/if_dwc_rk.cSun Sep  6 18:48:50 2020
(r365387)
+++ stable/12/sys/arm64/rockchip/if_dwc_rk.cSun Sep  6 19:03:19 2020
(r365388)
@@ -24,7 +24,7 @@
  * 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$");
@@ -34,91 +34,350 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
+#include 
+#include 
+
 #include 
 #include 
 #include 
 #include 
 
 #include 
+#include 
 #include 
-
 #include 
 
+#include "if_dwc_if.h"
 #include "syscon_if.h"
 
-#include "if_dwc_if.h"
-
 #defineRK3328_GRF_MAC_CON0 0x0900
-#define RK3328_GRF_MAC_CON0_TX_MASK0x7F
-#define RK3328_GRF_MAC_CON0_TX_SHIFT   0
-#define RK3328_GRF_MAC_CON0_RX_MASK0x7F
-#define RK3328_GRF_MAC_CON0_RX_SHIFT   7
+#define MAC_CON0_GMAC2IO_TX_DL_CFG_MASK0x7F
+#define MAC_CON0_GMAC2IO_TX_DL_CFG_SHIFT   0
+#define MAC_CON0_GMAC2IO_RX_DL_CFG_MASK0x7F
+#define MAC_CON0_GMAC2IO_RX_DL_CFG_SHIFT   7
 
 #defineRK3328_GRF_MAC_CON1 0x0904
+#define MAC_CON1_GMAC2IO_GMAC_TXCLK_DLY_ENA(1 << 0)
+#define MAC_CON1_GMAC2IO_GMAC_RXCLK_DLY_ENA(1 << 1)
+#define MAC_CON1_GMAC2IO_GMII_CLK_SEL_MASK (3 << 11)
+#define MAC_CON1_GMAC2IO_GMII_CLK_SEL_125  (0 << 11)
+#define MAC_CON1_GMAC2IO_GMII_CLK_SEL_25   (3 << 11)
+#define MAC_CON1_GMAC2IO_GMII_CLK_SEL_2_5  (2 << 11)
+#define MAC_CON1_GMAC2IO_RMII_MODE_MASK(1 << 9)
+#define MAC_CON1_GMAC2IO_RMII_MODE (1 << 9)
+#define MAC_CON1_GMAC2IO_INTF_SEL_MASK (7 << 4)
+#define MAC_CON1_GMAC2IO_INTF_RMII (4 << 4)
+#define MAC_CON1_GMAC2IO_INTF_RGMII(1 << 4)
+#define MAC_CON1_GMAC2IO_RMII_CLK_SEL_MASK (1 << 7)
+#define MAC_CON1_GMAC2IO_RMII_CLK_SEL_25   (1 << 7)
+#define MAC_CON1_GMAC2IO_RMII_CLK_SEL_2_5  (0 << 7)
+#define MAC_CON1_GMAC2IO_MAC_SPEED_MASK(1 << 2)
+#define MAC_CON1_GMAC2IO_MAC_SPEED_100 (1 << 2)
+#define MAC_CON1_GMAC2IO_MAC_SPEED_10  (0 << 2)
 #defineRK3328_GRF_MAC_CON2 0x0908
 #defineRK3328_GRF_MACPHY_CON0  0x0B00
+#define MACPHY_CON0_CLK_50M_MASK   (1 << 14)
+#define MACPHY_CON0_CLK_50M(1 << 14)
+#define MACPHY_CON0_RMII_MODE_MASK (3 << 6)
+#define MACPHY_CON0_RMII_MODE  (1 << 6)
 #defineRK3328_GRF_MACPHY_CON1  0x0B04
+#define MACPHY_CON1_RMII_MODE_MASK (1 << 9)
+#define MACPHY_CON1_RMII_MODE  (1 << 9)
 #defineRK3328_GRF_MACPHY_CON2  0x0B08
 #defineRK3328_GRF_MACPHY_CON3  0x0B0C
 #defineRK3328_GRF_MACPHY_STATUS0x0B10
 
+#defineRK3399_GRF_SOC_CON5 0xc214
+#define SOC_CON5_GMAC_CLK_SEL_MASK (3 << 4)
+#define SOC_CON5_GMAC_CLK_SEL_125  (0 << 4)
+#define SOC_CON5_GMAC_CLK_SEL_25   (3 << 4)
+#define SOC_CON5_GMAC_CLK_SEL_2_5  (2 << 4)
+#defineRK3399_GRF_SOC_CON6 0xc218
+#define SOC_CON6_GMAC_TXCLK_DLY_ENA(1 << 7)
+#define SOC_CON6_TX_DL_CFG_MASK0x7F
+#define SOC_CON6_TX_DL_CFG_SHIFT   0
+#define SOC_CON6_RX_DL_CFG_MASK0x7F
+#define SOC_CON6_GMAC_RXCLK_DLY_ENA(1 << 15)
+#define  

svn commit: r365387 - in stable/12/sys: arm/allwinner arm/amlogic/aml8726 arm64/rockchip dev/altera/dwc dev/dwc

2020-09-06 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Sep  6 18:48:50 2020
New Revision: 365387
URL: https://svnweb.freebsd.org/changeset/base/365387

Log:
  MFC r360467, r362399, r362405, r362415
  
  r360467 by mmel:
  Fix style(9). Strip write only variables.
  Not a functional change.
  
  r362399 by mmel:
  Use naming nomenclature used in DesignWare TRM.
  Use naming nomenclature used in DesignWare TRM.
  This driver was written by using Altera (now Intel) documentation for Arria
  FPGA manual. Unfortunately this manual used very different (and in some cases
  opposite naming) for registers and descriptor fields. Unfortunately,
  this makes future expansion extremely hard.
  
  Should not been functional change.
  
  r362405 by mmel:
  Finish renaming in if_dwc.
  By using DWC TRM terminology, normal descriptor format should be named
  extended and alternate descriptor format should be named normal.
  
  Should not been functional change.
  
  r362415 by mmel:
  Improve if_dwc:
   - refactorize packet receive path. Make sure that we don't leak mbufs
 and/or that we don't create holes in RX descriptor ring
   - slightly simplify handling with TX descriptors

Modified:
  stable/12/sys/arm/allwinner/aw_if_dwc.c
  stable/12/sys/arm/amlogic/aml8726/aml8726_if_dwc.c
  stable/12/sys/arm64/rockchip/if_dwc_rk.c
  stable/12/sys/dev/altera/dwc/if_dwc_socfpga.c
  stable/12/sys/dev/dwc/if_dwc.c
  stable/12/sys/dev/dwc/if_dwc.h
  stable/12/sys/dev/dwc/if_dwc_if.m
  stable/12/sys/dev/dwc/if_dwcvar.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm/allwinner/aw_if_dwc.c
==
--- stable/12/sys/arm/allwinner/aw_if_dwc.c Sun Sep  6 18:27:36 2020
(r365386)
+++ stable/12/sys/arm/allwinner/aw_if_dwc.c Sun Sep  6 18:48:50 2020
(r365387)
@@ -114,7 +114,7 @@ static int
 a20_if_dwc_mac_type(device_t dev)
 {
 
-   return (DWC_GMAC_ALT_DESC);
+   return (DWC_GMAC_NORMAL_DESC);
 }
 
 static int

Modified: stable/12/sys/arm/amlogic/aml8726/aml8726_if_dwc.c
==
--- stable/12/sys/arm/amlogic/aml8726/aml8726_if_dwc.c  Sun Sep  6 18:27:36 
2020(r365386)
+++ stable/12/sys/arm/amlogic/aml8726/aml8726_if_dwc.c  Sun Sep  6 18:48:50 
2020(r365387)
@@ -66,7 +66,7 @@ static int
 aml8726_if_dwc_mac_type(device_t dev)
 {
 
-   return (DWC_GMAC_ALT_DESC);
+   return (DWC_GMAC_NORMAL_DESC);
 }
 
 static int

Modified: stable/12/sys/arm64/rockchip/if_dwc_rk.c
==
--- stable/12/sys/arm64/rockchip/if_dwc_rk.cSun Sep  6 18:27:36 2020
(r365386)
+++ stable/12/sys/arm64/rockchip/if_dwc_rk.cSun Sep  6 18:48:50 2020
(r365387)
@@ -161,7 +161,7 @@ static int
 if_dwc_rk_mac_type(device_t dev)
 {
 
-   return (DWC_GMAC_ALT_DESC);
+   return (DWC_GMAC_NORMAL_DESC);
 }
 
 static int

Modified: stable/12/sys/dev/altera/dwc/if_dwc_socfpga.c
==
--- stable/12/sys/dev/altera/dwc/if_dwc_socfpga.c   Sun Sep  6 18:27:36 
2020(r365386)
+++ stable/12/sys/dev/altera/dwc/if_dwc_socfpga.c   Sun Sep  6 18:48:50 
2020(r365387)
@@ -74,7 +74,7 @@ static int
 if_dwc_socfpga_mac_type(device_t dev)
 {
 
-   return (DWC_GMAC);
+   return (DWC_GMAC_EXT_DESC);
 }
 
 static int

Modified: stable/12/sys/dev/dwc/if_dwc.c
==
--- stable/12/sys/dev/dwc/if_dwc.c  Sun Sep  6 18:27:36 2020
(r365386)
+++ stable/12/sys/dev/dwc/if_dwc.c  Sun Sep  6 18:48:50 2020
(r365387)
@@ -93,46 +93,113 @@ __FBSDID("$FreeBSD$");
 #defineDWC_ASSERT_LOCKED(sc)   mtx_assert(&(sc)->mtx, MA_OWNED)
 #defineDWC_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, 
MA_NOTOWNED)
 
-#defineDDESC_TDES0_OWN (1U << 31)
-#defineDDESC_TDES0_TXINT   (1U << 30)
-#defineDDESC_TDES0_TXLAST  (1U << 29)
-#defineDDESC_TDES0_TXFIRST (1U << 28)
-#defineDDESC_TDES0_TXCRCDIS(1U << 27)
-#defineDDESC_TDES0_TXRINGEND   (1U << 21)
-#defineDDESC_TDES0_TXCHAIN (1U << 20)
+/* TX descriptors - TDESC0 is almost unified */
+#defineTDESC0_OWN  (1U << 31)
+#defineTDESC0_IHE  (1U << 16)  /* IP Header Error */
+#defineTDESC0_ES   (1U << 15)  /* Error Summary */
+#defineTDESC0_JT   (1U << 14)  /* Jabber Timeout */
+#defineTDESC0_FF   (1U << 13)  /* Frame Flushed */
+#defineTDESC0_PCE  (1U << 12)  /* Payload Checksum 
Error */
+#defineTDESC0_LOC  (1U << 11)  /* Loss of Carrier */
+#defineTDESC0_NC

svn commit: r365386 - stable/12/sys/dev/dwc

2020-09-06 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Sep  6 18:27:36 2020
New Revision: 365386
URL: https://svnweb.freebsd.org/changeset/base/365386

Log:
  MFC r353843 by glebius:
  
  Convert to if_foreach_llmaddr() KPI.

Modified:
  stable/12/sys/dev/dwc/if_dwc.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/dwc/if_dwc.c
==
--- stable/12/sys/dev/dwc/if_dwc.c  Sun Sep  6 18:25:50 2020
(r365385)
+++ stable/12/sys/dev/dwc/if_dwc.c  Sun Sep  6 18:27:36 2020
(r365386)
@@ -581,13 +581,37 @@ bitreverse(uint8_t x)
return (nibbletab[x & 0xf] << 4) | nibbletab[x >> 4];
 }
 
+struct dwc_hash_maddr_ctx {
+   struct dwc_softc *sc;
+   uint32_t hash[8];
+};
+
+static u_int
+dwc_hash_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt)
+{
+   struct dwc_hash_maddr_ctx *ctx = arg;
+   uint32_t crc, hashbit, hashreg;
+   uint8_t val;
+
+   crc = ether_crc32_le(LLADDR(sdl), ETHER_ADDR_LEN);
+   /* Take lower 8 bits and reverse it */
+   val = bitreverse(~crc & 0xff);
+   if (ctx->sc->mactype == DWC_GMAC_ALT_DESC)
+   val >>= 2; /* Only need lower 6 bits */
+   hashreg = (val >> 5);
+   hashbit = (val & 31);
+   ctx->hash[hashreg] |= (1 << hashbit);
+
+   return (1);
+}
+
 static void
 dwc_setup_rxfilter(struct dwc_softc *sc)
 {
-   struct ifmultiaddr *ifma;
+   struct dwc_hash_maddr_ctx ctx;
struct ifnet *ifp;
-   uint8_t *eaddr, val;
-   uint32_t crc, ffval, hashbit, hashreg, hi, lo, hash[8];
+   uint8_t *eaddr;
+   uint32_t ffval, hi, lo;
int nhash, i;
 
DWC_ASSERT_LOCKED(sc);
@@ -601,27 +625,13 @@ dwc_setup_rxfilter(struct dwc_softc *sc)
if ((ifp->if_flags & IFF_ALLMULTI) != 0) {
ffval = (FRAME_FILTER_PM);
for (i = 0; i < nhash; i++)
-   hash[i] = ~0;
+   ctx.hash[i] = ~0;
} else {
ffval = (FRAME_FILTER_HMC);
for (i = 0; i < nhash; i++)
-   hash[i] = 0;
-   if_maddr_rlock(ifp);
-   CK_STAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) {
-   if (ifma->ifma_addr->sa_family != AF_LINK)
-   continue;
-   crc = ether_crc32_le(LLADDR((struct sockaddr_dl *)
-   ifma->ifma_addr), ETHER_ADDR_LEN);
-
-   /* Take lower 8 bits and reverse it */
-   val = bitreverse(~crc & 0xff);
-   if (sc->mactype == DWC_GMAC_ALT_DESC)
-   val >>= nhash; /* Only need lower 6 bits */
-   hashreg = (val >> 5);
-   hashbit = (val & 31);
-   hash[hashreg] |= (1 << hashbit);
-   }
-   if_maddr_runlock(ifp);
+   ctx.hash[i] = 0;
+   ctx.sc = sc;
+   if_foreach_llmaddr(ifp, dwc_hash_maddr, &ctx);
}
 
/*
@@ -641,11 +651,11 @@ dwc_setup_rxfilter(struct dwc_softc *sc)
WRITE4(sc, MAC_ADDRESS_HIGH(0), hi);
WRITE4(sc, MAC_FRAME_FILTER, ffval);
if (sc->mactype == DWC_GMAC_ALT_DESC) {
-   WRITE4(sc, GMAC_MAC_HTLOW, hash[0]);
-   WRITE4(sc, GMAC_MAC_HTHIGH, hash[1]);
+   WRITE4(sc, GMAC_MAC_HTLOW, ctx.hash[0]);
+   WRITE4(sc, GMAC_MAC_HTHIGH, ctx.hash[1]);
} else {
for (i = 0; i < nhash; i++)
-   WRITE4(sc, HASH_TABLE_REG(i), hash[i]);
+   WRITE4(sc, HASH_TABLE_REG(i), ctx.hash[i]);
}
 }
 
___
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: r365385 - in stable/12/sys: arm64/conf conf dev/altera/dwc

2020-09-06 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Sep  6 18:25:50 2020
New Revision: 365385
URL: https://svnweb.freebsd.org/changeset/base/365385

Log:
  MFC r350418 by br:
  
  Add glue driver for Altera SOCFPGA Ethernet MAC (EMAC) found in
  Terasic DE10-Pro (an Intel Stratix 10 GX/SX FPGA Development Kit).
  
  The Altera EMAC is an instance of Synopsys DesignWare Gigabit MAC.
  
  This driver sets correct clock range for MDIO interface on Intel Stratix 10
  platform.
  
  This is required due to lack of support for clock manager device for
  this platform that could tell us the clock frequency value for ethernet
  clock domain.
  
  Sponsored by: DARPA, AFRL

Added:
  stable/12/sys/dev/altera/dwc/
 - copied from r350418, head/sys/dev/altera/dwc/
Modified:
  stable/12/sys/arm64/conf/GENERIC
  stable/12/sys/conf/files.arm64
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm64/conf/GENERIC
==
--- stable/12/sys/arm64/conf/GENERICSun Sep  6 18:20:25 2020
(r365384)
+++ stable/12/sys/arm64/conf/GENERICSun Sep  6 18:25:50 2020
(r365385)
@@ -146,6 +146,7 @@ device  smc # SMSC LAN91C111
 device vnic# Cavium ThunderX NIC
 device al_eth  # Annapurna Alpine Ethernet NIC
 device dwc_rk  # Rockchip Designware
+device dwc_socfpga # Altera SOCFPGA Ethernet MAC
 
 # Block devices
 device ahci

Modified: stable/12/sys/conf/files.arm64
==
--- stable/12/sys/conf/files.arm64  Sun Sep  6 18:20:25 2020
(r365384)
+++ stable/12/sys/conf/files.arm64  Sun Sep  6 18:25:50 2020
(r365385)
@@ -214,6 +214,7 @@ dev/acpica/acpi_pci_link.c  optionalacpi pci
 dev/acpica/acpi_pcib.c optionalacpi pci
 dev/acpica/acpi_pxm.c  optionalacpi
 dev/ahci/ahci_generic.coptionalahci
+dev/altera/dwc/if_dwc_socfpga.coptionalfdt dwc_socfpga
 dev/axgbe/if_axgbe.c   optionalaxgbe
 dev/axgbe/xgbe-desc.c  optionalaxgbe
 dev/axgbe/xgbe-dev.c   optionalaxgbe
___
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: r365384 - stable/12/sys/net

2020-09-06 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Sep  6 18:20:25 2020
New Revision: 365384
URL: https://svnweb.freebsd.org/changeset/base/365384

Log:
  MFC r353419:
  
  Provide new KPI for network drivers to access lists of interface
  addresses.  The KPI doesn't reveal neither how addresses are stored,
  how the access to them is synchronized, neither reveal struct ifaddr
  and struct ifmaddr.
  
  Reviewed by:  gallatin, erj, hselasky, philip, stevek
  Differential Revision:https://reviews.freebsd.org/D21943

Modified:
  stable/12/sys/net/if.c
  stable/12/sys/net/if_var.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/net/if.c
==
--- stable/12/sys/net/if.c  Sun Sep  6 17:40:35 2020(r365383)
+++ stable/12/sys/net/if.c  Sun Sep  6 18:20:25 2020(r365384)
@@ -4313,6 +4313,53 @@ if_getmtu_family(if_t ifp, int family)
return (((struct ifnet *)ifp)->if_mtu);
 }
 
+/*
+ * Methods for drivers to access interface unicast and multicast
+ * link level addresses.  Driver shall not know 'struct ifaddr' neither
+ * 'struct ifmultiaddr'.
+ */
+u_int
+if_foreach_lladdr(if_t ifp, iflladdr_cb_t cb, void *cb_arg)
+{
+   struct ifaddr *ifa;
+   u_int count;
+
+   MPASS(cb);
+
+   count = 0;
+   IF_ADDR_RLOCK(ifp);
+   CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+   if (ifa->ifa_addr->sa_family != AF_LINK)
+   continue;
+   count += (*cb)(cb_arg, (struct sockaddr_dl *)ifa->ifa_addr,
+   count);
+   }
+   IF_ADDR_RUNLOCK(ifp);
+
+   return (count);
+}
+
+u_int
+if_foreach_llmaddr(if_t ifp, iflladdr_cb_t cb, void *cb_arg)
+{
+   struct ifmultiaddr *ifma;
+   u_int count;
+
+   MPASS(cb);
+
+   count = 0;
+   IF_ADDR_RLOCK(ifp);
+   CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+   if (ifma->ifma_addr->sa_family != AF_LINK)
+   continue;
+   count += (*cb)(cb_arg, (struct sockaddr_dl *)ifma->ifma_addr,
+   count);
+   }
+   IF_ADDR_RUNLOCK(ifp);
+
+   return (count);
+}
+
 int
 if_setsoftc(if_t ifp, void *softc)
 {

Modified: stable/12/sys/net/if_var.h
==
--- stable/12/sys/net/if_var.h  Sun Sep  6 17:40:35 2020(r365383)
+++ stable/12/sys/net/if_var.h  Sun Sep  6 18:20:25 2020(r365384)
@@ -735,11 +735,20 @@ void if_bpfmtap(if_t ifp, struct mbuf *m);
 void if_etherbpfmtap(if_t ifp, struct mbuf *m);
 void if_vlancap(if_t ifp);
 
-int if_setupmultiaddr(if_t ifp, void *mta, int *cnt, int max);
-int if_multiaddr_array(if_t ifp, void *mta, int *cnt, int max);
+/*
+ * Traversing through interface address lists.
+ */
+struct sockaddr_dl;
+typedef u_int iflladdr_cb_t(void *, struct sockaddr_dl *, u_int);
+u_int if_foreach_lladdr(if_t, iflladdr_cb_t, void *);
+u_int if_foreach_llmaddr(if_t, iflladdr_cb_t, void *);
 int if_multiaddr_count(if_t ifp, int max);
 
+/* Obsoleted multicast management functions. */
+int if_setupmultiaddr(if_t ifp, void *mta, int *cnt, int max);
+int if_multiaddr_array(if_t ifp, void *mta, int *cnt, int max);
 int if_multi_apply(struct ifnet *ifp, int (*filter)(void *, struct ifmultiaddr 
*, int), void *arg);
+
 int if_getamcount(if_t ifp);
 struct ifaddr * if_getifaddr(if_t ifp);
 
___
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: r365322 - stable/12/sys/dev/extres/clk

2020-09-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Sep  4 00:25:02 2020
New Revision: 365322
URL: https://svnweb.freebsd.org/changeset/base/365322

Log:
  MFC r363122:
  
   Assigned clocks: fix off-by-one bug, don't leak allocated memory.
  
   MFC after:   1 week

Modified:
  stable/12/sys/dev/extres/clk/clk.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/extres/clk/clk.c
==
--- stable/12/sys/dev/extres/clk/clk.c  Fri Sep  4 00:24:31 2020
(r365321)
+++ stable/12/sys/dev/extres/clk/clk.c  Fri Sep  4 00:25:02 2020
(r365322)
@@ -1420,15 +1420,17 @@ clk_set_assigned(device_t dev, phandle_t node)
}
 
/* First set it's parent if needed */
-   if (i <= nparents)
+   if (i < nparents)
clk_set_assigned_parent(dev, clk, i);
 
/* Then set a new frequency */
-   if (i <= nrates && rates[i] != 0)
+   if (i < nrates && rates[i] != 0)
clk_set_assigned_rates(dev, clk, rates[i]);
 
clk_release(clk);
}
+   if (rates != NULL)
+   OF_prop_free(rates);
 
return (0);
 }
___
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: r353419 - head/sys/net

2020-09-03 Thread Oleksandr Tymoshenko
Gleb Smirnoff (gleb...@freebsd.org) wrote:
> On Fri, Aug 28, 2020 at 02:31:30PM -0700, Oleksandr Tymoshenko wrote:
> O> Gleb Smirnoff (gleb...@freebsd.org) wrote:
> O> > Author: glebius
> O> > Date: Thu Oct 10 23:42:55 2019
> O> > New Revision: 353419
> O> > URL: https://svnweb.freebsd.org/changeset/base/353419
> O> > 
> O> > Log:
> O> >   Provide new KPI for network drivers to access lists of interface
> O> >   addresses.  The KPI doesn't reveal neither how addresses are stored,
> O> >   how the access to them is synchronized, neither reveal struct ifaddr
> O> >   and struct ifmaddr.
> O> >   
> O> >   Reviewed by:   gallatin, erj, hselasky, philip, stevek
> O> >   Differential Revision: https://reviews.freebsd.org/D21943
> O> 
> O> Hi Gleb,
> O> 
> O> Are there any plans to MFC this change and the subsequent API consumer 
> changes?
> O> Lack of this API in 12 makes MFCing unrelated eth driver fixes hard.
> 
> I don't plan to MFC it, but there is nothing that would blocks such MFC.
> 
> Of course internals of the functions would be different - using mutex instead
> of the epoch to sync access to address lists.
> 
> I can provide patch for you, but you would be responsive for MFC. I don't
> have any 12-based systems to test changes.

I only need it for if_dwc, I don't plan to merge code for any other
drivers. I tested this patch[1] and there were no issues. Does it look
sane? Do I need to run specific steps to trigger codepaths with these
new API calls?

[1] https://people.freebsd.org/~gonzo/patches/if-foreach-mfc.diff
-- 
gonzo
___
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: r353419 - head/sys/net

2020-08-28 Thread Oleksandr Tymoshenko
Gleb Smirnoff (gleb...@freebsd.org) wrote:
> Author: glebius
> Date: Thu Oct 10 23:42:55 2019
> New Revision: 353419
> URL: https://svnweb.freebsd.org/changeset/base/353419
> 
> Log:
>   Provide new KPI for network drivers to access lists of interface
>   addresses.  The KPI doesn't reveal neither how addresses are stored,
>   how the access to them is synchronized, neither reveal struct ifaddr
>   and struct ifmaddr.
>   
>   Reviewed by:gallatin, erj, hselasky, philip, stevek
>   Differential Revision:  https://reviews.freebsd.org/D21943

Hi Gleb,

Are there any plans to MFC this change and the subsequent API consumer changes?
Lack of this API in 12 makes MFCing unrelated eth driver fixes hard.

-- 
gonzo
___
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: r364939 - stable/12/release/tools

2020-08-28 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Aug 28 20:37:57 2020
New Revision: 364939
URL: https://svnweb.freebsd.org/changeset/base/364939

Log:
  MFC r363187:
  
  Enable EFI system partition on amd64 and i386 VM images
  
  EFI support is a hard requirement for generating Hyper-V Gen2 VM images.
  
  Reviewed by:  gjb
  Differential Revision:https://reviews.freebsd.org/D25655

Modified:
  stable/12/release/tools/vmimage.subr
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/release/tools/vmimage.subr
==
--- stable/12/release/tools/vmimage.subrFri Aug 28 20:25:03 2020
(r364938)
+++ stable/12/release/tools/vmimage.subrFri Aug 28 20:37:57 2020
(r364939)
@@ -21,12 +21,17 @@ write_partition_layout() {
 
case "${TARGET}:${TARGET_ARCH}" in
amd64:amd64 | i386:i386)
+   # Create an ESP
+   espfilename=$(mktemp /tmp/efiboot.XX)
+   make_esp_file ${espfilename} ${fat32min} 
${BOOTFILES}/efi/loader_lua/loader_lua.efi
mkimg -s gpt -f ${VMFORMAT} \
-b ${BOOTFILES}/i386/pmbr/pmbr \
-p 
freebsd-boot/bootfs:=${BOOTFILES}/i386/gptboot/gptboot \
+   -p efi:=${espfilename} \
${SWAPOPT} \
-p freebsd-ufs/rootfs:=${VMBASE} \
-o ${VMIMAGE}
+   rm ${espfilename}
;;
arm64:aarch64)
mkimg -s mbr -f ${VMFORMAT} \
___
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: r364938 - stable/12/sys/arm64/rockchip/clk

2020-08-28 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Aug 28 20:25:03 2020
New Revision: 364938
URL: https://svnweb.freebsd.org/changeset/base/364938

Log:
  MFC r357250, r363926-r363927
  
  r357250 (by ganbold@):
  Add USB3 related clock definitions for Rockchip RK3328 SoC.
  
  Reviewed by:  manu
  
  r363926:
  Add flag for SYSCON-controlled clocks on Rockhip platform
  
  Ethernet clocks on RK3328 are controlled by SYSCON registers, so add
  RK_CLK_COMPOSITE_GRF flag to indicate that clock node should access grf
  registers instead of CRU's
  
  Reviewed by:  manu
  Differential Revision:https://reviews.freebsd.org/D25918
  
  r363927:
  Add clocks for ethernet controllers on RK3328
  
  Reviewed by:  manu
  Differential Revision:https://reviews.freebsd.org/D25918

Modified:
  stable/12/sys/arm64/rockchip/clk/rk3328_cru.c
  stable/12/sys/arm64/rockchip/clk/rk_clk_composite.c
  stable/12/sys/arm64/rockchip/clk/rk_clk_composite.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm64/rockchip/clk/rk3328_cru.c
==
--- stable/12/sys/arm64/rockchip/clk/rk3328_cru.c   Fri Aug 28 20:05:18 
2020(r364937)
+++ stable/12/sys/arm64/rockchip/clk/rk3328_cru.c   Fri Aug 28 20:25:03 
2020(r364938)
@@ -50,8 +50,31 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+/* Registers */
+#defineRK3328_GRF_SOC_CON4 0x410
+#defineRK3328_GRF_MAC_CON1 0x904
+#defineRK3328_GRF_MAC_CON2 0x908
+
 /* GATES */
 
+#defineSCLK_MAC2PHY_RXTX   83
+#defineSCLK_MAC2PHY_SRC84
+#defineSCLK_MAC2PHY_REF85
+#defineSCLK_MAC2PHY_OUT86
+#defineSCLK_MAC2IO_RX  87
+#defineSCLK_MAC2IO_TX  88
+#defineSCLK_MAC2IO_REFOUT  89
+#defineSCLK_MAC2IO_REF 90
+#defineSCLK_MAC2IO_OUT 91
+#defineSCLK_USB3OTG_REF96
+#defineSCLK_MAC2IO_SRC 99
+#defineSCLK_MAC2IO 100
+#defineSCLK_MAC2PHY101
+#defineSCLK_MAC2IO_EXT 102
+#defineACLK_USB3OTG132
+#define ACLK_GMAC  146
+#define ACLK_MAC2PHY   149
+#define ACLK_MAC2IO150
 #defineACLK_PERI   153
 #definePCLK_GPIO0  200
 #definePCLK_GPIO1  201
@@ -62,6 +85,12 @@ __FBSDID("$FreeBSD$");
 #definePCLK_I2C2   207
 #definePCLK_I2C3   208
 #definePCLK_TSADC  213
+#define PCLK_GMAC  220
+#define PCLK_MAC2PHY   222
+#define PCLK_MAC2IO223
+#definePCLK_USB3PHY_OTG224
+#definePCLK_USB3PHY_PIPE   225
+#definePCLK_USB3_GRF   226
 #defineHCLK_SDMMC  317
 #defineHCLK_SDIO   318
 #defineHCLK_EMMC   319
@@ -77,11 +106,20 @@ static struct rk_cru_gate rk3328_gates[] = {
/* CRU_CLKGATE_CON4 */
CRU_GATE(0, "gpll_peri", "gpll", 0x210, 0)
CRU_GATE(0, "cpll_peri", "cpll", 0x210, 1)
+   CRU_GATE(SCLK_USB3OTG_REF, "clk_usb3otg_ref", "xin24m", 0x210, 7)
 
/* CRU_CLKGATE_CON8 */
CRU_GATE(0, "pclk_bus", "pclk_bus_pre", 0x220, 3)
CRU_GATE(0, "pclk_phy_pre", "pclk_bus_pre", 0x220, 4)
 
+   /* CRU_CLKGATE_CON8 */
+   CRU_GATE(SCLK_MAC2IO_REF, "clk_mac2io_ref", "clk_mac2io", 0x224, 7)
+   CRU_GATE(SCLK_MAC2IO_REFOUT, "clk_mac2io_refout", "clk_mac2io", 0x224, 
6)
+   CRU_GATE(SCLK_MAC2IO_TX, "clk_mac2io_tx", "clk_mac2io", 0x224, 5)
+   CRU_GATE(SCLK_MAC2IO_RX, "clk_mac2io_rx", "clk_mac2io", 0x224, 4)
+   CRU_GATE(SCLK_MAC2PHY_REF, "clk_mac2phy_ref", "clk_mac2phy", 0x224, 3)
+   CRU_GATE(SCLK_MAC2PHY_RXTX, "clk_mac2phy_rxtx", "clk_mac2phy", 0x224, 1)
+
/* CRU_CLKGATE_CON10 */
CRU_GATE(ACLK_PERI, "aclk_peri", "aclk_peri_pre", 0x228, 0)
 
@@ -99,13 +137,27 @@ static struct rk_cru_gate rk3328_gates[] = {
CRU_GATE(PCLK_GPIO2, "pclk_gpio2", "pclk_bus", 0x240, 9)
CRU_GATE(PCLK_GPIO3, "pclk_gpio3", "pclk_bus", 0x240, 10)
 
+   /* CRU_CLKGATE_CON17 */
+   CRU_GATE(PCLK_USB3_GRF, "pclk_usb3_grf", "pclk_phy_pre", 0x244, 2)
+
/* CRU_CLKGATE_CON19 */
CRU_GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_peri", 0x24C, 0)
CRU_GATE(HCLK_SDIO, "hclk_sdio", "hclk_peri", 0x24C, 1)
CRU_GATE(HCLK_EMMC, "hclk_emmc", "hclk_peri", 0x24C, 2)
CRU_GATE(0, "hclk_peri_niu", "hclk_peri", 0x24C, 12)
CRU_GATE(0, "pclk_peri_niu", "hclk_peri", 0x24C, 13)
+   CRU_GATE(ACLK_USB3OTG, "aclk_usb3otg", "aclk_peri", 0x24C, 14)
CRU_GATE(HCLK_SDMMC_EXT, "hclk_sdmmc_ext", "hclk_peri", 0x24C, 15)
+
+   /* CRU_CLKGATE_CON26 */
+   CRU_GATE(ACLK_MAC2PHY, "aclk_mac2phy", "aclk_gmac", 0x268, 0)
+   CRU_GATE(PCLK_MAC2PHY, "pclk_mac2phy", "pclk_gmac", 0x268, 1)
+   C

Re: svn commit: r364222 - in head: lib/liblua libexec/flua

2020-08-13 Thread Oleksandr Tymoshenko
Ed Maste (ema...@freebsd.org) wrote:
> Author: emaste
> Date: Thu Aug 13 23:13:05 2020
> New Revision: 364222
> URL: https://svnweb.freebsd.org/changeset/base/364222
> 
> Log:
>   flua: support "require" for binary objects in the base system
>   
>   Export symbols from flua, and enable dlopen.
>   
>   Sponsored by:   The FreeBSD Foundation
>   Differential Revision:  https://reviews.freebsd.org/D26059
> 
> Modified:
>   head/lib/liblua/luaconf.h
>   head/libexec/flua/Makefile

Hi Ed,

This change breaks the build. flua segfaults when it is called during
libifconfig build.

Backtrace:

* thread #1, name = 'flua', stop reason = signal SIGSEGV
  * frame #0: 0x002e166c flua.full`__je_malloc_tsd_boot0 [inlined] 
tsd_fetch_impl(init=true, minimal=false) at tsd.h:265:6
frame #1: 0x002e166c flua.full`__je_malloc_tsd_boot0 [inlined] 
tsd_fetch at tsd.h:292
frame #2: 0x002e166c flua.full`__je_malloc_tsd_boot0 at 
jemalloc_tsd.c:266
frame #3: 0x002c30d5 flua.full`__malloc [inlined] malloc_init_hard 
at jemalloc_jemalloc.c:1527:8
frame #4: 0x002c30bd flua.full`__malloc [inlined] malloc_init at 
jemalloc_jemalloc.c:221
frame #5: 0x002c30bd flua.full`__malloc [inlined] 
imalloc(sopts=, dopts=) at jemalloc_jemalloc.c:1990
frame #6: 0x002c2d10 flua.full`__malloc(size=1560) at 
jemalloc_jemalloc.c:2042
frame #7: 0x0027e742 flua.full`lua_newstate(f=(flua.full`l_alloc at 
lauxlib.c:1008), ud=0x) at lstate.c:299:11
frame #8: 0x0027e0d2 flua.full`luaL_newstate at lauxlib.c:1027:18
frame #9: 0x0026d316 flua.full`main(argc=3, 
argv=0x7fffc458) at lua.c:598:18
frame #10: 0x0026d10f flua.full`_start(ap=, 
cleanup=) at crt1.c:76:7

Host build system: 12.1-RELEASE-p7
Target: arm64

-- 
gonzo
___
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: r364088 - in head/sys: arm64/rockchip dev/dwc

2020-08-10 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Aug 10 19:37:06 2020
New Revision: 364088
URL: https://svnweb.freebsd.org/changeset/base/364088

Log:
  Improve Rockchip's integration of if_dwc
  
  - Do not rely on U-Boot for clocks configuration, enable and set frequencies
  in the driver's attach method.
  - Adjust MAC settings according to detected linespeed on RK3399 and RK3328.
  - Add support for RMII PHY mode on RK3328.
  
  Reviewed by:  manu
  Differential Revision:https://reviews.freebsd.org/D26006

Modified:
  head/sys/arm64/rockchip/if_dwc_rk.c
  head/sys/dev/dwc/if_dwc.c
  head/sys/dev/dwc/if_dwc.h
  head/sys/dev/dwc/if_dwc_if.m
  head/sys/dev/dwc/if_dwcvar.h

Modified: head/sys/arm64/rockchip/if_dwc_rk.c
==
--- head/sys/arm64/rockchip/if_dwc_rk.c Mon Aug 10 18:26:18 2020
(r364087)
+++ head/sys/arm64/rockchip/if_dwc_rk.c Mon Aug 10 19:37:06 2020
(r364088)
@@ -23,7 +23,7 @@
  * 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$");
@@ -33,97 +33,350 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
+#include 
+#include 
+
 #include 
 #include 
 #include 
 #include 
 
 #include 
+#include 
 #include 
-
 #include 
 
+#include "if_dwc_if.h"
 #include "syscon_if.h"
 
-#include "if_dwc_if.h"
-
 #defineRK3328_GRF_MAC_CON0 0x0900
-#define RK3328_GRF_MAC_CON0_TX_MASK0x7F
-#define RK3328_GRF_MAC_CON0_TX_SHIFT   0
-#define RK3328_GRF_MAC_CON0_RX_MASK0x7F
-#define RK3328_GRF_MAC_CON0_RX_SHIFT   7
+#define MAC_CON0_GMAC2IO_TX_DL_CFG_MASK0x7F
+#define MAC_CON0_GMAC2IO_TX_DL_CFG_SHIFT   0
+#define MAC_CON0_GMAC2IO_RX_DL_CFG_MASK0x7F
+#define MAC_CON0_GMAC2IO_RX_DL_CFG_SHIFT   7
 
 #defineRK3328_GRF_MAC_CON1 0x0904
-#define RK3328_GRF_MAC_CON1_RX_ENA (1 << 1)
-#define RK3328_GRF_MAC_CON1_TX_ENA (1 << 0)
+#define MAC_CON1_GMAC2IO_GMAC_TXCLK_DLY_ENA(1 << 0)
+#define MAC_CON1_GMAC2IO_GMAC_RXCLK_DLY_ENA(1 << 1)
+#define MAC_CON1_GMAC2IO_GMII_CLK_SEL_MASK (3 << 11)
+#define MAC_CON1_GMAC2IO_GMII_CLK_SEL_125  (0 << 11)
+#define MAC_CON1_GMAC2IO_GMII_CLK_SEL_25   (3 << 11)
+#define MAC_CON1_GMAC2IO_GMII_CLK_SEL_2_5  (2 << 11)
+#define MAC_CON1_GMAC2IO_RMII_MODE_MASK(1 << 9)
+#define MAC_CON1_GMAC2IO_RMII_MODE (1 << 9)
+#define MAC_CON1_GMAC2IO_INTF_SEL_MASK (7 << 4)
+#define MAC_CON1_GMAC2IO_INTF_RMII (4 << 4)
+#define MAC_CON1_GMAC2IO_INTF_RGMII(1 << 4)
+#define MAC_CON1_GMAC2IO_RMII_CLK_SEL_MASK (1 << 7)
+#define MAC_CON1_GMAC2IO_RMII_CLK_SEL_25   (1 << 7)
+#define MAC_CON1_GMAC2IO_RMII_CLK_SEL_2_5  (0 << 7)
+#define MAC_CON1_GMAC2IO_MAC_SPEED_MASK(1 << 2)
+#define MAC_CON1_GMAC2IO_MAC_SPEED_100 (1 << 2)
+#define MAC_CON1_GMAC2IO_MAC_SPEED_10  (0 << 2)
 #defineRK3328_GRF_MAC_CON2 0x0908
 #defineRK3328_GRF_MACPHY_CON0  0x0B00
+#define MACPHY_CON0_CLK_50M_MASK   (1 << 14)
+#define MACPHY_CON0_CLK_50M(1 << 14)
+#define MACPHY_CON0_RMII_MODE_MASK (3 << 6)
+#define MACPHY_CON0_RMII_MODE  (1 << 6)
 #defineRK3328_GRF_MACPHY_CON1  0x0B04
+#define MACPHY_CON1_RMII_MODE_MASK (1 << 9)
+#define MACPHY_CON1_RMII_MODE  (1 << 9)
 #defineRK3328_GRF_MACPHY_CON2  0x0B08
 #defineRK3328_GRF_MACPHY_CON3  0x0B0C
 #defineRK3328_GRF_MACPHY_STATUS0x0B10
 
+#defineRK3399_GRF_SOC_CON5 0xc214
+#define SOC_CON5_GMAC_CLK_SEL_MASK (3 << 4)
+#define SOC_CON5_GMAC_CLK_SEL_125  (0 << 4)
+#define SOC_CON5_GMAC_CLK_SEL_25   (3 << 4)
+#define SOC_CON5_GMAC_CLK_SEL_2_5  (2 << 4)
+#defineRK3399_GRF_SOC_CON6 0xc218
+#define SOC_CON6_GMAC_TXCLK_DLY_ENA(1 << 7)
+#define SOC_CON6_TX_DL_CFG_MASK0x7F
+#define SOC_CON6_TX_DL_CFG_SHIFT   0
+#define SOC_CON6_RX_DL_CFG_MASK0x7F
+#define SOC_CON6_GMAC_RXCLK_DLY_ENA(1 << 15)
+#define SOC_CON6_RX_DL_CFG_SHIFT   8
+
+struct if_dwc_rk_softc;
+
+typedef void (*if_dwc_rk_set_delaysfn_t)(struct if_dwc_rk_softc *);
+typedef int (*if_dwc_rk_set_speedfn_t)(struct if_dwc_rk_softc *, int);
+typedef void (*if_dwc_rk_set_phy_modefn_t)(struct if_dwc_rk_softc *);
+typedef void (*if_dwc_r

svn commit: r363927 - head/sys/arm64/rockchip/clk

2020-08-05 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed Aug  5 18:22:24 2020
New Revision: 363927
URL: https://svnweb.freebsd.org/changeset/base/363927

Log:
  Add clocks for ethernet controllers on RK3328
  
  Reviewed by:  manu
  Differential Revision:https://reviews.freebsd.org/D25918

Modified:
  head/sys/arm64/rockchip/clk/rk3328_cru.c

Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c
==
--- head/sys/arm64/rockchip/clk/rk3328_cru.cWed Aug  5 18:21:22 2020
(r363926)
+++ head/sys/arm64/rockchip/clk/rk3328_cru.cWed Aug  5 18:22:24 2020
(r363927)
@@ -49,10 +49,31 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+/* Registers */
+#defineRK3328_GRF_SOC_CON4 0x410
+#defineRK3328_GRF_MAC_CON1 0x904
+#defineRK3328_GRF_MAC_CON2 0x908
+
 /* GATES */
 
+#defineSCLK_MAC2PHY_RXTX   83
+#defineSCLK_MAC2PHY_SRC84
+#defineSCLK_MAC2PHY_REF85
+#defineSCLK_MAC2PHY_OUT86
+#defineSCLK_MAC2IO_RX  87
+#defineSCLK_MAC2IO_TX  88
+#defineSCLK_MAC2IO_REFOUT  89
+#defineSCLK_MAC2IO_REF 90
+#defineSCLK_MAC2IO_OUT 91
 #defineSCLK_USB3OTG_REF96
+#defineSCLK_MAC2IO_SRC 99
+#defineSCLK_MAC2IO 100
+#defineSCLK_MAC2PHY101
+#defineSCLK_MAC2IO_EXT 102
 #defineACLK_USB3OTG132
+#define ACLK_GMAC  146
+#define ACLK_MAC2PHY   149
+#define ACLK_MAC2IO150
 #defineACLK_PERI   153
 #definePCLK_GPIO0  200
 #definePCLK_GPIO1  201
@@ -63,6 +84,9 @@ __FBSDID("$FreeBSD$");
 #definePCLK_I2C2   207
 #definePCLK_I2C3   208
 #definePCLK_TSADC  213
+#define PCLK_GMAC  220
+#define PCLK_MAC2PHY   222
+#define PCLK_MAC2IO223
 #definePCLK_USB3PHY_OTG224
 #definePCLK_USB3PHY_PIPE   225
 #definePCLK_USB3_GRF   226
@@ -87,6 +111,14 @@ static struct rk_cru_gate rk3328_gates[] = {
CRU_GATE(0, "pclk_bus", "pclk_bus_pre", 0x220, 3)
CRU_GATE(0, "pclk_phy_pre", "pclk_bus_pre", 0x220, 4)
 
+   /* CRU_CLKGATE_CON8 */
+   CRU_GATE(SCLK_MAC2IO_REF, "clk_mac2io_ref", "clk_mac2io", 0x224, 7)
+   CRU_GATE(SCLK_MAC2IO_REFOUT, "clk_mac2io_refout", "clk_mac2io", 0x224, 
6)
+   CRU_GATE(SCLK_MAC2IO_TX, "clk_mac2io_tx", "clk_mac2io", 0x224, 5)
+   CRU_GATE(SCLK_MAC2IO_RX, "clk_mac2io_rx", "clk_mac2io", 0x224, 4)
+   CRU_GATE(SCLK_MAC2PHY_REF, "clk_mac2phy_ref", "clk_mac2phy", 0x224, 3)
+   CRU_GATE(SCLK_MAC2PHY_RXTX, "clk_mac2phy_rxtx", "clk_mac2phy", 0x224, 1)
+
/* CRU_CLKGATE_CON10 */
CRU_GATE(ACLK_PERI, "aclk_peri", "aclk_peri_pre", 0x228, 0)
 
@@ -116,6 +148,12 @@ static struct rk_cru_gate rk3328_gates[] = {
CRU_GATE(ACLK_USB3OTG, "aclk_usb3otg", "aclk_peri", 0x24C, 14)
CRU_GATE(HCLK_SDMMC_EXT, "hclk_sdmmc_ext", "hclk_peri", 0x24C, 15)
 
+   /* CRU_CLKGATE_CON26 */
+   CRU_GATE(ACLK_MAC2PHY, "aclk_mac2phy", "aclk_gmac", 0x268, 0)
+   CRU_GATE(PCLK_MAC2PHY, "pclk_mac2phy", "pclk_gmac", 0x268, 1)
+   CRU_GATE(ACLK_MAC2IO, "aclk_mac2io", "aclk_gmac", 0x268, 2)
+   CRU_GATE(PCLK_MAC2IO, "pclk_mac2io", "pclk_gmac", 0x268, 3)
+
/* CRU_CLKGATE_CON28 */
CRU_GATE(PCLK_USB3PHY_OTG, "pclk_usb3phy_otg", "pclk_phy_pre", 0x270, 1)
CRU_GATE(PCLK_USB3PHY_PIPE, "pclk_usb3phy_pipe", "pclk_phy_pre", 0x270, 
2)
@@ -1077,6 +1115,210 @@ static struct rk_clk_composite_def ref_usb3otg_src = {
.flags = RK_CLK_COMPOSITE_HAVE_GATE,
 };
 
+static const char *mac2io_src_parents[] = { "cpll", "gpll" };
+
+static struct rk_clk_composite_def mac2io_src = {
+   .clkdef = {
+   .id = SCLK_MAC2IO_SRC,
+   .name = "clk_mac2io_src",
+   .parent_names = mac2io_src_parents,
+   .parent_cnt = nitems(mac2io_src_parents),
+   },
+   /* CRU_CLKSEL_CON27 */
+   .muxdiv_offset = 0x16c,
+
+   .mux_shift = 7,
+   .mux_width = 1,
+
+   .div_shift = 0,
+   .div_width = 5,
+
+   /* CRU_CLKGATE_CON3 */
+   .gate_offset = 0x20c,
+   .gate_shift = 1,
+
+   .flags = RK_CLK_COMPOSITE_HAVE_GATE | RK_CLK_COMPOSITE_HAVE_MUX,
+};
+
+static const char *mac2io_out_parents[] = { "cpll", "gpll" };
+
+static struct rk_clk_composite_def mac2io_out = {
+   .clkdef = {
+   .id = SCLK_MAC2IO_OUT,
+   .name = "clk_mac2io_out",
+   .parent_names = mac2io_out_parents,
+   .parent_cnt = nitems(mac2io_out_parents),
+   },
+   /* CRU_CLKSEL_CON27 */
+   .muxdiv_offset = 0x16c,
+
+   .mux_shift = 15,
+   .mux_width = 1,
+
+   .div_shift = 8,
+   .div_width = 5,
+
+   /* CRU_CLKGAT

svn commit: r363926 - head/sys/arm64/rockchip/clk

2020-08-05 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed Aug  5 18:21:22 2020
New Revision: 363926
URL: https://svnweb.freebsd.org/changeset/base/363926

Log:
  Add flag for SYSCON-controlled clocks on Rockhip platform
  
  Ethernet clocks on RK3328 are controlled by SYSCON registers, so add
  RK_CLK_COMPOSITE_GRF flag to indicate that clock node should access grf
  registers instead of CRU's
  
  Reviewed by:  manu
  Differential Revision:https://reviews.freebsd.org/D25918

Modified:
  head/sys/arm64/rockchip/clk/rk_clk_composite.c
  head/sys/arm64/rockchip/clk/rk_clk_composite.h

Modified: head/sys/arm64/rockchip/clk/rk_clk_composite.c
==
--- head/sys/arm64/rockchip/clk/rk_clk_composite.c  Wed Aug  5 17:26:20 
2020(r363925)
+++ head/sys/arm64/rockchip/clk/rk_clk_composite.c  Wed Aug  5 18:21:22 
2020(r363926)
@@ -35,10 +35,12 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 
 #include 
 
 #include "clkdev_if.h"
+#include "syscon_if.h"
 
 struct rk_clk_composite_sc {
uint32_tmuxdiv_offset;
@@ -54,12 +56,14 @@ struct rk_clk_composite_sc {
uint32_tgate_shift;
 
uint32_tflags;
+
+   struct syscon   *grf;
 };
 
 #defineWRITE4(_clk, off, val)  
\
-   CLKDEV_WRITE_4(clknode_get_device(_clk), off, val)
+   rk_clk_composite_write_4(_clk, off, val)
 #defineREAD4(_clk, off, val)   
\
-   CLKDEV_READ_4(clknode_get_device(_clk), off, val)
+   rk_clk_composite_read_4(_clk, off, val)
 #defineDEVICE_LOCK(_clk)   
\
CLKDEV_DEVICE_LOCK(clknode_get_device(_clk))
 #defineDEVICE_UNLOCK(_clk) 
\
@@ -74,6 +78,49 @@ struct rk_clk_composite_sc {
 #definedprintf(format, arg...)
 #endif
 
+static void
+rk_clk_composite_read_4(struct clknode *clk, bus_addr_t addr, uint32_t *val)
+{
+   struct rk_clk_composite_sc *sc;
+
+   sc = clknode_get_softc(clk);
+   if (sc->grf)
+   *val = SYSCON_READ_4(sc->grf, addr);
+   else
+   CLKDEV_READ_4(clknode_get_device(clk), addr, val);
+}
+
+static void
+rk_clk_composite_write_4(struct clknode *clk, bus_addr_t addr, uint32_t val)
+{
+   struct rk_clk_composite_sc *sc;
+
+   sc = clknode_get_softc(clk);
+   if (sc->grf)
+   SYSCON_WRITE_4(sc->grf, addr, val | (0x << 16));
+   else
+   CLKDEV_WRITE_4(clknode_get_device(clk), addr, val);
+}
+
+static struct syscon *
+rk_clk_composite_get_grf(struct clknode *clk)
+{
+   device_t dev;
+   phandle_t node;
+   struct syscon *grf;
+
+   grf = NULL;
+   dev = clknode_get_device(clk);
+   node = ofw_bus_get_node(dev);
+   if (OF_hasprop(node, "rockchip,grf") &&
+   syscon_get_by_ofw_property(dev, node,
+   "rockchip,grf", &grf) != 0) {
+   return (NULL);
+}
+
+   return (grf);
+}
+
 static int
 rk_clk_composite_init(struct clknode *clk, device_t dev)
 {
@@ -81,6 +128,12 @@ rk_clk_composite_init(struct clknode *clk, device_t de
uint32_t val, idx;
 
sc = clknode_get_softc(clk);
+   if ((sc->flags & RK_CLK_COMPOSITE_GRF) != 0) {
+   sc->grf = rk_clk_composite_get_grf(clk);
+   if (sc->grf == NULL)
+   panic("clock %s has GRF flag set but no syscon is 
available",
+   clknode_get_name(clk));
+   }
 
idx = 0;
if ((sc->flags & RK_CLK_COMPOSITE_HAVE_MUX) != 0) {

Modified: head/sys/arm64/rockchip/clk/rk_clk_composite.h
==
--- head/sys/arm64/rockchip/clk/rk_clk_composite.h  Wed Aug  5 17:26:20 
2020(r363925)
+++ head/sys/arm64/rockchip/clk/rk_clk_composite.h  Wed Aug  5 18:21:22 
2020(r363926)
@@ -53,6 +53,7 @@ struct rk_clk_composite_def {
 #defineRK_CLK_COMPOSITE_HAVE_GATE  0x0002
 #defineRK_CLK_COMPOSITE_DIV_EXP0x0004  /* Register   0, 1, 2, 
2, ... */
/* Divider1, 2, 4, 8, ... */
+#defineRK_CLK_COMPOSITE_GRF0x0008 /* Use syscon registers 
instead of CRU's */
 int rk_clk_composite_register(struct clkdom *clkdom,
 struct rk_clk_composite_def *clkdef);
 
___
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: r363190 - stable/11/usr.bin/mkimg

2020-07-14 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Jul 14 18:31:15 2020
New Revision: 363190
URL: https://svnweb.freebsd.org/changeset/base/363190

Log:
  MFC r363140:
  
  Fix invalid VHDX generation for image larger than 4Gb
  
  - Part of BAT payload location was lost due to invalid
  BAT entry encoding type (32 bits instead of 64 bits)
  - The sequence of PB/SB entries in BAT was broken due to
  off-by-one index check. It worked for smaller than
  4Gb because there were no SB entries in BAT.

Modified:
  stable/11/usr.bin/mkimg/vhdx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/mkimg/vhdx.c
==
--- stable/11/usr.bin/mkimg/vhdx.c  Tue Jul 14 18:31:00 2020
(r363189)
+++ stable/11/usr.bin/mkimg/vhdx.c  Tue Jul 14 18:31:15 2020
(r363190)
@@ -430,7 +430,7 @@ vhdx_write_bat(int fd, uint64_t image_size)
payload_offset = 3 + (bat_size / SIZE_1MB);
bat_ptr = 0;
for (idx = 0; idx < data_block_count; idx++) {
-   le32enc(bat + bat_ptr,
+   le64enc(bat + bat_ptr,
BAT_ENTRY(payload_offset, PAYLOAD_BLOCK_FULLY_PRESENT));
bat_ptr += 8;
payload_offset += (PAYLOAD_BLOCK_SIZE / SIZE_1MB);
@@ -446,9 +446,9 @@ vhdx_write_bat(int fd, uint64_t image_size)
bat_ptr = 0;
}
 
-   if ((idx % chunk_ratio) == 0 &&
-   (idx > 0) && (idx != data_block_count - 1)) {
-   le32enc(bat + bat_ptr,
+   if (((idx + 1) % chunk_ratio) == 0 &&
+   (idx != data_block_count - 1)) {
+   le64enc(bat + bat_ptr,
BAT_ENTRY(0, SB_BLOCK_NOT_PRESENT));
bat_ptr += 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: r363189 - stable/12/usr.bin/mkimg

2020-07-14 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Jul 14 18:31:00 2020
New Revision: 363189
URL: https://svnweb.freebsd.org/changeset/base/363189

Log:
  MFC r363140:
  
  Fix invalid VHDX generation for image larger than 4Gb
  
  - Part of BAT payload location was lost due to invalid
  BAT entry encoding type (32 bits instead of 64 bits)
  - The sequence of PB/SB entries in BAT was broken due to
  off-by-one index check. It worked for smaller than
  4Gb because there were no SB entries in BAT.

Modified:
  stable/12/usr.bin/mkimg/vhdx.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/mkimg/vhdx.c
==
--- stable/12/usr.bin/mkimg/vhdx.c  Tue Jul 14 18:11:05 2020
(r363188)
+++ stable/12/usr.bin/mkimg/vhdx.c  Tue Jul 14 18:31:00 2020
(r363189)
@@ -429,7 +429,7 @@ vhdx_write_bat(int fd, uint64_t image_size)
payload_offset = 3 + (bat_size / SIZE_1MB);
bat_ptr = 0;
for (idx = 0; idx < data_block_count; idx++) {
-   le32enc(bat + bat_ptr,
+   le64enc(bat + bat_ptr,
BAT_ENTRY(payload_offset, PAYLOAD_BLOCK_FULLY_PRESENT));
bat_ptr += 8;
payload_offset += (PAYLOAD_BLOCK_SIZE / SIZE_1MB);
@@ -445,9 +445,9 @@ vhdx_write_bat(int fd, uint64_t image_size)
bat_ptr = 0;
}
 
-   if ((idx % chunk_ratio) == 0 &&
-   (idx > 0) && (idx != data_block_count - 1)) {
-   le32enc(bat + bat_ptr,
+   if (((idx + 1) % chunk_ratio) == 0 &&
+   (idx != data_block_count - 1)) {
+   le64enc(bat + bat_ptr,
BAT_ENTRY(0, SB_BLOCK_NOT_PRESENT));
bat_ptr += 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: r363187 - head/release/tools

2020-07-14 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Jul 14 18:02:24 2020
New Revision: 363187
URL: https://svnweb.freebsd.org/changeset/base/363187

Log:
  Enable EFI system partition on amd64 and i386 VM images
  
  EFI support is a hard requirement for generating Hyper-V Gen2 VM images.
  
  Reviewed by:  gjb
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D25655

Modified:
  head/release/tools/vmimage.subr

Modified: head/release/tools/vmimage.subr
==
--- head/release/tools/vmimage.subr Tue Jul 14 17:46:40 2020
(r363186)
+++ head/release/tools/vmimage.subr Tue Jul 14 18:02:24 2020
(r363187)
@@ -24,12 +24,17 @@ write_partition_layout() {
 
case "${TARGET}:${TARGET_ARCH}" in
amd64:amd64 | i386:i386)
+   # Create an ESP
+   espfilename=$(mktemp /tmp/efiboot.XX)
+   make_esp_file ${espfilename} ${fat32min} 
${BOOTFILES}/efi/loader_lua/loader_lua.efi
mkimg -s gpt -f ${VMFORMAT} \
-b ${BOOTFILES}/i386/pmbr/pmbr \
-p 
freebsd-boot/bootfs:=${BOOTFILES}/i386/gptboot/gptboot \
+   -p efi:=${espfilename} \
${SWAPOPT} \
-p freebsd-ufs/rootfs:=${VMBASE} \
-o ${VMIMAGE}
+   rm ${espfilename}
;;
arm64:aarch64)
# Create an ESP
___
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: r363186 - stable/11/contrib/ldns/drill

2020-07-14 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Jul 14 17:46:40 2020
New Revision: 363186
URL: https://svnweb.freebsd.org/changeset/base/363186

Log:
  MFC r362516:
  
  Fix crash in drill(1) when IP has two subsequent dots
  
  Cherry-pick crash fix from the upstream repo
  
  PR:   226575
  Reported by:  Goran Mekić 
  Obtained from:https://git.nlnetlabs.nl/ldns/commit/?id=98291475

Modified:
  stable/11/contrib/ldns/drill/drill.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/ldns/drill/drill.c
==
--- stable/11/contrib/ldns/drill/drill.cTue Jul 14 17:23:25 2020
(r363185)
+++ stable/11/contrib/ldns/drill/drill.cTue Jul 14 17:46:40 2020
(r363186)
@@ -747,15 +747,17 @@ main(int argc, char *argv[])
free(name2);
} else {
qname = ldns_dname_new_frm_str(name);
-   qname_tmp = ldns_dname_reverse(qname);
-   ldns_rdf_deep_free(qname);
-   qname = qname_tmp;
-   qname_tmp = 
ldns_dname_new_frm_str("in-addr.arpa.");
-   status = ldns_dname_cat(qname, qname_tmp);
-   if (status != LDNS_STATUS_OK) {
-   error("%s", "could not create reverse 
address for ip4: %s\n", ldns_get_errorstr_by_id(status));
+   if (qname) {
+   qname_tmp = ldns_dname_reverse(qname);
+   ldns_rdf_deep_free(qname);
+   qname = qname_tmp;
+   qname_tmp = 
ldns_dname_new_frm_str("in-addr.arpa.");
+   status = ldns_dname_cat(qname, 
qname_tmp);
+   if (status != LDNS_STATUS_OK) {
+   error("%s", "could not create 
reverse address for ip4: %s\n", ldns_get_errorstr_by_id(status));
+   }
+   ldns_rdf_deep_free(qname_tmp);
}
-   ldns_rdf_deep_free(qname_tmp);
}
if (!qname) {
error("%s", "-x implies an ip address");
___
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: r363175 - stable/12/contrib/ldns/drill

2020-07-13 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Jul 14 05:24:07 2020
New Revision: 363175
URL: https://svnweb.freebsd.org/changeset/base/363175

Log:
  MFC r362516:
  
  Fix crash in drill(1) when IP has two subsequent dots
  
  Cherry-pick crash fix from the upstream repo
  
  PR:   226575
  Reported by:  Goran Mekić 
  Obtained from:https://git.nlnetlabs.nl/ldns/commit/?id=98291475

Modified:
  stable/12/contrib/ldns/drill/drill.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/ldns/drill/drill.c
==
--- stable/12/contrib/ldns/drill/drill.cTue Jul 14 05:10:50 2020
(r363174)
+++ stable/12/contrib/ldns/drill/drill.cTue Jul 14 05:24:07 2020
(r363175)
@@ -787,15 +787,17 @@ main(int argc, char *argv[])
qname = ldns_dname_new_frm_str(ip6_arpa_str);
} else {
qname = ldns_dname_new_frm_str(name);
-   qname_tmp = ldns_dname_reverse(qname);
-   ldns_rdf_deep_free(qname);
-   qname = qname_tmp;
-   qname_tmp = 
ldns_dname_new_frm_str("in-addr.arpa.");
-   status = ldns_dname_cat(qname, qname_tmp);
-   if (status != LDNS_STATUS_OK) {
-   error("%s", "could not create reverse 
address for ip4: %s\n", ldns_get_errorstr_by_id(status));
+   if (qname) {
+   qname_tmp = ldns_dname_reverse(qname);
+   ldns_rdf_deep_free(qname);
+   qname = qname_tmp;
+   qname_tmp = 
ldns_dname_new_frm_str("in-addr.arpa.");
+   status = ldns_dname_cat(qname, 
qname_tmp);
+   if (status != LDNS_STATUS_OK) {
+   error("%s", "could not create 
reverse address for ip4: %s\n", ldns_get_errorstr_by_id(status));
+   }
+   ldns_rdf_deep_free(qname_tmp);
}
-   ldns_rdf_deep_free(qname_tmp);
}
if (!qname) {
error("%s", "-x implies an ip address");
___
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: r363140 - head/usr.bin/mkimg

2020-07-12 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Jul 13 02:24:31 2020
New Revision: 363140
URL: https://svnweb.freebsd.org/changeset/base/363140

Log:
  Fix invalid VHDX generation for image larger than 4Gb
  
  - Part of BAT payload location was lost due to invalid
  BAT entry encoding type (32 bits instead of 64 bits)
  - The sequence of PB/SB entries in BAT was broken due to
  off-by-one index check. It worked for smaller than
  4Gb because there were no SB entries in BAT.
  
  MFC after:1 day

Modified:
  head/usr.bin/mkimg/vhdx.c

Modified: head/usr.bin/mkimg/vhdx.c
==
--- head/usr.bin/mkimg/vhdx.c   Mon Jul 13 02:09:21 2020(r363139)
+++ head/usr.bin/mkimg/vhdx.c   Mon Jul 13 02:24:31 2020(r363140)
@@ -429,7 +429,7 @@ vhdx_write_bat(int fd, uint64_t image_size)
payload_offset = 3 + (bat_size / SIZE_1MB);
bat_ptr = 0;
for (idx = 0; idx < data_block_count; idx++) {
-   le32enc(bat + bat_ptr,
+   le64enc(bat + bat_ptr,
BAT_ENTRY(payload_offset, PAYLOAD_BLOCK_FULLY_PRESENT));
bat_ptr += 8;
payload_offset += (PAYLOAD_BLOCK_SIZE / SIZE_1MB);
@@ -445,9 +445,9 @@ vhdx_write_bat(int fd, uint64_t image_size)
bat_ptr = 0;
}
 
-   if ((idx % chunk_ratio) == 0 &&
-   (idx > 0) && (idx != data_block_count - 1)) {
-   le32enc(bat + bat_ptr,
+   if (((idx + 1) % chunk_ratio) == 0 &&
+   (idx != data_block_count - 1)) {
+   le64enc(bat + bat_ptr,
BAT_ENTRY(0, SB_BLOCK_NOT_PRESENT));
bat_ptr += 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"


Re: svn commit: r362736 - head/sys/arm64/rockchip

2020-07-06 Thread Oleksandr Tymoshenko
Peter Jeremy (pe...@rulingia.com) wrote:
> On 2020-Jul-02 17:26:23 -0700, Oleksandr Tymoshenko  wrote:
> >Could you try kernel with this patch? It's mostly debug output,
> >with one possible clock-related fix.
> >
> >https://people.freebsd.org/~gonzo/patches/rk3328-gmac-debug.patch
> 
> It's still not working for me.  I get the following:
> dwc0:  mem 0xff54-0xff54 irq 44 
> on ofwbus0
> setting RK3328 RX/TX delays:  24/36
> >>> RK3328_GRF_MAC_CON1 (0413):
> >>> gmac2io_gmii_clk_sel: 0x0
> >>> gmac2io_rmii_extclk_sel: 0x1
> >>> gmac2io_rmii_mode: 0x0
> >>> gmac2io_rmii_clk_sel: 0x0
> >>> gmac2io_phy_intf_sel: 0x1
> >>> gmac2io_flowctrl: 0x0
> >>> gmac2io_rxclk_dly_ena: 0x1
> >>> gmac2io_txclk_dly_ena: 0x1
> >>> RK3328_GRF_MAC_CON0 (0c24):
> miibus0:  on dwc0
> rgephy0:  PHY 0 on miibus0
> rgephy0: OUI 0x00e04c, model 0x0011, rev. 6
> rgephy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 
> 1000baseT-FDX, 1000baseT-FDX-master, auto

Thanks for running the test. Register values seem OK :(
 
> >I have Rock64 v2, which, as you mentioned, has a known issue with GigE, so
> >my tests are not reliable. I'll try to get another RK3328 board for tests,
> >but it may take some time.
> 
> I've asked on -arm if anyone else has tried this on a Rock64 v2 or v3.
> 
> >If the clock fix doesn't help, I'll make
> >delays configuration run-time configurable with off by default until
> >more hardware is tested.
> 
> That sounds like a good way forward - maybe boot and run-time configurable.
> It's a pity that there doesn't seem to be any documentation on what the
> numbers represent (or what the "default" value is) - which means that
> actually adjusting the delay numbers would be very time consuming.

There are no "default" values AFAIK. They depend on the board schematics.
I was told that Rockhip partners use some kind of proprietary tool
which they feed with values based on the scematics (like trace lengths)
and tool calculates delays.

With boot-time or run-time configuration I think it's possible to
automate the search for good value. Something like this:
https://github.com/ayufan-rock64/linux-build/blob/master/recipes/gmac-delays-test/range-test

but with loader.conf modifications instead of DTB

-- 
gonzo
___
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: r362736 - head/sys/arm64/rockchip

2020-07-02 Thread Oleksandr Tymoshenko
Peter Jeremy (pe...@rulingia.com) wrote:
> On 2020-Jul-01 18:57:47 +1000, Peter Jeremy  wrote:
> >On 2020-Jun-28 21:11:10 +, Oleksandr Tymoshenko  
> >wrote:
> >>Log:
> >>  Configure rx_delay/tx_delay values for RK3399/RK3328 GMAC
> >>  
> >>  For 1000Mb mode to work reliably TX/RX delays need to be configured
> >>  between the TX/RX clock and the respective signals on the PHY
> >>  to compensate for differing trace lengths on the PCB.
> >
> >This breaks (at least) diskless booting on my Rock64.
> 
> I've studied the RK3328 TRM[1] and the RK3328 code following r362736
> matches[2] the GRF_MAC_CON0/1 documentation on p201-203 (though p574
> says the delay line is configured via GRF_SOC_CON3 - which doesn't
> match the documentation on GRF_SOC_CON3 on p175-177).  That suggests
> that the delay values in the FDT are incorrect.  Unfortunately, the
> TRM doesn't include any details on how to configure the delay values
> so it's difficult to adjust the numbers in the FDT.
> 
> One possible explanation I have is that there are (at least) 2
> different Rock64 variants.  Later versions have increased the RGMII
> bus voltage to improve GigE reliability.  I initially had problems
> with GigE reliability and mod'd my Rock64[3] to use the higher RGMII
> bus voltage - which made it rock solid at GigE.  It's possible that
> different variants need different delay values, due to different track
> skew or different driver behaviour at different bus voltages.
> 
> [1] Rockchip_RK3328TRM_V1.1-Part1-20170321.pdf
> [2] There's one typo: RK3328_GRF_MAC_CON0_TX_MASK instead of
> RK3328_GRF_MAC_CON0_RX_MASK but the values are the same).
> [3] Move 1 resistor to change a pull-up to a pull-down

Hi Peter,

Could you try kernel with this patch? It's mostly debug output,
with one possible clock-related fix.

https://people.freebsd.org/~gonzo/patches/rk3328-gmac-debug.patch

I have Rock64 v2, which, as you mentioned, has a known issue with GigE, so
my tests are not reliable. I'll try to get another RK3328 board for tests,
but it may take some time. If the clock fix doesn't help, I'll make
delays configuration run-time configurable with off by default until
more hardware is tested.

-- 
gonzo
___
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: r362817 - in head/sys: arm/freescale/imx arm64/conf arm64/freescale arm64/freescale/imx arm64/freescale/imx/clk conf dev/ffec dev/uart modules/dtb/imx8

2020-06-30 Thread Oleksandr Tymoshenko
ff < best_diff) {
+   best = cur;
+   best_diff = diff;
+   best_pre_div = pre_div;
+   best_post_div = pre_div;
+   best_parent = p_idx;
+   dprintf("Best parent so far %s (%d) with best freq at "
+   "%ju\n", clknode_get_name(p_clk), p_idx, best);
+   }
+   }
+
+   *stop = 1;
+   if (best_diff == INT64_MAX)
+   return (ERANGE);
+
+   if ((flags & CLK_SET_DRYRUN) != 0) {
+   *fout = best;
+   return (0);
+   }
+
+   p_idx = clknode_get_parent_idx(clk);
+   if (p_idx != best_parent) {
+   dprintf("Switching parent index from %d to %d\n", p_idx,
+   best_parent);
+   clknode_set_parent_by_idx(clk, best_parent);
+   }
+
+   dprintf("Setting dividers to pre=%d, post=%d\n", best_pre_div, 
best_post_div);
+
+   DEVICE_LOCK(clk);
+   READ4(clk, sc->offset, &val);
+   val &= ~(TARGET_ROOT_PRE_PODF_MASK | TARGET_ROOT_POST_PODF_MASK);
+   val |= TARGET_ROOT_PRE_PODF(pre_div);
+   val |= TARGET_ROOT_POST_PODF(post_div);
+   DEVICE_UNLOCK(clk);
+
+   *fout = best;
+   return (0);
+}
+
+static clknode_method_t imx_clk_composite_clknode_methods[] = {
+   /* Device interface */
+   CLKNODEMETHOD(clknode_init, imx_clk_composite_init),
+   CLKNODEMETHOD(clknode_set_gate, imx_clk_composite_set_gate),
+   CLKNODEMETHOD(clknode_set_mux,  imx_clk_composite_set_mux),
+   CLKNODEMETHOD(clknode_recalc_freq,  imx_clk_composite_recalc),
+   CLKNODEMETHOD(clknode_set_freq, imx_clk_composite_set_freq),
+   CLKNODEMETHOD_END
+};
+
+DEFINE_CLASS_1(imx_clk_composite_clknode, imx_clk_composite_clknode_class,
+imx_clk_composite_clknode_methods, sizeof(struct imx_clk_composite_sc),
+clknode_class);
+
+int
+imx_clk_composite_register(struct clkdom *clkdom,
+struct imx_clk_composite_def *clkdef)
+{
+   struct clknode *clk;
+   struct imx_clk_composite_sc *sc;
+
+   clk = clknode_create(clkdom, &imx_clk_composite_clknode_class,
+   &clkdef->clkdef);
+   if (clk == NULL)
+   return (1);
+
+   sc = clknode_get_softc(clk);
+
+   sc->offset = clkdef->offset;
+   sc->flags = clkdef->flags;
+
+   clknode_register(clkdom, clk);
+
+   return (0);
+}

Added: head/sys/arm64/freescale/imx/clk/imx_clk_composite.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm64/freescale/imx/clk/imx_clk_composite.hWed Jul  1 
00:33:16 2020(r362817)
@@ -0,0 +1,45 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright 2018 Emmanuel Vadot 
+ *
+ * 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.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _IMX_CLK_COMPOSITE_H_
+#define _IMX_CLK_COMPOSITE_H_
+
+#include 
+
+struct imx_clk_composite_def {
+   struct clknode_init_def clkdef;
+
+   uint32_toffset;
+   uint32_tflags;
+};
+
+int imx_clk_composite_register(struct clkdom *clkdom,
+struct imx_clk_composite_def *clkdef);
+
+#endif /* _IMX_CLK_COMPOSITE_H_ */

Added: head/sys/arm64/freescale/imx/clk/imx_clk_frac_pll.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm64/freescale/imx/clk/imx_clk_frac_pll.c Wed Jul  1 00:33:16 
2020(r362817)
@@ -0,0 

svn commit: r362776 - stable/12/usr.bin/mkimg/tests

2020-06-29 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Jun 29 08:14:45 2020
New Revision: 362776
URL: https://svnweb.freebsd.org/changeset/base/362776

Log:
  MFC r344957:
  
  Don't compress and uuencode the "hexdump -C" output files.  Just
  save them with the $FreeBSD$ tag prepended.  Changes to these
  files are now a lot easier to comprehend, which makes diffs also
  reviewable.

Added:
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow2.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow2.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-apm.raw.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-apm.raw.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-apm.vhd.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-apm.vhd.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdf.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdf.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-apm.vmdk.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-apm.vmdk.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow2.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow2.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-bsd.raw.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-bsd.raw.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhd.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhd.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdf.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdf.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-bsd.vmdk.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-bsd.vmdk.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-ebr.qcow.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-ebr.qcow.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-ebr.qcow2.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-ebr.qcow2.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-ebr.raw.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-ebr.raw.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhd.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhd.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhdf.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhdf.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-ebr.vmdk.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-ebr.vmdk.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-mbr.qcow.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-mbr.qcow.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-mbr.qcow2.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-mbr.qcow2.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-mbr.raw.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-mbr.raw.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhd.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhd.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhdf.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhdf.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-mbr.vmdk.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-mbr.vmdk.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.qcow.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.qcow.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.qc

svn commit: r362775 - stable/12/usr.bin/mkimg/tests

2020-06-29 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Jun 29 08:12:01 2020
New Revision: 362775
URL: https://svnweb.freebsd.org/changeset/base/362775

Log:
  Revert r362772. The proper fix is to merge format change commit from the HEAD

Added:
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-512-apm.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-1x1-512-apm.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-512-bsd.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-1x1-512-bsd.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-512-ebr.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-1x1-512-ebr.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-512-mbr.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-1x1-512-mbr.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-512-vtoc8.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-1x1-512-vtoc8.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-apm.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-63x255-4096-apm.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-bsd.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-63x255-4096-bsd.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-512-apm.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-63x255-512-apm.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-512-bsd.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-63x255-512-bsd.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-512-ebr.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-63x255-512-ebr.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-512-mbr.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-63x255-512-mbr.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-512-vtoc8.vhdx.hex
 - copied unchanged from r362771, 
stable/12/usr.bin/mkimg/tests/img-63x255-512-vtoc8.vhdx.hex
Deleted:
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdx.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdx.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhdx.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdx.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhdx.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhdx.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-512-apm.vhdx.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-512-bsd.vhdx.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-512-ebr.vhdx.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdx.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-512-mbr.vhdx.gz.uu
  stable/12/usr.bin/mkimg/tests/img-1x1-512-vtoc8.vhdx.gz.uu
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-apm.vhdx.gz.uu
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-bsd.vhdx.gz.uu
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhdx.gz.uu
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdx.gz.uu
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhdx.gz.uu
  stabl

svn commit: r362774 - stable/11/usr.bin/mkimg/tests

2020-06-29 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Jun 29 07:50:55 2020
New Revision: 362774
URL: https://svnweb.freebsd.org/changeset/base/362774

Log:
  MFC r344957:
  
  Don't compress and uuencode the "hexdump -C" output files.  Just
  save them with the $FreeBSD$ tag prepended.  Changes to these
  files are now a lot easier to comprehend, which makes diffs also
  reviewable.

Added:
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow2.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow2.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-apm.raw.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-apm.raw.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-apm.vhd.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-apm.vhd.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdf.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdf.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-apm.vmdk.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-apm.vmdk.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow2.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow2.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-bsd.raw.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-bsd.raw.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhd.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhd.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdf.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdf.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-bsd.vmdk.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-bsd.vmdk.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-ebr.qcow.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-ebr.qcow.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-ebr.qcow2.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-ebr.qcow2.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-ebr.raw.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-ebr.raw.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhd.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhd.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhdf.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhdf.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-ebr.vmdk.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-ebr.vmdk.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-mbr.qcow.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-mbr.qcow.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-mbr.qcow2.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-mbr.qcow2.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-mbr.raw.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-mbr.raw.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhd.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhd.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhdf.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhdf.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-mbr.vmdk.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-mbr.vmdk.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.qcow.hex
 - copied unchanged from r344957, 
head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.qcow.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.qc

Re: svn commit: r362767 - in stable/12/usr.bin/mkimg: . tests

2020-06-28 Thread Oleksandr Tymoshenko
Li-Wen Hsu (lw...@freebsd.org) wrote:
> On Mon, Jun 29, 2020 at 2:21 PM Oleksandr Tymoshenko  
> wrote:
> >
> > Li-Wen Hsu (lw...@freebsd.org) wrote:
> > > On Mon, Jun 29, 2020 at 8:36 AM Oleksandr Tymoshenko  
> > > wrote:
> > > >
> > > > Author: gonzo
> > > > Date: Mon Jun 29 00:34:11 2020
> > > > New Revision: 362767
> > > > URL: https://svnweb.freebsd.org/changeset/base/362767
> > > >
> > > > Log:
> > > >   MFC r361935:
> > > >
> > > >   Add VHDX support to mkimg(1)
> > > >
> > > >   VHDX is the successor of Microsoft's VHD file format. It increases
> > > >   maximum capacity of the virtual drive to 64TB and introduces features
> > > >   to better handle power/system failures.
> > > >
> > > >   VHDX is the required format for 2nd generation Hyper-V VMs.
> > > >
> > > >   Reviewed by:  marcel
> > > >   Differential Revision:https://reviews.freebsd.org/D25184
> > >
> > > Some mkimg(1) tests are failing after this merge:
> > >
> > > https://ci.freebsd.org/job/FreeBSD-stable-12-amd64-test/2484/
> > > https://ci.freebsd.org/job/FreeBSD-stable-12-i386-test/2466/
> > >
> > > Can you check if there are something related to tests also need merging?
> >
> > Ooops, sorry for the breakage. Should be fixed in 362772. The problem
> > was different format for the reference images. I'll wait to check if
> > the commit fixes the test suite on stable/12 for sure and commit fix
> > for stable/11 then.
> 
> Thank you for the quick analysis and fix. Perhaps mering the codes to
> process the new format of the reference images can easy the process of
> future update and MFH?

Good point. I assumed it was global change, but looks like it's just
mkimg format change. I'll look into merging it both to stable/12 (and
reverting current fix) and stable/11.

-- 
gonzo
___
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: r362767 - in stable/12/usr.bin/mkimg: . tests

2020-06-28 Thread Oleksandr Tymoshenko
Li-Wen Hsu (lw...@freebsd.org) wrote:
> On Mon, Jun 29, 2020 at 8:36 AM Oleksandr Tymoshenko  
> wrote:
> >
> > Author: gonzo
> > Date: Mon Jun 29 00:34:11 2020
> > New Revision: 362767
> > URL: https://svnweb.freebsd.org/changeset/base/362767
> >
> > Log:
> >   MFC r361935:
> >
> >   Add VHDX support to mkimg(1)
> >
> >   VHDX is the successor of Microsoft's VHD file format. It increases
> >   maximum capacity of the virtual drive to 64TB and introduces features
> >   to better handle power/system failures.
> >
> >   VHDX is the required format for 2nd generation Hyper-V VMs.
> >
> >   Reviewed by:  marcel
> >   Differential Revision:https://reviews.freebsd.org/D25184
> 
> Some mkimg(1) tests are failing after this merge:
> 
> https://ci.freebsd.org/job/FreeBSD-stable-12-amd64-test/2484/
> https://ci.freebsd.org/job/FreeBSD-stable-12-i386-test/2466/
> 
> Can you check if there are something related to tests also need merging?

Ooops, sorry for the breakage. Should be fixed in 362772. The problem
was different format for the reference images. I'll wait to check if
the commit fixes the test suite on stable/12 for sure and commit fix
for stable/11 then.

-- 
gonzo
___
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: r362771 - in stable/11/usr.bin/mkimg: . tests

2020-06-28 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Jun 29 05:03:03 2020
New Revision: 362771
URL: https://svnweb.freebsd.org/changeset/base/362771

Log:
  MFC r361935:
  
  Add VHDX support to mkimg(1)
  
  VHDX is the successor of Microsoft's VHD file format. It increases
  maximum capacity of the virtual drive to 64TB and introduces features
  to better handle power/system failures.
  
  VHDX is the required format for 2nd generation Hyper-V VMs.
  
  Reviewed by:  marcel
  Differential Revision:https://reviews.freebsd.org/D25184

Added:
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-512-apm.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-512-apm.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-512-bsd.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-512-bsd.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-512-ebr.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-512-ebr.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-512-mbr.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-512-mbr.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-1x1-512-vtoc8.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-512-vtoc8.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-63x255-4096-apm.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-4096-apm.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-63x255-4096-bsd.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-4096-bsd.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-63x255-512-apm.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-512-apm.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-63x255-512-bsd.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-512-bsd.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-63x255-512-ebr.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-512-ebr.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-63x255-512-mbr.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-512-mbr.vhdx.hex
  stable/11/usr.bin/mkimg/tests/img-63x255-512-vtoc8.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-512-vtoc8.vhdx.hex
  stable/11/usr.bin/mkimg/vhdx.c
 - copied, changed from r361935, head/usr.bin/mkimg/vhdx.c
Modified:
  stable/11/usr.bin/mkimg/Makefile
  stable/11/usr.bin/mkimg/mkimg.1
  stable/11/usr.bin/mkimg/tests/mkimg_test.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/mkimg/Makefile
==
--- stable/11/usr.bin/mkimg/MakefileMon Jun 29 03:23:13 2020
(r362770)
+++ stable/11/usr.bin/mkimg/MakefileMon Jun 29 05:03:03 2020
(r362771)
@@ -18,6 +18,7 @@ SRCS+= \
qcow.c \
raw.c \
vhd.c \
+   vhdx.c \
vmdk.c
 
 # List of schemes to support

Modified: stable/11/usr.bin/mkimg/mkimg.1
==
--- stable/11/usr.bin/mkimg/mki

svn commit: r362767 - in stable/12/usr.bin/mkimg: . tests

2020-06-28 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Jun 29 00:34:11 2020
New Revision: 362767
URL: https://svnweb.freebsd.org/changeset/base/362767

Log:
  MFC r361935:
  
  Add VHDX support to mkimg(1)
  
  VHDX is the successor of Microsoft's VHD file format. It increases
  maximum capacity of the virtual drive to 64TB and introduces features
  to better handle power/system failures.
  
  VHDX is the required format for 2nd generation Hyper-V VMs.
  
  Reviewed by:  marcel
  Differential Revision:https://reviews.freebsd.org/D25184

Added:
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-512-apm.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-512-apm.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-512-bsd.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-512-bsd.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-512-ebr.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-512-ebr.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-512-mbr.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-512-mbr.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-1x1-512-vtoc8.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-1x1-512-vtoc8.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-apm.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-4096-apm.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-bsd.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-4096-bsd.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-512-apm.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-512-apm.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-512-bsd.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-512-bsd.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-512-ebr.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-512-ebr.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-512-mbr.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-512-mbr.vhdx.hex
  stable/12/usr.bin/mkimg/tests/img-63x255-512-vtoc8.vhdx.hex
 - copied unchanged from r361935, 
head/usr.bin/mkimg/tests/img-63x255-512-vtoc8.vhdx.hex
  stable/12/usr.bin/mkimg/vhdx.c
 - copied unchanged from r361935, head/usr.bin/mkimg/vhdx.c
Modified:
  stable/12/usr.bin/mkimg/Makefile
  stable/12/usr.bin/mkimg/mkimg.1
  stable/12/usr.bin/mkimg/tests/mkimg_test.sh
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/mkimg/Makefile
==
--- stable/12/usr.bin/mkimg/MakefileMon Jun 29 00:32:24 2020
(r362766)
+++ stable/12/usr.bin/mkimg/MakefileMon Jun 29 00:34:11 2020
(r362767)
@@ -18,6 +18,7 @@ SRCS+= \
qcow.c \
raw.c \
vhd.c \
+   vhdx.c \
vmdk.c
 
 # List of schemes to support

Modified: stable/12/usr.bin/mkimg/mkimg.1
==
--- stable/12/usr.bin/mkimg/mk

svn commit: r362743 - in stable/12/sys: arm/freescale/imx dev/hdmi

2020-06-28 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Jun 29 00:28:11 2020
New Revision: 362743
URL: https://svnweb.freebsd.org/changeset/base/362743

Log:
  MFC r362029-r362030
  
  r362029:
  Fix reading EDID on TVs/monitors without E-DCC support
  
  Writing segment id to I2C device 0x30 only required if the segment is
  non-zero. On the devices without E-DCC support writing to that address
  fails and whole transaction then fails too. To avoid this do
  not attempt write to the segment selection device unless required.
  
  r362030:
  Add mode selection to iMX6 IPU driver
  
  - Configure ipu1_di0 tob e sourced from the VIDEO_PLL(PLL5) and hardcode
frequency to (45500/3)Mhz. This value, further divided, can yield
frequencies close enough to support 1080p, 720p, 1024x768, and 640x480
modes. This is not ideal but it's an improvement comparing to the only
hardcoded 1024x768 mode.
  
  - Fix memory leaks if attach method failed
  - Print EDID when -v passed to the kernel

Modified:
  stable/12/sys/arm/freescale/imx/imx6_ccm.c
  stable/12/sys/arm/freescale/imx/imx6_ccmreg.h
  stable/12/sys/arm/freescale/imx/imx6_ipu.c
  stable/12/sys/arm/freescale/imx/imx_ccmvar.h
  stable/12/sys/dev/hdmi/dwc_hdmi.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm/freescale/imx/imx6_ccm.c
==
--- stable/12/sys/arm/freescale/imx/imx6_ccm.c  Sun Jun 28 22:04:52 2020
(r362742)
+++ stable/12/sys/arm/freescale/imx/imx6_ccm.c  Mon Jun 29 00:28:11 2020
(r362743)
@@ -393,6 +393,53 @@ imx_ccm_ahb_hz(void)
return (13200);
 }
 
+int
+imx_ccm_pll_video_enable(void)
+{
+   uint32_t reg;
+   int timeout;
+
+   /* Power down PLL */
+   reg = RD4(ccm_sc, CCM_ANALOG_PLL_VIDEO);
+   reg &= ~CCM_ANALOG_PLL_VIDEO_POWERDOWN;
+   WR4(ccm_sc, CCM_ANALOG_PLL_VIDEO, reg);
+
+   /*
+* Fvideo = Fref * (37 + 11/12) / 2
+* Fref = 24MHz, Fvideo = 455MHz
+*/
+   reg &= ~CCM_ANALOG_PLL_VIDEO_POST_DIV_SELECT_MASK;
+   reg |= CCM_ANALOG_PLL_VIDEO_POST_DIV_2;
+   reg &= ~CCM_ANALOG_PLL_VIDEO_DIV_SELECT_MASK;
+   reg |= 37 << CCM_ANALOG_PLL_VIDEO_DIV_SELECT_SHIFT;
+   WR4(ccm_sc, CCM_ANALOG_PLL_VIDEO, reg);
+
+   WR4(ccm_sc, CCM_ANALOG_PLL_VIDEO_NUM, 11);
+   WR4(ccm_sc, CCM_ANALOG_PLL_VIDEO_DENOM, 12);
+
+   /* Power up and wait for PLL lock down */
+   reg = RD4(ccm_sc, CCM_ANALOG_PLL_VIDEO);
+   reg &= ~CCM_ANALOG_PLL_VIDEO_POWERDOWN;
+   WR4(ccm_sc, CCM_ANALOG_PLL_VIDEO, reg);
+
+   for (timeout = 10; timeout > 0; timeout--) {
+   if (RD4(ccm_sc, CCM_ANALOG_PLL_VIDEO) &
+  CCM_ANALOG_PLL_VIDEO_LOCK) {
+   break;
+   }
+   }
+   if (timeout <= 0) {
+   return ETIMEDOUT;
+   }
+
+   /* Enable the PLL */
+   reg |= CCM_ANALOG_PLL_VIDEO_ENABLE;
+   reg &= ~CCM_ANALOG_PLL_VIDEO_BYPASS;
+   WR4(ccm_sc, CCM_ANALOG_PLL_VIDEO, reg);
+
+   return (0);
+}
+
 void
 imx_ccm_ipu_enable(int ipu)
 {
@@ -406,8 +453,26 @@ imx_ccm_ipu_enable(int ipu)
else
reg |= CCGR3_IPU2_IPU | CCGR3_IPU2_DI0;
WR4(sc, CCM_CCGR3, reg);
+
+   /* Set IPU1_DI0 clock to source from PLL5 and divide it by 3 */
+   reg = RD4(sc, CCM_CHSCCDR);
+   reg &= ~(CHSCCDR_IPU1_DI0_PRE_CLK_SEL_MASK |
+   CHSCCDR_IPU1_DI0_PODF_MASK | CHSCCDR_IPU1_DI0_CLK_SEL_MASK);
+   reg |= (CHSCCDR_PODF_DIVIDE_BY_3 << CHSCCDR_IPU1_DI0_PODF_SHIFT);
+   reg |= (CHSCCDR_IPU_PRE_CLK_PLL5 << CHSCCDR_IPU1_DI0_PRE_CLK_SEL_SHIFT);
+   WR4(sc, CCM_CHSCCDR, reg);
+
+   reg |= (CHSCCDR_CLK_SEL_PREMUXED << CHSCCDR_IPU1_DI0_CLK_SEL_SHIFT);
+   WR4(sc, CCM_CHSCCDR, reg);
 }
 
+uint32_t
+imx_ccm_ipu_hz(void)
+{
+
+   return (45500 / 3);
+}
+
 void
 imx_ccm_hdmi_enable(void)
 {
@@ -418,16 +483,6 @@ imx_ccm_hdmi_enable(void)
reg = RD4(sc, CCM_CCGR2);
reg |= CCGR2_HDMI_TX | CCGR2_HDMI_TX_ISFR;
WR4(sc, CCM_CCGR2, reg);
-
-   /* Set HDMI clock to 280MHz */
-   reg = RD4(sc, CCM_CHSCCDR);
-   reg &= ~(CHSCCDR_IPU1_DI0_PRE_CLK_SEL_MASK |
-   CHSCCDR_IPU1_DI0_PODF_MASK | CHSCCDR_IPU1_DI0_CLK_SEL_MASK);
-   reg |= (CHSCCDR_PODF_DIVIDE_BY_3 << CHSCCDR_IPU1_DI0_PODF_SHIFT);
-   reg |= (CHSCCDR_IPU_PRE_CLK_540M_PFD << 
CHSCCDR_IPU1_DI0_PRE_CLK_SEL_SHIFT);
-   WR4(sc, CCM_CHSCCDR, reg);
-   reg |= (CHSCCDR_CLK_SEL_LDB_DI0 << CHSCCDR_IPU1_DI0_CLK_SEL_SHIFT);
-   WR4(sc, CCM_CHSCCDR, reg);
 }
 
 uint32_t

Modified: stable/12/sys/arm/freescale/imx/imx6_ccmreg.h
==
--- stable/12/sys/arm/freescale/imx/imx6_ccmreg.h   Sun Jun 28 22:04:52 
2020(r362742)
+++ stable/12/sys/arm/freescale/imx/imx6_ccmreg.h   Mon Jun 29 00:28:11 
2020(r362743)
@@ -64,9 +64,12 @@
 #define  CHSCCDR_IPU1_D

svn commit: r362736 - head/sys/arm64/rockchip

2020-06-28 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Jun 28 21:11:10 2020
New Revision: 362736
URL: https://svnweb.freebsd.org/changeset/base/362736

Log:
  Configure rx_delay/tx_delay values for RK3399/RK3328 GMAC
  
  For 1000Mb mode to work reliably TX/RX delays need to be configured
  between the TX/RX clock and the respective signals on the PHY
  to compensate for differing trace lengths on the PCB.
  
  Reviewed by:  manu
  MFC after:1 week

Modified:
  head/sys/arm64/rockchip/if_dwc_rk.c

Modified: head/sys/arm64/rockchip/if_dwc_rk.c
==
--- head/sys/arm64/rockchip/if_dwc_rk.c Sun Jun 28 18:56:32 2020
(r362735)
+++ head/sys/arm64/rockchip/if_dwc_rk.c Sun Jun 28 21:11:10 2020
(r362736)
@@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$");
 #define RK3328_GRF_MAC_CON0_RX_SHIFT   7
 
 #defineRK3328_GRF_MAC_CON1 0x0904
+#define RK3328_GRF_MAC_CON1_RX_ENA (1 << 1)
+#define RK3328_GRF_MAC_CON1_TX_ENA (1 << 0)
 #defineRK3328_GRF_MAC_CON2 0x0908
 #defineRK3328_GRF_MACPHY_CON0  0x0B00
 #defineRK3328_GRF_MACPHY_CON1  0x0B04
@@ -71,7 +73,6 @@ static struct ofw_compat_data compat_data[] = {
{NULL,   0}
 };
 
-#ifdef notyet
 static void
 rk3328_set_delays(struct syscon *grf, phandle_t node)
 {
@@ -82,22 +83,26 @@ rk3328_set_delays(struct syscon *grf, phandle_t node)
if (OF_getencprop(node, "rx_delay", &rx, sizeof(rx)) <= 0)
rx = 0x10;
 
+   if (bootverbose)
+   printf("setting RK3328 RX/TX delays:  %d/%d\n", rx, tx);
tx = ((tx & RK3328_GRF_MAC_CON0_TX_MASK) <<
RK3328_GRF_MAC_CON0_TX_SHIFT);
rx = ((rx & RK3328_GRF_MAC_CON0_TX_MASK) <<
RK3328_GRF_MAC_CON0_RX_SHIFT);
 
SYSCON_WRITE_4(grf, RK3328_GRF_MAC_CON0, tx | rx | 0x);
+   SYSCON_WRITE_4(grf, RK3328_GRF_MAC_CON1, RK3328_GRF_MAC_CON1_TX_ENA | 
RK3328_GRF_MAC_CON1_RX_ENA | 
+   ((RK3328_GRF_MAC_CON1_TX_ENA | RK3328_GRF_MAC_CON1_RX_ENA) << 16));
 }
-#endif
 
 #defineRK3399_GRF_SOC_CON6 0xc218
+#define RK3399_GRF_SOC_CON6_TX_ENA (1 << 7)
 #define RK3399_GRF_SOC_CON6_TX_MASK0x7F
 #define RK3399_GRF_SOC_CON6_TX_SHIFT   0
 #define RK3399_GRF_SOC_CON6_RX_MASK0x7F
+#define RK3399_GRF_SOC_CON6_RX_ENA (1 << 15)
 #define RK3399_GRF_SOC_CON6_RX_SHIFT   8
 
-#ifdef notyet
 static void
 rk3399_set_delays(struct syscon *grf, phandle_t node)
 {
@@ -108,14 +113,15 @@ rk3399_set_delays(struct syscon *grf, phandle_t node)
if (OF_getencprop(node, "rx_delay", &rx, sizeof(rx)) <= 0)
rx = 0x10;
 
+   if (bootverbose)
+   printf("setting RK3399 RX/TX delays:  %d/%d\n", rx, tx);
tx = ((tx & RK3399_GRF_SOC_CON6_TX_MASK) <<
-   RK3399_GRF_SOC_CON6_TX_SHIFT);
+   RK3399_GRF_SOC_CON6_TX_SHIFT) | RK3399_GRF_SOC_CON6_TX_ENA;
rx = ((rx & RK3399_GRF_SOC_CON6_TX_MASK) <<
-   RK3399_GRF_SOC_CON6_RX_SHIFT);
+   RK3399_GRF_SOC_CON6_RX_SHIFT) | RK3399_GRF_SOC_CON6_RX_ENA;
 
SYSCON_WRITE_4(grf, RK3399_GRF_SOC_CON6, tx | rx | 0x);
 }
-#endif
 
 static int
 if_dwc_rk_probe(device_t dev)
@@ -144,12 +150,10 @@ if_dwc_rk_init(device_t dev)
return (ENXIO);
}
 
-#ifdef notyet
if (ofw_bus_is_compatible(dev, "rockchip,rk3399-gmac"))
rk3399_set_delays(grf, node);
else if (ofw_bus_is_compatible(dev, "rockchip,rk3328-gmac"))
rk3328_set_delays(grf, node);
-#endif
 
/* Mode should be set according to dtb property */
 
___
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: r362516 - head/contrib/ldns/drill

2020-06-22 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Jun 22 23:13:14 2020
New Revision: 362516
URL: https://svnweb.freebsd.org/changeset/base/362516

Log:
  Fix crash in drill(1) when IP has two subsequent dots
  
  Cherry-pick crash fix from the upstream repo
  
  PR:   226575
  Reported by:  Goran Mekić 
  Obtained from:https://git.nlnetlabs.nl/ldns/commit/?id=98291475
  MFC after:2 weeks

Modified:
  head/contrib/ldns/drill/drill.c

Modified: head/contrib/ldns/drill/drill.c
==
--- head/contrib/ldns/drill/drill.c Mon Jun 22 22:59:03 2020
(r362515)
+++ head/contrib/ldns/drill/drill.c Mon Jun 22 23:13:14 2020
(r362516)
@@ -787,15 +787,17 @@ main(int argc, char *argv[])
qname = ldns_dname_new_frm_str(ip6_arpa_str);
} else {
qname = ldns_dname_new_frm_str(name);
-   qname_tmp = ldns_dname_reverse(qname);
-   ldns_rdf_deep_free(qname);
-   qname = qname_tmp;
-   qname_tmp = 
ldns_dname_new_frm_str("in-addr.arpa.");
-   status = ldns_dname_cat(qname, qname_tmp);
-   if (status != LDNS_STATUS_OK) {
-   error("%s", "could not create reverse 
address for ip4: %s\n", ldns_get_errorstr_by_id(status));
+   if (qname) {
+   qname_tmp = ldns_dname_reverse(qname);
+   ldns_rdf_deep_free(qname);
+   qname = qname_tmp;
+   qname_tmp = 
ldns_dname_new_frm_str("in-addr.arpa.");
+   status = ldns_dname_cat(qname, 
qname_tmp);
+   if (status != LDNS_STATUS_OK) {
+   error("%s", "could not create 
reverse address for ip4: %s\n", ldns_get_errorstr_by_id(status));
+   }
+   ldns_rdf_deep_free(qname_tmp);
}
-   ldns_rdf_deep_free(qname_tmp);
}
if (!qname) {
error("%s", "-x implies an ip address");
___
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: r362029 - head/sys/dev/hdmi

2020-06-11 Thread Oleksandr Tymoshenko
Rodney W. Grimes (free...@gndrsh.dnsmgr.net) wrote:
> > Author: gonzo
> > Date: Wed Jun 10 21:38:35 2020
> > New Revision: 362029
> > URL: https://svnweb.freebsd.org/changeset/base/362029
> > 
> > Log:
> >   Fix reading EDID on TVs/monitors without E-DCC support
> >   
> >   Writing segment id to I2C device 0x30 only required if the segment is
> >   non-zero. On the devices without E-DCC support writing to that address
> >   fails and whole transaction then fails too. To avoid this do
> >   not attempt write to the segment selection device unless required.
> >   
> >   MFC after:2 weeks
> 
> Is it possible that this bad write is what has caused me to corrupt
> the EDID of 3 monitors over the last year while using a Display
> Port to HDMI cable on them?

Very unlikely. This write just sets segment index for the following
EDID read. 

Also the driver is used only on iMX6 and MIPS Creator CI20.

-- 
gonzo
___
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: r362030 - head/sys/arm/freescale/imx

2020-06-10 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed Jun 10 22:00:31 2020
New Revision: 362030
URL: https://svnweb.freebsd.org/changeset/base/362030

Log:
  Add mode selection to iMX6 IPU driver
  
  - Configure ipu1_di0 tob e sourced from the VIDEO_PLL(PLL5) and hardcode
frequency to (45500/3)Mhz. This value, further divided, can yield
frequencies close enough to support 1080p, 720p, 1024x768, and 640x480
modes. This is not ideal but it's an improvement comparing to the only
hardcoded 1024x768 mode.
  
  - Fix memory leaks if attach method failed
  - Print EDID when -v passed to the kernel

Modified:
  head/sys/arm/freescale/imx/imx6_ccm.c
  head/sys/arm/freescale/imx/imx6_ccmreg.h
  head/sys/arm/freescale/imx/imx6_ipu.c
  head/sys/arm/freescale/imx/imx_ccmvar.h

Modified: head/sys/arm/freescale/imx/imx6_ccm.c
==
--- head/sys/arm/freescale/imx/imx6_ccm.c   Wed Jun 10 21:38:35 2020
(r362029)
+++ head/sys/arm/freescale/imx/imx6_ccm.c   Wed Jun 10 22:00:31 2020
(r362030)
@@ -393,6 +393,53 @@ imx_ccm_ahb_hz(void)
return (13200);
 }
 
+int
+imx_ccm_pll_video_enable(void)
+{
+   uint32_t reg;
+   int timeout;
+
+   /* Power down PLL */
+   reg = RD4(ccm_sc, CCM_ANALOG_PLL_VIDEO);
+   reg &= ~CCM_ANALOG_PLL_VIDEO_POWERDOWN;
+   WR4(ccm_sc, CCM_ANALOG_PLL_VIDEO, reg);
+
+   /*
+* Fvideo = Fref * (37 + 11/12) / 2
+* Fref = 24MHz, Fvideo = 455MHz
+*/
+   reg &= ~CCM_ANALOG_PLL_VIDEO_POST_DIV_SELECT_MASK;
+   reg |= CCM_ANALOG_PLL_VIDEO_POST_DIV_2;
+   reg &= ~CCM_ANALOG_PLL_VIDEO_DIV_SELECT_MASK;
+   reg |= 37 << CCM_ANALOG_PLL_VIDEO_DIV_SELECT_SHIFT;
+   WR4(ccm_sc, CCM_ANALOG_PLL_VIDEO, reg);
+
+   WR4(ccm_sc, CCM_ANALOG_PLL_VIDEO_NUM, 11);
+   WR4(ccm_sc, CCM_ANALOG_PLL_VIDEO_DENOM, 12);
+
+   /* Power up and wait for PLL lock down */
+   reg = RD4(ccm_sc, CCM_ANALOG_PLL_VIDEO);
+   reg &= ~CCM_ANALOG_PLL_VIDEO_POWERDOWN;
+   WR4(ccm_sc, CCM_ANALOG_PLL_VIDEO, reg);
+
+   for (timeout = 10; timeout > 0; timeout--) {
+   if (RD4(ccm_sc, CCM_ANALOG_PLL_VIDEO) &
+  CCM_ANALOG_PLL_VIDEO_LOCK) {
+   break;
+   }
+   }
+   if (timeout <= 0) {
+   return ETIMEDOUT;
+   }
+
+   /* Enable the PLL */
+   reg |= CCM_ANALOG_PLL_VIDEO_ENABLE;
+   reg &= ~CCM_ANALOG_PLL_VIDEO_BYPASS;
+   WR4(ccm_sc, CCM_ANALOG_PLL_VIDEO, reg);
+
+   return (0);
+}
+
 void
 imx_ccm_ipu_enable(int ipu)
 {
@@ -406,8 +453,26 @@ imx_ccm_ipu_enable(int ipu)
else
reg |= CCGR3_IPU2_IPU | CCGR3_IPU2_DI0;
WR4(sc, CCM_CCGR3, reg);
+
+   /* Set IPU1_DI0 clock to source from PLL5 and divide it by 3 */
+   reg = RD4(sc, CCM_CHSCCDR);
+   reg &= ~(CHSCCDR_IPU1_DI0_PRE_CLK_SEL_MASK |
+   CHSCCDR_IPU1_DI0_PODF_MASK | CHSCCDR_IPU1_DI0_CLK_SEL_MASK);
+   reg |= (CHSCCDR_PODF_DIVIDE_BY_3 << CHSCCDR_IPU1_DI0_PODF_SHIFT);
+   reg |= (CHSCCDR_IPU_PRE_CLK_PLL5 << CHSCCDR_IPU1_DI0_PRE_CLK_SEL_SHIFT);
+   WR4(sc, CCM_CHSCCDR, reg);
+
+   reg |= (CHSCCDR_CLK_SEL_PREMUXED << CHSCCDR_IPU1_DI0_CLK_SEL_SHIFT);
+   WR4(sc, CCM_CHSCCDR, reg);
 }
 
+uint32_t
+imx_ccm_ipu_hz(void)
+{
+
+   return (45500 / 3);
+}
+
 void
 imx_ccm_hdmi_enable(void)
 {
@@ -418,16 +483,6 @@ imx_ccm_hdmi_enable(void)
reg = RD4(sc, CCM_CCGR2);
reg |= CCGR2_HDMI_TX | CCGR2_HDMI_TX_ISFR;
WR4(sc, CCM_CCGR2, reg);
-
-   /* Set HDMI clock to 280MHz */
-   reg = RD4(sc, CCM_CHSCCDR);
-   reg &= ~(CHSCCDR_IPU1_DI0_PRE_CLK_SEL_MASK |
-   CHSCCDR_IPU1_DI0_PODF_MASK | CHSCCDR_IPU1_DI0_CLK_SEL_MASK);
-   reg |= (CHSCCDR_PODF_DIVIDE_BY_3 << CHSCCDR_IPU1_DI0_PODF_SHIFT);
-   reg |= (CHSCCDR_IPU_PRE_CLK_540M_PFD << 
CHSCCDR_IPU1_DI0_PRE_CLK_SEL_SHIFT);
-   WR4(sc, CCM_CHSCCDR, reg);
-   reg |= (CHSCCDR_CLK_SEL_LDB_DI0 << CHSCCDR_IPU1_DI0_CLK_SEL_SHIFT);
-   WR4(sc, CCM_CHSCCDR, reg);
 }
 
 uint32_t

Modified: head/sys/arm/freescale/imx/imx6_ccmreg.h
==
--- head/sys/arm/freescale/imx/imx6_ccmreg.hWed Jun 10 21:38:35 2020
(r362029)
+++ head/sys/arm/freescale/imx/imx6_ccmreg.hWed Jun 10 22:00:31 2020
(r362030)
@@ -64,9 +64,12 @@
 #define  CHSCCDR_IPU1_DI0_PODF_SHIFT 3
 #define  CHSCCDR_IPU1_DI0_CLK_SEL_MASK   (0x7)
 #define  CHSCCDR_IPU1_DI0_CLK_SEL_SHIFT  0
+#define  CHSCCDR_CLK_SEL_PREMUXED0
 #define  CHSCCDR_CLK_SEL_LDB_DI0 3
 #define  CHSCCDR_PODF_DIVIDE_BY_32
+#define  CHSCCDR_PODF_DIVIDE_BY_10
 #define  CHSCCDR_IPU_PRE_CLK_540M_PFD5
+#define  CHSCCDR_IPU_PRE_CLK_PLL52
 #define  

svn commit: r362029 - head/sys/dev/hdmi

2020-06-10 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed Jun 10 21:38:35 2020
New Revision: 362029
URL: https://svnweb.freebsd.org/changeset/base/362029

Log:
  Fix reading EDID on TVs/monitors without E-DCC support
  
  Writing segment id to I2C device 0x30 only required if the segment is
  non-zero. On the devices without E-DCC support writing to that address
  fails and whole transaction then fails too. To avoid this do
  not attempt write to the segment selection device unless required.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/hdmi/dwc_hdmi.c

Modified: head/sys/dev/hdmi/dwc_hdmi.c
==
--- head/sys/dev/hdmi/dwc_hdmi.cWed Jun 10 21:18:19 2020
(r362028)
+++ head/sys/dev/hdmi/dwc_hdmi.cWed Jun 10 21:38:35 2020
(r362029)
@@ -658,6 +658,11 @@ hdmi_edid_read(struct dwc_hdmi_softc *sc, int block, u
int result;
uint8_t addr = block & 1 ? EDID_LENGTH : 0;
uint8_t segment = block >> 1;
+   /*
+* Some devices do not support E-DDC so attempt
+* writing segment address only if it's neccessary
+*/
+   unsigned char xfers = segment ? 3 : 2;
struct iic_msg msg[] = {
{ I2C_DDC_SEGADDR, IIC_M_WR, 1, &segment },
{ I2C_DDC_ADDR, IIC_M_WR, 1, &addr },
@@ -687,7 +692,7 @@ hdmi_edid_read(struct dwc_hdmi_softc *sc, int block, u
return (result);
}
 
-   result = iicbus_transfer(i2c_dev, msg, 3);
+   result = iicbus_transfer(i2c_dev, &msg[3 - xfers], xfers);
iicbus_release_bus(i2c_dev, sc->sc_dev);
 
if (result) {
___
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: r361935 - in head/usr.bin/mkimg: . tests

2020-06-08 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Jun  8 20:28:32 2020
New Revision: 361935
URL: https://svnweb.freebsd.org/changeset/base/361935

Log:
  Add VHDX support to mkimg(1)
  
  VHDX is the successor of Microsoft's VHD file format. It increases
  maximum capacity of the virtual drive to 64TB and introduces features
  to better handle power/system failures.
  
  VHDX is the required format for 2nd generation Hyper-V VMs.
  
  Reviewed by:  marcel
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D25184

Added:
  head/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdx.hex   (contents, props changed)
  head/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdx.hex   (contents, props changed)
  head/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhdx.hex   (contents, props changed)
  head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdx.hex   (contents, props changed)
  head/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhdx.hex   (contents, props changed)
  head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhdx.hex   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-1x1-512-apm.vhdx.hex   (contents, props changed)
  head/usr.bin/mkimg/tests/img-1x1-512-bsd.vhdx.hex   (contents, props changed)
  head/usr.bin/mkimg/tests/img-1x1-512-ebr.vhdx.hex   (contents, props changed)
  head/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdx.hex   (contents, props changed)
  head/usr.bin/mkimg/tests/img-1x1-512-mbr.vhdx.hex   (contents, props changed)
  head/usr.bin/mkimg/tests/img-1x1-512-vtoc8.vhdx.hex   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-4096-apm.vhdx.hex   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-4096-bsd.vhdx.hex   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhdx.hex   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdx.hex   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhdx.hex   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.vhdx.hex   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-512-apm.vhdx.hex   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-512-bsd.vhdx.hex   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-512-ebr.vhdx.hex   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdx.hex   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-512-mbr.vhdx.hex   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-512-vtoc8.vhdx.hex   (contents, props 
changed)
  head/usr.bin/mkimg/vhdx.c   (contents, props changed)
Modified:
  head/usr.bin/mkimg/Makefile
  head/usr.bin/mkimg/mkimg.1
  head/usr.bin/mkimg/tests/mkimg_test.sh

Modified: head/usr.bin/mkimg/Makefile
==
--- head/usr.bin/mkimg/Makefile Mon Jun  8 20:23:20 2020(r361934)
+++ head/usr.bin/mkimg/Makefile Mon Jun  8 20:28:32 2020(r361935)
@@ -18,6 +18,7 @@ SRCS+= \
qcow.c \
raw.c \
vhd.c \
+   vhdx.c \
vmdk.c
 
 # List of schemes to support

Modified: head/usr.bin/mkimg/mkimg.1
==
--- head/usr.bin/mkimg/mkimg.1  Mon Jun  8 20:23:20 2020(r361934)
+++ head/usr.bin/mkimg/mkimg.1  Mon Jun  8 20:28:32 2020(r361935)
@@ -257,6 +257,16 @@ To create a fixed VHD file for use by Azure, specify
 .Fl f Ar vhdf
 on the command line.
 The preferred file extension is ".vhd".
+.Ss Dynamic VHDX
+Microsoft's "Virtual Hard Disk v2" file formats, the
+successor to VHD.
+VHDX is the required format for the 2nd generation Hyper-V VMs.
+To have
+.Nm
+create a dynamic VHDX file, specify
+.Fl f Ar vhdx
+on the command line.
+The preferred file extension is ".vhdx".
 .Ss VMDK
 VMware's "Virtual Machine Disk" file format.
 It's a sparse file format akin to QCOW and VHD and supported by many

Added: head/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdx.hex
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdx.hex  Mon Jun  8 20:28:32 
2020(r361935)
@@ -0,0 +1,79 @@
+# $FreeBSD$
+  76 68 64 78 66 69 6c 65  00 00 00 00 00 00 00 00  |vhdxfile|
+0010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ||
+*
+0001  68 65 61 64 64 db 05 73  00 00 00 00 00 00 00 00  |headd..s|
+00010010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ||
+*
+00010040  00 00 01 00 00 00 10 00  00 00 10 00 00 00 00 00  ||
+00010050  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ||
+*
+0002  68 65 61 64 13 47 fd f1  01 00 00 00 00 00 00 00  |head.G..|
+00020010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ||
+*
+00020040  00 00 01 00 00 00 10 00  00 00 10 00 00 00 00 00  ||
+000200

svn commit: r361899 - stable/12/sys/arm/broadcom/bcm2835

2020-06-07 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Jun  8 00:20:15 2020
New Revision: 361899
URL: https://svnweb.freebsd.org/changeset/base/361899

Log:
  MFC r352028:
  
  [rpi] Inherit framebuffer BPP value from the VideoCore firmware
  
  Instead of using hardcoded bpp of 24, obtain current/configured value
  from VideoCore. This solves certain problems with Xorg/Qt apps that
  require bpp of 32 to work properly. The mode can be forced by setting
  framebuffer_depth value in config.txt
  
  PR:   235363
  Submitted by: Steve Peurifoy 
  Tested by:Johnathan Chen  (stabe/12 patch)

Modified:
  stable/12/sys/arm/broadcom/bcm2835/bcm2835_fbd.c
  stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
  stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_fbd.c
==
--- stable/12/sys/arm/broadcom/bcm2835/bcm2835_fbd.cSun Jun  7 19:56:17 
2020(r361898)
+++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_fbd.cMon Jun  8 00:20:15 
2020(r361899)
@@ -85,7 +85,13 @@ bcm_fb_init(struct bcmsc_softc *sc, struct bcm2835_fb_
memset(fb, 0, sizeof(*fb));
if (bcm2835_mbox_fb_get_w_h(fb) != 0)
return (ENXIO);
-   fb->bpp = FB_DEPTH;
+   if (bcm2835_mbox_fb_get_bpp(fb) != 0)
+   return (ENXIO);
+   if (fb->bpp < FB_DEPTH) {
+   device_printf(sc->dev, "changing fb bpp from %d to %d\n", 
fb->bpp, FB_DEPTH);
+   fb->bpp = FB_DEPTH;
+   } else
+   device_printf(sc->dev, "keeping existing fb bpp of %d\n", 
fb->bpp);
 
fb->vxres = fb->xres;
fb->vyres = fb->yres;

Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
==
--- stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox.c   Sun Jun  7 19:56:17 
2020(r361898)
+++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox.c   Mon Jun  8 00:20:15 
2020(r361899)
@@ -499,6 +499,26 @@ bcm2835_mbox_fb_get_w_h(struct bcm2835_fb_config *fb)
 }
 
 int
+bcm2835_mbox_fb_get_bpp(struct bcm2835_fb_config *fb)
+{
+   int err;
+   struct msg_fb_get_bpp msg;
+   
+   memset(&msg, 0, sizeof(msg));
+   msg.hdr.buf_size = sizeof(msg);
+   msg.hdr.code = BCM2835_MBOX_CODE_REQ;
+   BCM2835_MBOX_INIT_TAG(&msg.bpp, GET_DEPTH);
+   msg.bpp.tag_hdr.val_len = 0;
+   msg.end_tag = 0;
+   
+   err = bcm2835_mbox_property(&msg, sizeof(msg));
+   if (err == 0)
+   fb->bpp = msg.bpp.body.resp.bpp;
+   
+   return (err);
+}
+
+int
 bcm2835_mbox_fb_init(struct bcm2835_fb_config *fb)
 {
int err;

Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h
==
--- stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h  Sun Jun  7 
19:56:17 2020(r361898)
+++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h  Mon Jun  8 
00:20:15 2020(r361899)
@@ -475,6 +475,14 @@ struct msg_fb_get_w_h {
 
 int bcm2835_mbox_fb_get_w_h(struct bcm2835_fb_config *);
 
+struct msg_fb_get_bpp {
+   struct bcm2835_mbox_hdr hdr;
+   struct bcm2835_mbox_tag_depth bpp;
+   uint32_t end_tag;
+};
+
+int bcm2835_mbox_fb_get_bpp(struct bcm2835_fb_config *);
+
 struct msg_fb_setup {
struct bcm2835_mbox_hdr hdr;
struct bcm2835_mbox_tag_fb_w_h physical_w_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: r361796 - head/sys/dts/arm64/overlays

2020-06-04 Thread Oleksandr Tymoshenko
Oleksandr Tymoshenko (go...@freebsd.org) wrote:
> Author: gonzo
> Date: Thu Jun  4 17:20:58 2020
> New Revision: 361796
> URL: https://svnweb.freebsd.org/changeset/base/361796
> 
> Log:
>   Remove licenses
>   
>   I haven't requested explicit permission from authors and shouldn't have
>   added BSDL headers without it.
>   
>   Requestes by:   imp

Some comments on this commit.

Adding license texts was a knee-jerk reaction to the request
to get over with a minor change. Not asking actual
contributors for permissions was the wrong thing to do, so I
reverted it.

I agree with Warner's view that dts files are not subject to
copyright because they're statements of facts. I also
checked other files in sys/dts/{arm,arm64}/overlays/ - none
of them has a license header, so my original commit was
consistent with the standards of that particular part of the
codebase and didn't introduce any legal exposure
(hypothetical or not) FreeBSD didn't have at the time of the
commit. Summing up everything above: I think r361796
brings files to the form they should be in.

If the eventual consensus in the Project is that dtso files
require licenses and copyright statements there need to be a
wider effort organized to get permissions from the respective
contributors. 

-- 
gonzo
___
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: r361796 - head/sys/dts/arm64/overlays

2020-06-04 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Jun  4 17:20:58 2020
New Revision: 361796
URL: https://svnweb.freebsd.org/changeset/base/361796

Log:
  Remove licenses
  
  I haven't requested explicit permission from authors and shouldn't have
  added BSDL headers without it.
  
  Requestes by: imp

Modified:
  head/sys/dts/arm64/overlays/spigen-rpi3.dtso
  head/sys/dts/arm64/overlays/spigen-rpi4.dtso

Modified: head/sys/dts/arm64/overlays/spigen-rpi3.dtso
==
--- head/sys/dts/arm64/overlays/spigen-rpi3.dtsoThu Jun  4 17:08:07 
2020(r361795)
+++ head/sys/dts/arm64/overlays/spigen-rpi3.dtsoThu Jun  4 17:20:58 
2020(r361796)
@@ -1,31 +1,4 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
- * Copyright (c) 2019 Bob Frazier 
- *
- * 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.
- *
- * $FreeBSD$
- */
+/* $FreeBSD$ */
 
 /dts-v1/;
 /plugin/;

Modified: head/sys/dts/arm64/overlays/spigen-rpi4.dtso
==
--- head/sys/dts/arm64/overlays/spigen-rpi4.dtsoThu Jun  4 17:08:07 
2020(r361795)
+++ head/sys/dts/arm64/overlays/spigen-rpi4.dtsoThu Jun  4 17:20:58 
2020(r361796)
@@ -1,31 +1,4 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
- * Copyright (c) 2020 Gergely Czuczy 
- *
- * 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.
- *
- * $FreeBSD$
- */
+/* $FreeBSD$ */
 
 /dts-v1/;
 /plugin/;
___
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: r361782 - head/sys/dts/arm64/overlays

2020-06-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Jun  4 02:36:41 2020
New Revision: 361782
URL: https://svnweb.freebsd.org/changeset/base/361782

Log:
  Add copyright headers to spigen overlays for rpi3 and rpi4
  
  Reported by:  Rodney W. Grimes  (for rpi4)

Modified:
  head/sys/dts/arm64/overlays/spigen-rpi3.dtso
  head/sys/dts/arm64/overlays/spigen-rpi4.dtso

Modified: head/sys/dts/arm64/overlays/spigen-rpi3.dtso
==
--- head/sys/dts/arm64/overlays/spigen-rpi3.dtsoThu Jun  4 01:49:29 
2020(r361781)
+++ head/sys/dts/arm64/overlays/spigen-rpi3.dtsoThu Jun  4 02:36:41 
2020(r361782)
@@ -1,4 +1,31 @@
-/* $FreeBSD$ */
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2019 Bob Frazier 
+ *
+ * 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.
+ *
+ * $FreeBSD$
+ */
 
 /dts-v1/;
 /plugin/;

Modified: head/sys/dts/arm64/overlays/spigen-rpi4.dtso
==
--- head/sys/dts/arm64/overlays/spigen-rpi4.dtsoThu Jun  4 01:49:29 
2020(r361781)
+++ head/sys/dts/arm64/overlays/spigen-rpi4.dtsoThu Jun  4 02:36:41 
2020(r361782)
@@ -1,4 +1,31 @@
-/* $FreeBSD$ */
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2020 Gergely Czuczy 
+ *
+ * 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.
+ *
+ * $FreeBSD$
+ */
 
 /dts-v1/;
 /plugin/;
___
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: r361775 - in head/sys: dts/arm64/overlays modules/dtb/rpi

2020-06-03 Thread Oleksandr Tymoshenko
Rodney W. Grimes (free...@gndrsh.dnsmgr.net) wrote:
> [ Charset UTF-8 unsupported, converting... ]
> > Author: gonzo
> > Date: Wed Jun  3 22:18:15 2020
> > New Revision: 361775
> > URL: https://svnweb.freebsd.org/changeset/base/361775
> > 
> > Log:
> >   Add spigen overlay for Raspberry Pi 4
> >   
> >   Submitted by: gergely.czu...@harmless.hu
> > 
> > Added:
> >   head/sys/dts/arm64/overlays/spigen-rpi4.dtso   (contents, props changed)
> > Modified:
> >   head/sys/modules/dtb/rpi/Makefile
> > 
> > Added: head/sys/dts/arm64/overlays/spigen-rpi4.dtso
> > ==
> > --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> > +++ head/sys/dts/arm64/overlays/spigen-rpi4.dtsoWed Jun  3 22:18:15 
> > 2020(r361775)
> > @@ -0,0 +1,30 @@
> > +/* $FreeBSD$ */
> 
> This file needs some form of copyright/license.

Whom should I put as a copyright folder, The FreeBSD Project or the
person who submitted the patch?

-- 
gonzo
___
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: r361775 - in head/sys: dts/arm64/overlays modules/dtb/rpi

2020-06-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed Jun  3 22:18:15 2020
New Revision: 361775
URL: https://svnweb.freebsd.org/changeset/base/361775

Log:
  Add spigen overlay for Raspberry Pi 4
  
  Submitted by: gergely.czu...@harmless.hu

Added:
  head/sys/dts/arm64/overlays/spigen-rpi4.dtso   (contents, props changed)
Modified:
  head/sys/modules/dtb/rpi/Makefile

Added: head/sys/dts/arm64/overlays/spigen-rpi4.dtso
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dts/arm64/overlays/spigen-rpi4.dtsoWed Jun  3 22:18:15 
2020(r361775)
@@ -0,0 +1,30 @@
+/* $FreeBSD$ */
+
+/dts-v1/;
+/plugin/;
+
+/ {
+   compatible = "brcm,bcm2711";
+};
+   
+&{/soc/spi@7e204000} {
+   status = "okay";
+   spigen0: spigen0 {
+   compatible = "freebsd,spigen";
+   reg = <0>;
+   spi-max-frequency = <50>; /* Req'd property, override with 
spi(8) */
+   status = "okay";
+   };
+   spigen1: spigen1 {
+   compatible = "freebsd,spigen";
+   reg = <1>;
+   spi-max-frequency = <50>; /* Req'd property, override with 
spi(8) */
+   status = "okay";
+   };
+};
+
+&{/soc/gpio@7e20/spi0_cs_pins} {
+   brcm,pins = <8 7>;
+   brcm,function = <4>; /* ALT0 */
+};
+

Modified: head/sys/modules/dtb/rpi/Makefile
==
--- head/sys/modules/dtb/rpi/Makefile   Wed Jun  3 22:15:11 2020
(r361774)
+++ head/sys/modules/dtb/rpi/Makefile   Wed Jun  3 22:18:15 2020
(r361775)
@@ -6,7 +6,8 @@ DTSO=   \
spigen-rpi2.dtso
 .elif ${MACHINE_ARCH} == "aarch64"
 DTSO=  \
-   spigen-rpi3.dtso
+   spigen-rpi3.dtso \
+   spigen-rpi4.dtso
 .endif
 
 .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: r361771 - head/sys/modules/dtb/rockchip

2020-06-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed Jun  3 21:19:57 2020
New Revision: 361771
URL: https://svnweb.freebsd.org/changeset/base/361771

Log:
  Add dtb for Firefly RK3399 to the list of Rockchip dtbs

Modified:
  head/sys/modules/dtb/rockchip/Makefile

Modified: head/sys/modules/dtb/rockchip/Makefile
==
--- head/sys/modules/dtb/rockchip/Makefile  Wed Jun  3 20:54:36 2020
(r361770)
+++ head/sys/modules/dtb/rockchip/Makefile  Wed Jun  3 21:19:57 2020
(r361771)
@@ -5,6 +5,7 @@ DTS=\
rockchip/rk3399-khadas-edge.dts \
rockchip/rk3399-khadas-edge-v.dts \
rockchip/rk3328-rock64.dts \
+   rockchip/rk3399-firefly.dts \
rockchip/rk3399-rockpro64.dts
 
 DTSO=  rk3328-dwc3.dtso
___
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: r359783 - in stable/11/usr.bin/calendar: . calendars tests

2020-04-10 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Apr 10 22:18:30 2020
New Revision: 359783
URL: https://svnweb.freebsd.org/changeset/base/359783

Log:
  MFC r359585, r359587
  
  r359585:
  Fix calculation of the recurring weekdays
  
  Both the result of the first_dayofweek_of_year and the target
  weekday are zero-based (0 fo sunday) while the target month-day
  or year-day is 1-based. Adjust logic accordingly.
  
  Also add testcase for this PR to the kyua test suite
  
  PR:   201062
  Submitted by: Richard Narron 
  
  r359587:
  Remove hardcoded US Election Day from calendar.usholiday
  
  calendar(1) syntax is not capable of representing the rules for the
  US Election Day. The hardcoded date was set in r15066 in 1996 and
  hasn't changed since then.
  
  PR:   173389
  Reported by:  Steve Ames 

Added:
  stable/11/usr.bin/calendar/tests/regress.s5.out
 - copied unchanged from r359585, head/usr.bin/calendar/tests/regress.s5.out
Modified:
  stable/11/usr.bin/calendar/calendars/calendar.usholiday
  stable/11/usr.bin/calendar/parsedata.c
  stable/11/usr.bin/calendar/tests/calendar.calibrate
  stable/11/usr.bin/calendar/tests/regress.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/calendar/calendars/calendar.usholiday
==
--- stable/11/usr.bin/calendar/calendars/calendar.usholiday Fri Apr 10 
22:18:13 2020(r359782)
+++ stable/11/usr.bin/calendar/calendars/calendar.usholiday Fri Apr 10 
22:18:30 2020(r359783)
@@ -30,7 +30,6 @@
 09/22* Autumnal Equinox
 10/MonSecond   Columbus Day in USA (2nd Monday of October)
 10/31  All Hallows Eve  (Halloween)
-11/05* Election Day in USA (1st Tuesday after 1st Monday for even years)
 11/SunFirstDaylight Savings Time ends in USA; clocks move back (1st Sunday 
of November)
 11/11  Veterans' Day
 11/ThuFourth   Thanksgiving Day (4th Thursday in November)

Modified: stable/11/usr.bin/calendar/parsedata.c
==
--- stable/11/usr.bin/calendar/parsedata.c  Fri Apr 10 22:18:13 2020
(r359782)
+++ stable/11/usr.bin/calendar/parsedata.c  Fri Apr 10 22:18:30 2020
(r359783)
@@ -578,7 +578,9 @@ parsedaymonth(char *date, int *yearp, int *monthp, int
/* Every dayofweek of the year */
if (lflags == (F_DAYOFWEEK | F_VARIABLE)) {
dow = first_dayofweek_of_year(year);
-   d = (idayofweek - dow + 8) % 7;
+   if (dow < 0)
+   continue;
+   d = (idayofweek - dow + 7) % 7 + 1;
while (d <= 366) {
if (remember_yd(year, d, &rm, &rd))
remember(&remindex,
@@ -616,7 +618,9 @@ parsedaymonth(char *date, int *yearp, int *monthp, int
(F_MONTH | F_DAYOFWEEK | F_MODIFIERINDEX | F_VARIABLE)) {
offset = indextooffset(modifierindex);
dow = first_dayofweek_of_month(year, imonth);
-   d = (idayofweek - dow + 8) % 7;
+   if (dow < 0)
+   continue;
+   d = (idayofweek - dow + 7) % 7 + 1;
 
if (offset > 0) {
while (d <= yearinfo->monthdays[imonth]) {
@@ -650,7 +654,9 @@ parsedaymonth(char *date, int *yearp, int *monthp, int
/* Every dayofweek of the month */
if (lflags == (F_DAYOFWEEK | F_MONTH | F_VARIABLE)) {
dow = first_dayofweek_of_month(year, imonth);
-   d = (idayofweek - dow + 8) % 7;
+   if (dow < 0)
+   continue;
+   d = (idayofweek - dow + 7) % 7 + 1;
while (d <= yearinfo->monthdays[imonth]) {
if (remember_ymd(year, imonth, d))
remember(&remindex,

Modified: stable/11/usr.bin/calendar/tests/calendar.calibrate
==
--- stable/11/usr.bin/calendar/tests/calendar.calibrate Fri Apr 10 22:18:13 
2020(r359782)
+++ stable/11/usr.bin/calendar/tests/calendar.calibrate Fri Apr 10 22:18:30 
2020(r359783)
@@ -188,6 +188,7 @@ LANG=C
 06/28  jun 28
 06/29  jun 29
 06/30  jun 30
+06/SunThirdsunthird
 07/01  jul 1
 07/02  jul 2
 07/03  jul 3

Copied: stable/11/usr.bin/calendar/tests/regress.s5.out (from r359585, 
head/usr.bin/calendar/tests/regress.s5.out)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/usr.bin/calendar/tests/regress.s5.out Fri Apr 10 22:18:30 
2020(r359783, copy of r359585, 
head

svn commit: r359782 - in stable/12/usr.bin/calendar: . calendars tests

2020-04-10 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Apr 10 22:18:13 2020
New Revision: 359782
URL: https://svnweb.freebsd.org/changeset/base/359782

Log:
  MFC r359585, r359587
  
  r359585:
  Fix calculation of the recurring weekdays
  
  Both the result of the first_dayofweek_of_year and the target
  weekday are zero-based (0 fo sunday) while the target month-day
  or year-day is 1-based. Adjust logic accordingly.
  
  Also add testcase for this PR to the kyua test suite
  
  PR:   201062
  Submitted by: Richard Narron 
  
  r359587:
  Remove hardcoded US Election Day from calendar.usholiday
  
  calendar(1) syntax is not capable of representing the rules for the
  US Election Day. The hardcoded date was set in r15066 in 1996 and
  hasn't changed since then.
  
  PR:   173389
  Reported by:  Steve Ames 

Added:
  stable/12/usr.bin/calendar/tests/regress.s5.out
 - copied unchanged from r359585, head/usr.bin/calendar/tests/regress.s5.out
Modified:
  stable/12/usr.bin/calendar/calendars/calendar.usholiday
  stable/12/usr.bin/calendar/parsedata.c
  stable/12/usr.bin/calendar/tests/calendar.calibrate
  stable/12/usr.bin/calendar/tests/regress.sh
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/calendar/calendars/calendar.usholiday
==
--- stable/12/usr.bin/calendar/calendars/calendar.usholiday Fri Apr 10 
21:27:49 2020(r359781)
+++ stable/12/usr.bin/calendar/calendars/calendar.usholiday Fri Apr 10 
22:18:13 2020(r359782)
@@ -30,7 +30,6 @@
 09/22* Autumnal Equinox
 10/MonSecond   Columbus Day in USA (2nd Monday of October)
 10/31  All Hallows Eve  (Halloween)
-11/05* Election Day in USA (1st Tuesday after 1st Monday for even years)
 11/SunFirstDaylight Savings Time ends in USA; clocks move back (1st Sunday 
of November)
 11/11  Veterans' Day
 11/ThuFourth   Thanksgiving Day (4th Thursday in November)

Modified: stable/12/usr.bin/calendar/parsedata.c
==
--- stable/12/usr.bin/calendar/parsedata.c  Fri Apr 10 21:27:49 2020
(r359781)
+++ stable/12/usr.bin/calendar/parsedata.c  Fri Apr 10 22:18:13 2020
(r359782)
@@ -578,7 +578,9 @@ parsedaymonth(char *date, int *yearp, int *monthp, int
/* Every dayofweek of the year */
if (lflags == (F_DAYOFWEEK | F_VARIABLE)) {
dow = first_dayofweek_of_year(year);
-   d = (idayofweek - dow + 8) % 7;
+   if (dow < 0)
+   continue;
+   d = (idayofweek - dow + 7) % 7 + 1;
while (d <= 366) {
if (remember_yd(year, d, &rm, &rd))
remember(&remindex,
@@ -616,7 +618,9 @@ parsedaymonth(char *date, int *yearp, int *monthp, int
(F_MONTH | F_DAYOFWEEK | F_MODIFIERINDEX | F_VARIABLE)) {
offset = indextooffset(modifierindex);
dow = first_dayofweek_of_month(year, imonth);
-   d = (idayofweek - dow + 8) % 7;
+   if (dow < 0)
+   continue;
+   d = (idayofweek - dow + 7) % 7 + 1;
 
if (offset > 0) {
while (d <= yearinfo->monthdays[imonth]) {
@@ -650,7 +654,9 @@ parsedaymonth(char *date, int *yearp, int *monthp, int
/* Every dayofweek of the month */
if (lflags == (F_DAYOFWEEK | F_MONTH | F_VARIABLE)) {
dow = first_dayofweek_of_month(year, imonth);
-   d = (idayofweek - dow + 8) % 7;
+   if (dow < 0)
+   continue;
+   d = (idayofweek - dow + 7) % 7 + 1;
while (d <= yearinfo->monthdays[imonth]) {
if (remember_ymd(year, imonth, d))
remember(&remindex,

Modified: stable/12/usr.bin/calendar/tests/calendar.calibrate
==
--- stable/12/usr.bin/calendar/tests/calendar.calibrate Fri Apr 10 21:27:49 
2020(r359781)
+++ stable/12/usr.bin/calendar/tests/calendar.calibrate Fri Apr 10 22:18:13 
2020(r359782)
@@ -188,6 +188,7 @@ LANG=C
 06/28  jun 28
 06/29  jun 29
 06/30  jun 30
+06/SunThirdsunthird
 07/01  jul 1
 07/02  jul 2
 07/03  jul 3

Copied: stable/12/usr.bin/calendar/tests/regress.s5.out (from r359585, 
head/usr.bin/calendar/tests/regress.s5.out)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/12/usr.bin/calendar/tests/regress.s5.out Fri Apr 10 22:18:13 
2020(r359782, copy of r359585, 
head

svn commit: r359587 - head/usr.bin/calendar/calendars

2020-04-02 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Apr  3 02:39:46 2020
New Revision: 359587
URL: https://svnweb.freebsd.org/changeset/base/359587

Log:
  Remove hardcoded US Election Day from calendar.usholiday
  
  calendar(1) syntax is not capable of representing the rules for the
  US Election Day. The hardcoded date was set in r15066 in 1996 and
  hasn't changed since then.
  
  PR:   173389
  Reported by:  Steve Ames 
  MFC after:1 week

Modified:
  head/usr.bin/calendar/calendars/calendar.usholiday

Modified: head/usr.bin/calendar/calendars/calendar.usholiday
==
--- head/usr.bin/calendar/calendars/calendar.usholiday  Fri Apr  3 01:31:48 
2020(r359586)
+++ head/usr.bin/calendar/calendars/calendar.usholiday  Fri Apr  3 02:39:46 
2020(r359587)
@@ -30,7 +30,6 @@
 09/22* Autumnal Equinox
 10/MonSecond   Columbus Day in USA (2nd Monday of October)
 10/31  All Hallows Eve  (Halloween)
-11/05* Election Day in USA (1st Tuesday after 1st Monday for even years)
 11/SunFirstDaylight Savings Time ends in USA; clocks move back (1st Sunday 
of November)
 11/11  Veterans' Day
 11/ThuFourth   Thanksgiving Day (4th Thursday in November)
___
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: r359585 - in head/usr.bin/calendar: . tests

2020-04-02 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Apr  3 01:17:43 2020
New Revision: 359585
URL: https://svnweb.freebsd.org/changeset/base/359585

Log:
  Fix calculation of the recurring weekdays
  
  Both the result of the first_dayofweek_of_year and the target
  weekday are zero-based (0 fo sunday) while the target month-day
  or year-day is 1-based. Adjust logic accordingly.
  
  Also add testcase for this PR to the kyua test suite
  
  PR:   201062
  Submitted by: Richard Narron 
  MFC after:1 week

Added:
  head/usr.bin/calendar/tests/regress.s5.out   (contents, props changed)
Modified:
  head/usr.bin/calendar/parsedata.c
  head/usr.bin/calendar/tests/calendar.calibrate
  head/usr.bin/calendar/tests/regress.sh

Modified: head/usr.bin/calendar/parsedata.c
==
--- head/usr.bin/calendar/parsedata.c   Fri Apr  3 00:38:12 2020
(r359584)
+++ head/usr.bin/calendar/parsedata.c   Fri Apr  3 01:17:43 2020
(r359585)
@@ -578,7 +578,9 @@ parsedaymonth(char *date, int *yearp, int *monthp, int
/* Every dayofweek of the year */
if (lflags == (F_DAYOFWEEK | F_VARIABLE)) {
dow = first_dayofweek_of_year(year);
-   d = (idayofweek - dow + 8) % 7;
+   if (dow < 0)
+   continue;
+   d = (idayofweek - dow + 7) % 7 + 1;
while (d <= 366) {
if (remember_yd(year, d, &rm, &rd))
remember(&remindex,
@@ -616,7 +618,9 @@ parsedaymonth(char *date, int *yearp, int *monthp, int
(F_MONTH | F_DAYOFWEEK | F_MODIFIERINDEX | F_VARIABLE)) {
offset = indextooffset(modifierindex);
dow = first_dayofweek_of_month(year, imonth);
-   d = (idayofweek - dow + 8) % 7;
+   if (dow < 0)
+   continue;
+   d = (idayofweek - dow + 7) % 7 + 1;
 
if (offset > 0) {
while (d <= yearinfo->monthdays[imonth]) {
@@ -650,7 +654,9 @@ parsedaymonth(char *date, int *yearp, int *monthp, int
/* Every dayofweek of the month */
if (lflags == (F_DAYOFWEEK | F_MONTH | F_VARIABLE)) {
dow = first_dayofweek_of_month(year, imonth);
-   d = (idayofweek - dow + 8) % 7;
+   if (dow < 0)
+   continue;
+   d = (idayofweek - dow + 7) % 7 + 1;
while (d <= yearinfo->monthdays[imonth]) {
if (remember_ymd(year, imonth, d))
remember(&remindex,

Modified: head/usr.bin/calendar/tests/calendar.calibrate
==
--- head/usr.bin/calendar/tests/calendar.calibrate  Fri Apr  3 00:38:12 
2020(r359584)
+++ head/usr.bin/calendar/tests/calendar.calibrate  Fri Apr  3 01:17:43 
2020(r359585)
@@ -188,6 +188,7 @@ LANG=C
 06/28  jun 28
 06/29  jun 29
 06/30  jun 30
+06/SunThirdsunthird
 07/01  jul 1
 07/02  jul 2
 07/03  jul 3

Added: head/usr.bin/calendar/tests/regress.s5.out
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/calendar/tests/regress.s5.out  Fri Apr  3 01:17:43 2020
(r359585)
@@ -0,0 +1,3 @@
+Jun 21*sunthird
+Jun 21 jun 21
+Jun 22 jun 22

Modified: head/usr.bin/calendar/tests/regress.sh
==
--- head/usr.bin/calendar/tests/regress.sh  Fri Apr  3 00:38:12 2020
(r359584)
+++ head/usr.bin/calendar/tests/regress.sh  Fri Apr  3 01:17:43 2020
(r359585)
@@ -7,12 +7,13 @@ CALENDAR="${CALENDAR_BIN} ${CALENDAR_FILE}"
 
 REGRESSION_START($1)
 
-echo 1..28
+echo 1..29
 
 REGRESSION_TEST(`s1',`$CALENDAR -t 29.12.2006')
 REGRESSION_TEST(`s2',`$CALENDAR -t 30.12.2006')
 REGRESSION_TEST(`s3',`$CALENDAR -t 31.12.2006')
 REGRESSION_TEST(`s4',`$CALENDAR -t 01.01.2007')
+REGRESSION_TEST(`s5',`$CALENDAR -t 21.06.2015')
 
 REGRESSION_TEST(`a1',`$CALENDAR -A 3 -t 28.12.2006')
 REGRESSION_TEST(`a2',`$CALENDAR -A 3 -t 29.12.2006')
___
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: r359114 - stable/11/sys/dev/sound/pci/hda

2020-03-18 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Mar 19 02:22:08 2020
New Revision: 359114
URL: https://svnweb.freebsd.org/changeset/base/359114

Log:
  MFC r352775-r352776
  
  r352775:
  snd_hda: Add Intel Cannon Lake support
  
  Add PCI ids for Intel Cannon Lake PCH
  
  Tested on:HP Spectre x360 13-p0043dx
  PR:   240574
  Submitted by: Neel Chauhan 
  Reviewed by:  imp, mizhka, ray
  Differential Revision:https://reviews.freebsd.org/D21789
  
  r352776:
  snd_hda: Add Intel Cannon Lake support
  
  Add missing header change ommitted in r352775
  
  X-MFC-with:   352775

Modified:
  stable/11/sys/dev/sound/pci/hda/hdac.c
  stable/11/sys/dev/sound/pci/hda/hdac.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sound/pci/hda/hdac.c
==
--- stable/11/sys/dev/sound/pci/hda/hdac.c  Thu Mar 19 01:50:24 2020
(r359113)
+++ stable/11/sys/dev/sound/pci/hda/hdac.c  Thu Mar 19 02:22:08 2020
(r359114)
@@ -99,6 +99,7 @@ static const struct {
{ HDA_INTEL_KBLK,"Intel Kaby Lake", 0, 0 },
{ HDA_INTEL_KBLKH,   "Intel Kaby Lake-H",   0, 0 },
{ HDA_INTEL_CFLK,"Intel Coffee Lake",   0, 0 },
+   { HDA_INTEL_CNLK,"Intel Cannon Lake",   0, 0 },
{ HDA_INTEL_82801F,  "Intel 82801F",0, 0 },
{ HDA_INTEL_63XXESB, "Intel 631x/632xESB",  0, 0 },
{ HDA_INTEL_82801G,  "Intel 82801G",0, 0 },

Modified: stable/11/sys/dev/sound/pci/hda/hdac.h
==
--- stable/11/sys/dev/sound/pci/hda/hdac.h  Thu Mar 19 01:50:24 2020
(r359113)
+++ stable/11/sys/dev/sound/pci/hda/hdac.h  Thu Mar 19 02:22:08 2020
(r359114)
@@ -75,6 +75,7 @@
 #define HDA_INTEL_KBLK HDA_MODEL_CONSTRUCT(INTEL, 0xa171)
 #define HDA_INTEL_KBLKHHDA_MODEL_CONSTRUCT(INTEL, 0xa2f0)
 #define HDA_INTEL_CFLK HDA_MODEL_CONSTRUCT(INTEL, 0xa348)
+#define HDA_INTEL_CNLK HDA_MODEL_CONSTRUCT(INTEL, 0x9dc8)
 #define HDA_INTEL_ALL  HDA_MODEL_CONSTRUCT(INTEL, 0x)
 
 /* Nvidia */
___
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: r359113 - stable/12/sys/dev/sound/pci/hda

2020-03-18 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Mar 19 01:50:24 2020
New Revision: 359113
URL: https://svnweb.freebsd.org/changeset/base/359113

Log:
  MFC r352775-r352776
  
  r352775:
  snd_hda: Add Intel Cannon Lake support
  
  Add PCI ids for Intel Cannon Lake PCH
  
  Tested on:HP Spectre x360 13-p0043dx
  PR:   240574
  Submitted by: Neel Chauhan 
  Reviewed by:  imp, mizhka, ray
  Differential Revision:https://reviews.freebsd.org/D21789
  
  r352776:
  snd_hda: Add Intel Cannon Lake support
  
  Add missing header change ommitted in r352775
  
  X-MFC-with:   352775

Modified:
  stable/12/sys/dev/sound/pci/hda/hdac.c
  stable/12/sys/dev/sound/pci/hda/hdac.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/sound/pci/hda/hdac.c
==
--- stable/12/sys/dev/sound/pci/hda/hdac.c  Thu Mar 19 01:05:54 2020
(r359112)
+++ stable/12/sys/dev/sound/pci/hda/hdac.c  Thu Mar 19 01:50:24 2020
(r359113)
@@ -102,6 +102,7 @@ static const struct {
{ HDA_INTEL_KBLK,"Intel Kaby Lake", 0, 0 },
{ HDA_INTEL_KBLKH,   "Intel Kaby Lake-H",   0, 0 },
{ HDA_INTEL_CFLK,"Intel Coffee Lake",   0, 0 },
+   { HDA_INTEL_CNLK,"Intel Cannon Lake",   0, 0 },
{ HDA_INTEL_82801F,  "Intel 82801F",0, 0 },
{ HDA_INTEL_63XXESB, "Intel 631x/632xESB",  0, 0 },
{ HDA_INTEL_82801G,  "Intel 82801G",0, 0 },

Modified: stable/12/sys/dev/sound/pci/hda/hdac.h
==
--- stable/12/sys/dev/sound/pci/hda/hdac.h  Thu Mar 19 01:05:54 2020
(r359112)
+++ stable/12/sys/dev/sound/pci/hda/hdac.h  Thu Mar 19 01:50:24 2020
(r359113)
@@ -77,6 +77,7 @@
 #define HDA_INTEL_KBLK HDA_MODEL_CONSTRUCT(INTEL, 0xa171)
 #define HDA_INTEL_KBLKHHDA_MODEL_CONSTRUCT(INTEL, 0xa2f0)
 #define HDA_INTEL_CFLK HDA_MODEL_CONSTRUCT(INTEL, 0xa348)
+#define HDA_INTEL_CNLK HDA_MODEL_CONSTRUCT(INTEL, 0x9dc8)
 #define HDA_INTEL_ALL  HDA_MODEL_CONSTRUCT(INTEL, 0x)
 
 /* Nvidia */
___
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: r354100 - head/sys/arm64/rockchip/clk

2019-10-25 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Oct 25 21:21:21 2019
New Revision: 354100
URL: https://svnweb.freebsd.org/changeset/base/354100

Log:
  arm64: rk3399: Add clock and gate for SPI clocks
  
  MFC after:1 month

Modified:
  head/sys/arm64/rockchip/clk/rk3399_cru.c

Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c
==
--- head/sys/arm64/rockchip/clk/rk3399_cru.cFri Oct 25 21:20:04 2019
(r354099)
+++ head/sys/arm64/rockchip/clk/rk3399_cru.cFri Oct 25 21:21:21 2019
(r354100)
@@ -75,6 +75,11 @@ __FBSDID("$FreeBSD$");
 #definePCLK_I2C5   344
 #definePCLK_I2C6   345
 #definePCLK_I2C7   346
+#definePCLK_SPI0   347
+#definePCLK_SPI1   348
+#definePCLK_SPI2   349
+#definePCLK_SPI4   350
+#definePCLK_SPI5   351
 #defineHCLK_HOST0  456
 #defineHCLK_HOST0_ARB  457
 #defineHCLK_HOST1  458
@@ -132,6 +137,12 @@ static struct rk_cru_gate rk3399_gates[] = {
CRU_GATE(PCLK_I2C2, "pclk_rki2c2", "pclk_perilp1", 0x358, 9)
CRU_GATE(PCLK_I2C3, "pclk_rki2c3", "pclk_perilp1", 0x358, 10)
 
+   /* CRU_CLKGATE_CON23 */
+   CRU_GATE(PCLK_SPI0, "pclk_spi0", "pclk_perilp1", 0x35C, 10)
+   CRU_GATE(PCLK_SPI1, "pclk_spi1", "pclk_perilp1", 0x35C, 11)
+   CRU_GATE(PCLK_SPI2, "pclk_spi2", "pclk_perilp1", 0x35C, 12)
+   CRU_GATE(PCLK_SPI4, "pclk_spi4", "pclk_perilp1", 0x35C, 13)
+
/* CRU_CLKGATE_CON30 */
CRU_GATE(ACLK_USB3_NOC, "aclk_usb3_noc", "aclk_usb3", 0x378, 0)
CRU_GATE(ACLK_USB3OTG0, "aclk_usb3otg0", "aclk_usb3", 0x378, 1)
@@ -151,6 +162,9 @@ static struct rk_cru_gate rk3399_gates[] = {
 
/* CRU_CLKGATE_CON33 */
CRU_GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_sd", 0x384, 8)
+
+   /* CRU_CLKGATE_CON34 */
+   CRU_GATE(PCLK_SPI4, "pclk_spi5", "pclk_perilp1", 0x388, 5)
 };
 
 
@@ -1367,6 +1381,127 @@ static struct rk_clk_composite_def uphy1_tcpdcore = {
 };
 
 /*
+ * spi
+ */
+static const char *spi_parents[] = {"cpll", "gpll"};
+
+#defineSCLK_SPI0   71
+#defineSCLK_SPI1   72
+#defineSCLK_SPI2   73
+#defineSCLK_SPI4   74
+#defineSCLK_SPI5   75
+
+static struct rk_clk_composite_def spi0 = {
+   .clkdef = {
+   .id = SCLK_SPI0,
+   .name = "clk_spi0",
+   .parent_names = spi_parents,
+   .parent_cnt = nitems(spi_parents),
+   },
+   /* CRU_CLKSEL_CON59 */
+   .muxdiv_offset = 0x01ec,
+   .mux_shift = 7,
+   .mux_width = 1,
+
+   .div_shift = 0,
+   .div_width = 7,
+
+   /* CRU_CLKGATE_CON9 */
+   .gate_offset = 0x0324,
+   .gate_shift = 12,
+
+   .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
+};
+
+static struct rk_clk_composite_def spi1 = {
+   .clkdef = {
+   .id = SCLK_SPI1,
+   .name = "clk_spi1",
+   .parent_names = spi_parents,
+   .parent_cnt = nitems(spi_parents),
+   },
+   /* CRU_CLKSEL_CON59 */
+   .muxdiv_offset = 0x01ec,
+   .mux_shift = 15,
+   .mux_width = 1,
+
+   .div_shift = 8,
+   .div_width = 7,
+
+   /* CRU_CLKGATE_CON9 */
+   .gate_offset = 0x0324,
+   .gate_shift = 13,
+
+   .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
+};
+
+static struct rk_clk_composite_def spi2 = {
+   .clkdef = {
+   .id = SCLK_SPI2,
+   .name = "clk_spi2",
+   .parent_names = spi_parents,
+   .parent_cnt = nitems(spi_parents),
+   },
+   /* CRU_CLKSEL_CON60 */
+   .muxdiv_offset = 0x01f0,
+   .mux_shift = 7,
+   .mux_width = 1,
+
+   .div_shift = 0,
+   .div_width = 7,
+
+   /* CRU_CLKGATE_CON9 */
+   .gate_offset = 0x0324,
+   .gate_shift = 14,
+
+   .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
+};
+
+static struct rk_clk_composite_def spi4 = {
+   .clkdef = {
+   .id = SCLK_SPI4,
+   .name = "clk_spi4",
+   .parent_names = spi_parents,
+   .parent_cnt = nitems(spi_parents),
+   },
+   /* CRU_CLKSEL_CON60 */
+   .muxdiv_offset = 0x01f0,
+   .mux_shift = 15,
+   .mux_width = 1,
+
+   .div_shift = 8,
+   .div_width = 7,
+
+   /* CRU_CLKGATE_CON9 */
+   .gate_offset = 0x0324,
+   .gate_shift = 15,
+
+   .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
+};
+
+static struct rk_clk_composite_def spi5 = {
+   .clkdef = {
+   .id = SCLK_SPI5,
+   .name = "clk_spi5",
+   .parent_names = spi_parents,
+   .parent_cnt = nitems(spi_parents),
+   },
+   /* CRU_CLKSEL_CON58 */
+   .muxdiv_offset = 0x01e8,
+   

svn commit: r354103 - in head/sys: arm64/conf arm64/rockchip conf

2019-10-25 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Oct 25 21:38:38 2019
New Revision: 354103
URL: https://svnweb.freebsd.org/changeset/base/354103

Log:
  arm64: rk3399: add SPI driver and include it in GENERIC config
  
  SPI driver for Rockchip's RK3399 SoC. Implements PIO mode, CS selection,
  SPI mode and frequency configuration.
  
  Reviewed by:  manu
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D22148

Added:
  head/sys/arm64/rockchip/rk_spi.c   (contents, props changed)
Modified:
  head/sys/arm64/conf/GENERIC
  head/sys/conf/files.arm64

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Fri Oct 25 21:32:28 2019(r354102)
+++ head/sys/arm64/conf/GENERIC Fri Oct 25 21:38:38 2019(r354103)
@@ -286,6 +286,7 @@ device  mv_thermal  # Marvell Thermal 
Sensor Controller
 # SPI
 device spibus
 device bcm2835_spi # Broadcom BCM283x SPI bus
+device rk_spi  # RockChip SPI controller
 
 # PWM
 device pwm

Added: head/sys/arm64/rockchip/rk_spi.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm64/rockchip/rk_spi.cFri Oct 25 21:38:38 2019
(r354103)
@@ -0,0 +1,483 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2019 Oleksandr Tymoshenko 
+ *
+ * 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.
+ *
+ * $FreeBSD$
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include "spibus_if.h"
+
+#defineRK_SPI_CTRLR0   0x
+#defineCTRLR0_OPM_MASTER   (0 << 20)
+#defineCTRLR0_XFM_TR   (0 << 18)
+#defineCTRLR0_FRF_MOTO (0 << 16)
+#defineCTRLR0_BHT_8BIT (1 << 13)
+#defineCTRLR0_EM_BIG   (1 << 11)
+#defineCTRLR0_SSD_ONE  (1 << 10)
+#defineCTRLR0_SCPOL(1 <<  7)
+#defineCTRLR0_SCPH (1 <<  6)
+#defineCTRLR0_DFS_8BIT (1 <<  0)
+#defineRK_SPI_CTRLR1   0x0004
+#defineRK_SPI_ENR  0x0008
+#defineRK_SPI_SER  0x000c
+#defineRK_SPI_BAUDR0x0010
+#defineRK_SPI_TXFTLR   0x0014
+#defineRK_SPI_RXFTLR   0x0018
+#defineRK_SPI_TXFLR0x001c
+#defineRK_SPI_RXFLR0x0020
+#defineRK_SPI_SR   0x0024
+#defineSR_BUSY (1 <<  0)
+#defineRK_SPI_IPR  0x0028
+#defineRK_SPI_IMR  0x002c
+#defineIMR_RFFIM   (1 <<  4)
+#defineIMR_TFEIM   (1 <<  0)
+#defineRK_SPI_ISR  0x0030
+#defineISR_RFFIS   (1 <<  4)
+#defineISR_TFEIS   (1 <<  0)
+#defineRK_SPI_RISR 0x0034
+#defineRK_SPI_ICR  0x0038
+#defineRK_SPI_DMACR0x003c
+#defineRK_SPI_DMATDLR  0x0040
+#defineRK_SPI_DMARDLR  0x0044
+#defineRK_SPI_TXDR 0x0400
+#defineRK_SPI_RXDR 0x0800
+
+#defineCS_MAX  1
+
+static struct ofw_compat_data c

svn commit: r352776 - head/sys/dev/sound/pci/hda

2019-09-26 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Sep 26 21:04:36 2019
New Revision: 352776
URL: https://svnweb.freebsd.org/changeset/base/352776

Log:
  snd_hda: Add Intel Cannon Lake support
  
  Add missing header change ommitted in r352775
  
  MFC after:2 weeks
  X-MFC-with:   352775

Modified:
  head/sys/dev/sound/pci/hda/hdac.h

Modified: head/sys/dev/sound/pci/hda/hdac.h
==
--- head/sys/dev/sound/pci/hda/hdac.h   Thu Sep 26 21:02:21 2019
(r352775)
+++ head/sys/dev/sound/pci/hda/hdac.h   Thu Sep 26 21:04:36 2019
(r352776)
@@ -77,6 +77,7 @@
 #define HDA_INTEL_KBLK HDA_MODEL_CONSTRUCT(INTEL, 0xa171)
 #define HDA_INTEL_KBLKHHDA_MODEL_CONSTRUCT(INTEL, 0xa2f0)
 #define HDA_INTEL_CFLK HDA_MODEL_CONSTRUCT(INTEL, 0xa348)
+#define HDA_INTEL_CNLK HDA_MODEL_CONSTRUCT(INTEL, 0x9dc8)
 #define HDA_INTEL_ALL  HDA_MODEL_CONSTRUCT(INTEL, 0x)
 
 /* Nvidia */
___
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: r352775 - head/sys/dev/sound/pci/hda

2019-09-26 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Sep 26 21:02:21 2019
New Revision: 352775
URL: https://svnweb.freebsd.org/changeset/base/352775

Log:
  snd_hda: Add Intel Cannon Lake support
  
  Add PCI ids for Intel Cannon Lake PCH
  
  Tested on:HP Spectre x360 13-p0043dx
  PR:   240574
  Submitted by: Neel Chauhan 
  Reviewed by:  imp, mizhka, ray
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D21789

Modified:
  head/sys/dev/sound/pci/hda/hdac.c

Modified: head/sys/dev/sound/pci/hda/hdac.c
==
--- head/sys/dev/sound/pci/hda/hdac.c   Thu Sep 26 20:56:07 2019
(r352774)
+++ head/sys/dev/sound/pci/hda/hdac.c   Thu Sep 26 21:02:21 2019
(r352775)
@@ -102,6 +102,7 @@ static const struct {
{ HDA_INTEL_KBLK,"Intel Kaby Lake", 0, 0 },
{ HDA_INTEL_KBLKH,   "Intel Kaby Lake-H",   0, 0 },
{ HDA_INTEL_CFLK,"Intel Coffee Lake",   0, 0 },
+   { HDA_INTEL_CNLK,"Intel Cannon Lake",   0, 0 },
{ HDA_INTEL_82801F,  "Intel 82801F",0, 0 },
{ HDA_INTEL_63XXESB, "Intel 631x/632xESB",  0, 0 },
{ HDA_INTEL_82801G,  "Intel 82801G",0, 0 },
___
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: r352028 - head/sys/arm/broadcom/bcm2835

2019-09-08 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Sep  8 09:47:21 2019
New Revision: 352028
URL: https://svnweb.freebsd.org/changeset/base/352028

Log:
  [rpi] Inherit framebuffer BPP value from the VideoCore firmware
  
  Instead of using hardcoded bpp of 24, obtain current/configured value
  from VideoCore. This solves certain problems with Xorg/Qt apps that
  require bpp of 32 to work properly. The mode can be forced by setting
  framebuffer_depth value in config.txt
  
  PR:   235363
  Submitted by: Steve Peurifoy 

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c
  head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
  head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Sun Sep  8 01:58:02 2019
(r352027)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Sun Sep  8 09:47:21 2019
(r352028)
@@ -85,7 +85,13 @@ bcm_fb_init(struct bcmsc_softc *sc, struct bcm2835_fb_
memset(fb, 0, sizeof(*fb));
if (bcm2835_mbox_fb_get_w_h(fb) != 0)
return (ENXIO);
-   fb->bpp = FB_DEPTH;
+   if (bcm2835_mbox_fb_get_bpp(fb) != 0)
+   return (ENXIO);
+   if (fb->bpp < FB_DEPTH) {
+   device_printf(sc->dev, "changing fb bpp from %d to %d\n", 
fb->bpp, FB_DEPTH);
+   fb->bpp = FB_DEPTH;
+   } else
+   device_printf(sc->dev, "keeping existing fb bpp of %d\n", 
fb->bpp);
 
fb->vxres = fb->xres;
fb->vyres = fb->yres;

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.cSun Sep  8 01:58:02 
2019(r352027)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.cSun Sep  8 09:47:21 
2019(r352028)
@@ -499,6 +499,26 @@ bcm2835_mbox_fb_get_w_h(struct bcm2835_fb_config *fb)
 }
 
 int
+bcm2835_mbox_fb_get_bpp(struct bcm2835_fb_config *fb)
+{
+   int err;
+   struct msg_fb_get_bpp msg;
+   
+   memset(&msg, 0, sizeof(msg));
+   msg.hdr.buf_size = sizeof(msg);
+   msg.hdr.code = BCM2835_MBOX_CODE_REQ;
+   BCM2835_MBOX_INIT_TAG(&msg.bpp, GET_DEPTH);
+   msg.bpp.tag_hdr.val_len = 0;
+   msg.end_tag = 0;
+   
+   err = bcm2835_mbox_property(&msg, sizeof(msg));
+   if (err == 0)
+   fb->bpp = msg.bpp.body.resp.bpp;
+   
+   return (err);
+}
+
+int
 bcm2835_mbox_fb_init(struct bcm2835_fb_config *fb)
 {
int err;

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h   Sun Sep  8 01:58:02 
2019(r352027)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h   Sun Sep  8 09:47:21 
2019(r352028)
@@ -474,6 +474,14 @@ struct msg_fb_get_w_h {
 
 int bcm2835_mbox_fb_get_w_h(struct bcm2835_fb_config *);
 
+struct msg_fb_get_bpp {
+   struct bcm2835_mbox_hdr hdr;
+   struct bcm2835_mbox_tag_depth bpp;
+   uint32_t end_tag;
+};
+
+int bcm2835_mbox_fb_get_bpp(struct bcm2835_fb_config *);
+
 struct msg_fb_setup {
struct bcm2835_mbox_hdr hdr;
struct bcm2835_mbox_tag_fb_w_h physical_w_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: r351616 - head/sys/dev/usb/net

2019-09-02 Thread Oleksandr Tymoshenko
Hans Petter Selasky (h...@selasky.org) wrote:
> On 2019-09-02 02:29, Oleksandr Tymoshenko wrote:
> > Gleb Smirnoff (gleb...@freebsd.org) wrote:
> >> Author: glebius
> >> Date: Fri Aug 30 00:05:04 2019
> >> New Revision: 351616
> >> URL: https://svnweb.freebsd.org/changeset/base/351616
> >>
> >> Log:
> >>Use mbuf queue instead of ifqueue in USB network drivers.
> > 
> > Hi Gleb,
> > 
> > This change broke NFS root on RPi. I suspect it's not just NFS root
> > but USB ethernet functionality in general. Patch below fixes it for me.
> > The same patch probably should also be applied to if_axe and if_axge.
> > 
> 
> Hi,
> 
> 1) axe and axge use the common code, so no patch needed there from what 
> I can see.
> 
> 2) This queue should be unlimited.
> 
> See:
> https://svnweb.freebsd.org/changeset/base/351692

Thanks for a quick fix. Can confirm that latest HEAD boots fine now with
NFS root.

-- 
gonzo
___
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: r351616 - head/sys/dev/usb/net

2019-09-01 Thread Oleksandr Tymoshenko
Gleb Smirnoff (gleb...@freebsd.org) wrote:
> Author: glebius
> Date: Fri Aug 30 00:05:04 2019
> New Revision: 351616
> URL: https://svnweb.freebsd.org/changeset/base/351616
> 
> Log:
>   Use mbuf queue instead of ifqueue in USB network drivers.

Hi Gleb,

This change broke NFS root on RPi. I suspect it's not just NFS root
but USB ethernet functionality in general. Patch below fixes it for me.
The same patch probably should also be applied to if_axe and if_axge.

Index: sys/dev/usb/net/usb_ethernet.c
===
--- sys/dev/usb/net/usb_ethernet.c  (revision 351673)
+++ sys/dev/usb/net/usb_ethernet.c  (working copy)
@@ -219,6 +219,7 @@
ue->ue_unit = alloc_unr(ueunit);
usb_callout_init_mtx(&ue->ue_watchdog, ue->ue_mtx, 0);
sysctl_ctx_init(&ue->ue_sysctl_ctx);
+   mbufq_init(&ue->ue_rxq, ifqmaxlen);
 
error = 0;
CURVNET_SET_QUIET(vnet0);
@@ -330,6 +331,9 @@
/* free sysctl */
sysctl_ctx_free(&ue->ue_sysctl_ctx);
 
+   /* drain mbuf queue */
+   mbufq_drain(&ue->ue_rxq);
+
/* free unit */
free_unr(ueunit, ue->ue_unit);
}
___
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: r347637 - stable/11/sys/kern

2019-05-15 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu May 16 00:53:54 2019
New Revision: 347637
URL: https://svnweb.freebsd.org/changeset/base/347637

Log:
  MFC r345550:
  
  Change default value of kern.bootfile to reflect reality
  
  In most cases kernel.bootfile is populated from the information
  provided by loader(8). There are certain scenarios when loader
  is not available, for instance when kernel is loaded by u-boot
  or some other BootROM directly. In this case the default value
  "/kernel" points to invalid location and breaks some functinality,
  like using installkernel on self-hosted system or dtrace's CTF
  lookup. This can be fixed by setting the value manually but the
  default that reflects correct location is better than default that
  points to invalid one.
  
  Current default was set around FreeBSD 1, when "/kernel" was the
  actual path. Transition to /boot/kernel/kernel happened circa FreeBSD 3.
  
  PR:   221550
  Reviewed by:  ian, imp
  Differential Revision:https://reviews.freebsd.org/D18902

Modified:
  stable/11/sys/kern/kern_mib.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_mib.c
==
--- stable/11/sys/kern/kern_mib.c   Thu May 16 00:51:30 2019
(r347636)
+++ stable/11/sys/kern/kern_mib.c   Thu May 16 00:53:54 2019
(r347637)
@@ -135,7 +135,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_R
 SYSCTL_NULL_INT_PTR, 0, "Whether saved set-group/user ID is available");
 #endif
 
-char kernelname[MAXPATHLEN] = "/kernel";   /* XXX bloat */
+char kernelname[MAXPATHLEN] = "/boot/kernel/kernel";   /* XXX bloat */
 
 SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW | CTLFLAG_MPSAFE,
 kernelname, sizeof kernelname, "Name of kernel file booted");
___
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: r347636 - stable/11/sys/dev/acpi_support

2019-05-15 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu May 16 00:51:30 2019
New Revision: 347636
URL: https://svnweb.freebsd.org/changeset/base/347636

Log:
  MFC r346647:
  
  [acpi_ibm] Add support for newer Thinkpad models
  
  Add support for newer Thinkpad models with id LEN0268. Was tested on
  Thinkpad T480 and ThinkPad X1 Yoga 2nd gen.
  
  PR:   229120
  Submitted by: Ali Abdallah 

Modified:
  stable/11/sys/dev/acpi_support/acpi_ibm.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/acpi_support/acpi_ibm.c
==
--- stable/11/sys/dev/acpi_support/acpi_ibm.c   Wed May 15 22:51:25 2019
(r347635)
+++ stable/11/sys/dev/acpi_support/acpi_ibm.c   Thu May 16 00:51:30 2019
(r347636)
@@ -340,7 +340,7 @@ static devclass_t acpi_ibm_devclass;
 DRIVER_MODULE(acpi_ibm, acpi, acpi_ibm_driver, acpi_ibm_devclass,
  0, 0);
 MODULE_DEPEND(acpi_ibm, acpi, 1, 1, 1);
-static char*ibm_ids[] = {"IBM0068", "LEN0068", NULL};
+static char*ibm_ids[] = {"IBM0068", "LEN0068", "LEN0268", NULL};
 
 static void
 ibm_led(void *softc, int onoff)
@@ -387,9 +387,14 @@ static int
 acpi_ibm_attach(device_t dev)
 {
int i;
+   int hkey;
struct acpi_ibm_softc   *sc;
char *maker, *product;
-   devclass_t  ec_devclass;
+   ACPI_OBJECT_LIST input;
+   ACPI_OBJECT params[1];
+   ACPI_OBJECT out_obj;
+   ACPI_BUFFER result;
+   devclass_t ec_devclass;
 
ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__);
 
@@ -424,15 +429,42 @@ acpi_ibm_attach(device_t dev)
"initialmask", CTLFLAG_RD,
&sc->events_initialmask, 0, "Initial eventmask");
 
-   /* The availmask is the bitmask of supported events */
-   if (ACPI_FAILURE(acpi_GetInteger(sc->handle,
-   IBM_NAME_EVENTS_AVAILMASK, &sc->events_availmask)))
+   if (ACPI_SUCCESS (acpi_GetInteger(sc->handle, "MHKV", &hkey))) {
+   device_printf(dev, "Firmware version is 0x%X\n", hkey);
+   switch(hkey >> 8)
+   {
+   case 1:
+   /* The availmask is the bitmask of supported 
events */
+   if (ACPI_FAILURE(acpi_GetInteger(sc->handle,
+   IBM_NAME_EVENTS_AVAILMASK, 
&sc->events_availmask)))
+   sc->events_availmask = 0x;
+   break;
+
+   case 2:
+   result.Length = sizeof(out_obj);
+   result.Pointer = &out_obj;
+   params[0].Type = ACPI_TYPE_INTEGER;
+   params[0].Integer.Value = 1;
+   input.Pointer = params;
+   input.Count = 1;
+
+   sc->events_availmask = 0x;
+
+   if (ACPI_SUCCESS(AcpiEvaluateObject (sc->handle,
+   IBM_NAME_EVENTS_AVAILMASK, &input, 
&result)))
+   sc->events_availmask = 
out_obj.Integer.Value;
+   break;
+   default:
+   device_printf(dev, "Unknown firmware version 
0x%x\n", hkey);
+   break;
+   }
+   } else
sc->events_availmask = 0x;
 
SYSCTL_ADD_UINT(sc->sysctl_ctx,
-   SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
-   "availmask", CTLFLAG_RD,
-   &sc->events_availmask, 0, "Mask of supported events");
+   SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
+   "availmask", CTLFLAG_RD,
+   &sc->events_availmask, 0, "Mask of supported 
events");
}
 
/* Hook up proc nodes */
___
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: r347634 - stable/12/sys/dev/acpi_support

2019-05-15 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed May 15 21:52:43 2019
New Revision: 347634
URL: https://svnweb.freebsd.org/changeset/base/347634

Log:
  MFC r346647:
  
  [acpi_ibm] Add support for newer Thinkpad models
  
  Add support for newer Thinkpad models with id LEN0268. Was tested on
  Thinkpad T480 and ThinkPad X1 Yoga 2nd gen.
  
  PR:   229120
  Submitted by: Ali Abdallah 

Modified:
  stable/12/sys/dev/acpi_support/acpi_ibm.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/acpi_support/acpi_ibm.c
==
--- stable/12/sys/dev/acpi_support/acpi_ibm.c   Wed May 15 21:25:44 2019
(r347633)
+++ stable/12/sys/dev/acpi_support/acpi_ibm.c   Wed May 15 21:52:43 2019
(r347634)
@@ -349,7 +349,7 @@ static devclass_t acpi_ibm_devclass;
 DRIVER_MODULE(acpi_ibm, acpi, acpi_ibm_driver, acpi_ibm_devclass,
  0, 0);
 MODULE_DEPEND(acpi_ibm, acpi, 1, 1, 1);
-static char*ibm_ids[] = {"IBM0068", "LEN0068", NULL};
+static char*ibm_ids[] = {"IBM0068", "LEN0068", "LEN0268", NULL};
 
 static void
 ibm_led(void *softc, int onoff)
@@ -425,9 +425,14 @@ static int
 acpi_ibm_attach(device_t dev)
 {
int i;
+   int hkey;
struct acpi_ibm_softc   *sc;
char *maker, *product;
-   devclass_t  ec_devclass;
+   ACPI_OBJECT_LIST input;
+   ACPI_OBJECT params[1];
+   ACPI_OBJECT out_obj;
+   ACPI_BUFFER result;
+   devclass_t ec_devclass;
 
ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__);
 
@@ -462,15 +467,42 @@ acpi_ibm_attach(device_t dev)
"initialmask", CTLFLAG_RD,
&sc->events_initialmask, 0, "Initial eventmask");
 
-   /* The availmask is the bitmask of supported events */
-   if (ACPI_FAILURE(acpi_GetInteger(sc->handle,
-   IBM_NAME_EVENTS_AVAILMASK, &sc->events_availmask)))
+   if (ACPI_SUCCESS (acpi_GetInteger(sc->handle, "MHKV", &hkey))) {
+   device_printf(dev, "Firmware version is 0x%X\n", hkey);
+   switch(hkey >> 8)
+   {
+   case 1:
+   /* The availmask is the bitmask of supported 
events */
+   if (ACPI_FAILURE(acpi_GetInteger(sc->handle,
+   IBM_NAME_EVENTS_AVAILMASK, 
&sc->events_availmask)))
+   sc->events_availmask = 0x;
+   break;
+
+   case 2:
+   result.Length = sizeof(out_obj);
+   result.Pointer = &out_obj;
+   params[0].Type = ACPI_TYPE_INTEGER;
+   params[0].Integer.Value = 1;
+   input.Pointer = params;
+   input.Count = 1;
+
+   sc->events_availmask = 0x;
+
+   if (ACPI_SUCCESS(AcpiEvaluateObject (sc->handle,
+   IBM_NAME_EVENTS_AVAILMASK, &input, 
&result)))
+   sc->events_availmask = 
out_obj.Integer.Value;
+   break;
+   default:
+   device_printf(dev, "Unknown firmware version 
0x%x\n", hkey);
+   break;
+   }
+   } else
sc->events_availmask = 0x;
 
SYSCTL_ADD_UINT(sc->sysctl_ctx,
-   SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
-   "availmask", CTLFLAG_RD,
-   &sc->events_availmask, 0, "Mask of supported events");
+   SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
+   "availmask", CTLFLAG_RD,
+   &sc->events_availmask, 0, "Mask of supported 
events");
}
 
/* Hook up proc nodes */
___
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: r347629 - stable/12/sys/kern

2019-05-15 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed May 15 18:56:42 2019
New Revision: 347629
URL: https://svnweb.freebsd.org/changeset/base/347629

Log:
  MFC r345550:
  
  Change default value of kern.bootfile to reflect reality
  
  In most cases kernel.bootfile is populated from the information
  provided by loader(8). There are certain scenarios when loader
  is not available, for instance when kernel is loaded by u-boot
  or some other BootROM directly. In this case the default value
  "/kernel" points to invalid location and breaks some functinality,
  like using installkernel on self-hosted system or dtrace's CTF
  lookup. This can be fixed by setting the value manually but the
  default that reflects correct location is better than default that
  points to invalid one.
  
  Current default was set around FreeBSD 1, when "/kernel" was the
  actual path. Transition to /boot/kernel/kernel happened circa FreeBSD 3.
  
  PR:   221550
  Reviewed by:  ian, imp
  Differential Revision:https://reviews.freebsd.org/D18902

Modified:
  stable/12/sys/kern/kern_mib.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/kern_mib.c
==
--- stable/12/sys/kern/kern_mib.c   Wed May 15 18:13:43 2019
(r347628)
+++ stable/12/sys/kern/kern_mib.c   Wed May 15 18:56:42 2019
(r347629)
@@ -136,7 +136,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_R
 SYSCTL_NULL_INT_PTR, 0, "Whether saved set-group/user ID is available");
 #endif
 
-char kernelname[MAXPATHLEN] = "/kernel";   /* XXX bloat */
+char kernelname[MAXPATHLEN] = "/boot/kernel/kernel";   /* XXX bloat */
 
 SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW | CTLFLAG_MPSAFE,
 kernelname, sizeof kernelname, "Name of kernel file booted");
___
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: r346656 - stable/11/sys/compat/ndis

2019-04-24 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Apr 25 00:58:11 2019
New Revision: 346656
URL: https://svnweb.freebsd.org/changeset/base/346656

Log:
  MFC r343298:
  
  [ndis] Fix unregistered use of FPU by NDIS in kernel on amd64
  
  amd64 miniport drivers are allowed to use FPU which triggers "Unregistered use
  of FPU in kernel" panic.
  
  Wrap all variants of MSCALL with fpu_kern_enter/fpu_kern_leave.  To reduce
  amount of allocations/deallocations done via
  fpu_kern_alloc_ctx/fpu_kern_free_ctx maintain cache of fpu_kern_ctx elements.
  
  Based on the patch by Paul B Mahol
  
  PR:   165622
  Submitted by: Vlad Movchan 

Modified:
  stable/11/sys/compat/ndis/kern_windrv.c
  stable/11/sys/compat/ndis/pe_var.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/ndis/kern_windrv.c
==
--- stable/11/sys/compat/ndis/kern_windrv.c Thu Apr 25 00:56:11 2019
(r346655)
+++ stable/11/sys/compat/ndis/kern_windrv.c Thu Apr 25 00:58:11 2019
(r346656)
@@ -56,6 +56,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif
 
+#ifdef __amd64__
+#include 
+#endif
+
 #include 
 
 #include 
@@ -66,6 +70,19 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef __amd64__
+struct fpu_cc_ent {
+   struct fpu_kern_ctx *ctx;
+   LIST_ENTRY(fpu_cc_ent)  entries;
+};
+static LIST_HEAD(fpu_ctx_free, fpu_cc_ent) fpu_free_head =
+LIST_HEAD_INITIALIZER(fpu_free_head);
+static LIST_HEAD(fpu_ctx_busy, fpu_cc_ent) fpu_busy_head =
+LIST_HEAD_INITIALIZER(fpu_busy_head);
+static struct mtx fpu_free_mtx;
+static struct mtx fpu_busy_mtx;
+#endif
+
 static struct mtx drvdb_mtx;
 static STAILQ_HEAD(drvdb, drvdb_ent) drvdb_head;
 
@@ -96,6 +113,13 @@ windrv_libinit(void)
mtx_init(&drvdb_mtx, "Windows driver DB lock",
"Windows internal lock", MTX_DEF);
 
+#ifdef __amd64__
+   LIST_INIT(&fpu_free_head);
+   LIST_INIT(&fpu_busy_head);
+   mtx_init(&fpu_free_mtx, "free fpu context list lock", NULL, MTX_DEF);
+   mtx_init(&fpu_busy_mtx, "busy fpu context list lock", NULL, MTX_DEF);
+#endif
+
/*
 * PCI and pccard devices don't need to use IRPs to
 * interact with their bus drivers (usually), so our
@@ -130,6 +154,9 @@ int
 windrv_libfini(void)
 {
struct drvdb_ent*d;
+#ifdef __amd64__
+   struct fpu_cc_ent   *ent;
+#endif
 
mtx_lock(&drvdb_mtx); 
while(STAILQ_FIRST(&drvdb_head) != NULL) {
@@ -148,6 +175,18 @@ windrv_libfini(void)
smp_rendezvous(NULL, x86_oldldt, NULL, NULL);
ExFreePool(my_tids);
 #endif
+#ifdef __amd64__
+   while ((ent = LIST_FIRST(&fpu_free_head)) != NULL) {
+   LIST_REMOVE(ent, entries);
+   fpu_kern_free_ctx(ent->ctx);
+   free(ent, M_DEVBUF);
+   }
+   mtx_destroy(&fpu_free_mtx);
+
+   ent = LIST_FIRST(&fpu_busy_head);
+   KASSERT(ent == NULL, ("busy fpu context list is not empty"));
+   mtx_destroy(&fpu_busy_mtx);
+#endif
return (0);
 }
 
@@ -612,6 +651,148 @@ windrv_wrap(func, wrap, argcnt, ftype)
*wrap = p;
 
return (0);
+}
+
+static struct fpu_cc_ent *
+request_fpu_cc_ent(void)
+{
+   struct fpu_cc_ent *ent;
+
+   mtx_lock(&fpu_free_mtx);
+   if ((ent = LIST_FIRST(&fpu_free_head)) != NULL) {
+   LIST_REMOVE(ent, entries);
+   mtx_unlock(&fpu_free_mtx);
+   mtx_lock(&fpu_busy_mtx);
+   LIST_INSERT_HEAD(&fpu_busy_head, ent, entries);
+   mtx_unlock(&fpu_busy_mtx);
+   return (ent);
+   }
+   mtx_unlock(&fpu_free_mtx);
+
+   if ((ent = malloc(sizeof(struct fpu_cc_ent), M_DEVBUF, M_NOWAIT |
+   M_ZERO)) != NULL) {
+   ent->ctx = fpu_kern_alloc_ctx(FPU_KERN_NORMAL |
+   FPU_KERN_NOWAIT);
+   if (ent->ctx != NULL) {
+   mtx_lock(&fpu_busy_mtx);
+   LIST_INSERT_HEAD(&fpu_busy_head, ent, entries);
+   mtx_unlock(&fpu_busy_mtx);
+   } else {
+   free(ent, M_DEVBUF);
+   ent = NULL;
+   }
+   }
+
+   return (ent);
+}
+
+static void
+release_fpu_cc_ent(struct fpu_cc_ent *ent)
+{
+   mtx_lock(&fpu_busy_mtx);
+   LIST_REMOVE(ent, entries);
+   mtx_unlock(&fpu_busy_mtx);
+   mtx_lock(&fpu_free_mtx);
+   LIST_INSERT_HEAD(&fpu_free_head, ent, entries);
+   mtx_unlock(&fpu_free_mtx);
+}
+
+uint64_t
+_x86_64_call1(void *fn, uint64_t a)
+{
+   struct fpu_cc_ent *ent;
+   uint64_t ret;
+
+   if ((ent = request_fpu_cc_ent()) == NULL)
+   return (ENOMEM);
+   fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL);
+   ret = x86_64_call1(fn, a);
+   fpu_kern_leave(curthread, ent->ctx);
+   release_fpu_cc_ent(ent);
+
+   return (ret);
+}
+
+uint64_t
+_x86_64_call2(void *fn, uint64_t a,

svn commit: r346655 - in stable/11/sys/dev/usb: . quirk

2019-04-24 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Apr 25 00:56:11 2019
New Revision: 346655
URL: https://svnweb.freebsd.org/changeset/base/346655

Log:
  MFC r343224, r343533
  
  r343224:
  Add KBD_BOOTPROTO quirk for Logitech G510s USB keyboard
  
  PR:   232136
  Submitted by: dgilb...@eicat.ca
  
  r343533:
  [usb] Add UQ_KBD_BOOTPROTO quirk for Corsair K68 keyboard
  
  PR:   222114
  Submitted by: Zane C. Bowers-Hadley 

Modified:
  stable/11/sys/dev/usb/quirk/usb_quirk.c
  stable/11/sys/dev/usb/usbdevs
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/usb/quirk/usb_quirk.c
==
--- stable/11/sys/dev/usb/quirk/usb_quirk.c Thu Apr 25 00:08:15 2019
(r346654)
+++ stable/11/sys/dev/usb/quirk/usb_quirk.c Thu Apr 25 00:56:11 2019
(r346655)
@@ -94,6 +94,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK
USB_QUIRK(TELEX, MIC1, 0x009, 0x009, UQ_AU_NO_FRAC),
USB_QUIRK(SILICONPORTALS, YAPPHONE, 0x100, 0x100, UQ_AU_INP_ASYNC),
USB_QUIRK(LOGITECH, UN53B, 0x, 0x, UQ_NO_STRINGS),
+   USB_QUIRK(LOGITECH, G510S, 0x, 0x, UQ_KBD_BOOTPROTO),
USB_QUIRK(REALTEK, RTL8196EU, 0x, 0x, UQ_CFG_INDEX_1),
USB_QUIRK(REALTEK, RTL8153, 0x, 0x, UQ_CFG_INDEX_1),
USB_QUIRK(ELSA, MODEM1, 0x, 0x, UQ_CFG_INDEX_1),
@@ -134,6 +135,8 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK
USB_QUIRK(MICROSOFT, WLINTELLIMOUSE, 0x, 0x, 
UQ_MS_LEADING_BYTE),
/* Quirk for Corsair Vengeance K60 keyboard */
USB_QUIRK(CORSAIR, K60, 0x, 0x, UQ_KBD_BOOTPROTO),
+   /* Quirk for Corsair Gaming K68 keyboard */
+   USB_QUIRK(CORSAIR, K68, 0x, 0x, UQ_KBD_BOOTPROTO),
/* Quirk for Corsair Vengeance K70 keyboard */
USB_QUIRK(CORSAIR, K70, 0x, 0x, UQ_KBD_BOOTPROTO),
/* Quirk for Corsair K70 RGB keyboard */

Modified: stable/11/sys/dev/usb/usbdevs
==
--- stable/11/sys/dev/usb/usbdevs   Thu Apr 25 00:08:15 2019
(r346654)
+++ stable/11/sys/dev/usb/usbdevs   Thu Apr 25 00:56:11 2019
(r346655)
@@ -1522,6 +1522,7 @@ product COREGA FETHER_USB_TXC 0x9601  FEther USB-TXC
 
 /* Corsair products */
 product CORSAIR K600x0a60  Corsair Vengeance K60 keyboard
+product CORSAIR K680x1b3f  Corsair Gaming K68 keyboard
 product CORSAIR K700x1b09  Corsair Vengeance K70 keyboard
 product CORSAIR K70_RGB0x1b13  Corsair K70 RGB Keyboard
 product CORSAIR STRAFE 0x1b15  Corsair STRAFE Gaming keyboard
@@ -2746,6 +2747,7 @@ product LOGITECH UN58A0xc030  iFeel Mouse
 product LOGITECH UN53B 0xc032  iFeel MouseMan
 product LOGITECH WMPAD 0xc208  WingMan GamePad Extreme
 product LOGITECH WMRPAD0xc20a  WingMan RumblePad
+product LOGITECH G510S 0xc22d  G510s Keyboard
 product LOGITECH WMJOY 0xc281  WingMan Force joystick
 product LOGITECH BB13  0xc401  USB-PS/2 Trackball
 product LOGITECH RK53  0xc501  Cordless mouse
___
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: r346647 - head/sys/dev/acpi_support

2019-04-24 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed Apr 24 23:10:19 2019
New Revision: 346647
URL: https://svnweb.freebsd.org/changeset/base/346647

Log:
  [acpi_ibm] Add support for newer Thinkpad models
  
  Add support for newer Thinkpad models with id LEN0268. Was tested on
  Thinkpad T480 and ThinkPad X1 Yoga 2nd gen.
  
  PR:   229120
  Submitted by: Ali Abdallah 
  MFC after:1 week

Modified:
  head/sys/dev/acpi_support/acpi_ibm.c

Modified: head/sys/dev/acpi_support/acpi_ibm.c
==
--- head/sys/dev/acpi_support/acpi_ibm.cWed Apr 24 22:35:29 2019
(r346646)
+++ head/sys/dev/acpi_support/acpi_ibm.cWed Apr 24 23:10:19 2019
(r346647)
@@ -349,7 +349,7 @@ static devclass_t acpi_ibm_devclass;
 DRIVER_MODULE(acpi_ibm, acpi, acpi_ibm_driver, acpi_ibm_devclass,
  0, 0);
 MODULE_DEPEND(acpi_ibm, acpi, 1, 1, 1);
-static char*ibm_ids[] = {"IBM0068", "LEN0068", NULL};
+static char*ibm_ids[] = {"IBM0068", "LEN0068", "LEN0268", NULL};
 
 static void
 ibm_led(void *softc, int onoff)
@@ -428,9 +428,14 @@ static int
 acpi_ibm_attach(device_t dev)
 {
int i;
+   int hkey;
struct acpi_ibm_softc   *sc;
char *maker, *product;
-   devclass_t  ec_devclass;
+   ACPI_OBJECT_LIST input;
+   ACPI_OBJECT params[1];
+   ACPI_OBJECT out_obj;
+   ACPI_BUFFER result;
+   devclass_t ec_devclass;
 
ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__);
 
@@ -465,15 +470,42 @@ acpi_ibm_attach(device_t dev)
"initialmask", CTLFLAG_RD,
&sc->events_initialmask, 0, "Initial eventmask");
 
-   /* The availmask is the bitmask of supported events */
-   if (ACPI_FAILURE(acpi_GetInteger(sc->handle,
-   IBM_NAME_EVENTS_AVAILMASK, &sc->events_availmask)))
+   if (ACPI_SUCCESS (acpi_GetInteger(sc->handle, "MHKV", &hkey))) {
+   device_printf(dev, "Firmware version is 0x%X\n", hkey);
+   switch(hkey >> 8)
+   {
+   case 1:
+   /* The availmask is the bitmask of supported 
events */
+   if (ACPI_FAILURE(acpi_GetInteger(sc->handle,
+   IBM_NAME_EVENTS_AVAILMASK, 
&sc->events_availmask)))
+   sc->events_availmask = 0x;
+   break;
+
+   case 2:
+   result.Length = sizeof(out_obj);
+   result.Pointer = &out_obj;
+   params[0].Type = ACPI_TYPE_INTEGER;
+   params[0].Integer.Value = 1;
+   input.Pointer = params;
+   input.Count = 1;
+
+   sc->events_availmask = 0x;
+
+   if (ACPI_SUCCESS(AcpiEvaluateObject (sc->handle,
+   IBM_NAME_EVENTS_AVAILMASK, &input, 
&result)))
+   sc->events_availmask = 
out_obj.Integer.Value;
+   break;
+   default:
+   device_printf(dev, "Unknown firmware version 
0x%x\n", hkey);
+   break;
+   }
+   } else
sc->events_availmask = 0x;
 
SYSCTL_ADD_UINT(sc->sysctl_ctx,
-   SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
-   "availmask", CTLFLAG_RD,
-   &sc->events_availmask, 0, "Mask of supported events");
+   SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
+   "availmask", CTLFLAG_RD,
+   &sc->events_availmask, 0, "Mask of supported 
events");
}
 
/* Hook up proc nodes */
___
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: r345550 - head/sys/kern

2019-03-26 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Mar 26 18:03:18 2019
New Revision: 345550
URL: https://svnweb.freebsd.org/changeset/base/345550

Log:
  Change default value of kern.bootfile to reflect reality
  
  In most cases kernel.bootfile is populated from the information
  provided by loader(8). There are certain scenarios when loader
  is not available, for instance when kernel is loaded by u-boot
  or some other BootROM directly. In this case the default value
  "/kernel" points to invalid location and breaks some functinality,
  like using installkernel on self-hosted system or dtrace's CTF
  lookup. This can be fixed by setting the value manually but the
  default that reflects correct location is better than default that
  points to invalid one.
  
  Current default was set around FreeBSD 1, when "/kernel" was the
  actual path. Transition to /boot/kernel/kernel happened circa FreeBSD 3.
  
  PR:   221550
  Reviewed by:  ian, imp
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D18902

Modified:
  head/sys/kern/kern_mib.c

Modified: head/sys/kern/kern_mib.c
==
--- head/sys/kern/kern_mib.cTue Mar 26 15:47:13 2019(r345549)
+++ head/sys/kern/kern_mib.cTue Mar 26 18:03:18 2019(r345550)
@@ -136,7 +136,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_R
 SYSCTL_NULL_INT_PTR, 0, "Whether saved set-group/user ID is available");
 #endif
 
-char kernelname[MAXPATHLEN] = "/kernel";   /* XXX bloat */
+char kernelname[MAXPATHLEN] = "/boot/kernel/kernel";   /* XXX bloat */
 
 SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW | CTLFLAG_MPSAFE,
 kernelname, sizeof kernelname, "Name of kernel file booted");
___
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: r345463 - stable/12/share/examples/kld/dyn_sysctl

2019-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Mar 23 23:44:40 2019
New Revision: 345463
URL: https://svnweb.freebsd.org/changeset/base/345463

Log:
  MFC r345220:
  
  Fix build for KLD dyn_sysctl example
  
  Looks like the example was broken by change of SYSCTL_STATIC_CHILDREN
  definition in r267992. Fix build by switching to using SYSCTL_ADD_ROOT_NODE
  
  PR:   236139
  Submitted by: Andrew Reiter 

Modified:
  stable/12/share/examples/kld/dyn_sysctl/dyn_sysctl.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/examples/kld/dyn_sysctl/dyn_sysctl.c
==
--- stable/12/share/examples/kld/dyn_sysctl/dyn_sysctl.cSat Mar 23 
23:43:33 2019(r345462)
+++ stable/12/share/examples/kld/dyn_sysctl/dyn_sysctl.cSat Mar 23 
23:44:40 2019(r345463)
@@ -72,12 +72,10 @@ load(module_t mod, int cmd, void *arg)
 * to different contexts.
 */
printf("TREEROOT  NAME\n");
-   a_root = SYSCTL_ADD_NODE(&clist,
-   SYSCTL_STATIC_CHILDREN(/* top of sysctl tree */),
+   a_root = SYSCTL_ADD_ROOT_NODE(&clist,
OID_AUTO, "dyn_sysctl", CTLFLAG_RW, 0,
"dyn_sysctl root node");
-   a_root = SYSCTL_ADD_NODE(&clist1,
-   SYSCTL_STATIC_CHILDREN(/* top of sysctl tree */),
+   a_root = SYSCTL_ADD_ROOT_NODE(&clist1,
OID_AUTO, "dyn_sysctl", CTLFLAG_RW, 0,
"dyn_sysctl root node");
if (a_root == NULL) {
___
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: r345462 - stable/12/sys/dev/beri/virtio

2019-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Mar 23 23:43:33 2019
New Revision: 345462
URL: https://svnweb.freebsd.org/changeset/base/345462

Log:
  MFC r343998:
  
  Fix off-by-one error in BERI virtio driver
  
  The hardcoded ident is exactly 20 bytes long but sprintf adds terminating 
zero,
  so there is one byte written out of array bounds.As a fix use strncpy it
  appends \0 only if space allows and its behavior matches virtio spec:
  
  When VIRTIO_BLK_T_GET_ID is issued, the device identifier, up to 20 bytes, is
  written to the buffer. The identifier should be interpreted as an ascii 
string.
  It is terminated with \0, unless it is exactly 20 bytes long.
  
  PR:   202298
  Reviewed by:  br
  Differential Revision:https://reviews.freebsd.org/D18852

Modified:
  stable/12/sys/dev/beri/virtio/virtio_block.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/beri/virtio/virtio_block.c
==
--- stable/12/sys/dev/beri/virtio/virtio_block.cSat Mar 23 22:56:03 
2019(r345461)
+++ stable/12/sys/dev/beri/virtio/virtio_block.cSat Mar 23 23:43:33 
2019(r345462)
@@ -187,7 +187,7 @@ vtblk_proc(struct beri_vtblk_softc *sc, struct vqueue_
break;
case VIRTIO_BLK_T_GET_ID:
/* Assume a single buffer */
-   strlcpy(iov[1].iov_base, sc->ident,
+   strncpy(iov[1].iov_base, sc->ident,
MIN(iov[1].iov_len, sizeof(sc->ident)));
err = 0;
break;
@@ -401,7 +401,7 @@ backend_info(struct beri_vtblk_softc *sc)
s+=1;
}
 
-   sprintf(sc->ident, "Virtio block backend");
+   strncpy(sc->ident, "Virtio block backend", sizeof(sc->ident));
 
return (0);
 }
___
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: r345459 - stable/12/sys/compat/ndis

2019-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Mar 23 22:44:11 2019
New Revision: 345459
URL: https://svnweb.freebsd.org/changeset/base/345459

Log:
  MFC r343298:
  
  [ndis] Fix unregistered use of FPU by NDIS in kernel on amd64
  
  amd64 miniport drivers are allowed to use FPU which triggers "Unregistered use
  of FPU in kernel" panic.
  
  Wrap all variants of MSCALL with fpu_kern_enter/fpu_kern_leave.  To reduce
  amount of allocations/deallocations done via
  fpu_kern_alloc_ctx/fpu_kern_free_ctx maintain cache of fpu_kern_ctx elements.
  
  Based on the patch by Paul B Mahol
  
  PR:   165622
  Submitted by: Vlad Movchan 

Modified:
  stable/12/sys/compat/ndis/kern_windrv.c
  stable/12/sys/compat/ndis/pe_var.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/ndis/kern_windrv.c
==
--- stable/12/sys/compat/ndis/kern_windrv.c Sat Mar 23 21:36:59 2019
(r345458)
+++ stable/12/sys/compat/ndis/kern_windrv.c Sat Mar 23 22:44:11 2019
(r345459)
@@ -58,6 +58,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif
 
+#ifdef __amd64__
+#include 
+#endif
+
 #include 
 
 #include 
@@ -68,6 +72,19 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef __amd64__
+struct fpu_cc_ent {
+   struct fpu_kern_ctx *ctx;
+   LIST_ENTRY(fpu_cc_ent)  entries;
+};
+static LIST_HEAD(fpu_ctx_free, fpu_cc_ent) fpu_free_head =
+LIST_HEAD_INITIALIZER(fpu_free_head);
+static LIST_HEAD(fpu_ctx_busy, fpu_cc_ent) fpu_busy_head =
+LIST_HEAD_INITIALIZER(fpu_busy_head);
+static struct mtx fpu_free_mtx;
+static struct mtx fpu_busy_mtx;
+#endif
+
 static struct mtx drvdb_mtx;
 static STAILQ_HEAD(drvdb, drvdb_ent) drvdb_head;
 
@@ -98,6 +115,13 @@ windrv_libinit(void)
mtx_init(&drvdb_mtx, "Windows driver DB lock",
"Windows internal lock", MTX_DEF);
 
+#ifdef __amd64__
+   LIST_INIT(&fpu_free_head);
+   LIST_INIT(&fpu_busy_head);
+   mtx_init(&fpu_free_mtx, "free fpu context list lock", NULL, MTX_DEF);
+   mtx_init(&fpu_busy_mtx, "busy fpu context list lock", NULL, MTX_DEF);
+#endif
+
/*
 * PCI and pccard devices don't need to use IRPs to
 * interact with their bus drivers (usually), so our
@@ -132,6 +156,9 @@ int
 windrv_libfini(void)
 {
struct drvdb_ent*d;
+#ifdef __amd64__
+   struct fpu_cc_ent   *ent;
+#endif
 
mtx_lock(&drvdb_mtx); 
while(STAILQ_FIRST(&drvdb_head) != NULL) {
@@ -150,6 +177,18 @@ windrv_libfini(void)
smp_rendezvous(NULL, x86_oldldt, NULL, NULL);
ExFreePool(my_tids);
 #endif
+#ifdef __amd64__
+   while ((ent = LIST_FIRST(&fpu_free_head)) != NULL) {
+   LIST_REMOVE(ent, entries);
+   fpu_kern_free_ctx(ent->ctx);
+   free(ent, M_DEVBUF);
+   }
+   mtx_destroy(&fpu_free_mtx);
+
+   ent = LIST_FIRST(&fpu_busy_head);
+   KASSERT(ent == NULL, ("busy fpu context list is not empty"));
+   mtx_destroy(&fpu_busy_mtx);
+#endif
return (0);
 }
 
@@ -614,6 +653,148 @@ windrv_wrap(func, wrap, argcnt, ftype)
*wrap = p;
 
return (0);
+}
+
+static struct fpu_cc_ent *
+request_fpu_cc_ent(void)
+{
+   struct fpu_cc_ent *ent;
+
+   mtx_lock(&fpu_free_mtx);
+   if ((ent = LIST_FIRST(&fpu_free_head)) != NULL) {
+   LIST_REMOVE(ent, entries);
+   mtx_unlock(&fpu_free_mtx);
+   mtx_lock(&fpu_busy_mtx);
+   LIST_INSERT_HEAD(&fpu_busy_head, ent, entries);
+   mtx_unlock(&fpu_busy_mtx);
+   return (ent);
+   }
+   mtx_unlock(&fpu_free_mtx);
+
+   if ((ent = malloc(sizeof(struct fpu_cc_ent), M_DEVBUF, M_NOWAIT |
+   M_ZERO)) != NULL) {
+   ent->ctx = fpu_kern_alloc_ctx(FPU_KERN_NORMAL |
+   FPU_KERN_NOWAIT);
+   if (ent->ctx != NULL) {
+   mtx_lock(&fpu_busy_mtx);
+   LIST_INSERT_HEAD(&fpu_busy_head, ent, entries);
+   mtx_unlock(&fpu_busy_mtx);
+   } else {
+   free(ent, M_DEVBUF);
+   ent = NULL;
+   }
+   }
+
+   return (ent);
+}
+
+static void
+release_fpu_cc_ent(struct fpu_cc_ent *ent)
+{
+   mtx_lock(&fpu_busy_mtx);
+   LIST_REMOVE(ent, entries);
+   mtx_unlock(&fpu_busy_mtx);
+   mtx_lock(&fpu_free_mtx);
+   LIST_INSERT_HEAD(&fpu_free_head, ent, entries);
+   mtx_unlock(&fpu_free_mtx);
+}
+
+uint64_t
+_x86_64_call1(void *fn, uint64_t a)
+{
+   struct fpu_cc_ent *ent;
+   uint64_t ret;
+
+   if ((ent = request_fpu_cc_ent()) == NULL)
+   return (ENOMEM);
+   fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL);
+   ret = x86_64_call1(fn, a);
+   fpu_kern_leave(curthread, ent->ctx);
+   release_fpu_cc_ent(ent);
+
+   return (ret);
+}
+
+uint64_t
+_x86_64_call2(void *fn, uint64_t a,

svn commit: r345220 - head/share/examples/kld/dyn_sysctl

2019-03-16 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Mar 16 04:24:02 2019
New Revision: 345220
URL: https://svnweb.freebsd.org/changeset/base/345220

Log:
  Fix build for KLD dyn_sysctl example
  
  Looks like the example was broken by change of SYSCTL_STATIC_CHILDREN
  definition in r267992. Fix build by switching to using SYSCTL_ADD_ROOT_NODE
  
  PR:   236139
  Submitted by: Andrew Reiter 
  MFC after:1 week

Modified:
  head/share/examples/kld/dyn_sysctl/dyn_sysctl.c

Modified: head/share/examples/kld/dyn_sysctl/dyn_sysctl.c
==
--- head/share/examples/kld/dyn_sysctl/dyn_sysctl.c Sat Mar 16 04:02:19 
2019(r345219)
+++ head/share/examples/kld/dyn_sysctl/dyn_sysctl.c Sat Mar 16 04:24:02 
2019(r345220)
@@ -72,12 +72,10 @@ load(module_t mod, int cmd, void *arg)
 * to different contexts.
 */
printf("TREEROOT  NAME\n");
-   a_root = SYSCTL_ADD_NODE(&clist,
-   SYSCTL_STATIC_CHILDREN(/* top of sysctl tree */),
+   a_root = SYSCTL_ADD_ROOT_NODE(&clist,
OID_AUTO, "dyn_sysctl", CTLFLAG_RW, 0,
"dyn_sysctl root node");
-   a_root = SYSCTL_ADD_NODE(&clist1,
-   SYSCTL_STATIC_CHILDREN(/* top of sysctl tree */),
+   a_root = SYSCTL_ADD_ROOT_NODE(&clist1,
OID_AUTO, "dyn_sysctl", CTLFLAG_RW, 0,
"dyn_sysctl root node");
if (a_root == NULL) {
___
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: r344001 - stable/12/usr.bin/calendar/calendars/de_AT.ISO_8859-15

2019-02-11 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Feb 11 08:55:38 2019
New Revision: 344001
URL: https://svnweb.freebsd.org/changeset/base/344001

Log:
  MFC r343560:
  
  calendar(1): Fix Aschermittwoch date for Austrian calendar
  
  PR:   165516
  Submitted by: j...@berklix.com

Modified:
  stable/12/usr.bin/calendar/calendars/de_AT.ISO_8859-15/calendar.feiertag
Directory Properties:
  stable/12/   (props changed)

Modified: 
stable/12/usr.bin/calendar/calendars/de_AT.ISO_8859-15/calendar.feiertag
==
--- stable/12/usr.bin/calendar/calendars/de_AT.ISO_8859-15/calendar.feiertag
Mon Feb 11 08:52:48 2019(r344000)
+++ stable/12/usr.bin/calendar/calendars/de_AT.ISO_8859-15/calendar.feiertag
Mon Feb 11 08:55:38 2019(r344001)
@@ -37,7 +37,7 @@ Easter+60 Fronleichnam
 
 /*  Gedenktage - nicht arbeitsfreie Feiertage */
 02/14  Valentinstag
-02/WednesdayLast   Aschermittwoch
+Easter-46  Aschermittwoch
 Easter-7   Palmsonntag
 Nov Sun+3  Totensonntag
 Nov Sun+4  1. Advent
___
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: r344000 - stable/12/sys/fs/smbfs

2019-02-11 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Feb 11 08:52:48 2019
New Revision: 344000
URL: https://svnweb.freebsd.org/changeset/base/344000

Log:
  MFC r343209:
  
  [smbfs] Allow semicolon in mounts that support long names
  
  Semicolon is a legal character in long names but not in 8.3 format.
  Move it to respective character set.
  
  PR:   140068
  Submitted by: t...@uffner.com

Modified:
  stable/12/sys/fs/smbfs/smbfs_vnops.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/fs/smbfs/smbfs_vnops.c
==
--- stable/12/sys/fs/smbfs/smbfs_vnops.cMon Feb 11 08:49:56 2019
(r343999)
+++ stable/12/sys/fs/smbfs/smbfs_vnops.cMon Feb 11 08:52:48 2019
(r344000)
@@ -1120,8 +1120,8 @@ smbfs_advlock(ap)
 static int
 smbfs_pathcheck(struct smbmount *smp, const char *name, int nmlen, int nameiop)
 {
-   static const char *badchars = "*/:<>;?";
-   static const char *badchars83 = " +|,[]=";
+   static const char *badchars = "*/:<>?";
+   static const char *badchars83 = " +|,[]=;";
const char *cp;
int i, error;
 
___
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: r343999 - in stable/12: sbin/ifconfig sys/net80211

2019-02-11 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Feb 11 08:49:56 2019
New Revision: 343999
URL: https://svnweb.freebsd.org/changeset/base/343999

Log:
  MFC r343204:
  
  [ifconfig] Print more WPS attributes in verbose "list scan" output
  
  - Move WPS related defines to dedicated file
  - Add handlers for more WPS attributes
  
  PR:   217317
  Submitted by: J.R. Oldroyd 

Added:
  stable/12/sys/net80211/ieee80211_wps.h
 - copied unchanged from r343204, head/sys/net80211/ieee80211_wps.h
Modified:
  stable/12/sbin/ifconfig/ifieee80211.c
  stable/12/sys/net80211/ieee80211.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/ifconfig/ifieee80211.c
==
--- stable/12/sbin/ifconfig/ifieee80211.c   Mon Feb 11 07:42:32 2019
(r343998)
+++ stable/12/sbin/ifconfig/ifieee80211.c   Mon Feb 11 08:49:56 2019
(r343999)
@@ -77,6 +77,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -3124,13 +3125,6 @@ printrsnie(const char *tag, const u_int8_t *ie, size_t
}
 }
 
-/* XXX move to a public include file */
-#define IEEE80211_WPS_DEV_PASS_ID  0x1012
-#define IEEE80211_WPS_SELECTED_REG 0x1041
-#define IEEE80211_WPS_SETUP_STATE  0x1044
-#define IEEE80211_WPS_UUID_E   0x1047
-#define IEEE80211_WPS_VERSION  0x104a
-
 #define BE_READ_2(p)   \
((u_int16_t)\
 const u_int8_t *)(p))[1]  ) |  \
@@ -3152,6 +3146,7 @@ printwpsie(const char *tag, const u_int8_t *ie, size_t
"R" /* Registrar-specified */
};
int n;
+   int f;
 
ie +=6, len -= 4;   /* NB: len is payload only */
 
@@ -3160,6 +3155,7 @@ printwpsie(const char *tag, const u_int8_t *ie, size_t
while (len) {
uint16_t tlv_type = BE_READ_2(ie);
uint16_t tlv_len  = BE_READ_2(ie + 2);
+   uint16_t cfg_mthd;
 
/* some devices broadcast invalid WPS frames */
if (tlv_len > len) {
@@ -3172,30 +3168,191 @@ printwpsie(const char *tag, const u_int8_t *ie, size_t
ie += 4, len -= 4;
 
switch (tlv_type) {
-   case IEEE80211_WPS_VERSION:
+   case IEEE80211_WPS_ATTR_VERSION:
printf("v:%d.%d", *ie >> 4, *ie & 0xf);
break;
-   case IEEE80211_WPS_SETUP_STATE:
-   /* Only 1 and 2 are valid */
-   if (*ie == 0 || *ie >= 3)
-   printf(" state:B");
+   case IEEE80211_WPS_ATTR_AP_SETUP_LOCKED:
+   printf(" ap_setup:%s", *ie ? "locked" :
+   "unlocked");
+   break;
+   case IEEE80211_WPS_ATTR_CONFIG_METHODS:
+   case 
IEEE80211_WPS_ATTR_SELECTED_REGISTRAR_CONFIG_METHODS:
+   if (tlv_type == 
IEEE80211_WPS_ATTR_SELECTED_REGISTRAR_CONFIG_METHODS)
+   printf(" sel_reg_cfg_mthd:");
else
-   printf(" st:%s", *ie == 1 ? "N" : "C");
+   printf(" cfg_mthd:" );
+   cfg_mthd = BE_READ_2(ie);
+   f = 0;
+   for (n = 15; n >= 0; n--) {
+   if (f) {
+   printf(",");
+   f = 0;
+   }
+   switch (cfg_mthd & (1 << n)) {
+   case 0:
+   break;
+   case IEEE80211_WPS_CONFIG_USBA:
+   printf("usba");
+   f++;
+   break;
+   case IEEE80211_WPS_CONFIG_ETHERNET:
+   printf("ethernet");
+   f++;
+   break;
+   case IEEE80211_WPS_CONFIG_LABEL:
+   printf("label");
+   f++;
+   break;
+   case IEEE80211_WPS_CONFIG_DISPLAY:
+   if (!(cfg_m

svn commit: r343998 - head/sys/dev/beri/virtio

2019-02-10 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Feb 11 07:42:32 2019
New Revision: 343998
URL: https://svnweb.freebsd.org/changeset/base/343998

Log:
  Fix off-by-one error in BERI virtio driver
  
  The hardcoded ident is exactly 20 bytes long but sprintf adds terminating 
zero,
  so there is one byte written out of array bounds.As a fix use strncpy it
  appends \0 only if space allows and its behavior matches virtio spec:
  
  When VIRTIO_BLK_T_GET_ID is issued, the device identifier, up to 20 bytes, is
  written to the buffer. The identifier should be interpreted as an ascii 
string.
  It is terminated with \0, unless it is exactly 20 bytes long.
  
  PR:   202298
  Reviewed by:  br
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D18852

Modified:
  head/sys/dev/beri/virtio/virtio_block.c

Modified: head/sys/dev/beri/virtio/virtio_block.c
==
--- head/sys/dev/beri/virtio/virtio_block.c Mon Feb 11 07:09:02 2019
(r343997)
+++ head/sys/dev/beri/virtio/virtio_block.c Mon Feb 11 07:42:32 2019
(r343998)
@@ -187,7 +187,7 @@ vtblk_proc(struct beri_vtblk_softc *sc, struct vqueue_
break;
case VIRTIO_BLK_T_GET_ID:
/* Assume a single buffer */
-   strlcpy(iov[1].iov_base, sc->ident,
+   strncpy(iov[1].iov_base, sc->ident,
MIN(iov[1].iov_len, sizeof(sc->ident)));
err = 0;
break;
@@ -401,7 +401,7 @@ backend_info(struct beri_vtblk_softc *sc)
s+=1;
}
 
-   sprintf(sc->ident, "Virtio block backend");
+   strncpy(sc->ident, "Virtio block backend", sizeof(sc->ident));
 
return (0);
 }
___
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: r343741 - stable/12/usr.bin/find

2019-02-04 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Feb  4 10:25:29 2019
New Revision: 343741
URL: https://svnweb.freebsd.org/changeset/base/343741

Log:
  MFC r343516:
  
  Fix whiteout support in find(1)
  
  find(1) ignores -type w passed to it. With this patch find(1) properly
  identifies and prints whiteouts.
  
  PR:   126384, 156703
  Submitted by: o...@mamontov.net

Modified:
  stable/12/usr.bin/find/find.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/find/find.c
==
--- stable/12/usr.bin/find/find.c   Mon Feb  4 10:24:57 2019
(r343740)
+++ stable/12/usr.bin/find/find.c   Mon Feb  4 10:25:29 2019
(r343741)
@@ -208,8 +208,10 @@ find_execute(PLAN *plan, char *paths[])
entry->fts_path, strerror(entry->fts_errno));
exitstatus = 1;
continue;
-#ifdef FTS_W
+#if defined(FTS_W) && defined(FTS_WHITEOUT)
case FTS_W:
+   if (ftsoptions & FTS_WHITEOUT)
+   break;
continue;
 #endif /* FTS_W */
}
___
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: r343740 - stable/12/sys/dev/bhnd/cores/pmu

2019-02-04 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Feb  4 10:24:57 2019
New Revision: 343740
URL: https://svnweb.freebsd.org/changeset/base/343740

Log:
  MFC r343458:
  
  Fix format/arg mismatch
  
  USe correct format for int arguments
  
  PR:   229549
  Submitted by: David Binderman 

Modified:
  stable/12/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c
==
--- stable/12/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.cMon Feb  4 10:24:16 
2019(r343739)
+++ stable/12/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.cMon Feb  4 10:24:57 
2019(r343740)
@@ -1036,7 +1036,7 @@ bhnd_pmu_res_init(struct bhnd_pmu_softc *sc)
return (error);
}
 
-   PMU_DEBUG(sc, "Applying %s=%s to rsrc %d res_updn_timer\n",
+   PMU_DEBUG(sc, "Applying %s=%d to rsrc %d res_updn_timer\n",
name, val, i);
 
BHND_PMU_WRITE_4(sc, BHND_PMU_RES_TABLE_SEL, i);
@@ -,7 +,7 @@ bhnd_pmu_res_init(struct bhnd_pmu_softc *sc)
return (error);
}
 
-   PMU_DEBUG(sc, "Applying %s=%s to rsrc %d res_dep_mask\n", name,
+   PMU_DEBUG(sc, "Applying %s=%d to rsrc %d res_dep_mask\n", name,
val, i);
 
BHND_PMU_WRITE_4(sc, BHND_PMU_RES_TABLE_SEL, i);
___
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: r343739 - stable/12/tools/tools/tinybsd

2019-02-04 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Feb  4 10:24:16 2019
New Revision: 343739
URL: https://svnweb.freebsd.org/changeset/base/343739

Log:
  MFC r343391:
  
  Fix prompt for MFSROOT in tinybsd
  
  tinybsd offers two choices when prompting user for MFSROOT: 'YES'
  and 'NO'. Script logic only handles 'yes'. Change offered values
  to lower case.
  
  PR:   131059
  Submitted by: Brock Williams 

Modified:
  stable/12/tools/tools/tinybsd/tinybsd
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/tools/tools/tinybsd/tinybsd
==
--- stable/12/tools/tools/tinybsd/tinybsd   Mon Feb  4 10:20:48 2019
(r343738)
+++ stable/12/tools/tools/tinybsd/tinybsd   Mon Feb  4 10:24:16 2019
(r343739)
@@ -206,7 +206,7 @@ loadconfig () {
   break
 fi
   done
-  MFSROOT=`confirm_action "$MFSROOT" "Use an MFSROOT? (YES/NO)"`
+  MFSROOT=`confirm_action "$MFSROOT" "Use an MFSROOT? (yes/no)"`
   IMG=`confirm_action "$IMG" "Image file to generate?"`
 
 # example of formatted value (NNN in this case)
___
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: r343738 - stable/12/sys/dev/aic7xxx

2019-02-04 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Feb  4 10:20:48 2019
New Revision: 343738
URL: https://svnweb.freebsd.org/changeset/base/343738

Log:
  MFC r343170:
  
  [aic7xxx] Use correct product name 29320LPE instead of non-existent 39320LPE
  
  The PCI id belongs to Adaptec 29320LPE controller. The same fix also was
  merged[1] to OpenBSD driver ~6 years ago.
  
  [1] https://github.com/openbsd/src/commit/f997b5
  
  PR:   172133
  Submitted by: henning.peter...@t-online.de

Modified:
  stable/12/sys/dev/aic7xxx/aic79xx_pci.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/aic7xxx/aic79xx_pci.c
==
--- stable/12/sys/dev/aic7xxx/aic79xx_pci.c Mon Feb  4 10:19:27 2019
(r343737)
+++ stable/12/sys/dev/aic7xxx/aic79xx_pci.c Mon Feb  4 10:20:48 2019
(r343738)
@@ -75,6 +75,7 @@ ahd_compose_id(u_int device, u_int vendor, u_int subde
 #define ID_AIC7901 0x800F90059005ull
 #define ID_AHA_29320A  0x8000900500609005ull
 #define ID_AHA_29320ALP0x8017900500449005ull
+#define ID_AHA_29320LPE0x8017900500459005ull
 
 #define ID_AIC7901A0x801E90059005ull
 #define ID_AHA_29320LP 0x8014900500449005ull
@@ -91,7 +92,6 @@ ahd_compose_id(u_int device, u_int vendor, u_int subde
 #define ID_AHA_39320D_B0x801C900500419005ull
 #define ID_AHA_39320D_HP   0x8011900500AC0E11ull
 #define ID_AHA_39320D_B_HP 0x801C900500AC0E11ull
-#define ID_AHA_39320LPE0x8017900500459005ull
 #define ID_AIC7902_PCI_REV_A4  0x3
 #define ID_AIC7902_PCI_REV_B0  0x10
 #define SUBID_HP   0x0E11
@@ -144,6 +144,12 @@ struct ahd_pci_identity ahd_pci_ident_table [] =
"Adaptec 29320ALP Ultra320 SCSI adapter",
ahd_aic7901_setup
},
+   {
+   ID_AHA_29320LPE,
+   ID_ALL_MASK,
+   "Adaptec 29320LPE Ultra320 SCSI adapter",
+   ahd_aic7901_setup
+   },
/* aic7901A based controllers */
{
ID_AHA_29320LP,
@@ -210,12 +216,6 @@ struct ahd_pci_identity ahd_pci_ident_table [] =
ID_AHA_39320D_B_HP,
ID_ALL_MASK,
"Adaptec (HP OEM) 39320D Ultra320 SCSI adapter",
-   ahd_aic7902_setup
-   },
-   {
-   ID_AHA_39320LPE,
-   ID_ALL_MASK,
-   "Adaptec 39320LPE Ultra320 SCSI adapter",
ahd_aic7902_setup
},
/* Generic chip probes for devices we don't know 'exactly' */
___
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: r343737 - in stable/12/sys/dev/usb: . quirk

2019-02-04 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Feb  4 10:19:27 2019
New Revision: 343737
URL: https://svnweb.freebsd.org/changeset/base/343737

Log:
  MFC r343224, r343533
  
  r343224:
  Add KBD_BOOTPROTO quirk for Logitech G510s USB keyboard
  
  PR:   232136
  Submitted by: dgilb...@eicat.ca
  
  r343533:
  [usb] Add UQ_KBD_BOOTPROTO quirk for Corsair K68 keyboard
  
  PR:   222114
  Submitted by: Zane C. Bowers-Hadley 

Modified:
  stable/12/sys/dev/usb/quirk/usb_quirk.c
  stable/12/sys/dev/usb/usbdevs
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/usb/quirk/usb_quirk.c
==
--- stable/12/sys/dev/usb/quirk/usb_quirk.c Mon Feb  4 09:08:36 2019
(r343736)
+++ stable/12/sys/dev/usb/quirk/usb_quirk.c Mon Feb  4 10:19:27 2019
(r343737)
@@ -96,6 +96,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK
USB_QUIRK(TELEX, MIC1, 0x009, 0x009, UQ_AU_NO_FRAC),
USB_QUIRK(SILICONPORTALS, YAPPHONE, 0x100, 0x100, UQ_AU_INP_ASYNC),
USB_QUIRK(LOGITECH, UN53B, 0x, 0x, UQ_NO_STRINGS),
+   USB_QUIRK(LOGITECH, G510S, 0x, 0x, UQ_KBD_BOOTPROTO),
USB_QUIRK(REALTEK, RTL8196EU, 0x, 0x, UQ_CFG_INDEX_1),
USB_QUIRK(ELSA, MODEM1, 0x, 0x, UQ_CFG_INDEX_1),
USB_QUIRK(PLANEX2, MZKUE150N, 0x, 0x, UQ_CFG_INDEX_1),
@@ -164,6 +165,8 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK
USB_QUIRK(MICROSOFT, WLINTELLIMOUSE, 0x, 0x, 
UQ_MS_LEADING_BYTE),
/* Quirk for Corsair Vengeance K60 keyboard */
USB_QUIRK(CORSAIR, K60, 0x, 0x, UQ_KBD_BOOTPROTO),
+   /* Quirk for Corsair Gaming K68 keyboard */
+   USB_QUIRK(CORSAIR, K68, 0x, 0x, UQ_KBD_BOOTPROTO),
/* Quirk for Corsair Vengeance K70 keyboard */
USB_QUIRK(CORSAIR, K70, 0x, 0x, UQ_KBD_BOOTPROTO),
/* Quirk for Corsair K70 RGB keyboard */

Modified: stable/12/sys/dev/usb/usbdevs
==
--- stable/12/sys/dev/usb/usbdevs   Mon Feb  4 09:08:36 2019
(r343736)
+++ stable/12/sys/dev/usb/usbdevs   Mon Feb  4 10:19:27 2019
(r343737)
@@ -1581,6 +1581,7 @@ product COREGA FETHER_USB_TXC 0x9601  FEther USB-TXC
 
 /* Corsair products */
 product CORSAIR K600x0a60  Corsair Vengeance K60 keyboard
+product CORSAIR K680x1b3f  Corsair Gaming K68 keyboard
 product CORSAIR K700x1b09  Corsair Vengeance K70 keyboard
 product CORSAIR K70_RGB0x1b13  Corsair K70 RGB Keyboard
 product CORSAIR STRAFE 0x1b15  Corsair STRAFE Gaming keyboard
@@ -2841,6 +2842,7 @@ product LOGITECH UN58A0xc030  iFeel Mouse
 product LOGITECH UN53B 0xc032  iFeel MouseMan
 product LOGITECH WMPAD 0xc208  WingMan GamePad Extreme
 product LOGITECH WMRPAD0xc20a  WingMan RumblePad
+product LOGITECH G510S 0xc22d  G510s Keyboard
 product LOGITECH WMJOY 0xc281  WingMan Force joystick
 product LOGITECH BB13  0xc401  USB-PS/2 Trackball
 product LOGITECH RK53  0xc501  Cordless mouse
___
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: r343726 - in stable/12/sys/dev/usb: . quirk

2019-02-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Feb  3 22:49:01 2019
New Revision: 343726
URL: https://svnweb.freebsd.org/changeset/base/343726

Log:
  MFC r343156:
  
  [usb] Add HID_IGNORE quirks for multiple UPS devices
  
  Without HID_IGNORE quirk enabled these models appear in the system as a uhid
  devices while NUT (Network UPS Tool) expects them to be ugen.
  
  PR:   131521
  Submitted by: Naoyuki Tai , John Bayly 


Modified:
  stable/12/sys/dev/usb/quirk/usb_quirk.c
  stable/12/sys/dev/usb/usbdevs
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/usb/quirk/usb_quirk.c
==
--- stable/12/sys/dev/usb/quirk/usb_quirk.c Sun Feb  3 22:45:50 2019
(r343725)
+++ stable/12/sys/dev/usb/quirk/usb_quirk.c Sun Feb  3 22:49:01 2019
(r343726)
@@ -110,8 +110,19 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK
USB_QUIRK(XEROX, WCM15, 0x, 0x, UQ_BROKEN_BIDIR),
/* Devices which should be ignored by uhid */
USB_QUIRK(APC, UPS, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(BELKIN, F6H375USB, 0x, 0x, UQ_HID_IGNORE),
USB_QUIRK(BELKIN, F6C550AVR, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(BELKIN, F6C1250TWRK, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(BELKIN, F6C1500TWRK, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(BELKIN, F6C900UNV, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(BELKIN, F6C100UNV, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(BELKIN, F6C120UNV, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(BELKIN, F6C800UNV, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(BELKIN, F6C1100UNV, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(CYBERPOWER, BC900D, 0x, 0x, UQ_HID_IGNORE),
USB_QUIRK(CYBERPOWER, 1500CAVRLCD, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(CYBERPOWER, OR2200LCDRM2U, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(DELL2, VARIOUS_UPS, 0x, 0x, UQ_HID_IGNORE),
USB_QUIRK(CYPRESS, SILVERSHIELD, 0x, 0x, UQ_HID_IGNORE),
USB_QUIRK(DELORME, EARTHMATE, 0x, 0x, UQ_HID_IGNORE),
USB_QUIRK(DREAMLINK, DL100B, 0x, 0x, UQ_HID_IGNORE),
@@ -119,8 +130,26 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK
USB_QUIRK(ITUNERNET, USBLCD4X20, 0x, 0x, UQ_HID_IGNORE),
USB_QUIRK(LIEBERT, POWERSURE_PXT, 0x, 0x, UQ_HID_IGNORE),
USB_QUIRK(LIEBERT2, PSI1000, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(LIEBERT2, POWERSURE_PSA, 0x, 0x, UQ_HID_IGNORE),
USB_QUIRK(MGE, UPS1, 0x, 0x, UQ_HID_IGNORE),
USB_QUIRK(MGE, UPS2, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(POWERCOM, IMPERIAL_SERIES, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(POWERCOM, SMART_KING_PRO, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(POWERCOM, WOW, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(POWERCOM, VANGUARD, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(POWERCOM, BLACK_KNIGHT_PRO, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(TRIPPLITE2, AVR550U, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(TRIPPLITE2, AVR750U, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(TRIPPLITE2, ECO550UPS, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(TRIPPLITE2, T750_INTL, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(TRIPPLITE2, RT_2200_INTL, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(TRIPPLITE2, OMNI1000LCD, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(TRIPPLITE2, OMNI900LCD, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(TRIPPLITE2, SMART_2200RMXL2U, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(TRIPPLITE2, UPS_3014, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(TRIPPLITE2, SU1500RTXL2UA, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(TRIPPLITE2, SU6000RT4U, 0x, 0x, UQ_HID_IGNORE),
+   USB_QUIRK(TRIPPLITE2, SU1500RTXL2UA_2, 0x, 0x, UQ_HID_IGNORE),
USB_QUIRK(APPLE, IPHONE, 0x, 0x, UQ_HID_IGNORE),
USB_QUIRK(APPLE, IPHONE_3G, 0x, 0x, UQ_HID_IGNORE),
USB_QUIRK(MEGATEC, UPS, 0x, 0x, UQ_HID_IGNORE),

Modified: stable/12/sys/dev/usb/usbdevs
==
--- stable/12/sys/dev/usb/usbdevs   Sun Feb  3 22:45:50 2019
(r343725)
+++ stable/12/sys/dev/usb/usbdevs   Sun Feb  3 22:49:01 2019
(r343726)
@@ -140,6 +140,7 @@ vendor SANYO0x0474  Sanyo Electric
 vendor SEAGATE 0x0477  Seagate
 vendor CONNECTIX   0x0478  Connectix
 vendor SEMTECH 0x047a  Semtech
+vendor DELL2   0x047c  Dell
 vendor KENSINGTON  0x047d  Kensington
 vendor LUCENT  0x047e  Lucent
 vendor PLANTRONICS 0x047f  Plantronics
@@ -554,6 +555,7 @@ vendor ACDC 0x0d7e  American Computer & Digital 
Compon
 vendor CMEDIA  0x0d8c  CMEDIA
 vendor CONCEPTRONIC0x0d8e  Conce

svn commit: r343725 - stable/12/sys/cam/ata

2019-02-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Feb  3 22:45:50 2019
New Revision: 343725
URL: https://svnweb.freebsd.org/changeset/base/343725

Log:
  MFC r343129:
  
  [ata] Add workaround for KingDian S200 SSD crash on receiving TRIM command
  
  - Add ADA_Q_NO_TRIM quirk to be used with the device that falsely advertise 
TRIM support
  - Add ADA_Q_NO_TRIM entry for KingDian S200 SSD
  
  PR:   222802
  Submitted by: Bertrand Petit 

Modified:
  stable/12/sys/cam/ata/ata_da.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cam/ata/ata_da.c
==
--- stable/12/sys/cam/ata/ata_da.c  Sun Feb  3 21:31:40 2019
(r343724)
+++ stable/12/sys/cam/ata/ata_da.c  Sun Feb  3 22:45:50 2019
(r343725)
@@ -118,7 +118,8 @@ typedef enum {
ADA_Q_4K= 0x01,
ADA_Q_NCQ_TRIM_BROKEN   = 0x02,
ADA_Q_LOG_BROKEN= 0x04,
-   ADA_Q_SMR_DM= 0x08
+   ADA_Q_SMR_DM= 0x08,
+   ADA_Q_NO_TRIM   = 0x10
 } ada_quirks;
 
 #define ADA_Q_BIT_STRING   \
@@ -126,7 +127,8 @@ typedef enum {
"\0014K"\
"\002NCQ_TRIM_BROKEN"   \
"\003LOG_BROKEN"\
-   "\004SMR_DM"
+   "\004SMR_DM"\
+   "\005NO_TRIM"
 
 typedef enum {
ADA_CCB_RAHEAD  = 0x01,
@@ -540,6 +542,14 @@ static struct ada_quirk_entry ada_quirk_table[] =
},
{
/*
+* KingDian S200 60GB P0921B
+* Trimming crash the SSD
+*/
+   { T_DIRECT, SIP_MEDIA_FIXED, "*", "KingDian S200 *", "*" },
+   /*quirks*/ADA_Q_NO_TRIM
+   },
+   {
+   /*
 * Kingston E100 Series SSDs
 * 4k optimised & trim only works in 4k requests + 4k aligned
 */
@@ -1796,6 +1806,10 @@ adaregister(struct cam_periph *periph, void *arg)
softc->disk->d_flags = DISKFLAG_DIRECT_COMPLETION | DISKFLAG_CANZONE;
if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE)
softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE;
+   /* Device lies about TRIM capability. */
+   if ((softc->quirks & ADA_Q_NO_TRIM) &&
+   (softc->flags & ADA_FLAG_CAN_TRIM))
+   softc->flags &= ~ADA_FLAG_CAN_TRIM;
if (softc->flags & ADA_FLAG_CAN_TRIM) {
softc->disk->d_flags |= DISKFLAG_CANDELETE;
softc->disk->d_delmaxsize = softc->params.secsize *
___
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: r343722 - stable/12/usr.bin/compress

2019-02-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Feb  3 21:18:46 2019
New Revision: 343722
URL: https://svnweb.freebsd.org/changeset/base/343722

Log:
  MFC r343127:
  
  Fix descriptor/memory leak in compress(1) code
  
  This is mostly a style fix since the code in question is not called multiple
  times and doesn't have cummulative effect.
  
  PR:   204953
  Submitted by: David Binderman 

Modified:
  stable/12/usr.bin/compress/compress.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/compress/compress.c
==
--- stable/12/usr.bin/compress/compress.c   Sun Feb  3 21:17:26 2019
(r343721)
+++ stable/12/usr.bin/compress/compress.c   Sun Feb  3 21:18:46 2019
(r343722)
@@ -322,6 +322,8 @@ decompress(const char *in, const char *out, int bits)
if ((ofp = fopen(out, "w")) == NULL ||
(nr != 0 && fwrite(buf, 1, nr, ofp) != nr)) {
cwarn("%s", out);
+   if (ofp)
+   (void)fclose(ofp);
(void)fclose(ifp);
return;
}
___
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: r343721 - in stable/12/sys/dev/usb: . quirk

2019-02-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Feb  3 21:17:26 2019
New Revision: 343721
URL: https://svnweb.freebsd.org/changeset/base/343721

Log:
  MFC r343106:
  
  [usb] Add quirk for SmartG2 USB memory key
  
  PR:   167001
  Submitted by: Daan Vreeken [PA4DAN] 

Modified:
  stable/12/sys/dev/usb/quirk/usb_quirk.c
  stable/12/sys/dev/usb/usbdevs
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/usb/quirk/usb_quirk.c
==
--- stable/12/sys/dev/usb/quirk/usb_quirk.c Sun Feb  3 18:43:20 2019
(r343720)
+++ stable/12/sys/dev/usb/quirk/usb_quirk.c Sun Feb  3 21:17:26 2019
(r343721)
@@ -497,6 +497,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK
USB_QUIRK(VIALABS, USB30SATABRIDGE, 0x, 0x, 
UQ_MSC_NO_SYNC_CACHE),
USB_QUIRK(QUALCOMMINC, ZTE_MF730M, 0x, 0x, UQ_MSC_NO_GETMAXLUN,
UQ_MSC_NO_INQUIRY, UQ_CFG_INDEX_0),
+   USB_QUIRK(SMART2, G2MEMKEY, 0x, 0x, UQ_MSC_NO_INQUIRY),
/* Non-standard USB MIDI devices */
USB_QUIRK(ROLAND, UM1, 0x, 0x, UQ_AU_VENDOR_CLASS),
USB_QUIRK(ROLAND, SC8850, 0x, 0x, UQ_AU_VENDOR_CLASS),

Modified: stable/12/sys/dev/usb/usbdevs
==
--- stable/12/sys/dev/usb/usbdevs   Sun Feb  3 18:43:20 2019
(r343720)
+++ stable/12/sys/dev/usb/usbdevs   Sun Feb  3 21:17:26 2019
(r343721)
@@ -561,6 +561,7 @@ vendor NETAC0x0dd8  Netac
 vendor SITECOMEU   0x0df6  Sitecom Europe
 vendor MOBILEACTION0x0df7  Mobile Action
 vendor AMIGO   0x0e0b  Amigo Technology
+vendor SMART2  0x0e39  Smart Modular Technologies
 vendor SPEEDDRAGON 0x0e55  Speed Dragon Multimedia
 vendor HAWKING 0x0e66  Hawking
 vendor FOSSIL  0x0e67  Fossil, Inc
@@ -4370,6 +4371,9 @@ product SKANHEX SX_520Z   0x5200  SX 520z Camera
 
 /* Smart Technologies products */
 product SMART PL2303   0x2303  Serial adapter
+
+/* Smart Modular Technologies products */
+product SMART2 G2MEMKEY0x1700  G2 Memory Key
 
 /* SmartBridges products */
 product SMARTBRIDGES SMARTLINK 0x0001  SmartLink USB Ethernet
___
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: r343717 - stable/12/sys/dev/drm

2019-02-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Feb  3 14:56:38 2019
New Revision: 343717
URL: https://svnweb.freebsd.org/changeset/base/343717

Log:
  MFC r343060:
  
  [drm] Fix off-by-one error when accessing driver-specific ioctl handlers array
  
  PR:   231513
  Submitted by: Young_X 
  Approved by:  imp

Modified:
  stable/12/sys/dev/drm/drm_drv.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/drm/drm_drv.c
==
--- stable/12/sys/dev/drm/drm_drv.c Sun Feb  3 14:55:21 2019
(r343716)
+++ stable/12/sys/dev/drm/drm_drv.c Sun Feb  3 14:56:38 2019
(r343717)
@@ -745,7 +745,7 @@ int drm_ioctl(struct cdev *kdev, u_long cmd, caddr_t d
if (ioctl->func == NULL && nr >= DRM_COMMAND_BASE) {
/* The array entries begin at DRM_COMMAND_BASE ioctl nr */
nr -= DRM_COMMAND_BASE;
-   if (nr > dev->driver->max_ioctl) {
+   if (nr >= dev->driver->max_ioctl) {
DRM_DEBUG("Bad driver ioctl number, 0x%x (of 0x%x)\n",
nr, dev->driver->max_ioctl);
return EINVAL;
___
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: r343716 - stable/12/sys/dev/led

2019-02-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Feb  3 14:55:21 2019
New Revision: 343716
URL: https://svnweb.freebsd.org/changeset/base/343716

Log:
  MFC r343029:
  
  [led] propagate error from set_led() to the caller
  
  Do not lose error condition by always returning 0 from set_led.
  None of the calls to set_led checks for return value at the moment so
  none of API consumers in base is affected.
  
  PR:   231567
  Submitted by: Bertrand Petit 

Modified:
  stable/12/sys/dev/led/led.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/led/led.c
==
--- stable/12/sys/dev/led/led.c Sun Feb  3 14:54:29 2019(r343715)
+++ stable/12/sys/dev/led/led.c Sun Feb  3 14:55:21 2019(r343716)
@@ -261,7 +261,7 @@ led_set(char const *name, char const *cmd)
mtx_unlock(&led_mtx);
if (sb != NULL)
sbuf_delete(sb);
-   return (0);
+   return (error);
 }
 
 static struct cdevsw led_cdevsw = {
___
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: r343718 - in stable/12/sys: arm64/conf dts/arm/overlays dts/arm64/overlays modules/dtb/rpi

2019-02-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Feb  3 15:34:09 2019
New Revision: 343718
URL: https://svnweb.freebsd.org/changeset/base/343718

Log:
  MFC r343069:
  
  [rpi] Reorganize spigen(4) overlays for Raspberry Pi
  
  - Remove CS=2 entry from spigen-rpi2 since it didn't work
  - Add spigen-rpi3 overlay for Raspberry Pi 3
  - Enable rpi overlay modules for GENERIC kernel on aarch64
  
  PR:   233489
  Submitted by: b...@mrp3.com
  Reviewed by:  db
  Differential Revision:https://reviews.freebsd.org/D16088

Added:
  stable/12/sys/dts/arm64/overlays/spigen-rpi3.dtso
 - copied unchanged from r343069, 
head/sys/dts/arm64/overlays/spigen-rpi3.dtso
Modified:
  stable/12/sys/arm64/conf/GENERIC
  stable/12/sys/dts/arm/overlays/spigen-rpi2.dtso
  stable/12/sys/modules/dtb/rpi/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm64/conf/GENERIC
==
--- stable/12/sys/arm64/conf/GENERICSun Feb  3 14:56:38 2019
(r343717)
+++ stable/12/sys/arm64/conf/GENERICSun Feb  3 15:34:09 2019
(r343718)
@@ -262,4 +262,4 @@ options FDT
 device acpi
 
 # DTBs
-makeoptionsMODULES_EXTRA="dtb/allwinner"
+makeoptionsMODULES_EXTRA="dtb/allwinner dtb/rpi"

Modified: stable/12/sys/dts/arm/overlays/spigen-rpi2.dtso
==
--- stable/12/sys/dts/arm/overlays/spigen-rpi2.dtso Sun Feb  3 14:56:38 
2019(r343717)
+++ stable/12/sys/dts/arm/overlays/spigen-rpi2.dtso Sun Feb  3 15:34:09 
2019(r343718)
@@ -12,6 +12,7 @@
spigen0: spigen0 {
compatible = "freebsd,spigen";
reg = <0>;
+   spi-max-frequency = <50>; /* Req'd property, override with 
spi(8) */
status = "okay";
};
spigen1: spigen1 {
@@ -20,20 +21,10 @@
spi-max-frequency = <50>; /* Req'd property, override with 
spi(8) */
status = "okay";
};
-   spigen2: spigen2 {
-   compatible = "freebsd,spigen";
-   reg = <2>;
-   spi-max-frequency = <50>; /* Req'd property, override with 
spi(8) */
-   status = "okay";
-   };
 };
 
 &{/soc/gpio@7e20/spi0_cs_pins} {
-   brcm,pins = <8 7 16>;
+   brcm,pins = <8 7>;
brcm,function = <4>; /* ALT0 */
-};
-
-&{/soc/gpio@7e20/spi0_gpio7} {
-   brcm,pins = <7 8 16 9 10 11>;
 };
 

Copied: stable/12/sys/dts/arm64/overlays/spigen-rpi3.dtso (from r343069, 
head/sys/dts/arm64/overlays/spigen-rpi3.dtso)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/12/sys/dts/arm64/overlays/spigen-rpi3.dtso   Sun Feb  3 15:34:09 
2019(r343718, copy of r343069, 
head/sys/dts/arm64/overlays/spigen-rpi3.dtso)
@@ -0,0 +1,30 @@
+/* $FreeBSD$ */
+
+/dts-v1/;
+/plugin/;
+
+/ {
+   compatible = "brcm,bcm2837";
+};
+   
+&{/soc/spi@7e204000} {
+   status = "okay";
+   spigen0: spigen0 {
+   compatible = "freebsd,spigen";
+   reg = <0>;
+   spi-max-frequency = <50>; /* Req'd property, override with 
spi(8) */
+   status = "okay";
+   };
+   spigen1: spigen1 {
+   compatible = "freebsd,spigen";
+   reg = <1>;
+   spi-max-frequency = <50>; /* Req'd property, override with 
spi(8) */
+   status = "okay";
+   };
+};
+
+&{/soc/gpio@7e20/spi0_cs_pins} {
+   brcm,pins = <8 7>;
+   brcm,function = <4>; /* ALT0 */
+};
+

Modified: stable/12/sys/modules/dtb/rpi/Makefile
==
--- stable/12/sys/modules/dtb/rpi/Makefile  Sun Feb  3 14:56:38 2019
(r343717)
+++ stable/12/sys/modules/dtb/rpi/Makefile  Sun Feb  3 15:34:09 2019
(r343718)
@@ -1,7 +1,12 @@
 # $FreeBSD$
 # DTS files for the Raspberry Pi-B
+.if ${MACHINE_ARCH:Marmv[67]*} != ""
 DTSO=  \
spigen-rpi-b.dtso \
-   spigen-rpi2.dtso \
+   spigen-rpi2.dtso
+.elif ${MACHINE_ARCH} == "aarch64"
+DTSO=  \
+   spigen-rpi3.dtso
+.endif
 
 .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: r343714 - stable/12/usr.bin/systat

2019-02-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Feb  3 14:47:22 2019
New Revision: 343714
URL: https://svnweb.freebsd.org/changeset/base/343714

Log:
  MFC r343222-r343223, r343338
  
  r343222:
  Fix crash in systat(4) when certain commands are called without arguments
  
  Add check for missing arguments to dsmatchselect and dsselect
  
  PR:   219689
  Submitted by: Marko Turk 
  
  r343223:
  Fix inconsistency in return values introduced by r343222
  
  Consistently return 1 or the case of missing arguments in both functions
  
  PR:   219689
  X-MFC-With:   343222
  
  r343338:
  Fix systat's :only command parser for the multiple arguments case
  
  According to systat(1) :only option is supposed to accept multiple drives
  but the parser for its arguments stops after first entry. Fix the parser
  logic to accept multiple drives.
  
  PR:   59220
  Reported by:  Andy Farkas 

Modified:
  stable/12/usr.bin/systat/devs.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/systat/devs.c
==
--- stable/12/usr.bin/systat/devs.c Sun Feb  3 12:46:27 2019
(r343713)
+++ stable/12/usr.bin/systat/devs.c Sun Feb  3 14:47:22 2019
(r343714)
@@ -193,6 +193,11 @@ dsmatchselect(const char *args, devstat_select_mode se
int i;
int retval = 0;
 
+   if (!args) {
+   warnx("dsmatchselect: no arguments");
+   return(1);
+   }
+
/*
 * Break the (pipe delimited) input string out into separate
 * strings.
@@ -251,6 +256,11 @@ dsselect(const char *args, devstat_select_mode select_
int i;
int retval = 0;
 
+   if (!args) {
+   warnx("dsselect: no argument");
+   return(1);
+   }
+
/*
 * If we've gone through this code before, free previously
 * allocated resources.
@@ -278,7 +288,7 @@ dsselect(const char *args, devstat_select_mode select_
;
if (*cp)
*cp++ = '\0';
-   if (cp - args == 0)
+   if (cp - tmpstr1 == 0)
break;
for (i = 0; i < num_devices; i++) {
asprintf(&buffer, "%s%d", dev_select[i].device_name,
@@ -302,7 +312,7 @@ dsselect(const char *args, devstat_select_mode select_
}
if (i >= num_devices)
error("%s: unknown drive", args);
-   args = cp;
+   tmpstr1 = cp;
}
free(tmpstr);
 
___
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: r343715 - stable/12/stand/i386/libi386

2019-02-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Feb  3 14:54:29 2019
New Revision: 343715
URL: https://svnweb.freebsd.org/changeset/base/343715

Log:
  MFC r343008:
  
  Add Dell Chromebook to the list of devices with E820 extmem quirk enabled
  
  Just like for Acer C270 chromebook the E820 extmem workaround is required for
  FreeBSD to boot on Dell chromebook.
  
  PR:   204916
  Submitted by: Keith White 

Modified:
  stable/12/stand/i386/libi386/biosmem.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/stand/i386/libi386/biosmem.c
==
--- stable/12/stand/i386/libi386/biosmem.c  Sun Feb  3 14:47:22 2019
(r343714)
+++ stable/12/stand/i386/libi386/biosmem.c  Sun Feb  3 14:54:29 2019
(r343715)
@@ -74,6 +74,7 @@ struct bios_getmem_quirks {
 
 static struct bios_getmem_quirks quirks[] = {
{"coreboot", "Acer", "Peppy", BQ_DISTRUST_E820_EXTMEM},
+   {"coreboot", "Dell", "Wolf", BQ_DISTRUST_E820_EXTMEM},
{NULL, NULL, NULL, 0}
 };
 
___
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: r343710 - stable/12/sys/arm/mv

2019-02-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Feb  3 09:14:53 2019
New Revision: 343710
URL: https://svnweb.freebsd.org/changeset/base/343710

Log:
  MFC r343028, r343104
  
  r343028:
  [mv_pci] Increase default PCI space size for mv_pci
  
  mv_pci driver reads PCI memory window layout from DTB data and if the
  data is incomplete falls back to default value. The value is too small
  to fit two PCI spaces for mwlwifi devices on WRT3200ACM so the resource
  allocation for them fails. Increase the default to 4Mb from 1Mb so
  the devices can be properly attached.
  
  r343104:
  [mv] Fix invalid condition in fdt_fixup_ranges
  
  Add parentheses to perform assignment before comparison. The prior
  condition worked because fdt_parent_addr_cells returns 1 for the DTB
  on which fdt_fixup_ranges is called and accidentally par_addr_cells
  ends up to be set to the same value.
  
  PR:   210705
  Submitted by: David Binderman 

Modified:
  stable/12/sys/arm/mv/mv_common.c
  stable/12/sys/arm/mv/mv_pci.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm/mv/mv_common.c
==
--- stable/12/sys/arm/mv/mv_common.cSun Feb  3 08:53:03 2019
(r343709)
+++ stable/12/sys/arm/mv/mv_common.cSun Feb  3 09:14:53 2019
(r343710)
@@ -2935,7 +2935,7 @@ fdt_fixup_ranges(phandle_t root)
/* Fix-up SoC ranges according to real fdt_immr_pa */
if ((node = fdt_find_compatible(root, "simple-bus", 1)) != 0) {
if (fdt_addrsize_cells(node, &addr_cells, &size_cells) == 0 &&
-   (par_addr_cells = fdt_parent_addr_cells(node) <= 2)) {
+   ((par_addr_cells = fdt_parent_addr_cells(node)) <= 2)) {
tuple_size = sizeof(pcell_t) * (par_addr_cells +
   addr_cells + size_cells);
len = OF_getprop(node, "ranges", ranges,

Modified: stable/12/sys/arm/mv/mv_pci.c
==
--- stable/12/sys/arm/mv/mv_pci.c   Sun Feb  3 08:53:03 2019
(r343709)
+++ stable/12/sys/arm/mv/mv_pci.c   Sun Feb  3 09:14:53 2019
(r343710)
@@ -100,7 +100,7 @@ struct mv_pci_range {
 };
 
 #define FDT_RANGES_CELLS   ((3 + 3 + 2) * 2)
-#define PCI_SPACE_LEN  0x0010
+#define PCI_SPACE_LEN  0x0040
 
 static void
 mv_pci_range_dump(struct mv_pci_range *range)
___
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: r343711 - stable/12/tools/build/mk

2019-02-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Feb  3 11:07:40 2019
New Revision: 343711
URL: https://svnweb.freebsd.org/changeset/base/343711

Log:
  MFC r343009, r343109-r343110, r343128, r343232
  
  r343009:
  Add four kerberos CLI utilities to OptionalObsoleteFiles.inc
  
  Add asn1_compile, make-roken, kcc, and slc to the OptionalObsoleteFiles.inc
  so they would be removed during delete-old stage if the new world is built
  without Kerberos support.
  
  PR:   230725
  Submitted by: Dmitry Wagin 
  
  r343109:
  Add optional obsolete files for the installworld without sendmail
  
  Add two more entries for WITHOUT_SENDMAIL install. The /var/spool/clientmqueue
  entry would be deleted only if there are no files/dirs in it, so the
  content generated during previous lifecycle of the system is safe
  
  PR:   228484
  Submitted by: Dmitry Wagin 
  
  r343110:
  Fix conditional obsolete files entry for WITHOUT_EXAMPLES
  
  Add all the files under /usr/share/examples to the MK_EXAMPLES
  section. OLD_DIRS entries are not removed if they're not empty so
  prior to this change WITHOUT_EXAMPLES didn't have significant effect
  on the updated system.
  
  PR:   228484
  Submitted by: Dmitry Wagin  (original patch)
  
  r343128:
  Add ypldap to the list of conditional obsolete files
  
  ypldap should be removed during delete-old if WITHOUT_NIS flag is enabled
  
  PR:   230727
  Submitted by: Dmitry Wagin 
  
  r343232:
  Add more profile-enabled libraries to remove when WITHOUT_PROFILE is defined
  
  PR:   230898
  Submitted by: Herbert J. Skuhra 

Modified:
  stable/12/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc
==
--- stable/12/tools/build/mk/OptionalObsoleteFiles.inc  Sun Feb  3 09:14:53 
2019(r343710)
+++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc  Sun Feb  3 11:07:40 
2019(r343711)
@@ -2279,22 +2279,274 @@ OLD_FILES+=usr/share/nls/uk_UA.KOI8-U/ee.cat
 .endif
 
 .if ${MK_EXAMPLES} == no
+OLD_FILES+=usr/share/examples/BSD_daemon/FreeBSD.pfa
+OLD_FILES+=usr/share/examples/BSD_daemon/README
+OLD_FILES+=usr/share/examples/BSD_daemon/beastie.eps
+OLD_FILES+=usr/share/examples/BSD_daemon/beastie.fig
+OLD_FILES+=usr/share/examples/BSD_daemon/eps.patch
+OLD_FILES+=usr/share/examples/BSD_daemon/poster.sh
+OLD_FILES+=usr/share/examples/FreeBSD_version/FreeBSD_version.c
+OLD_FILES+=usr/share/examples/FreeBSD_version/Makefile
+OLD_FILES+=usr/share/examples/FreeBSD_version/README
+OLD_FILES+=usr/share/examples/IPv6/USAGE
+OLD_FILES+=usr/share/examples/bhyve/vmrun.sh
+OLD_FILES+=usr/share/examples/bootforth/README
+OLD_FILES+=usr/share/examples/bootforth/boot.4th
+OLD_FILES+=usr/share/examples/bootforth/frames.4th
+OLD_FILES+=usr/share/examples/bootforth/loader.rc
+OLD_FILES+=usr/share/examples/bootforth/menu.4th
+OLD_FILES+=usr/share/examples/bootforth/menuconf.4th
+OLD_FILES+=usr/share/examples/bootforth/screen.4th
+OLD_FILES+=usr/share/examples/bsdconfig/add_some_packages.sh
+OLD_FILES+=usr/share/examples/bsdconfig/browse_packages_http.sh
+OLD_FILES+=usr/share/examples/bsdconfig/bsdconfigrc
+OLD_FILES+=usr/share/examples/csh/dot.cshrc
+OLD_FILES+=usr/share/examples/diskless/ME
+OLD_FILES+=usr/share/examples/diskless/README.BOOTP
+OLD_FILES+=usr/share/examples/diskless/README.TEMPLATING
+OLD_FILES+=usr/share/examples/diskless/clone_root
+OLD_FILES+=usr/share/examples/dma/mailer.conf
+OLD_FILES+=usr/share/examples/drivers/README
+OLD_FILES+=usr/share/examples/drivers/make_device_driver.sh
+OLD_FILES+=usr/share/examples/drivers/make_pseudo_driver.sh
+OLD_FILES+=usr/share/examples/dwatch/profile_template
+OLD_FILES+=usr/share/examples/etc/README.examples
+OLD_FILES+=usr/share/examples/etc/bsd-style-copyright
+OLD_FILES+=usr/share/examples/etc/group
+OLD_FILES+=usr/share/examples/etc/login.access
+OLD_FILES+=usr/share/examples/etc/make.conf
+OLD_FILES+=usr/share/examples/etc/rc.bsdextended
+OLD_FILES+=usr/share/examples/etc/rc.firewall
+OLD_FILES+=usr/share/examples/etc/rc.sendmail
+OLD_FILES+=usr/share/examples/etc/termcap.small
+OLD_FILES+=usr/share/examples/etc/wpa_supplicant.conf
+OLD_FILES+=usr/share/examples/find_interface/Makefile
+OLD_FILES+=usr/share/examples/find_interface/README
+OLD_FILES+=usr/share/examples/find_interface/find_interface.c
+OLD_FILES+=usr/share/examples/hast/ucarp.sh
+OLD_FILES+=usr/share/examples/hast/ucarp_down.sh
+OLD_FILES+=usr/share/examples/hast/ucarp_up.sh
+OLD_FILES+=usr/share/examples/hast/vip-down.sh
+OLD_FILES+=usr/share/examples/hast/vip-up.sh
+OLD_FILES+=usr/share/examples/hostapd/hostapd.conf
+OLD_FILES+=usr/share/examples/hostapd/hostapd.eap_user
+OLD_FILES+=usr/share/examples/hostapd/hostapd.wpa_psk
+OLD_FILES+=usr/share/examples/indent/indent.pro
+OLD_FILES+=usr/share/examples/ipfilter/BASIC.NAT
+OLD_FILES+=usr/share/examples/ipfilter/BASIC_1.FW
+

svn commit: r343709 - in stable/12/sys/mips: ingenic mips nlm

2019-02-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Feb  3 08:53:03 2019
New Revision: 343709
URL: https://svnweb.freebsd.org/changeset/base/343709

Log:
  MFC r343443, r343446, r343448, r343452
  
  r343443:
  [mips] remove dublicate values in enable mask in nlm_usb_intr_en
  
  PR:   230572
  Submitted by: David Binderman 
  
  r343446:
  [mips] remove check that is always false (unsinged < 0)
  
  cpuid and local cpu variable are unsigned so checking if value is less than 
zero
  always yields false.
  
  PR:   211088
  Submitted by: David Binderman 
  
  r343448:
  [mips] Fix counter mask in jz4780 timer driver
  
  Fix dublicate value in what is apparent copypaste mistake. The last value
  in mask is supposed to be for counter 7, not counter 3.
  
  PR:   229790
  Submitted by: David Binderman 
  
  r343452:
  [mips] Fix error condition check that always evaluates to false
  
  Use proper logical operand when checking the value of srcid
  
  PR:   200988
  Submitted by: David Binderman 

Modified:
  stable/12/sys/mips/ingenic/jz4780_timer.c
  stable/12/sys/mips/mips/tlb.c
  stable/12/sys/mips/nlm/cms.c
  stable/12/sys/mips/nlm/usb_init.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/mips/ingenic/jz4780_timer.c
==
--- stable/12/sys/mips/ingenic/jz4780_timer.c   Sun Feb  3 08:45:01 2019
(r343708)
+++ stable/12/sys/mips/ingenic/jz4780_timer.c   Sun Feb  3 08:53:03 2019
(r343709)
@@ -185,7 +185,7 @@ jz4780_timer_attach(device_t dev)
CSR_WRITE_4(sc, JZ_TC_TECR, TESR_OST);
/* Stop all other channels as well */
CSR_WRITE_4(sc, JZ_TC_TECR, TESR_TCST0 | TESR_TCST1 | TESR_TCST2 |
-   TESR_TCST3 | TESR_TCST4 | TESR_TCST5 | TESR_TCST6 | TESR_TCST3);
+   TESR_TCST3 | TESR_TCST4 | TESR_TCST5 | TESR_TCST6 | TESR_TCST7);
/* Clear detect mask flags */
CSR_WRITE_4(sc, JZ_TC_TFCR, 0x);
/* Mask all interrupts */

Modified: stable/12/sys/mips/mips/tlb.c
==
--- stable/12/sys/mips/mips/tlb.c   Sun Feb  3 08:45:01 2019
(r343708)
+++ stable/12/sys/mips/mips/tlb.c   Sun Feb  3 08:53:03 2019
(r343709)
@@ -348,7 +348,7 @@ DB_SHOW_COMMAND(tlb, ddb_dump_tlb)
else
cpu = PCPU_GET(cpuid);
 
-   if (cpu < 0 || cpu >= mp_ncpus) {
+   if (cpu >= mp_ncpus) {
db_printf("Invalid CPU %u\n", cpu);
return;
}

Modified: stable/12/sys/mips/nlm/cms.c
==
--- stable/12/sys/mips/nlm/cms.cSun Feb  3 08:45:01 2019
(r343708)
+++ stable/12/sys/mips/nlm/cms.cSun Feb  3 08:53:03 2019
(r343709)
@@ -204,7 +204,7 @@ xlp_handle_msg_vc(u_int vcmask, int max_msgs)
nlm_restore_flags(mflags);
if (status != 0)/*  no msg or error */
continue;
-   if (srcid < 0 && srcid >= 1024) {
+   if (srcid < 0 || srcid >= 1024) {
printf("[%s]: bad src id %d\n", __func__,
srcid);
continue;

Modified: stable/12/sys/mips/nlm/usb_init.c
==
--- stable/12/sys/mips/nlm/usb_init.c   Sun Feb  3 08:45:01 2019
(r343708)
+++ stable/12/sys/mips/nlm/usb_init.c   Sun Feb  3 08:53:03 2019
(r343709)
@@ -52,8 +52,7 @@ nlm_usb_intr_en(int node, int port)
port_addr = nlm_get_usb_regbase(node, port);
val = nlm_read_usb_reg(port_addr, USB_INT_EN);
val = USB_CTRL_INTERRUPT_EN  | USB_OHCI_INTERRUPT_EN |
-   USB_OHCI_INTERRUPT1_EN | USB_CTRL_INTERRUPT_EN  |
-   USB_OHCI_INTERRUPT_EN | USB_OHCI_INTERRUPT2_EN;
+   USB_OHCI_INTERRUPT1_EN | USB_OHCI_INTERRUPT2_EN;
 nlm_write_usb_reg(port_addr, USB_INT_EN, 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: r343708 - stable/12/sys/mips/ingenic

2019-02-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Feb  3 08:45:01 2019
New Revision: 343708
URL: https://svnweb.freebsd.org/changeset/base/343708

Log:
  MFC r343450:
  
  [mips] Unbreak kernel build for CI20
  
  - Include header required for boot_parse_XXX functions
  - Use boot_parse_args when parsing argc/argv style arguments
  - Remove unused function

Modified:
  stable/12/sys/mips/ingenic/jz4780_machdep.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/mips/ingenic/jz4780_machdep.c
==
--- stable/12/sys/mips/ingenic/jz4780_machdep.c Sun Feb  3 08:28:02 2019
(r343707)
+++ stable/12/sys/mips/ingenic/jz4780_machdep.c Sun Feb  3 08:45:01 2019
(r343708)
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -173,20 +174,6 @@ mips_init(void)
 #endif
 }
 
-#ifdef FDT
-static void
-_parse_bootargs(char *cmdline)
-{
-   char *v;
-
-   while ((v = strsep(&cmdline, " \n")) != NULL) {
-   if (*v == '\0')
-   continue;
-   boothowto |= boot_parse_arg(v);
-   }
-}
-#endif
-
 void
 platform_start(__register_t a0,  __register_t a1,
 __register_t a2 __unused, __register_t a3 __unused)
@@ -247,7 +234,7 @@ platform_start(__register_t a0,  __register_t a1,
/* Parse cmdline from U-Boot */
argc = a0;
argv = (char **)a1;
-   boothowto |= boot_parse_cmdline(argc, argv);
+   boothowto |= boot_parse_args(argc, argv);
 
mips_init();
 }
___
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: r343560 - head/usr.bin/calendar/calendars/de_AT.ISO_8859-15

2019-01-29 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Jan 29 19:54:37 2019
New Revision: 343560
URL: https://svnweb.freebsd.org/changeset/base/343560

Log:
  calendar(1): Fix Aschermittwoch date for Austrian calendar
  
  PR:   165516
  Submitted by: j...@berklix.com
  MFC after:1 week

Modified:
  head/usr.bin/calendar/calendars/de_AT.ISO_8859-15/calendar.feiertag

Modified: head/usr.bin/calendar/calendars/de_AT.ISO_8859-15/calendar.feiertag
==
--- head/usr.bin/calendar/calendars/de_AT.ISO_8859-15/calendar.feiertag Tue Jan 
29 18:18:55 2019(r343559)
+++ head/usr.bin/calendar/calendars/de_AT.ISO_8859-15/calendar.feiertag Tue Jan 
29 19:54:37 2019(r343560)
@@ -37,7 +37,7 @@ Easter+60 Fronleichnam
 
 /*  Gedenktage - nicht arbeitsfreie Feiertage */
 02/14  Valentinstag
-02/WednesdayLast   Aschermittwoch
+Easter-46  Aschermittwoch
 Easter-7   Palmsonntag
 Nov Sun+3  Totensonntag
 Nov Sun+4  1. Advent
___
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"


  1   2   3   4   5   6   7   8   9   >