CVS commit: src/lib/libkvm

2018-10-31 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Nov  1 05:37:12 UTC 2018

Modified Files:
src/lib/libkvm: kvm_aarch64.c

Log Message:
compare matching TG1 bits.

aarch64 crash dump kvtop now less broken, but still not stable.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libkvm/kvm_aarch64.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libkvm/kvm_aarch64.c
diff -u src/lib/libkvm/kvm_aarch64.c:1.3 src/lib/libkvm/kvm_aarch64.c:1.4
--- src/lib/libkvm/kvm_aarch64.c:1.3	Sun Apr  1 04:35:02 2018
+++ src/lib/libkvm/kvm_aarch64.c	Thu Nov  1 05:37:11 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: kvm_aarch64.c,v 1.3 2018/04/01 04:35:02 ryo Exp $ */
+/* $NetBSD: kvm_aarch64.c,v 1.4 2018/11/01 05:37:11 mrg Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
 
 #include "kvm_private.h"
 
-__RCSID("$NetBSD: kvm_aarch64.c,v 1.3 2018/04/01 04:35:02 ryo Exp $");
+__RCSID("$NetBSD: kvm_aarch64.c,v 1.4 2018/11/01 05:37:11 mrg Exp $");
 
 /*ARGSUSED*/
 void
@@ -83,7 +83,7 @@ lose:
 	}
 
 	const cpu_kcore_hdr_t * const cpu_kh = kd->cpu_data;
-	const u_int tg1 =__SHIFTOUT(cpu_kh->kh_tcr1, TCR_TG1); 
+	const u_int tg1 = cpu_kh->kh_tcr1 & TCR_TG1; 
 	const u_int t1siz = __SHIFTOUT(cpu_kh->kh_tcr1, TCR_T1SZ);
 
 	/*



CVS commit: src/usr.sbin/acpitools/acpidump

2018-10-31 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov  1 03:08:46 UTC 2018

Modified Files:
src/usr.sbin/acpitools/acpidump: acpi.c acpidump.8

Log Message:
 Decode CSRT (Core System Resources Table).


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/acpitools/acpidump/acpi.c
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/acpitools/acpidump/acpidump.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/acpitools/acpidump/acpi.c
diff -u src/usr.sbin/acpitools/acpidump/acpi.c:1.38 src/usr.sbin/acpitools/acpidump/acpi.c:1.39
--- src/usr.sbin/acpitools/acpidump/acpi.c:1.38	Thu Oct 18 05:20:05 2018
+++ src/usr.sbin/acpitools/acpidump/acpi.c	Thu Nov  1 03:08:46 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi.c,v 1.38 2018/10/18 05:20:05 msaitoh Exp $ */
+/* $NetBSD: acpi.c,v 1.39 2018/11/01 03:08:46 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 1998 Doug Rabson
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: acpi.c,v 1.38 2018/10/18 05:20:05 msaitoh Exp $");
+__RCSID("$NetBSD: acpi.c,v 1.39 2018/11/01 03:08:46 msaitoh Exp $");
 
 #include 
 #include 
@@ -40,6 +40,7 @@ __RCSID("$NetBSD: acpi.c,v 1.38 2018/10/
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -53,7 +54,11 @@ __RCSID("$NetBSD: acpi.c,v 1.38 2018/10/
 #define BEGIN_COMMENT	"/*\n"
 #define END_COMMENT	" */\n"
 
+/* Commonly used helper functions */
 static void	acpi_print_string(char *s, size_t length);
+static void	acpi_print_tabs(unsigned int n);
+static void	acpi_dump_bytes(uint8_t *p, uint32_t len, unsigned int ntabs);
+static void	acpi_dump_table(ACPI_TABLE_HEADER *sdp);
 static void	acpi_print_gas(ACPI_GENERIC_ADDRESS *gas);
 static void	acpi_print_pci(uint16_t vendorid, uint16_t deviceid,
 		uint8_t seg, uint8_t bus, uint8_t device, uint8_t func);
@@ -68,6 +73,8 @@ static void	acpi_print_whea(ACPI_WHEA_HE
 		void (*print_ins)(ACPI_WHEA_HEADER *),
 		void (*print_flags)(ACPI_WHEA_HEADER *));
 static uint64_t	acpi_select_address(uint32_t, uint64_t);
+
+/* Handlers for each table */
 static void	acpi_handle_fadt(ACPI_TABLE_HEADER *fadt);
 static void	acpi_print_cpu(u_char cpu_id);
 static void	acpi_print_cpu_uid(uint32_t uid, char *uid_string);
