Module Name: src
Committed By: thorpej
Date: Sat Dec 8 21:14:37 UTC 2018
Modified Files:
src/sys/arch/mips/alchemy/dev: com_aubus.c
src/sys/arch/mips/ingenic: ingenic_com.c
src/sys/arch/mips/ralink: ralink_com.c
src/sys/arch/mips/rmi: rmixl_com.c
src/sys/conf: files
src/sys/dev/ic: com.c comvar.h
src/sys/dev/marvell: com_mv.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/alchemy/dev/com_aubus.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/ingenic/ingenic_com.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/ralink/ralink_com.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/rmi/rmixl_com.c
cvs rdiff -u -r1.1217 -r1.1218 src/sys/conf/files
cvs rdiff -u -r1.351 -r1.352 src/sys/dev/ic/com.c
cvs rdiff -u -r1.89 -r1.90 src/sys/dev/ic/comvar.h
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/marvell/com_mv.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/mips/alchemy/dev/com_aubus.c
diff -u src/sys/arch/mips/alchemy/dev/com_aubus.c:1.7 src/sys/arch/mips/alchemy/dev/com_aubus.c:1.8
--- src/sys/arch/mips/alchemy/dev/com_aubus.c:1.7 Sat Dec 8 17:46:12 2018
+++ src/sys/arch/mips/alchemy/dev/com_aubus.c Sat Dec 8 21:14:36 2018
@@ -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 @@ CFATTACH_DECL_NEW(com_aubus, sizeof(stru
#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)
{
Index: src/sys/arch/mips/ingenic/ingenic_com.c
diff -u src/sys/arch/mips/ingenic/ingenic_com.c:1.7 src/sys/arch/mips/ingenic/ingenic_com.c:1.8
--- src/sys/arch/mips/ingenic/ingenic_com.c:1.7 Sat Dec 8 17:46:12 2018
+++ src/sys/arch/mips/ingenic/ingenic_com.c Sat Dec 8 21:14:36 2018
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: ingenic_com.
#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);
Index: src/sys/arch/mips/ralink/ralink_com.c
diff -u src/sys/arch/mips/ralink/ralink_com.c:1.6 src/sys/arch/mips/ralink/ralink_com.c:1.7
--- src/sys/arch/mips/ralink/ralink_com.c:1.6 Sat Dec 8 17:46:12 2018
+++ src/sys/arch/mips/ralink/ralink_com.c Sat Dec 8 21:14:36 2018
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: ralink_com.c
#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 @@ CFATTACH_DECL_NEW(ralink_com, sizeof(str
#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
Index: src/sys/arch/mips/rmi/rmixl_com.c
diff -u src/sys/arch/mips/rmi/rmixl_com.c:1.6 src/sys/arch/mips/rmi/rmixl_com.c:1.7
--- src/sys/arch/mips/rmi/rmixl_com.c:1.6 Sat Dec 8 17:46:12 2018
+++ src/sys/arch/mips/rmi/rmixl_com.c Sat Dec 8 21:14:37 2018
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: rmixl_com.c,
#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 @@ static void rmixl_com_attach(device_t, d
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);
Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1217 src/sys/conf/files:1.1218
--- src/sys/conf/files:1.1217 Sun Dec 2 21:00:13 2018
+++ src/sys/conf/files Sat Dec 8 21:14:37 2018
@@ -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 @@ file dev/ic/ne2000.c ne
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
Index: src/sys/dev/ic/com.c
diff -u src/sys/dev/ic/com.c:1.351 src/sys/dev/ic/com.c:1.352
--- src/sys/dev/ic/com.c:1.351 Sat Dec 8 17:46:13 2018
+++ src/sys/dev/ic/com.c Sat Dec 8 21:14:37 2018
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: com.c,v 1.35
#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 @@ __KERNEL_RCSID(0, "$NetBSD: com.c,v 1.35
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 @@ int com_kgdb_getc(void *);
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 @@ void com_kgdb_putc(void *, int);
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 @@ com_init_regs(struct com_regs *regs, bus
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*/
Index: src/sys/dev/ic/comvar.h
diff -u src/sys/dev/ic/comvar.h:1.89 src/sys/dev/ic/comvar.h:1.90
--- src/sys/dev/ic/comvar.h:1.89 Sat Dec 8 17:46:13 2018
+++ src/sys/dev/ic/comvar.h Sat Dec 8 21:14:37 2018
@@ -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 @@ int com_is_console(bus_space_tag_t, bus_
#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 @@ struct com_regs {
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);
Index: src/sys/dev/marvell/com_mv.c
diff -u src/sys/dev/marvell/com_mv.c:1.8 src/sys/dev/marvell/com_mv.c:1.9
--- src/sys/dev/marvell/com_mv.c:1.8 Sat Dec 8 17:46:13 2018
+++ src/sys/dev/marvell/com_mv.c Sat Dec 8 21:14:37 2018
@@ -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 @@ mvuart_init_regs(struct com_regs *regs,
{
com_init_regs(regs, tag, hdl, addr);
-#ifdef COM_REGMAP
for (size_t i = 0; i < __arraycount(regs->cr_map); i++)
regs->cr_map[i] = regs->cr_map[i] << 2;
regs->cr_nports = size;
-#endif
}
@@ -132,7 +128,6 @@ mvuart_attach(device_t parent, device_t
marvell_intr_establish(mva->mva_irq, IPL_SERIAL, comintr, sc);
}
-#ifdef COM_REGMAP
int mvuart_cnattach(bus_space_tag_t, bus_addr_t, int, uint32_t, int);
int
@@ -145,4 +140,3 @@ mvuart_cnattach(bus_space_tag_t iot, bus
return comcnattach1(®s, baud, sysfreq, COM_TYPE_16550_NOERS, mode);
}
-#endif /* COM_REGMAP */