Source-Changes-HG archive

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

[src/trunk]: src/sys Remove the COM_REGMAP option -- just use it all the time...



details:   https://anonhg.NetBSD.org/src/rev/91527b155907
branches:  trunk
changeset: 446510:91527b155907
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Dec 08 21:14:36 2018 +0000

description:
Remove the COM_REGMAP option -- just use it all the time.  While here,
garbage-collect the COM_FUNCMAP and COM_AU1X00 options, as there are
not used anywhere.

diffstat:

 sys/arch/mips/alchemy/dev/com_aubus.c |   8 ++------
 sys/arch/mips/ingenic/ingenic_com.c   |  10 ++--------
 sys/arch/mips/ralink/ralink_com.c     |  10 ++--------
 sys/arch/mips/rmi/rmixl_com.c         |  10 ++--------
 sys/conf/files                        |   5 ++---
 sys/dev/ic/com.c                      |  21 ++-------------------
 sys/dev/ic/comvar.h                   |  32 +-------------------------------
 sys/dev/marvell/com_mv.c              |  10 ++--------
 8 files changed, 15 insertions(+), 91 deletions(-)

diffs (truncated from 324 to 300 lines):

diff -r cb8752b36678 -r 91527b155907 sys/arch/mips/alchemy/dev/com_aubus.c
--- a/sys/arch/mips/alchemy/dev/com_aubus.c     Sat Dec 08 17:46:09 2018 +0000
+++ b/sys/arch/mips/alchemy/dev/com_aubus.c     Sat Dec 08 21:14:36 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: com_aubus.c,v 1.7 2018/12/08 17:46:12 thorpej Exp $ */
+/* $NetBSD: com_aubus.c,v 1.8 2018/12/08 21:14:36 thorpej Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com_aubus.c,v 1.7 2018/12/08 17:46:12 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_aubus.c,v 1.8 2018/12/08 21:14:36 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -70,10 +70,6 @@
 
 #define CONMODE        ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
 
-#ifndef        COM_REGMAP
-#error COM_REGMAP not defined!
-#endif
-
 int
 com_aubus_probe(device_t parent, cfdata_t cf, void *aux)
 {
diff -r cb8752b36678 -r 91527b155907 sys/arch/mips/ingenic/ingenic_com.c
--- a/sys/arch/mips/ingenic/ingenic_com.c       Sat Dec 08 17:46:09 2018 +0000
+++ b/sys/arch/mips/ingenic/ingenic_com.c       Sat Dec 08 21:14:36 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ingenic_com.c,v 1.7 2018/12/08 17:46:12 thorpej Exp $ */
+/*     $NetBSD: ingenic_com.c,v 1.8 2018/12/08 21:14:36 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2014 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ingenic_com.c,v 1.7 2018/12/08 17:46:12 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ingenic_com.c,v 1.8 2018/12/08 21:14:36 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -48,12 +48,6 @@
 #include <mips/ingenic/ingenic_var.h>
 #include <mips/ingenic/ingenic_regs.h>
 
-#include "opt_com.h"
-
-#ifndef COM_REGMAP
-#error We need COM_REGMAP
-#endif
-
 volatile int32_t *com0addr = (int32_t *)MIPS_PHYS_TO_KSEG1(JZ_UART0);
 
 void   ingenic_putchar_init(void);
diff -r cb8752b36678 -r 91527b155907 sys/arch/mips/ralink/ralink_com.c
--- a/sys/arch/mips/ralink/ralink_com.c Sat Dec 08 17:46:09 2018 +0000
+++ b/sys/arch/mips/ralink/ralink_com.c Sat Dec 08 21:14:36 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ralink_com.c,v 1.6 2018/12/08 17:46:12 thorpej Exp $   */
+/*     $NetBSD: ralink_com.c,v 1.7 2018/12/08 21:14:36 thorpej Exp $   */
 /*-
  * Copyright (c) 2011 CradlePoint Technology, Inc.
  * All rights reserved.
@@ -130,7 +130,7 @@
 /* ralink_com.c -- Ralink 3052 uart console driver */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ralink_com.c,v 1.6 2018/12/08 17:46:12 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ralink_com.c,v 1.7 2018/12/08 21:14:36 thorpej Exp $");
 
 #include "locators.h"
 #include <sys/param.h>
@@ -151,8 +151,6 @@
 #include <mips/ralink/ralink_reg.h>
 #include <mips/ralink/ralink_var.h>
 
