Module Name:    src
Committed By:   jmcneill
Date:           Tue Nov 27 18:29:17 UTC 2018

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

Log Message:
Add support for SPCR 16550 and 16450 interface types


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/acpi/acpi_platform.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_platform.c
diff -u src/sys/arch/arm/acpi/acpi_platform.c:1.7 src/sys/arch/arm/acpi/acpi_platform.c:1.8
--- src/sys/arch/arm/acpi/acpi_platform.c:1.7	Sat Nov 24 22:17:12 2018
+++ src/sys/arch/arm/acpi/acpi_platform.c	Tue Nov 27 18:29:17 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_platform.c,v 1.7 2018/11/24 22:17:12 rjs Exp $ */
+/* $NetBSD: acpi_platform.c,v 1.8 2018/11/27 18:29:17 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #include "opt_efi.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.7 2018/11/24 22:17:12 rjs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.8 2018/11/27 18:29:17 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -74,6 +74,8 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_platfor
 
 #include <libfdt.h>
 
+#define	SPCR_INTERFACE_TYPE_COM16550		0x0000
+#define	SPCR_INTERFACE_TYPE_COM16450		0x0001
 #define	SPCR_INTERFACE_TYPE_PL011		0x0003
 #define	SPCR_INTERFACE_TYPE_SBSA_32BIT		0x000d
 #define	SPCR_INTERFACE_TYPE_SBSA_GENERIC	0x000e
@@ -159,6 +161,16 @@ acpi_platform_startup(void)
 				break;
 #endif
 #if NCOM > 0
+			case SPCR_INTERFACE_TYPE_COM16550:
+			case SPCR_INTERFACE_TYPE_COM16450:
+				if (ACPI_ACCESS_BIT_WIDTH(spcr->SerialPort.AccessWidth) == 8) {
+					comcnattach(&arm_generic_bs_tag, spcr->SerialPort.Address, baud_rate, -1,
+					    COM_TYPE_NORMAL, TTYDEF_CFLAG);
+				} else {
+					comcnattach(&arm_generic_a4x_bs_tag, spcr->SerialPort.Address, baud_rate, -1,
+					    COM_TYPE_NORMAL, TTYDEF_CFLAG);
+				}
+				break;
 			case SPCR_INTERFACE_TYPE_BCM2835:
 				comcnattach(&arm_generic_a4x_bs_tag, spcr->SerialPort.Address + 0x40, baud_rate, -1,
 				    COM_TYPE_BCMAUXUART, TTYDEF_CFLAG);

Reply via email to