@@ -81,6 +88,7 @@ static void	acpi_print_madt(ACPI_SUBTABL
 static void	acpi_handle_bert(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_boot(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_cpep(ACPI_TABLE_HEADER *sdp);
+static void	acpi_handle_csrt(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_dbgp(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_dbg2(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_einj(ACPI_TABLE_HEADER *sdp);
@@ -113,7 +121,6 @@ static void	acpi_handle_wdat(ACPI_TABLE_
 static void	acpi_handle_wddt(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_wdrt(ACPI_TABLE_HEADER *sdp);
 static void	acpi_print_sdt(ACPI_TABLE_HEADER *sdp);
-static void	acpi_dump_bytes(ACPI_TABLE_HEADER *sdp);
 static void	acpi_print_fadt(ACPI_TABLE_HEADER *sdp);
 static void	acpi_print_facs(ACPI_TABLE_FACS *facs);
 static void	acpi_print_dsdt(ACPI_TABLE_HEADER *dsdp);
@@ -1249,6 +1256,130 @@ acpi_handle_cpep(ACPI_TABLE_HEADER *sdp)
 }
 
 static void
+acpi_print_csrt_resource_group(ACPI_CSRT_GROUP *grp)
+{
+	ACPI_CSRT_DESCRIPTOR *desc;
+
+	printf("\tLength=%u\n", grp->Length);
+	printf("\tVendorId=");
+	acpi_print_string((char *)&grp->VendorId, 4);
+	printf("\n");
+	if (grp->SubvendorId != 0) {
+		printf("\tSubvendorId=");
+		acpi_print_string((char *)&grp->SubvendorId, 4);
+		printf("\n");
+	}
+	printf("\tDeviceId=0x%08x\n", grp->DeviceId);
+	if (grp->SubdeviceId != 0)
+		printf("\tSubdeviceId=0x%08x\n", grp->SubdeviceId);
+	printf("\tRevision=%hu\n", grp->Revision);
+	printf("\tSharedInfoLength=%u\n", grp->SharedInfoLength);
+
+	/* Next is Shared Info */
+	if (grp->SharedInfoLength != 0) {
+		printf("\tShared Info ");
+		acpi_dump_bytes((uint8_t *)(grp + 1),
+		grp->SharedInfoLength, 1);
+	}
+
+	/* And then, Resource Descriptors */
+	desc = (ACPI_CSRT_DESCRIPTOR *)
+	((vaddr_t)(grp + 1) + grp->SharedInfoLength);
+	while (desc < (ACPI_CSRT_DESCRIPTOR *)((vaddr_t)grp + grp->Length)) {
+		bool unknownsubytpe = false;
+		printf("\n\tLength=%u\n", desc->Length);
+		printf("\tResource Type=");
+		switch (desc->Type) {
+		case ACPI_CSRT_TYPE_INTERRUPT:
+			printf("Interrupt");
+			switch (desc->Subtype) {
+			case ACPI_CSRT_XRUPT_LINE:
+printf("(Interrupt line)\n");
+break;
+			case ACPI_CSRT_XRUPT_CONTROLLER:
+printf("(Interrupt controller)\n");
+break;
+			default:
+unknownsubytpe = true;
+break;
+			}
+			break;
+		case ACPI_CSRT_TYPE_TIMER:
+			printf("Timer");
+			switch (desc->Subtype) {
+			case ACPI_CSRT_TIMER:
+printf("\n");
+break;
+			default:
+unknownsubytpe = true;
+break;
+			}
+			break;
+		case ACPI_CSRT_TYPE_DMA:
+			printf("DMA");
+			switch (desc->Subtype) {
+			case ACP

CVS commit: src/sys/stand/efiboot

2018-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Nov  1 00:43:38 UTC 2018

Modified Files:
src/sys/stand/efiboot: efiblock.c efiblock.h efiboot.c efifdt.c version

Log Message:
Add GPT support.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/stand/efiboot/efiblock.c
cvs rdiff -u -r1.2 -r1.3 src/sys/stand/efiboot/efiblock.h
cvs rdiff -u -r1.11 -r1.12 src/sys/stand/efiboot/efiboot.c \
src/sys/stand/efiboot/efifdt.c
cvs rdiff -u -r1.6 -r1.7 src/sys/stand/efiboot/version

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/stand/efiboot/efiblock.c
diff -u src/sys/stand/efiboot/efiblock.c:1.3 src/sys/stand/efiboot/efiblock.c:1.4
--- src/sys/stand/efiboot/efiblock.c:1.3	Fri Sep 14 21:37:03 2018
+++ src/sys/stand/efiboot/efiblock.c	Thu Nov  1 00:43:38 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: efiblock.c,v 1.3 2018/09/14 21:37:03 jakllsch Exp $ */
+/* $NetBSD: efiblock.c,v 1.4 2018/11/01 00:43:38 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -31,6 +31,7 @@
 
 #include 
 #include 
+#include 
 
 #include "efiboot.h"
 #include "efiblock.h"
@@ -192,16 +193,114 @@ efi_block_find_partitions_mbr(struct efi
 	return 0;
 }
 
+static const struct {
+	struct uuid guid;
+	uint8_t fstype;
+} gpt_guid_to_str[] = {
+	{ GPT_ENT_TYPE_NETBSD_FFS,		FS_BSDFFS },
+	{ GPT_ENT_TYPE_NETBSD_LFS,		FS_BSDLFS },
+	{ GPT_ENT_TYPE_NETBSD_RAIDFRAME,	FS_RAID },
+	{ GPT_ENT_TYPE_NETBSD_CCD,		FS_CCD },
+	{ GPT_ENT_TYPE_NETBSD_CGD,		FS_CGD },
+	{ GPT_ENT_TYPE_MS_BASIC_DATA,		FS_MSDOS },	/* or NTFS? ambiguous */
+};
+
+static int
+efi_block_find_partitions_gpt_entry(struct efi_block_dev *bdev, struct gpt_hdr *hdr, struct gpt_ent *ent, UINT32 index)
+{
+	struct efi_block_part *bpart;
+	uint8_t fstype = FS_UNUSED;
+	struct uuid uuid;
+	int n;
+
+	memcpy(&uuid, ent->ent_type, sizeof(uuid));
+	for (n = 0; n < __arraycount(gpt_guid_to_str); n++)
+		if (memcmp(ent->ent_type, &gpt_guid_to_str[n].guid, sizeof(ent->ent_type)) == 0) {
+			fstype = gpt_guid_to_str[n].fstype;
+			break;
+		}
+	if (fstype == FS_UNUSED)
+		return 0;
+
+	bpart = alloc(sizeof(*bpart));
+	bpart->index = index;
+	bpart->bdev = bdev;
+	bpart->type = EFI_BLOCK_PART_GPT;
+	bpart->gpt.fstype = fstype;
+	bpart->gpt.ent = *ent;
+	memcpy(bpart->hash, ent->ent_guid, sizeof(bpart->hash));
+	TAILQ_INSERT_TAIL(&bdev->partitions, bpart, entries);
+
+	return 0;
+}
+
+static int
+efi_block_find_partitions_gpt(struct efi_block_dev *bdev)
+{
+	struct gpt_hdr hdr;
+	struct gpt_ent ent;
+	EFI_STATUS status;
+	UINT32 sz, entry;
+	uint8_t *buf;
+
+	sz = __MAX(sizeof(hdr), bdev->bio->Media->BlockSize);
+	sz = roundup(sz, bdev->bio->Media->BlockSize);
+	buf = AllocatePool(sz);
+	if (!buf)
+		return ENOMEM;
+
+	status = uefi_call_wrapper(bdev->bio->ReadBlocks, 5, bdev->bio, bdev->media_id, GPT_HDR_BLKNO, sz, buf);
+	if (EFI_ERROR(status)) {
+		FreePool(buf);
+		return EIO;
+	}
+	memcpy(&hdr, buf, sizeof(hdr));
+	FreePool(buf);
+
+	if (memcmp(hdr.hdr_sig, GPT_HDR_SIG, sizeof(hdr.hdr_sig)) != 0)
+		return ENOENT;
+	if (le32toh(hdr.hdr_entsz) < sizeof(ent))
+		return EINVAL;
+
+	sz = __MAX(le32toh(hdr.hdr_entsz) * le32toh(hdr.hdr_entries), bdev->bio->Media->BlockSize);
+	sz = roundup(sz, bdev->bio->Media->BlockSize);
+	buf = AllocatePool(sz);
+	if (!buf)
+		return ENOMEM;
+
+	status = uefi_call_wrapper(bdev->bio->ReadBlocks, 5, bdev->bio, bdev->media_id, le64toh(hdr.hdr_lba_table), sz, buf);
+	if (EFI_ERROR(status)) {
+		FreePool(buf);
+		return EIO;
+	}
+
+	for (entry = 0; entry < le32toh(hdr.hdr_entries); entry++) {
+		memcpy(&ent, buf + (entry * le32toh(hdr.hdr_entsz)), sizeof(ent));
+		efi_block_find_partitions_gpt_entry(bdev, &hdr, &ent, entry);
+	}
+
+	FreePool(buf);
+
+	return 0;
+}
+
 static int
 efi_block_find_partitions(struct efi_block_dev *bdev)
 {
-	return efi_block_find_partitions_mbr(bdev);
+	int error;
+
+	error = efi_block_find_partitions_gpt(bdev);
+	if (error)
+		error = efi_block_find_partitions_mbr(bdev);
+
+	return error;
 }
 
 void
 efi_block_probe(void)
 {
 	struct efi_block_dev *bdev;
+	struct efi_block_part *bpart;
 	EFI_BLOCK_IO *bio;
 	EFI_STATUS status;
 	uint16_t devindex = 0;
@@ -234,13 +333,40 @@ efi_block_probe(void)
 		TAILQ_INIT(&bdev->partitions);
 		TAILQ_INSERT_TAIL(&efi_block_devs, bdev, entries);
 
+		efi_block_find_partitions(bdev);
+
 		if (depth > 0 && efi_device_path_ncmp(efi_bootdp, DevicePathFromHandle(efi_block[n]), depth) == 0) {
-			char devname[9];
-			snprintf(devname, sizeof(devname), "hd%ua", bdev->index);
-			set_default_device(devname);
+			TAILQ_FOREACH(bpart, &bdev->partitions, entries) {
+uint8_t fstype = FS_UNUSED;
+switch (bpart->type) {
+case EFI_BLOCK_PART_DISKLABEL:
+	fstype = bpart->disklabel.part.p_fstype;
+	break;
+case EFI_BLOCK_PART_GPT:
+	fstype = bpart->gpt.fstype;
+	break;
+}
+if (fstype == FS_BSDFFS) {
+	char devname[9];
+	snprintf(devnam

CVS commit: src/sys/arch/evbarm/fdt

2018-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Nov  1 00:44:06 UTC 2018

Modified Files:
src/sys/arch/evbarm/fdt: fdt_machdep.c

Log Message:
Add support for auto-selection of GPT root devices


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/evbarm/fdt/fdt_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/fdt/fdt_machdep.c
diff -u src/sys/arch/evbarm/fdt/fdt_machdep.c:1.52 src/sys/arch/evbarm/fdt/fdt_machdep.c:1.53
--- src/sys/arch/evbarm/fdt/fdt_machdep.c:1.52	Wed Oct 31 13:37:35 2018
+++ src/sys/arch/evbarm/fdt/fdt_machdep.c	Thu Nov  1 00:44:06 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.52 2018/10/31 13:37:35 jmcneill Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.53 2018/11/01 00:44:06 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.52 2018/10/31 13:37:35 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.53 2018/11/01 00:44:06 jmcneill Exp $");
 
 #include "opt_machdep.h"
 #include "opt_bootconfig.h"
@@ -60,6 +60,8 @@ __KERNEL_RCSID(0, "$NetBSD: fdt_machdep.
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 #include 
@@ -629,7 +631,7 @@ fdt_detect_root_device(device_t dev)
 	uint8_t buf[DEV_BSIZE];
 	uint8_t hash[16];
 	const uint8_t *rhash;
-	char rootarg[32];
+	char rootarg[64];
 	struct vnode *vp;
 	MD5_CTX md5ctx;
 	int error, len;
@@ -677,6 +679,27 @@ fdt_detect_root_device(device_t dev)
 		snprintf(rootarg, sizeof(rootarg), " root=%s%c", device_xname(dev), part + 'a');
 		strcat(boot_args, rootarg);
 	}
+
+	if (of_hasprop(chosen, "netbsd,gpt-guid")) {
+		char guidbuf[UUID_STR_LEN];
+		const struct uuid *guid = fdtbus_get_prop(chosen, "netbsd,gpt-guid", &len);
+		if (guid == NULL || len != 16)
+			return;
+
+		uuid_snprintf(guidbuf, sizeof(guidbuf), guid);
+		snprintf(rootarg, sizeof(rootarg), " root=wedge:%s", guidbuf);
+		strcat(boot_args, rootarg);
+	}
+
+	if (of_hasprop(chosen, "netbsd,gpt-label")) {
+		const char *label = fdtbus_get_string(chosen, "netbsd,gpt-label");
+		if (label == NULL || *label == '\0')
+			return;
+
+		device_t dv = dkwedge_find_by_wname(label);
+		if (dv != NULL)
+			booted_device = dv;
+	}
 }
 
 static void



CVS commit: src/sys/stand/efiboot

2018-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct 31 23:49:34 UTC 2018

Modified Files:
src/sys/stand/efiboot: prompt.c

Log Message:
No need to re-print the countdown timer if the number of seconds hasn't changed.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/stand/efiboot/prompt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/stand/efiboot/prompt.c
diff -u src/sys/stand/efiboot/prompt.c:1.3 src/sys/stand/efiboot/prompt.c:1.4
--- src/sys/stand/efiboot/prompt.c:1.3	Sat Sep 15 16:41:37 2018
+++ src/sys/stand/efiboot/prompt.c	Wed Oct 31 23:49:34 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: prompt.c,v 1.3 2018/09/15 16:41:37 jmcneill Exp $	*/
+/*	$NetBSD: prompt.c,v 1.4 2018/10/31 23:49:34 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997
@@ -73,6 +73,7 @@ char
 awaitkey(int timeout, int tell)
 {
 	int i = timeout * POLL_FREQ;
+	int last_secs = -1, secs;
 	char c = 0;
 
 	for (;;) {
@@ -80,13 +81,17 @@ awaitkey(int timeout, int tell)
 			char buf[32];
 			int len;
 
-			len = snprintf(buf, sizeof(buf), "%d seconds. ", (i + POLL_FREQ - 1) / POLL_FREQ);
-			if (len > 0 && len < sizeof(buf)) {
-char *p = buf;
-printf("%s", buf);
-while (*p)
-	*p++ = '\b';
-printf("%s", buf);
+			secs = (i + POLL_FREQ - 1) / POLL_FREQ;
+			if (secs != last_secs) {
+len = snprintf(buf, sizeof(buf), "%d seconds. ", (i + POLL_FREQ - 1) / POLL_FREQ);
+if (len > 0 && len < sizeof(buf)) {
+	char *p = buf;
+	printf("%s", buf);
+	while (*p)
+		*p++ = '\b';
+	printf("%s", buf);
+}
+last_secs = secs;
 			}
 		}
 		if (ischar()) {



CVS commit: src/sbin/atactl

2018-10-31 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Oct 31 20:00:56 UTC 2018

Modified Files:
src/sbin/atactl: atactl.8 atactl.c

Log Message:
extend "smart status" command to "smart status [vendor]", and supply a
"Micron" (for Micron/Crucial) list with their documented values.

this allows the vendor-specific data to be used.

there appears to be no simple way to automatically determine the right
vendor to use -- identify data seems to be the only obvious way and
that data can be and is changed by OEMs.  (eg, a disk may be listed as
being "dell", but dell don't make disks.)  as such, no attempt is made
to automatically determine if a vendor list should be used.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sbin/atactl/atactl.8
cvs rdiff -u -r1.77 -r1.78 src/sbin/atactl/atactl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/atactl/atactl.8
diff -u src/sbin/atactl/atactl.8:1.24 src/sbin/atactl/atactl.8:1.25
--- src/sbin/atactl/atactl.8:1.24	Wed Jan  9 21:58:23 2013
+++ src/sbin/atactl/atactl.8	Wed Oct 31 20:00:56 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: atactl.8,v 1.24 2013/01/09 21:58:23 riastradh Exp $
+.\"	$NetBSD: atactl.8,v 1.25 2018/10/31 20:00:56 mrg Exp $
 .\"
 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 9, 2013
+.Dd October 4, 2018
 .Dt ATACTL 8
 .Os
 .Sh NAME
@@ -103,7 +103,7 @@ and other from 127 to 253.
 Per the specification, values of 127 and higher do not permit the device
 to spin down to save power.
 .El
-.It Cm smart Bq Ar enable | disable | status | offline # | error-log | selftest-log
+.It Cm smart Bq Ar enable | disable | status [ vendor ] | offline # | error-log | selftest-log
 Controls SMART feature set of the specified device.
 SMART stands for Self-Monitoring, Analysis, and Reporting Technology.
 It provides an early warning system by comparing subtle operation
@@ -119,7 +119,7 @@ be preserved by the device across power 
 .It Ar disable
 Disables access to SMART capabilities within the device.
 Attribute values will be saved, and will no longer be monitored.
-.It Ar status
+.It Ar status Bq Ar vendor
 Reports whether SMART is supported by the device, and whether SMART is
 enabled on the device (can only be determined on ATA6 or better devices).
 If SMART is enabled, then a table of attribute information is printed.
@@ -153,6 +153,15 @@ The collect field indicates whether this
 device is online.
 The reliability field indicates whether the attribute
 value is within the acceptable threshold.
+.Pp
+If the
+.Ar vendor
+argument is supplied, a vendor-specific table will be used for SMART
+information if known to
+.Nm .
+Currently, only
+.Dq micron
+has a vendor-specific table.
 .It Ar offline #
 Runs the numbered offline self-test on the drive.
 .It Ar error-log
@@ -272,3 +281,8 @@ The
 .Nx
 kernel behaves poorly with drives that have passwords set and are
 locked.
+.Pp
+The
+.Cm smart status
+command is currently unable to automatically determine the vendor
+attribute name table to use, and must be specified manually.

Index: src/sbin/atactl/atactl.c
diff -u src/sbin/atactl/atactl.c:1.77 src/sbin/atactl/atactl.c:1.78
--- src/sbin/atactl/atactl.c:1.77	Tue Oct  4 21:37:46 2016
+++ src/sbin/atactl/atactl.c	Wed Oct 31 20:00:56 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: atactl.c,v 1.77 2016/10/04 21:37:46 mrg Exp $	*/
+/*	$NetBSD: atactl.c,v 1.78 2018/10/31 20:00:56 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: atactl.c,v 1.77 2016/10/04 21:37:46 mrg Exp $");
+__RCSID("$NetBSD: atactl.c,v 1.78 2018/10/31 20:00:56 mrg Exp $");
 #endif
 
 
@@ -107,7 +107,7 @@ static void	print_bitinfo(const char *, 
 const struct bitinfo *);
 static void	print_bitinfo2(const char *, const char *, u_int, u_int,
 const struct bitinfo *);
-static void	print_smart_status(void *, void *);
+static void	print_smart_status(void *, void *, const char *);
 static void	print_error_entry(int, const struct ata_smart_error *);
 static void	print_selftest_entry(int, const struct ata_smart_selftest *);
 
@@ -143,7 +143,7 @@ static const struct command device_comma
 	{ "sleep",	"",			device_idle },
 	{ "checkpower",	"",			device_checkpower },
 	{ "smart",
-		"enable|disable|status|offline #|error-log|selftest-log",
+		"enable|disable|status [vendor]|offline #|error-log|selftest-log",
 		device_smart },
 	{ "security",
 		"status|freeze|[setpass|unlock|disable|erase] [user|master]",
@@ -255,8 +255,15 @@ static const struct bitinfo ata_sata_fea
 	{ 0, NULL },
 };
 
-static const struct {
-	const int	id;
+/*
+ * Global SMART attribute table.  All known attributes should be defined
+ * here with overrides outside of the standard in

CVS commit: src/sys/arch/amd64/include

2018-10-31 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Oct 31 18:35:05 UTC 2018

Modified Files:
src/sys/arch/amd64/include: Makefile

Log Message:
Revert my kasan addition in this makefile, it looks like it causes
asan.h to be installed, while we don't want it to be.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/amd64/include/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/include/Makefile
diff -u src/sys/arch/amd64/include/Makefile:1.21 src/sys/arch/amd64/include/Makefile:1.22
--- src/sys/arch/amd64/include/Makefile:1.21	Wed Oct 31 06:26:26 2018
+++ src/sys/arch/amd64/include/Makefile	Wed Oct 31 18:35:04 2018
@@ -1,8 +1,8 @@
-#	$NetBSD: Makefile,v 1.21 2018/10/31 06:26:26 maxv Exp $
+#	$NetBSD: Makefile,v 1.22 2018/10/31 18:35:04 maxv Exp $
 
 INCSDIR= /usr/include/amd64
 
-INCS=	ansi.h aout_machdep.h asan.h asm.h \
+INCS=	ansi.h aout_machdep.h asm.h \
 	bootinfo.h bswap.h byte_swap.h \
 	cdefs.h cpu.h cpu_rng.h\
 	disklabel.h \



CVS commit: src/sys/dev/pci

2018-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct 31 16:11:29 UTC 2018

Modified Files:
src/sys/dev/pci: xhci_pci.c

Log Message:
Add MSI-X support.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/xhci_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/xhci_pci.c
diff -u src/sys/dev/pci/xhci_pci.c:1.14 src/sys/dev/pci/xhci_pci.c:1.15
--- src/sys/dev/pci/xhci_pci.c:1.14	Tue Sep 18 05:24:10 2018
+++ src/sys/dev/pci/xhci_pci.c	Wed Oct 31 16:11:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci_pci.c,v 1.14 2018/09/18 05:24:10 mrg Exp $	*/
+/*	$NetBSD: xhci_pci.c,v 1.15 2018/10/31 16:11:29 jmcneill Exp $	*/
 /*	OpenBSD: xhci_pci.c,v 1.4 2014/07/12 17:38:51 yuo Exp	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.14 2018/09/18 05:24:10 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.15 2018/10/31 16:11:29 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_xhci_pci.h"
@@ -186,6 +186,9 @@ xhci_pci_attach(device_t parent, device_
 #ifndef XHCI_DISABLE_MSI
 		[PCI_INTR_TYPE_MSI] = 1,
 #endif
+#ifndef XHCI_DISABLE_MSIX
+		[PCI_INTR_TYPE_MSIX] = 1,
+#endif
 	};
 
 alloc_retry:
@@ -203,6 +206,12 @@ alloc_retry:
 		pci_intr_release(pc, psc->sc_pihp, 1);
 		psc->sc_ih = NULL;
 		switch (intr_type) {
+		case PCI_INTR_TYPE_MSIX:
+			/* The next try is for MSI: Disable MSIX */
+			counts[PCI_INTR_TYPE_MSIX] = 0;
+			counts[PCI_INTR_TYPE_MSI] = 1;
+			counts[PCI_INTR_TYPE_INTX] = 1;
+			goto alloc_retry;
 		case PCI_INTR_TYPE_MSI:
 			/* The next try is for INTx: Disable MSI */
 			counts[PCI_INTR_TYPE_MSI] = 0;



CVS commit: src/sys/arch/arm/fdt

2018-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct 31 15:42:54 UTC 2018

Modified Files:
src/sys/arch/arm/fdt: acpi_fdt.c

Log Message:
Add MSI-X support


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/fdt/acpi_fdt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/fdt/acpi_fdt.c
diff -u src/sys/arch/arm/fdt/acpi_fdt.c:1.7 src/sys/arch/arm/fdt/acpi_fdt.c:1.8
--- src/sys/arch/arm/fdt/acpi_fdt.c:1.7	Sun Oct 28 10:21:42 2018
+++ src/sys/arch/arm/fdt/acpi_fdt.c	Wed Oct 31 15:42:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_fdt.c,v 1.7 2018/10/28 10:21:42 jmcneill Exp $ */
+/* $NetBSD: acpi_fdt.c,v 1.8 2018/10/31 15:42:54 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -29,7 +29,7 @@
 #include "opt_efi.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_fdt.c,v 1.7 2018/10/28 10:21:42 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_fdt.c,v 1.8 2018/10/31 15:42:54 jmcneill Exp $");
 
 #include 
 #include 
@@ -127,7 +127,7 @@ acpi_fdt_attach(device_t parent, device_
 	PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | 
 	PCI_FLAGS_MWI_OKAY;
 #ifdef __HAVE_PCI_MSI_MSIX
-	aa.aa_pciflags |= PCI_FLAGS_MSI_OKAY;
+	aa.aa_pciflags |= PCI_FLAGS_MSI_OKAY | PCI_FLAGS_MSIX_OKAY;
 #endif
 	aa.aa_ic = 0;
 	aa.aa_dmat = faa->faa_dmat;



CVS commit: src/sys/arch/arm/cortex

2018-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct 31 15:43:19 UTC 2018

Modified Files:
src/sys/arch/arm/cortex: gic_v2m.c

Log Message:
Add MSI-X support.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/cortex/gic_v2m.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/cortex/gic_v2m.c
diff -u src/sys/arch/arm/cortex/gic_v2m.c:1.2 src/sys/arch/arm/cortex/gic_v2m.c:1.3
--- src/sys/arch/arm/cortex/gic_v2m.c:1.2	Tue Oct 30 23:59:47 2018
+++ src/sys/arch/arm/cortex/gic_v2m.c	Wed Oct 31 15:43:19 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: gic_v2m.c,v 1.2 2018/10/30 23:59:47 jmcneill Exp $ */
+/* $NetBSD: gic_v2m.c,v 1.3 2018/10/31 15:43:19 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gic_v2m.c,v 1.2 2018/10/30 23:59:47 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic_v2m.c,v 1.3 2018/10/31 15:43:19 jmcneill Exp $");
 
 #include 
 #include 
@@ -135,6 +135,48 @@ gic_v2m_msi_disable(struct gic_v2m_frame
 	pci_conf_write(pc, tag, off + PCI_MSI_CTL, ctl);
 }
 
+static void
+gic_v2m_msix_enable(struct gic_v2m_frame *frame, int spi, int msix_vec,
+bus_space_tag_t bst, bus_space_handle_t bsh)
+{
+	const struct pci_attach_args *pa = frame->frame_pa[spi];
+	pci_chipset_tag_t pc = pa->pa_pc;
+	pcitag_t tag = pa->pa_tag;
+	pcireg_t ctl;
+	int off;
+
+	if (!pci_get_capability(pc, tag, PCI_CAP_MSIX, &off, NULL))
+		panic("gic_v2m_msix_enable: device is not MSI-X-capable");
+
+	const uint64_t addr = frame->frame_reg + GIC_MSI_SETSPI;
+	const uint64_t entry_base = PCI_MSIX_TABLE_ENTRY_SIZE * msix_vec;
+	bus_space_write_4(bst, bsh, entry_base + PCI_MSIX_TABLE_ENTRY_ADDR_LO, (uint32_t)addr);
+	bus_space_write_4(bst, bsh, entry_base + PCI_MSIX_TABLE_ENTRY_ADDR_HI, (uint32_t)(addr >> 32));
+	bus_space_write_4(bst, bsh, entry_base + PCI_MSIX_TABLE_ENTRY_DATA, spi);
+	bus_space_write_4(bst, bsh, entry_base + PCI_MSIX_TABLE_ENTRY_VECTCTL, 0);
+
+	ctl = pci_conf_read(pc, tag, off + PCI_MSIX_CTL);
+	ctl |= PCI_MSIX_CTL_ENABLE;
+	pci_conf_write(pc, tag, off + PCI_MSIX_CTL, ctl);
+}
+
+static void
+gic_v2m_msix_disable(struct gic_v2m_frame *frame, int spi)
+{
+	const struct pci_attach_args *pa = frame->frame_pa[spi];
+	pci_chipset_tag_t pc = pa->pa_pc;
+	pcitag_t tag = pa->pa_tag;
+	pcireg_t ctl;
+	int off;
+
+	if (!pci_get_capability(pc, tag, PCI_CAP_MSIX, &off, NULL))
+		panic("gic_v2m_msix_disable: device is not MSI-X-capable");
+
+	ctl = pci_conf_read(pc, tag, off + PCI_MSIX_CTL);
+	ctl &= ~PCI_MSIX_CTL_ENABLE;
+	pci_conf_write(pc, tag, off + PCI_MSIX_CTL, ctl);
+}
+
 static pci_intr_handle_t *
 gic_v2m_msi_alloc(struct arm_pci_msi *msi, int *count,
 const struct pci_attach_args *pa, bool exact)
@@ -175,6 +217,69 @@ gic_v2m_msi_alloc(struct arm_pci_msi *ms
 	return vectors;
 }
 
+static pci_intr_handle_t *
+gic_v2m_msix_alloc(struct arm_pci_msi *msi, u_int *table_indexes, int *count,
+const struct pci_attach_args *pa, bool exact)
+{
+	struct gic_v2m_frame * const frame = msi->msi_priv;
+	pci_intr_handle_t *vectors;
+	bus_space_tag_t bst;
+	bus_space_handle_t bsh;
+	bus_size_t bsz;
+	uint32_t table_offset, table_size;
+	int n, off, bar, error;
+	pcireg_t tbl;
+
+	if (!pci_get_capability(pa->pa_pc, pa->pa_tag, PCI_CAP_MSIX, &off, NULL))
+		return NULL;
+
+	const int avail = gic_v2m_msi_available_spi(frame);
+	if (exact && *count > avail)
+		return NULL;
+
+	while (*count > avail) {
+		if (avail < *count)
+			(*count) >>= 1;
+	}
+	if (*count == 0)
+		return NULL;
+
+	tbl = pci_conf_read(pa->pa_pc, pa->pa_tag, off + PCI_MSIX_TBLOFFSET);
+	bar = PCI_BAR0 + (4 * (tbl & PCI_MSIX_PBABIR_MASK));
+	table_offset = tbl & PCI_MSIX_TBLOFFSET_MASK;
+	table_size = pci_msix_count(pa->pa_pc, pa->pa_tag) * PCI_MSIX_TABLE_ENTRY_SIZE;
+	if (table_size == 0)
+		return NULL;
+
+	error = pci_mapreg_submap(pa, bar, pci_mapreg_type(pa->pa_pc, pa->pa_tag, bar),
+	BUS_SPACE_MAP_LINEAR, roundup(table_size, PAGE_SIZE), table_offset,
+	&bst, &bsh, NULL, &bsz);
+	if (error)
+		return NULL;
+
+	const int spi_base = gic_v2m_msi_alloc_spi(frame, *count, pa);
+	if (spi_base == -1) {
+		bus_space_unmap(bst, bsh, bsz);
+		return NULL;
+	}
+
+	vectors = kmem_alloc(sizeof(*vectors) * *count, KM_SLEEP);
+	for (n = 0; n < *count; n++) {
+		const int spi = spi_base + n;
+		const int msix_vec = table_indexes ? table_indexes[n] : n;
+		vectors[msix_vec] = ARM_PCI_INTR_MSIX |
+		__SHIFTIN(spi, ARM_PCI_INTR_IRQ) |
+		__SHIFTIN(msix_vec, ARM_PCI_INTR_MSI_VEC) |
+		__SHIFTIN(msi->msi_id, ARM_PCI_INTR_FRAME);
+
+		gic_v2m_msix_enable(frame, spi, msix_vec, bst, bsh);
+	}
+
+	bus_space_unmap(bst, bsh, bsz);
+
+	return vectors;
+}
+
 static void *
 gic_v2m_msi_intr_establish(struct arm_pci_msi *msi,
 pci_intr_handle_t ih, int ipl, int (*func)(void *), void *arg)
@@ -197,7 +302,10 @@ gic

CVS commit: src/sys/arch/arm/acpi

2018-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct 31 15:42:36 UTC 2018

Modified Files:
src/sys/arch/arm/acpi: acpi_pci_machdep.c

Log Message:
Add MSI-X support


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/acpi/acpi_pci_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/acpi/acpi_pci_machdep.c
diff -u src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.4 src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.5
--- src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.4	Sun Oct 21 11:56:26 2018
+++ src/sys/arch/arm/acpi/acpi_pci_machdep.c	Wed Oct 31 15:42:36 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_pci_machdep.c,v 1.4 2018/10/21 11:56:26 jmcneill Exp $ */
+/* $NetBSD: acpi_pci_machdep.c,v 1.5 2018/10/31 15:42:36 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_pci_machdep.c,v 1.4 2018/10/21 11:56:26 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_pci_machdep.c,v 1.5 2018/10/31 15:42:36 jmcneill Exp $");
 
 #include 
 #include 
@@ -331,9 +331,12 @@ static const char *
 acpi_pci_md_intr_string(void *v, pci_intr_handle_t ih, char *buf, size_t len)
 {
 	const int irq = __SHIFTOUT(ih, ARM_PCI_INTR_IRQ);
+	const int vec = __SHIFTOUT(ih, ARM_PCI_INTR_MSI_VEC);
 
-	if (ih & ARM_PCI_INTR_MSI)
-		snprintf(buf, len, "irq %d (MSI)", irq);
+	if (ih & ARM_PCI_INTR_MSIX)
+		snprintf(buf, len, "irq %d (MSI-X vec %d)", irq, vec);
+	else if (ih & ARM_PCI_INTR_MSI)
+		snprintf(buf, len, "irq %d (MSI vec %d)", irq, vec);
 	else
 		snprintf(buf, len, "irq %d", irq);
 
@@ -367,7 +370,7 @@ acpi_pci_md_intr_establish(void *v, pci_
 {
 	struct acpi_pci_context * const ap = v;
 
-	if (ih & ARM_PCI_INTR_MSI)
+	if ((ih & (ARM_PCI_INTR_MSI | ARM_PCI_INTR_MSIX)) != 0)
 		return arm_pci_msi_intr_establish(&ap->ap_pc, ih, ipl, callback, arg);
 
 	const int irq = (int)__SHIFTOUT(ih, ARM_PCI_INTR_IRQ);



CVS commit: src/sys/arch/arm/pci

2018-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct 31 15:42:17 UTC 2018

Modified Files:
src/sys/arch/arm/pci: pci_msi_machdep.c pci_msi_machdep.h

Log Message:
Add MSI-X support.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/pci/pci_msi_machdep.c \
src/sys/arch/arm/pci/pci_msi_machdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/pci/pci_msi_machdep.c
diff -u src/sys/arch/arm/pci/pci_msi_machdep.c:1.1 src/sys/arch/arm/pci/pci_msi_machdep.c:1.2
--- src/sys/arch/arm/pci/pci_msi_machdep.c:1.1	Sun Oct 21 00:42:06 2018
+++ src/sys/arch/arm/pci/pci_msi_machdep.c	Wed Oct 31 15:42:17 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_msi_machdep.c,v 1.1 2018/10/21 00:42:06 jmcneill Exp $ */
+/* $NetBSD: pci_msi_machdep.c,v 1.2 2018/10/31 15:42:17 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_msi_machdep.c,v 1.1 2018/10/21 00:42:06 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_msi_machdep.c,v 1.2 2018/10/31 15:42:17 jmcneill Exp $");
 
 #include 
 #include 
@@ -81,6 +81,28 @@ arm_pci_msi_alloc_common(pci_intr_handle
 	return 0;
 }
 
+static int
+arm_pci_msix_alloc_common(pci_intr_handle_t **ihps, u_int *table_indexes, int *count, const struct pci_attach_args *pa, bool exact)
+{
+	pci_intr_handle_t *vectors;
+	struct arm_pci_msi *msi;
+
+	if ((pa->pa_flags & PCI_FLAGS_MSIX_OKAY) == 0)
+		return ENODEV;
+
+	msi = SIMPLEQ_FIRST(&arm_pci_msi_list);		/* XXX multiple frame support */
+	if (msi == NULL || msi->msix_alloc == NULL)
+		return EINVAL;
+
+	vectors = msi->msix_alloc(msi, table_indexes, count, pa, exact);
+	if (vectors == NULL)
+		return ENOMEM;
+
+	*ihps = vectors;
+
+	return 0;
+}
+
 /*
  * arm_pci_msi MD API
  */
@@ -125,19 +147,19 @@ pci_msi_alloc_exact(const struct pci_att
 int
 pci_msix_alloc(const struct pci_attach_args *pa, pci_intr_handle_t **ihps, int *count)
 {
-	return EOPNOTSUPP;
+	return arm_pci_msix_alloc_common(ihps, NULL, count, pa, false);
 }
 
 int
 pci_msix_alloc_exact(const struct pci_attach_args *pa, pci_intr_handle_t **ihps, int count)
 {
-	return EOPNOTSUPP;
+	return arm_pci_msix_alloc_common(ihps, NULL, &count, pa, true);
 }
 
 int
 pci_msix_alloc_map(const struct pci_attach_args *pa, pci_intr_handle_t **ihps, u_int *table_indexes, int count)
 {
-	return EOPNOTSUPP;
+	return arm_pci_msix_alloc_common(ihps, table_indexes, &count, pa, true);
 }
 
 int
Index: src/sys/arch/arm/pci/pci_msi_machdep.h
diff -u src/sys/arch/arm/pci/pci_msi_machdep.h:1.1 src/sys/arch/arm/pci/pci_msi_machdep.h:1.2
--- src/sys/arch/arm/pci/pci_msi_machdep.h:1.1	Sun Oct 21 00:42:06 2018
+++ src/sys/arch/arm/pci/pci_msi_machdep.h	Wed Oct 31 15:42:17 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_msi_machdep.h,v 1.1 2018/10/21 00:42:06 jmcneill Exp $ */
+/* $NetBSD: pci_msi_machdep.h,v 1.2 2018/10/31 15:42:17 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -42,6 +42,7 @@ struct arm_pci_msi {
 	void *			msi_priv;
 
 	pci_intr_handle_t *	(*msi_alloc)(struct arm_pci_msi *, int *, const struct pci_attach_args *, bool);
+	pci_intr_handle_t *	(*msix_alloc)(struct arm_pci_msi *, u_int *, int *, const struct pci_attach_args *, bool);
 	void *			(*msi_intr_establish)(struct arm_pci_msi *,
 pci_intr_handle_t, int, int (*)(void *), void *);
 	void			(*msi_intr_release)(struct arm_pci_msi *,



CVS commit: src/sys/arch/aarch64/aarch64

2018-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct 31 14:15:12 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: efi_machdep.c

Log Message:
EFI runtime code section needs to be writable, otherwise we fail with a 
permission fault at shutdown on QEMU when writing to the RTC


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/aarch64/aarch64/efi_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/aarch64/aarch64/efi_machdep.c
diff -u src/sys/arch/aarch64/aarch64/efi_machdep.c:1.2 src/sys/arch/aarch64/aarch64/efi_machdep.c:1.3
--- src/sys/arch/aarch64/aarch64/efi_machdep.c:1.2	Wed Oct 31 13:01:48 2018
+++ src/sys/arch/aarch64/aarch64/efi_machdep.c	Wed Oct 31 14:15:12 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: efi_machdep.c,v 1.2 2018/10/31 13:01:48 jmcneill Exp $ */
+/* $NetBSD: efi_machdep.c,v 1.3 2018/10/31 14:15:12 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: efi_machdep.c,v 1.2 2018/10/31 13:01:48 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: efi_machdep.c,v 1.3 2018/10/31 14:15:12 jmcneill Exp $");
 
 #include 
 #include 
@@ -45,8 +45,8 @@ arm_efirt_md_map_range(vaddr_t va, paddr
 
 	switch (type) {
 	case ARM_EFIRT_MEM_CODE:
-		attr = LX_BLKPAG_OS_READ |
-		   LX_BLKPAG_AF | LX_BLKPAG_AP_RO | LX_BLKPAG_UXN |
+		attr = LX_BLKPAG_OS_READ | LX_BLKPAG_OS_WRITE |
+		   LX_BLKPAG_AF | LX_BLKPAG_AP_RW | LX_BLKPAG_UXN |
 		   LX_BLKPAG_ATTR_NORMAL_WB;
 		break;
 	case ARM_EFIRT_MEM_DATA:



CVS commit: src/sys/arch/aarch64/aarch64

2018-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct 31 13:42:24 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: aarch64_machdep.c

Log Message:
Implement parse_mi_bootargs for aarch64


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/aarch64/aarch64/aarch64_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/aarch64/aarch64/aarch64_machdep.c
diff -u src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.16 src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.17
--- src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.16	Sat Oct 20 06:18:18 2018
+++ src/sys/arch/aarch64/aarch64/aarch64_machdep.c	Wed Oct 31 13:42:24 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.16 2018/10/20 06:18:18 ryo Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.17 2018/10/31 13:42:24 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.16 2018/10/20 06:18:18 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.17 2018/10/31 13:42:24 jmcneill Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -45,6 +45,7 @@ __KERNEL_RCSID(1, "$NetBSD: aarch64_mach
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -501,6 +502,20 @@ SYSCTL_SETUP(sysctl_machdep_setup, "sysc
 void
 parse_mi_bootargs(char *args)
 {
+	int val;
+
+	if (get_bootconf_option(args, "-s", BOOTOPT_TYPE_BOOLEAN, &val) && val)
+		boothowto |= RB_SINGLE;
+	if (get_bootconf_option(args, "-d", BOOTOPT_TYPE_BOOLEAN, &val) && val)
+		boothowto |= RB_KDB;
+	if (get_bootconf_option(args, "-a", BOOTOPT_TYPE_BOOLEAN, &val) && val)
+		boothowto |= RB_ASKNAME;
+	if (get_bootconf_option(args, "-q", BOOTOPT_TYPE_BOOLEAN, &val) && val)
+		boothowto |= AB_QUIET;
+	if (get_bootconf_option(args, "-v", BOOTOPT_TYPE_BOOLEAN, &val) && val)
+		boothowto |= AB_VERBOSE;
+	if (get_bootconf_option(args, "-x", BOOTOPT_TYPE_BOOLEAN, &val) && val)
+		boothowto |= AB_DEBUG;
 }
 
 void



CVS commit: src/sys/arch/evbarm/fdt

2018-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct 31 13:37:35 UTC 2018

Modified Files:
src/sys/arch/evbarm/fdt: fdt_machdep.c

Log Message:
Use PRIx64 to print uint64_t


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/evbarm/fdt/fdt_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/fdt/fdt_machdep.c
diff -u src/sys/arch/evbarm/fdt/fdt_machdep.c:1.51 src/sys/arch/evbarm/fdt/fdt_machdep.c:1.52
--- src/sys/arch/evbarm/fdt/fdt_machdep.c:1.51	Wed Oct 31 13:01:48 2018
+++ src/sys/arch/evbarm/fdt/fdt_machdep.c	Wed Oct 31 13:37:35 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.51 2018/10/31 13:01:48 jmcneill Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.52 2018/10/31 13:37:35 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.51 2018/10/31 13:01:48 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.52 2018/10/31 13:37:35 jmcneill Exp $");
 
 #include "opt_machdep.h"
 #include "opt_bootconfig.h"
@@ -241,7 +241,7 @@ fdt_add_dram_blocks(const struct fdt_mem
 {
 	BootConfig *bc = arg;
 
-	VPRINTF("  %llx - %llx\n", m->start, m->end - 1);
+	VPRINTF("  %" PRIx64 " - %" PRIx64 "\n", m->start, m->end - 1);
 	bc->dram[bc->dramblocks].address = m->start;
 	bc->dram[bc->dramblocks].pages =
 	(m->end - m->start) / PAGE_SIZE;
@@ -257,7 +257,7 @@ fdt_add_boot_physmem(const struct fdt_me
 {
 	struct boot_physmem *bp = &fdt_physmem[nfdt_physmem++];
 
-	VPRINTF("  %llx - %llx\n", m->start, m->end - 1);
+	VPRINTF("  %" PRIx64 " - %" PRIx64 "\n", m->start, m->end - 1);
 
 	KASSERT(nfdt_physmem <= MAX_PHYSMEM);
 



CVS commit: src/sys/arch

2018-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct 31 13:01:48 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: efi_machdep.c
src/sys/arch/arm/arm: efi_runtime.h
src/sys/arch/evbarm/fdt: fdt_machdep.c

Log Message:
Setup mappings for EFI runtime mmio ranges.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/aarch64/aarch64/efi_machdep.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/arm/efi_runtime.h
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/evbarm/fdt/fdt_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/aarch64/aarch64/efi_machdep.c
diff -u src/sys/arch/aarch64/aarch64/efi_machdep.c:1.1 src/sys/arch/aarch64/aarch64/efi_machdep.c:1.2
--- src/sys/arch/aarch64/aarch64/efi_machdep.c:1.1	Sun Oct 28 10:21:42 2018
+++ src/sys/arch/aarch64/aarch64/efi_machdep.c	Wed Oct 31 13:01:48 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: efi_machdep.c,v 1.1 2018/10/28 10:21:42 jmcneill Exp $ */
+/* $NetBSD: efi_machdep.c,v 1.2 2018/10/31 13:01:48 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: efi_machdep.c,v 1.1 2018/10/28 10:21:42 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: efi_machdep.c,v 1.2 2018/10/31 13:01:48 jmcneill Exp $");
 
 #include 
 #include 
@@ -39,16 +39,30 @@ __KERNEL_RCSID(0, "$NetBSD: efi_machdep.
 #include 
 
 void
-arm_efirt_md_map_range(vaddr_t va, paddr_t pa, size_t sz, bool exec)
+arm_efirt_md_map_range(vaddr_t va, paddr_t pa, size_t sz, enum arm_efirt_mem_type type)
 {   
 	pt_entry_t attr;
-
-	attr = LX_BLKPAG_OS_READ | LX_BLKPAG_AF | LX_BLKPAG_UXN | LX_BLKPAG_ATTR_NORMAL_WB;
-	if (exec)
-		attr |= LX_BLKPAG_AP_RO;
-	else
-		attr |= LX_BLKPAG_AP_RW | LX_BLKPAG_OS_WRITE | LX_BLKPAG_PXN;
-
+
+	switch (type) {
+	case ARM_EFIRT_MEM_CODE:
+		attr = LX_BLKPAG_OS_READ |
+		   LX_BLKPAG_AF | LX_BLKPAG_AP_RO | LX_BLKPAG_UXN |
+		   LX_BLKPAG_ATTR_NORMAL_WB;
+		break;
+	case ARM_EFIRT_MEM_DATA:
+		attr = LX_BLKPAG_OS_READ | LX_BLKPAG_OS_WRITE |
+		   LX_BLKPAG_AF | LX_BLKPAG_AP_RW | LX_BLKPAG_UXN | LX_BLKPAG_PXN |
+		   LX_BLKPAG_ATTR_NORMAL_WB;
+		break;
+	case ARM_EFIRT_MEM_MMIO:
+		attr = LX_BLKPAG_OS_READ | LX_BLKPAG_OS_WRITE |
+		   LX_BLKPAG_AF | LX_BLKPAG_AP_RW | LX_BLKPAG_UXN | LX_BLKPAG_PXN |
+		   LX_BLKPAG_ATTR_DEVICE_MEM;
+		break;
+	default:
+		panic("arm_efirt_md_map_range: unsupported type %d", type);
+	}
+
 	pmapboot_enter(va, pa, sz, L3_SIZE, attr, 0, bootpage_alloc, NULL);
 	while (sz >= PAGE_SIZE) {
 		aarch64_tlbi_by_va(va);

Index: src/sys/arch/arm/arm/efi_runtime.h
diff -u src/sys/arch/arm/arm/efi_runtime.h:1.1 src/sys/arch/arm/arm/efi_runtime.h:1.2
--- src/sys/arch/arm/arm/efi_runtime.h:1.1	Sun Oct 28 10:21:42 2018
+++ src/sys/arch/arm/arm/efi_runtime.h	Wed Oct 31 13:01:48 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: efi_runtime.h,v 1.1 2018/10/28 10:21:42 jmcneill Exp $ */
+/* $NetBSD: efi_runtime.h,v 1.2 2018/10/31 13:01:48 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -39,6 +39,12 @@ int		arm_efirt_gettime(struct efi_tm *);
 int		arm_efirt_settime(struct efi_tm *);
 int		arm_efirt_reset(enum efi_reset);
 
-void		arm_efirt_md_map_range(vaddr_t, paddr_t, size_t, bool);
+enum arm_efirt_mem_type {
+	ARM_EFIRT_MEM_CODE,
+	ARM_EFIRT_MEM_DATA,
+	ARM_EFIRT_MEM_MMIO,
+};
+
+void		arm_efirt_md_map_range(vaddr_t, paddr_t, size_t, enum arm_efirt_mem_type);
 
 #endif /* !_ARM_EFI_RUNTIME_H */

Index: src/sys/arch/evbarm/fdt/fdt_machdep.c
diff -u src/sys/arch/evbarm/fdt/fdt_machdep.c:1.50 src/sys/arch/evbarm/fdt/fdt_machdep.c:1.51
--- src/sys/arch/evbarm/fdt/fdt_machdep.c:1.50	Wed Oct 31 09:15:25 2018
+++ src/sys/arch/evbarm/fdt/fdt_machdep.c	Wed Oct 31 13:01:48 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.50 2018/10/31 09:15:25 skrll Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.51 2018/10/31 13:01:48 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.50 2018/10/31 09:15:25 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.51 2018/10/31 13:01:48 jmcneill Exp $");
 
 #include "opt_machdep.h"
 #include "opt_bootconfig.h"
@@ -388,7 +388,7 @@ fdt_setup_initrd(void)
 
 #ifdef EFI_RUNTIME
 static void
-fdt_map_efi_runtime(const char *prop, bool exec)
+fdt_map_efi_runtime(const char *prop, enum arm_efirt_mem_type type)
 {
 	int len;
 
@@ -404,7 +404,8 @@ fdt_map_efi_runtime(const char *prop, bo
 		const paddr_t pa = be64toh(map[0]);
 		const vaddr_t va = be64toh(map[1]);
 		const uint64_t sz = be64toh(map[2]);
-		arm_efirt_md_map_range(va, pa, sz, exec);
+		VPRINTF("%s: %s %lx-%lx (%lx-%lx)\n", __func__, prop, pa, pa+sz-1, va, va+sz-1);
+		arm_efirt_md_map_range(va, pa, sz, type);
 		map += 3;
 		len -= 24;
 	}
@@ -523,8 +524,9 @@ initarm(void *arg)
 	fdt_build_bootc

CVS commit: src/sys/stand/efiboot

2018-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct 31 13:00:35 UTC 2018

Modified Files:
src/sys/stand/efiboot: efiboot.c

Log Message:
Assign VAs for EFI runtime mmio ranges


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/stand/efiboot/efiboot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/stand/efiboot/efiboot.c
diff -u src/sys/stand/efiboot/efiboot.c:1.10 src/sys/stand/efiboot/efiboot.c:1.11
--- src/sys/stand/efiboot/efiboot.c:1.10	Sun Oct 28 10:17:47 2018
+++ src/sys/stand/efiboot/efiboot.c	Wed Oct 31 13:00:35 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: efiboot.c,v 1.10 2018/10/28 10:17:47 jmcneill Exp $ */
+/* $NetBSD: efiboot.c,v 1.11 2018/10/31 13:00:35 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -144,6 +144,11 @@ efi_set_virtual_address_map(EFI_MEMORY_D
 			fdt_appendprop_u64(fdt, fdt_path_offset(fdt, "/chosen"), "netbsd,uefi-runtime-data", md->VirtualStart);
 			fdt_appendprop_u64(fdt, fdt_path_offset(fdt, "/chosen"), "netbsd,uefi-runtime-data", md->NumberOfPages * EFI_PAGE_SIZE);
 			break;
+		case EfiMemoryMappedIO:
+			fdt_appendprop_u64(fdt, fdt_path_offset(fdt, "/chosen"), "netbsd,uefi-runtime-mmio", md->PhysicalStart);
+			fdt_appendprop_u64(fdt, fdt_path_offset(fdt, "/chosen"), "netbsd,uefi-runtime-mmio", md->VirtualStart);
+			fdt_appendprop_u64(fdt, fdt_path_offset(fdt, "/chosen"), "netbsd,uefi-runtime-mmio", md->NumberOfPages * EFI_PAGE_SIZE);
+			break;
 		default:
 			break;
 		}



CVS commit: src/sys/stand/efiboot

2018-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct 31 12:59:43 UTC 2018

Modified Files:
src/sys/stand/efiboot: efifdt.c

Log Message:
When building /memory, skip EFI runtime memory ranges


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/stand/efiboot/efifdt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/stand/efiboot/efifdt.c
diff -u src/sys/stand/efiboot/efifdt.c:1.10 src/sys/stand/efiboot/efifdt.c:1.11
--- src/sys/stand/efiboot/efifdt.c:1.10	Wed Oct 31 09:13:32 2018
+++ src/sys/stand/efiboot/efifdt.c	Wed Oct 31 12:59:43 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: efifdt.c,v 1.10 2018/10/31 09:13:32 jmcneill Exp $ */
+/* $NetBSD: efifdt.c,v 1.11 2018/10/31 12:59:43 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -158,6 +158,8 @@ efi_fdt_memory_map(void)
 		md->PhysicalStart, md->VirtualStart,
 		(u_long)md->NumberOfPages * EFI_PAGE_SIZE);
 #endif
+		if ((md->Attribute & EFI_MEMORY_RUNTIME) != 0)
+			continue;
 		if ((md->Attribute & EFI_MEMORY_WB) == 0)
 			continue;
 		if (!FDT_MEMORY_USABLE(md))



CVS commit: [netbsd-8] src/distrib/sets/lists/man

2018-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 31 10:39:55 UTC 2018

Modified Files:
src/distrib/sets/lists/man [netbsd-8]: mi

Log Message:
Missing commit from ticket #1072: add bwfm man page


To generate a diff of this commit:
cvs rdiff -u -r1.1557.2.5 -r1.1557.2.6 src/distrib/sets/lists/man/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1557.2.5 src/distrib/sets/lists/man/mi:1.1557.2.6
--- src/distrib/sets/lists/man/mi:1.1557.2.5	Thu Jun  7 18:24:16 2018
+++ src/distrib/sets/lists/man/mi	Wed Oct 31 10:39:55 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1557.2.5 2018/06/07 18:24:16 martin Exp $
+# $NetBSD: mi,v 1.1557.2.6 2018/10/31 10:39:55 martin Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -951,6 +951,7 @@
 ./usr/share/man/cat4/btms.0			man-sys-catman		.cat
 ./usr/share/man/cat4/btsco.0			man-sys-catman		.cat
 ./usr/share/man/cat4/btuart.0			man-sys-catman		.cat
+./usr/share/man/cat4/bwfm.0			man-sys-catman		.cat
 ./usr/share/man/cat4/bwi.0			man-sys-catman		.cat
 ./usr/share/man/cat4/ca.0			man-obsolete		obsolete
 ./usr/share/man/cat4/cac.0			man-sys-catman		.cat
@@ -4072,6 +4073,7 @@
 ./usr/share/man/html4/btms.html			man-sys-htmlman		html
 ./usr/share/man/html4/btsco.html		man-sys-htmlman		html
 ./usr/share/man/html4/btuart.html		man-sys-htmlman		html
+./usr/share/man/html4/bwfm.html			man-sys-htmlman		html
 ./usr/share/man/html4/bwi.html			man-sys-htmlman		html
 ./usr/share/man/html4/cac.html			man-sys-htmlman		html
 ./usr/share/man/html4/can.html			man-sys-htmlman		html
@@ -6963,6 +6965,7 @@
 ./usr/share/man/man4/btms.4			man-sys-man		.man
 ./usr/share/man/man4/btsco.4			man-sys-man		.man
 ./usr/share/man/man4/btuart.4			man-sys-man		.man
+./usr/share/man/man4/bwfm.4			man-sys-man		.man
 ./usr/share/man/man4/bwi.4			man-sys-man		.man
 ./usr/share/man/man4/ca.4			man-obsolete		obsolete
 ./usr/share/man/man4/cac.4			man-sys-man		.man



CVS commit: [netbsd-8] src/doc

2018-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 31 10:05:33 UTC 2018

Modified Files:
src/doc [netbsd-8]: CHANGES-8.1

Log Message:
Tickets #1072, #1073 and #1076


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.42 -r1.1.2.43 src/doc/CHANGES-8.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.42 src/doc/CHANGES-8.1:1.1.2.43
--- src/doc/CHANGES-8.1:1.1.2.42	Tue Oct 30 09:32:48 2018
+++ src/doc/CHANGES-8.1	Wed Oct 31 10:05:33 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.42 2018/10/30 09:32:48 sborrill Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.43 2018/10/31 10:05:33 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1512,3 +1512,56 @@ sys/dev/pci/pcireg.h1.141-1.142
 	- Add comment.
 	[msaitoh, ticket #1074]
 
+distrib/sets/lists/base/mi(patch)
+etc/mtree/NetBSD.dist.base(patch)
+external/Makefile	(patch)
+external/broadcom/Makefile1.3 (patch)
+external/broadcom/Makefile.inc1.1 (patch)
+external/broadcom/bwfm/Makefile1.3 (patch)
+external/broadcom/bwfm/dist/LICENCE.broadcom_bcm43xx	1.1.1.1 (patch)
+external/broadcom/bwfm/dist/brcmfmac43143.bin		1.1.1.1 (patch)
+external/broadcom/bwfm/dist/brcmfmac43236b.bin		1.1.1.1 (patch)
+external/broadcom/bwfm/dist/brcmfmac43242a.bin		1.1.1.1 (patch)
+external/broadcom/bwfm/dist/brcmfmac4350-pcie.bin	1.1 (patch)
+external/broadcom/bwfm/dist/brcmfmac4350c2-pcie.bin	1.1 (patch)
+external/broadcom/bwfm/dist/brcmfmac43569.bin		1.1.1.1 (patch)
+external/broadcom/bwfm/dist/brcmfmac43602-pcie.bin	1.1 (patch)
+sys/arch/amd64/conf/GENERIC(patch)
+sys/arch/i386/conf/GENERIC(patch)
+sys/conf/files		(patch)
+sys/dev/pci/files.pci	(patch)
+sys/dev/usb/files.usb	(patch)
+sys/dev/usb/usbdevs	(patch)
+sys/dev/ic/bwfm.c	1.14 (patch)
+sys/dev/ic/bwfmreg.h	1.3 (patch)
+sys/dev/ic/bwfmvar.h	1.3 (patch)
+sys/dev/pci/if_bwfm_pci.c 1.4 (patch)
+sys/dev/pci/if_bwfm_pci.h1.8 (patch)
+sys/dev/usb/if_bwfm_usb.c 1.8 (patch)
+distrib/sets/lists/man/mi(patch)
+share/man/man4/bwfm.4	1.3 (patch)
+sys/dev/usb/usbdevs.h	(regen)
+sys/dev/usb/usbdevs_data.h(regen)
+
+	Add backport of bwfm(4).
+	[maya, ticket #1072]
+
+external/public-domain/tz/dist/NEWS up to 1.1.1.24
+external/public-domain/tz/dist/TZDATA_VERSION   up to 1.14
+external/public-domain/tz/dist/africa   up to 1.1.1.17
+external/public-domain/tz/dist/europe   up to 1.1.1.23
+external/public-domain/tz/dist/northamerica up to 1.1.1.21
+external/public-domain/tz/dist/theory.html  up to 1.1.1.6
+external/public-domain/tz/dist/version  up to 1.1.1.11
+external/public-domain/tz/dist/ziguard.awk  up to 1.1.1.3
+external/public-domain/tz/dist/zishrink.awk up to 1.1.1.5
+doc/3RDPARTY	(patch)
+
+	Updated tzdata to 2018g.
+	[kre, ticket #1073]
+
+sys/arch/arm/arm/disassem.c			1.40
+
+	Allow "setend be" decode.
+	[skrll, ticket #1076]
+



CVS commit: [netbsd-8] src/sys/arch/arm/arm

2018-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 31 10:03:48 UTC 2018

Modified Files:
src/sys/arch/arm/arm [netbsd-8]: disassem.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1076):

sys/arch/arm/arm/disassem.c: revision 1.40

Allow setend be decode


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.39.2.1 src/sys/arch/arm/arm/disassem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm/disassem.c
diff -u src/sys/arch/arm/arm/disassem.c:1.39 src/sys/arch/arm/arm/disassem.c:1.39.2.1
--- src/sys/arch/arm/arm/disassem.c:1.39	Sat Jun  3 11:51:59 2017
+++ src/sys/arch/arm/arm/disassem.c	Wed Oct 31 10:03:48 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: disassem.c,v 1.39 2017/06/03 11:51:59 skrll Exp $	*/
+/*	$NetBSD: disassem.c,v 1.39.2.1 2018/10/31 10:03:48 martin Exp $	*/
 
 /*
  * Copyright (c) 1996 Mark Brinicombe.
@@ -49,7 +49,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: disassem.c,v 1.39 2017/06/03 11:51:59 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disassem.c,v 1.39.2.1 2018/10/31 10:03:48 martin Exp $");
 
 #include 
 
@@ -134,7 +134,7 @@ static const struct arm32_insn arm32_i[]
  * miscellaneous instructions
  */
 { 0xfff10020, 0xf100, "cps",	"C!c" },
-{ 0xfff100f0, 0xf101, "setend\tle", "" },
+{ 0xfff102f0, 0xf101, "setend\tle", "" },
 { 0xfff102f0, 0xf1010200, "setend\tbe", "" },
 /* pli */
 /* pld */



CVS commit: [netbsd-8] src

2018-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 31 10:02:15 UTC 2018

Modified Files:
src/doc [netbsd-8]: 3RDPARTY
src/external/public-domain/tz/dist [netbsd-8]: NEWS TZDATA_VERSION
africa europe northamerica theory.html version ziguard.awk
zishrink.awk

Log Message:
Sync to -current, requested by kre in ticket #1073:

external/public-domain/tz/dist/NEWS up to 1.1.1.24
external/public-domain/tz/dist/TZDATA_VERSION   up to 1.14
external/public-domain/tz/dist/africa   up to 1.1.1.17
external/public-domain/tz/dist/europe   up to 1.1.1.23
external/public-domain/tz/dist/northamerica up to 1.1.1.21
external/public-domain/tz/dist/theory.html  up to 1.1.1.6
external/public-domain/tz/dist/version  up to 1.1.1.11
external/public-domain/tz/dist/ziguard.awk  up to 1.1.1.3
external/public-domain/tz/dist/zishrink.awk up to 1.1.1.5
doc/3RDPARTY(patch)

Import tzdata2018g from ftp://ftp.iana.org/tz/releases/tzdata2018g.tar.gz

Summary of changes in tzdata2018g (2018-10-26 22:22:45 -0700):

Morocco switches to permanent +01 on 2018-10-27.


To generate a diff of this commit:
cvs rdiff -u -r1.1444.2.18 -r1.1444.2.19 src/doc/3RDPARTY
cvs rdiff -u -r1.1.1.18.4.5 -r1.1.1.18.4.6 \
src/external/public-domain/tz/dist/NEWS
cvs rdiff -u -r1.8.4.5 -r1.8.4.6 \
src/external/public-domain/tz/dist/TZDATA_VERSION
cvs rdiff -u -r1.1.1.11.4.5 -r1.1.1.11.4.6 \
src/external/public-domain/tz/dist/africa
cvs rdiff -u -r1.1.1.17.4.5 -r1.1.1.17.4.6 \
src/external/public-domain/tz/dist/europe
cvs rdiff -u -r1.1.1.16.4.4 -r1.1.1.16.4.5 \
src/external/public-domain/tz/dist/northamerica
cvs rdiff -u -r1.1.1.1.2.6 -r1.1.1.1.2.7 \
src/external/public-domain/tz/dist/theory.html
cvs rdiff -u -r1.1.1.5.4.5 -r1.1.1.5.4.6 \
src/external/public-domain/tz/dist/version
cvs rdiff -u -r1.1.1.1.2.3 -r1.1.1.1.2.4 \
src/external/public-domain/tz/dist/ziguard.awk
cvs rdiff -u -r1.1.1.1.2.5 -r1.1.1.1.2.6 \
src/external/public-domain/tz/dist/zishrink.awk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1444.2.18 src/doc/3RDPARTY:1.1444.2.19
--- src/doc/3RDPARTY:1.1444.2.18	Sun Oct 21 12:10:22 2018
+++ src/doc/3RDPARTY	Wed Oct 31 10:02:14 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1444.2.18 2018/10/21 12:10:22 martin Exp $
+#	$NetBSD: 3RDPARTY,v 1.1444.2.19 2018/10/31 10:02:14 martin Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1411,8 +1411,8 @@ Notes:
 Added changes from a5 -> a12 manually.
 
 Package:	tz
-Version:	tzcode2017b / tzdata2018f
-Current Vers:	tzcode2018f / tzdata2018f
+Version:	tzcode2017b / tzdata2018g
+Current Vers:	tzcode2018g / tzdata2018g
 Maintainer:	Paul Eggert 
 Archive Site:	ftp://ftp.iana.org/tz/releases/
 Archive Site:	ftp://munnari.oz.au/pub/oldtz/

Index: src/external/public-domain/tz/dist/NEWS
diff -u src/external/public-domain/tz/dist/NEWS:1.1.1.18.4.5 src/external/public-domain/tz/dist/NEWS:1.1.1.18.4.6
--- src/external/public-domain/tz/dist/NEWS:1.1.1.18.4.5	Sun Oct 21 12:10:23 2018
+++ src/external/public-domain/tz/dist/NEWS	Wed Oct 31 10:02:15 2018
@@ -1,5 +1,40 @@
 News for the tz database
 
+Release 2018g - 2018-10-26 22:22:45 -0700
+
+  Briefly:
+Morocco switches to permanent +01 on 2018-10-27.
+
+  Changes to future timestamps
+
+Morocco switches from +00/+01 to permanent +01 effective 2018-10-27,
+so its clocks will not fall back on 2018-10-28 as previously scheduled.
+(Thanks to Mohamed Essedik Najd and Brian Inglis.)
+
+  Changes to code
+
+When generating TZif files with leap seconds, zic no longer uses a
+format that trips up older 32-bit clients, fixing a bug introduced
+in 2018f.  (Reported by Daniel Fischer.)  Also, the zic workaround
+for QTBUG-53071 now also works for TZif files with leap seconds.
+
+The translator to rearguard format now rewrites the line
+"Rule Japan 1948 1951 - Sep Sat>=8 25:00 0 S" to
+"Rule Japan 1948 1951 - Sep Sun>=9  1:00 0 S".
+This caters to zic before 2007 and to Oracle TZUpdater 2.2.0
+and earlier.  (Reported by Christos Zoulas.)
+
+  Changes to past time zone abbreviations
+
+Change HDT to HWT/HPT for WWII-era abbreviations in Hawaii.
+This reverts to 2011h, as the abbreviation change in 2011i was
+likely inadvertent.
+
+  Changes to documentation
+
+tzfile.5 has new sections on interoperability issues.
+
+
 Release 2018f - 2018-10-18 00:14:18 -0700
 
   Briefly:

Index: src/external/public-domain/tz/dist/TZDATA_VERSION
diff -u src/external/public-domain/tz/dist/TZDATA_VERSION:1.8.4.5 src/external/public-domain/tz/dist/TZDATA_VERSION:1.8.4

CVS commit: src/sys/arch/arm/arm32

2018-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Oct 31 09:31:01 UTC 2018

Modified Files:
src/sys/arch/arm/arm32: arm32_boot.c

Log Message:
Tidyup VERBOSE_INIT_ARM output


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/arm32/arm32_boot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm32/arm32_boot.c
diff -u src/sys/arch/arm/arm32/arm32_boot.c:1.26 src/sys/arch/arm/arm32/arm32_boot.c:1.27
--- src/sys/arch/arm/arm32/arm32_boot.c:1.26	Sun Oct 28 14:30:30 2018
+++ src/sys/arch/arm/arm32/arm32_boot.c	Wed Oct 31 09:31:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_boot.c,v 1.26 2018/10/28 14:30:30 skrll Exp $	*/
+/*	$NetBSD: arm32_boot.c,v 1.27 2018/10/31 09:31:01 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -122,7 +122,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: arm32_boot.c,v 1.26 2018/10/28 14:30:30 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: arm32_boot.c,v 1.27 2018/10/31 09:31:01 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_cputypes.h"
@@ -263,12 +263,13 @@ initarm_common(vaddr_t kvm_base, vsize_t
 			uvm_page_physload(start, end, start, end, VM_FREELIST_DEFAULT);
 			continue;
 		}
+		VPRINTF("\n");
 		paddr_t segend = end;
 		for (size_t j = 0; j < nbp; j++ /*, start = segend, segend = end */) {
 			paddr_t bp_start = bp[j].bp_start;
 			paddr_t bp_end = bp_start + bp[j].bp_pages;
 
-			VPRINTF("\n   bp %2zu start %08lx  end %08lx\n",
+			VPRINTF("   bp %2zu start %08lx  end %08lx\n",
 			j, ptoa(bp_start), ptoa(bp_end));
 			KASSERT(bp_start < bp_end);
 			if (start > bp_end || segend < bp_start)
@@ -286,7 +287,7 @@ initarm_common(vaddr_t kvm_base, vsize_t
 uvm_page_physload(start, segend, start, segend,
 vm_freelist);
 VPRINTF(" start %08lx  end %08lx"
-"... loading in freelist %d", ptoa(start),
+"... loading in freelist %d\n", ptoa(start),
 ptoa(segend), vm_freelist);
 start = segend;
 segend = end;



CVS commit: [netbsd-8] src/sys

2018-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 31 09:30:10 UTC 2018

Modified Files:
src/sys/arch/amd64/conf [netbsd-8]: GENERIC
src/sys/arch/i386/conf [netbsd-8]: GENERIC
src/sys/conf [netbsd-8]: files
src/sys/dev/pci [netbsd-8]: files.pci
src/sys/dev/usb [netbsd-8]: files.usb usbdevs

Log Message:
Add bwfm config glue, requested by maya in ticket #1072.


To generate a diff of this commit:
cvs rdiff -u -r1.459.2.11 -r1.459.2.12 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.1156.2.11 -r1.1156.2.12 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.1173.2.5 -r1.1173.2.6 src/sys/conf/files
cvs rdiff -u -r1.388.4.2 -r1.388.4.3 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.145 -r1.145.2.1 src/sys/dev/usb/files.usb
cvs rdiff -u -r1.736 -r1.736.2.1 src/sys/dev/usb/usbdevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.459.2.11 src/sys/arch/amd64/conf/GENERIC:1.459.2.12
--- src/sys/arch/amd64/conf/GENERIC:1.459.2.11	Fri Sep  7 12:27:26 2018
+++ src/sys/arch/amd64/conf/GENERIC	Wed Oct 31 09:30:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.459.2.11 2018/09/07 12:27:26 martin Exp $
+# $NetBSD: GENERIC,v 1.459.2.12 2018/10/31 09:30:10 martin Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.459.2.11 $"
+#ident		"GENERIC-$Revision: 1.459.2.12 $"
 
 maxusers	64		# estimated number of users
 
@@ -753,6 +753,7 @@ bce*	at pci? dev ? function ?	# Broadcom
 bge*	at pci? dev ? function ?	# Broadcom 570x gigabit Ethernet
 bnx*	at pci? dev ? function ?	# Broadcom NetXtremeII gigabit Ethernet
 bwi*	at pci? dev ? function ?	# Broadcom BCM43xx wireless
+bwfm*	at pci? dev ? function ?	# Broadcom FullMAC
 dge*	at pci? dev ? function ?	# Intel 82597 10GbE LR
 en*	at pci? dev ? function ?	# ENI/Adaptec ATM
 ep*	at pci? dev ? function ?	# 3Com 3c59x

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.1156.2.11 src/sys/arch/i386/conf/GENERIC:1.1156.2.12
--- src/sys/arch/i386/conf/GENERIC:1.1156.2.11	Fri Sep  7 12:27:26 2018
+++ src/sys/arch/i386/conf/GENERIC	Wed Oct 31 09:30:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1156.2.11 2018/09/07 12:27:26 martin Exp $
+# $NetBSD: GENERIC,v 1.1156.2.12 2018/10/31 09:30:10 martin Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.1156.2.11 $"
+#ident		"GENERIC-$Revision: 1.1156.2.12 $"
 
 maxusers	64		# estimated number of users
 
@@ -988,6 +988,7 @@ bce*	at pci? dev ? function ?	# Broadcom
 bge*	at pci? dev ? function ?	# Broadcom 570x gigabit Ethernet
 bnx*	at pci? dev ? function ?	# Broadcom NetXtremeII gigabit Ethernet
 bwi*	at pci? dev ? function ?	# Broadcom BCM43xx wireless
+bwfm*	at pci? dev ? function ?	# Broadcom FullMAC
 dge*	at pci? dev ? function ?	# Intel 82597 10GbE LR
 en*	at pci? dev ? function ?	# ENI/Adaptec ATM
 ep*	at pci? dev ? function ?	# 3Com 3c59x

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1173.2.5 src/sys/conf/files:1.1173.2.6
--- src/sys/conf/files:1.1173.2.5	Mon Apr  9 12:49:31 2018
+++ src/sys/conf/files	Wed Oct 31 09:30:10 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1173.2.5 2018/04/09 12:49:31 bouyer Exp $
+#	$NetBSD: files,v 1.1173.2.6 2018/10/31 09:30:10 martin Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20170615
@@ -1401,6 +1401,11 @@ file	dev/ic/isic_bchan.c		isic
 device	iavc: isdndev, isdncapi, passive_isdn
 file	dev/ic/iavc.c			iavc
 
+
+# Broadcom FullMAC 802.11 driver
+device	bwfm: arp, ifnet, wlan
+file	dev/ic/bwfm.c			bwfm
+
 # Broadcom AirForce / Apple Airport Extreme
 device	bwi: arp, ifnet, firmload, wlan
 file	dev/ic/bwi.c			bwi

Index: src/sys/dev/pci/files.pci
diff -u src/sys/dev/pci/files.pci:1.388.4.2 src/sys/dev/pci/files.pci:1.388.4.3
--- src/sys/dev/pci/files.pci:1.388.4.2	Sun Sep 23 18:00:53 2018
+++ src/sys/dev/pci/files.pci	Wed Oct 31 09:30:10 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.388.4.2 2018/09/23 18:00:53 martin Exp $
+#	$NetBSD: files.pci,v 1.388.4.3 2018/10/31 09:30:10 martin Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -1067,6 +1067,10 @@ include "dev/pci/n8/files.n8"
 attach	bwi at pci with bwi_pci
 file	dev/pci/if_bwi_pci.c		bwi_pci
 
+# Broadcom FullMAC USB wireless adapter
+attach	bwfm at pci with bwfm_pci: firmload
+file	dev/pci/if_bwfm_pci.c		bwfm_pci
+
 # Marvell Serial-ATA Host Controller
 attach	mvsata at pci with mvsata_pci
 file	dev/pci/mvsata_pci.c		mvsata_pci

Index: src/sys/dev/usb/files.usb
diff -u src/sys/dev/usb/files.usb

CVS commit: [netbsd-8] src/share/man/man4

2018-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 31 09:26:52 UTC 2018

Modified Files:
src/share/man/man4 [netbsd-8]: Makefile
Added Files:
src/share/man/man4 [netbsd-8]: bwfm.4

Log Message:
Pull up the following, requested by maya in ticket #1072:

distrib/sets/lists/man/mi   (patch)
share/man/man4/bwfm.4   1.3 (patch)

Add bwfm man page.


To generate a diff of this commit:
cvs rdiff -u -r1.637.2.2 -r1.637.2.3 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.3.4.2 src/share/man/man4/bwfm.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/Makefile
diff -u src/share/man/man4/Makefile:1.637.2.2 src/share/man/man4/Makefile:1.637.2.3
--- src/share/man/man4/Makefile:1.637.2.2	Sat May 12 10:35:45 2018
+++ src/share/man/man4/Makefile	Wed Oct 31 09:26:51 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.637.2.2 2018/05/12 10:35:45 martin Exp $
+#	$NetBSD: Makefile,v 1.637.2.3 2018/10/31 09:26:51 martin Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -15,7 +15,7 @@ MAN=	aac.4 ac97.4 acardide.4 aceride.4 a
 	bio.4 bktr.4 bluetooth.4 bmtphy.4 bpf.4 bpfjit.4 \
 	brgphy.4 bridge.4 bthidev.4 bthub.4 btkbd.4 \
 	btmagic.4 btms.4 btsco.4 btuart.4 \
-	bwi.4 \
+	bwfm.4 bwi.4 \
 	cac.4 can.4 canloop.4 cardbus.4 carp.4 cas.4 ccd.4 cd.4 \
 	cec.4 cgd.4 cfb.4 ch.4 chipsfb.4 ciphy.4 ciss.4 clcs.4 clct.4 \
 	clockctl.4 cmdide.4 cmpci.4 cms.4 cnw.4 \

Added files:

Index: src/share/man/man4/bwfm.4
diff -u /dev/null src/share/man/man4/bwfm.4:1.3.4.2
--- /dev/null	Wed Oct 31 09:26:52 2018
+++ src/share/man/man4/bwfm.4	Wed Oct 31 09:26:51 2018
@@ -0,0 +1,58 @@
+.\" $NetBSD: bwfm.4,v 1.3.4.2 2018/10/31 09:26:51 martin Exp $
+.\"
+.\" Copyright (c) 2017 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+.\"
+.Dd May 5, 2018
+.Dt BWFM 4
+.Os
+.Sh NAME
+.Nm bwfm
+.Nd Broadcom and Cypress wireless network driver
+.Sh SYNOPSIS
+.Cd "bwfm* at uhub? port ?"
+.Cd "bwfm* at pci? dev ? function ?"
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for Broadcom and Cypress FullMAC network adapters.
+.Sh SEE ALSO
+.Xr bwi 4 ,
+.\".Xr ifconfig 4 ,
+.Xr ifmedia 4 ,
+.Xr usb 4 ,
+.Xr ifconfig.if 5 ,
+.Xr wpa_supplicant 8
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An Patrick Wildt
+.Aq Mt patr...@blueri.se
+and ported to
+.Nx
+by
+.An Jared D. McNeill
+.Aq Mt jmcne...@netbsd.org .



CVS commit: src/sys/arch/evbarm/fdt

2018-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Oct 31 09:15:25 UTC 2018

Modified Files:
src/sys/arch/evbarm/fdt: fdt_machdep.c

Log Message:
Fix VERBOSE_INIT_ARM build


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/evbarm/fdt/fdt_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/fdt/fdt_machdep.c
diff -u src/sys/arch/evbarm/fdt/fdt_machdep.c:1.49 src/sys/arch/evbarm/fdt/fdt_machdep.c:1.50
--- src/sys/arch/evbarm/fdt/fdt_machdep.c:1.49	Tue Oct 30 21:32:35 2018
+++ src/sys/arch/evbarm/fdt/fdt_machdep.c	Wed Oct 31 09:15:25 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.49 2018/10/30 21:32:35 jmcneill Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.50 2018/10/31 09:15:25 skrll Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.49 2018/10/30 21:32:35 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.50 2018/10/31 09:15:25 skrll Exp $");
 
 #include "opt_machdep.h"
 #include "opt_bootconfig.h"
@@ -241,7 +241,7 @@ fdt_add_dram_blocks(const struct fdt_mem
 {
 	BootConfig *bc = arg;
 
-	VPRINTF("  %lx - %lx\n", m->start, m->end - 1);
+	VPRINTF("  %llx - %llx\n", m->start, m->end - 1);
 	bc->dram[bc->dramblocks].address = m->start;
 	bc->dram[bc->dramblocks].pages =
 	(m->end - m->start) / PAGE_SIZE;
@@ -257,7 +257,7 @@ fdt_add_boot_physmem(const struct fdt_me
 {
 	struct boot_physmem *bp = &fdt_physmem[nfdt_physmem++];
 
-	VPRINTF("  %lx - %lx\n", m->start, m->end - 1);
+	VPRINTF("  %llx - %llx\n", m->start, m->end - 1);
 
 	KASSERT(nfdt_physmem <= MAX_PHYSMEM);
 



CVS commit: src/sys/stand/efiboot

2018-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct 31 09:13:32 UTC 2018

Modified Files:
src/sys/stand/efiboot: efifdt.c

Log Message:
No longer need to delete reserved memory ranges.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/stand/efiboot/efifdt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/stand/efiboot/efifdt.c
diff -u src/sys/stand/efiboot/efifdt.c:1.9 src/sys/stand/efiboot/efifdt.c:1.10
--- src/sys/stand/efiboot/efifdt.c:1.9	Sun Sep  9 13:37:54 2018
+++ src/sys/stand/efiboot/efifdt.c	Wed Oct 31 09:13:32 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: efifdt.c,v 1.9 2018/09/09 13:37:54 jmcneill Exp $ */
+/* $NetBSD: efifdt.c,v 1.10 2018/10/31 09:13:32 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -146,10 +146,6 @@ efi_fdt_memory_map(void)
 		panic("FDT: Failed to create " FDT_MEMORY_NODE_PATH " node");
 
 	fdt_delprop(fdt_data, memory, "reg");
-	while (fdt_num_mem_rsv(fdt_data) > 0) {
-		if (fdt_del_mem_rsv(fdt_data, 0) < 0)
-			panic("FDT: Failed to remove reserved memory map entry");
-	}
 
 	const int address_cells = fdt_address_cells(fdt_data, fdt_path_offset(fdt_data, "/"));
 	const int size_cells = fdt_size_cells(fdt_data, fdt_path_offset(fdt_data, "/"));



CVS commit: [netbsd-8] src

2018-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 31 08:55:33 UTC 2018

Modified Files:
src/distrib/sets/lists/base [netbsd-8]: mi
src/etc/mtree [netbsd-8]: NetBSD.dist.base
src/external [netbsd-8]: Makefile
Added Files:
src/external/broadcom [netbsd-8]: Makefile Makefile.inc
src/external/broadcom/bwfm [netbsd-8]: Makefile
src/external/broadcom/bwfm/dist [netbsd-8]: LICENCE.broadcom_bcm43xx
brcmfmac43143.bin brcmfmac43236b.bin brcmfmac43242a.bin
brcmfmac4350-pcie.bin brcmfmac4350c2-pcie.bin brcmfmac43569.bin
brcmfmac43602-pcie.bin

Log Message:
Add bwfm firmware files, requested by maya in ticket #1072.


To generate a diff of this commit:
cvs rdiff -u -r1.1158.2.4 -r1.1158.2.5 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.160.2.2 -r1.160.2.3 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.18 -r1.18.26.1 src/external/Makefile
cvs rdiff -u -r0 -r1.3.4.2 src/external/broadcom/Makefile
cvs rdiff -u -r0 -r1.1.6.2 src/external/broadcom/Makefile.inc
cvs rdiff -u -r0 -r1.3.4.2 src/external/broadcom/bwfm/Makefile
cvs rdiff -u -r0 -r1.1.1.1.6.2 \
src/external/broadcom/bwfm/dist/LICENCE.broadcom_bcm43xx \
src/external/broadcom/bwfm/dist/brcmfmac43143.bin \
src/external/broadcom/bwfm/dist/brcmfmac43236b.bin \
src/external/broadcom/bwfm/dist/brcmfmac43242a.bin \
src/external/broadcom/bwfm/dist/brcmfmac43569.bin
cvs rdiff -u -r0 -r1.1.6.2 \
src/external/broadcom/bwfm/dist/brcmfmac4350-pcie.bin \
src/external/broadcom/bwfm/dist/brcmfmac4350c2-pcie.bin \
src/external/broadcom/bwfm/dist/brcmfmac43602-pcie.bin

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1158.2.4 src/distrib/sets/lists/base/mi:1.1158.2.5
--- src/distrib/sets/lists/base/mi:1.1158.2.4	Wed Oct 17 13:50:25 2018
+++ src/distrib/sets/lists/base/mi	Wed Oct 31 08:55:32 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1158.2.4 2018/10/17 13:50:25 martin Exp $
+# $NetBSD: mi,v 1.1158.2.5 2018/10/31 08:55:32 martin Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -138,6 +138,15 @@
 ./libdata/firmware/if_athn/athn-ar7010-11	base-firmware-root
 ./libdata/firmware/if_athn/athn-ar9271		base-firmware-root
 ./libdata/firmware/if_athn/athn-license		base-firmware-root
+./libdata/firmware/if_bwfm			base-firmware-root
+./libdata/firmware/if_bwfm/LICENCE.broadcom_bcm43xx	base-firmware-root
+./libdata/firmware/if_bwfm/brcmfmac43143.bin	base-firmware-root
+./libdata/firmware/if_bwfm/brcmfmac43236b.bin	base-firmware-root
+./libdata/firmware/if_bwfm/brcmfmac43242a.bin	base-firmware-root
+./libdata/firmware/if_bwfm/brcmfmac43569.bin	base-firmware-root
+./libdata/firmware/if_bwfm/brcmfmac4350-pcie.bin	base-firmware-root
+./libdata/firmware/if_bwfm/brcmfmac4350c2-pcie.bin	base-firmware-root
+./libdata/firmware/if_bwfm/brcmfmac43602-pcie.bin	base-firmware-root
 ./libdata/firmware/if_ipw			base-firmware-root
 ./libdata/firmware/if_ipw/LICENSE		base-firmware-root
 ./libdata/firmware/if_ipw/ipw2100-1.2-i.fw	base-firmware-root

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.160.2.2 src/etc/mtree/NetBSD.dist.base:1.160.2.3
--- src/etc/mtree/NetBSD.dist.base:1.160.2.2	Wed Oct 17 13:50:25 2018
+++ src/etc/mtree/NetBSD.dist.base	Wed Oct 31 08:55:32 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.160.2.2 2018/10/17 13:50:25 martin Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.160.2.3 2018/10/31 08:55:32 martin Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -69,6 +69,7 @@
 ./libdata
 ./libdata/firmware
 ./libdata/firmware/if_athn
+./libdata/firmware/if_bwfm
 ./libdata/firmware/if_ipw
 ./libdata/firmware/if_iwi
 ./libdata/firmware/if_iwm

Index: src/external/Makefile
diff -u src/external/Makefile:1.18 src/external/Makefile:1.18.26.1
--- src/external/Makefile:1.18	Thu Jun 14 04:14:36 2012
+++ src/external/Makefile	Wed Oct 31 08:55:32 2018
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile,v 1.18 2012/06/14 04:14:36 riz Exp $
+#	$NetBSD: Makefile,v 1.18.26.1 2018/10/31 08:55:32 martin Exp $
 
-SUBDIR+= apache2 atheros bsd cddl gpl2 gpl3 historical intel-fw-eula
+SUBDIR+= apache2 atheros broadcom bsd cddl gpl2 gpl3 historical intel-fw-eula
 SUBDIR+= intel-fw-public ibm-public mit public-domain realtek
 
 .include 

Added files:

Index: src/external/broadcom/Makefile
diff -u /dev/null src/external/broadcom/Makefile:1.3.4.2
--- /dev/null	Wed Oct 31 08:55:33 2018
+++ src/external/broadcom/Makefile	Wed Oct 31 08:55:32 2018
@@ -0,0 +1,5 @@
+# $NetBSD: Makefile,v 1.3.4.2 2018/10/31 08:55:32 martin Exp $
+
+SUBDIR+=	bwfm
+
+.include 

Index: src/external/broadcom/Makefile.inc
diff -u /dev/null src/external/broadcom/Makefile.inc:1.1.6.2
--- /dev/null	Wed Oct 31 0

CVS commit: src/sys/arch/arm/samsung

2018-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Oct 31 08:41:47 UTC 2018

Modified Files:
src/sys/arch/arm/samsung: exynos_soc.c

Log Message:
Fix non-DIGNOSTIC builds


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/arm/samsung/exynos_soc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/samsung/exynos_soc.c
diff -u src/sys/arch/arm/samsung/exynos_soc.c:1.38 src/sys/arch/arm/samsung/exynos_soc.c:1.39
--- src/sys/arch/arm/samsung/exynos_soc.c:1.38	Thu Oct 18 09:01:53 2018
+++ src/sys/arch/arm/samsung/exynos_soc.c	Wed Oct 31 08:41:47 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: exynos_soc.c,v 1.38 2018/10/18 09:01:53 skrll Exp $	*/
+/*	$NetBSD: exynos_soc.c,v 1.39 2018/10/31 08:41:47 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include "opt_exynos.h"
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: exynos_soc.c,v 1.38 2018/10/18 09:01:53 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exynos_soc.c,v 1.39 2018/10/31 08:41:47 skrll Exp $");
 
 #include 
 #include 
@@ -489,7 +489,6 @@ exynos_bootstrap(int soc)
 	bus_addr_t exynos_pmu_offset;
 	bus_addr_t exynos_sysreg_offset;
 	bus_addr_t exynos_cmu_apll_offset;
-	const vaddr_t iobase = EXYNOS_CORE_VBASE;
 
 	switch (soc) {
 #ifdef SOC_EXYNOS4
@@ -532,7 +531,7 @@ exynos_bootstrap(int soc)
 	if (error)
 		panic("%s: failed to map in Exynos SFR registers: %d",
 			__func__, error);
-	KASSERT(exynos_core_bsh == iobase);
+	KASSERT(exynos_core_bsh == EXYNOS_CORE_VBASE);
 
 	error = bus_space_map(&armv7_generic_bs_tag, audiocore_pbase,
 		audiocore_size, 0, &exynos_audiocore_bsh);



CVS commit: src/sys/arch/evbarm/conf

2018-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Oct 31 08:10:01 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: GENERIC

Log Message:
Turn off DIAGNOSTIC and DEBUG by default


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/conf/GENERIC

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/conf/GENERIC
diff -u src/sys/arch/evbarm/conf/GENERIC:1.11 src/sys/arch/evbarm/conf/GENERIC:1.12
--- src/sys/arch/evbarm/conf/GENERIC:1.11	Tue Oct 30 07:51:09 2018
+++ src/sys/arch/evbarm/conf/GENERIC	Wed Oct 31 08:10:01 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC,v 1.11 2018/10/30 07:51:09 skrll Exp $
+#	$NetBSD: GENERIC,v 1.12 2018/10/31 08:10:01 skrll Exp $
 #
 #	GENERIC ARM (aarch32) kernel
 #
@@ -189,8 +189,8 @@ options 	MULTIPROCESSOR
 
 pseudo-device 	openfirm	# /dev/openfirm
 
-options 	DIAGNOSTIC	# internal consistency checks
-options 	DEBUG
+#options 	DIAGNOSTIC	# internal consistency checks
+#options 	DEBUG
 #options 	LOCKDEBUG
 #options 	PMAP_DEBUG	# Enable pmap_debug_level code