-#include "opt_com.h"
-
 struct ralink_com_softc {
        struct com_softc sc_com;
        void *sc_ih;
@@ -171,10 +169,6 @@
 #define CONMODE        \
        ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
 
-#ifndef COM_REGMAP
-#error  COM_REGMAP not defined!
-#endif
-
 #ifndef RALINK_CONADDR
 #define RALINK_CONADDR RA_UART_LITE_BASE       /* default console is UART_LITE */
 #endif
diff -r cb8752b36678 -r 91527b155907 sys/arch/mips/rmi/rmixl_com.c
--- a/sys/arch/mips/rmi/rmixl_com.c     Sat Dec 08 17:46:09 2018 +0000
+++ b/sys/arch/mips/rmi/rmixl_com.c     Sat Dec 08 21:14:36 2018 +0000
@@ -1,4 +1,4 @@
-/* $Id: rmixl_com.c,v 1.6 2018/12/08 17:46:12 thorpej Exp $ */
+/* $Id: rmixl_com.c,v 1.7 2018/12/08 21:14:37 thorpej Exp $ */
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
  * Copyright (c) 2006 Garrett D'Amore.
@@ -101,7 +101,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rmixl_com.c,v 1.6 2018/12/08 17:46:12 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_com.c,v 1.7 2018/12/08 21:14:37 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -124,8 +124,6 @@
 #include <mips/rmi/rmixl_obiovar.h>
 #include <mips/rmi/rmixl_comvar.h>
 
-#include "opt_com.h"
-
 /* span of UART regs in bytes */
 #define RMIXL_IO_DEV_UART_SIZE (COM_NPORTS * sizeof(uint32_t))
 
@@ -141,10 +139,6 @@
 CFATTACH_DECL_NEW(com_rmixl, sizeof(struct rmixl_com_softc),
     rmixl_com_match, rmixl_com_attach, NULL, NULL);
 
-#ifndef        COM_REGMAP
-#error COM_REGMAP not defined!
-#endif
-
 volatile int32_t *com0addr = (int32_t *)
        MIPS_PHYS_TO_KSEG1(RMIXL_IO_DEV_PBASE + RMIXL_IO_DEV_UART_1);
 
diff -r cb8752b36678 -r 91527b155907 sys/conf/files
--- a/sys/conf/files    Sat Dec 08 17:46:09 2018 +0000
+++ b/sys/conf/files    Sat Dec 08 21:14:36 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files,v 1.1217 2018/12/02 21:00:13 maxv Exp $
+#      $NetBSD: files,v 1.1218 2018/12/08 21:14:37 thorpej Exp $
 #      @(#)files.newconf       7.5 (Berkeley) 5/10/93
 
 version        20171118
@@ -881,8 +881,7 @@
 defflag        opt_com.h               COM_DEBUG
 # XXX In a perfect world, this would be done with attributes
 defflag        opt_com.h               COM_16650 COM_16750
-                               COM_HAYESP COM_PXA2X0 COM_AU1X00
-                               COM_REGMAP COM_FUNCMAP
+                               COM_HAYESP COM_PXA2X0
 defparam opt_com.h             COM_TOLERANCE
 device com { } : tty
 file   dev/ic/com.c                    com                     needs-flag
diff -r cb8752b36678 -r 91527b155907 sys/dev/ic/com.c
--- a/sys/dev/ic/com.c  Sat Dec 08 17:46:09 2018 +0000
+++ b/sys/dev/ic/com.c  Sat Dec 08 21:14:36 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.351 2018/12/08 17:46:13 thorpej Exp $ */
+/* $NetBSD: com.c,v 1.352 2018/12/08 21:14:37 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.351 2018/12/08 17:46:13 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.352 2018/12/08 21:14:37 thorpej Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"
@@ -128,7 +128,6 @@
 
 #include "ioconf.h"
 
-#ifdef COM_REGMAP
 #define        CSR_WRITE_1(r, o, v)    \
        bus_space_write_1((r)->cr_iot, (r)->cr_ioh, (r)->cr_map[o], v)
 #define        CSR_READ_1(r, o)        \
@@ -139,18 +138,6 @@
        bus_space_read_2((r)->cr_iot, (r)->cr_ioh, (r)->cr_map[o])
 #define        CSR_WRITE_MULTI(r, o, p, n)     \
        bus_space_write_multi_1((r)->cr_iot, (r)->cr_ioh, (r)->cr_map[o], p, n)
-#else
-#define        CSR_WRITE_1(r, o, v)    \
-       bus_space_write_1((r)->cr_iot, (r)->cr_ioh, o, v)
-#define        CSR_READ_1(r, o)        \
-       bus_space_read_1((r)->cr_iot, (r)->cr_ioh, o)
-#define        CSR_WRITE_2(r, o, v)    \
-       bus_space_write_2((r)->cr_iot, (r)->cr_ioh, o, v)
-#define        CSR_READ_2(r, o)        \
-       bus_space_read_2((r)->cr_iot, (r)->cr_ioh, o)
-#define        CSR_WRITE_MULTI(r, o, p, n)     \
-       bus_space_write_multi_1((r)->cr_iot, (r)->cr_ioh, o, p, n)
-#endif
 
 
 static void com_enable_debugport(struct com_softc *);
@@ -248,7 +235,6 @@
 void   com_kgdb_putc(void *, int);
 #endif /* KGDB */
 
-#ifdef COM_REGMAP
 /* initializer for typical 16550-ish hardware */
 #define        COM_REG_STD { \
        com_data, com_data, com_dlbl, com_dlbh, com_ier, com_iir, com_fifo, \
@@ -257,7 +243,6 @@
        0, 0, 0, 0, 0, 0, 0, com_halt }
 
 static const bus_size_t com_std_map[42] = COM_REG_STD;
