Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/acpi Add support for SPCR 16550 and 16450 inter...



details:   https://anonhg.NetBSD.org/src/rev/bac5826cf4e9
branches:  trunk
changeset: 446212:bac5826cf4e9
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Nov 27 18:29:17 2018 +0000

description:
Add support for SPCR 16550 and 16450 interface types

diffstat:

 sys/arch/arm/acpi/acpi_platform.c |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (44 lines):

diff -r ce0648b41441 -r bac5826cf4e9 sys/arch/arm/acpi/acpi_platform.c
--- a/sys/arch/arm/acpi/acpi_platform.c Tue Nov 27 17:13:41 2018 +0000
+++ b/sys/arch/arm/acpi/acpi_platform.c Tue Nov 27 18:29:17 2018 +0000
@@ -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 @@
 
 #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 @@
                                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);



Home | Main Index | Thread Index | Old Index