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.
This commit is contained in:
parent
6d4870476f
commit
7266b92d32
|
@ -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(struct com_aubus_softc),
|
|||
|
||||
#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)
|
||||
{
|
||||
|
|
|
@ -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.c,v 1.7 2018/12/08 17:46:12 thorpej Exp
|
|||
#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);
|
||||
|
|
|
@ -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,v 1.6 2018/12/08 17:46:12 thorpej Exp $
|
|||
#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(struct ralink_com_softc),
|
|||
#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
|
||||
|
|
|
@ -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,v 1.6 2018/12/08 17:46:12 thorpej Exp $"
|
|||
#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, device_t, void *);
|
|||
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);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.351 2018/12/08 17:46:13 thorpej Exp $");
|
|||
|
||||
#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.351 2018/12/08 17:46:13 thorpej Exp $");
|
|||
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_space_tag_t st, bus_space_handle_t sh,
|
|||
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*/
|
||||
|
|
|
@ -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_addr_t, bus_space_handle_t *);
|
|||
#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);
|
||||
|
|
|
@ -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, bus_space_tag_t tag,
|
|||
{
|
||||
|
||||
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 self, void *aux)
|
|||
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_addr_t addr, int baud,
|
|||
|
||||
return comcnattach1(®s, baud, sysfreq, COM_TYPE_16550_NOERS, mode);
|
||||
}
|
||||
#endif /* COM_REGMAP */
|
||||
|
|
Loading…
Reference in New Issue