-#endif /* COM_REGMAP */
 
 #define        COMDIALOUT_MASK TTDIALOUT_MASK
 
@@ -288,9 +273,7 @@
        regs->cr_ioh = sh;
        regs->cr_iobase = addr;
        regs->cr_nports = COM_NPORTS;
-#ifdef COM_REGMAP
        memcpy(regs->cr_map, com_std_map, sizeof(regs->cr_map));
-#endif
 }
 
 /*ARGSUSED*/
diff -r cb8752b36678 -r 91527b155907 sys/dev/ic/comvar.h
--- a/sys/dev/ic/comvar.h       Sat Dec 08 17:46:09 2018 +0000
+++ b/sys/dev/ic/comvar.h       Sat Dec 08 21:14:36 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: comvar.h,v 1.89 2018/12/08 17:46:13 thorpej Exp $      */
+/*     $NetBSD: comvar.h,v 1.90 2018/12/08 21:14:37 thorpej Exp $      */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -76,7 +76,6 @@
 #define        COM_RING_SIZE   2048
 #endif
 
-#ifdef COM_REGMAP
 #define        COM_REG_RXDATA          0
 #define        COM_REG_TXDATA          1
 #define        COM_REG_DLBL            2
@@ -104,35 +103,6 @@
        bus_size_t              cr_nports;
        bus_size_t              cr_map[42];
 };
-#else /* ! COM_REGMAP */
-#define        COM_REG_RXDATA          com_data
-#define        COM_REG_TXDATA          com_data
-#define        COM_REG_DLBL            com_dlbl
-#define        COM_REG_DLBH            com_dlbh
-#define        COM_REG_IER             com_ier
-#define        COM_REG_IIR             com_iir
-#define        COM_REG_FIFO            com_fifo
-#define        COM_REG_EFR             com_efr
-#define        COM_REG_LCR             com_lctl
-#define        COM_REG_MCR             com_mcr
-#define        COM_REG_LSR             com_lsr
-#define        COM_REG_MSR             com_msr
-#define        COM_REG_TCR             com_msr
-#define        COM_REG_TLR             com_scratch
-#define        COM_REG_MDR1            8
-#define COM_REG_USR            com_usr         /* 16750/DW APB */
-#define        COM_REG_TFL             com_tfl         /* DW APB */
-#define        COM_REG_RFL             com_rfl         /* DW APB */
-#define        COM_REG_HALT            com_halt        /* DW APB */
-
-struct com_regs {
-       bus_space_tag_t         cr_iot;
-       bus_space_handle_t      cr_ioh;
-       bus_addr_t              cr_iobase;
-       bus_size_t              cr_nports;
-};
-
-#endif /* COM_REGMAP */
 
 void   com_init_regs(struct com_regs *, bus_space_tag_t, bus_space_handle_t,
                      bus_addr_t);
diff -r cb8752b36678 -r 91527b155907 sys/dev/marvell/com_mv.c
--- a/sys/dev/marvell/com_mv.c  Sat Dec 08 17:46:09 2018 +0000
+++ b/sys/dev/marvell/com_mv.c  Sat Dec 08 21:14:36 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: com_mv.c,v 1.8 2018/12/08 17:46:13 thorpej Exp $       */
+/*     $NetBSD: com_mv.c,v 1.9 2018/12/08 21:14:37 thorpej Exp $       */
 /*
  * Copyright (c) 2007, 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -26,9 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com_mv.c,v 1.8 2018/12/08 17:46:13 thorpej Exp $");
-
-#include "opt_com.h"
+__KERNEL_RCSID(0, "$NetBSD: com_mv.c,v 1.9 2018/12/08 21:14:37 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -61,11 +59,9 @@



Home | Main Index | Thread Index | Old Index