From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
"Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Subject: [PATCH v2 19/31] tty: moxa: drop ISA support
Date: Mon, 17 Mar 2025 08:00:34 +0100 [thread overview]
Message-ID: <20250317070046.24386-20-jirislaby@kernel.org> (raw)
In-Reply-To: <20250317070046.24386-1-jirislaby@kernel.org>
I doubt anyone actually uses this driver (unlike mxser.c and serial
moxa driven devices). Even less there is anyone with a moxa ISA card.
The newer mxser dropped the support for ISA in 2021. Let this moxa
follow now.
Good diet.
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
---
drivers/tty/Kconfig | 2 +-
drivers/tty/moxa.c | 100 +++-----------------------------------------
2 files changed, 6 insertions(+), 96 deletions(-)
diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
index 63a494d36a1f..0f3f55372c11 100644
--- a/drivers/tty/Kconfig
+++ b/drivers/tty/Kconfig
@@ -210,7 +210,7 @@ config SERIAL_NONSTANDARD
config MOXA_INTELLIO
tristate "Moxa Intellio support"
- depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI)
+ depends on SERIAL_NONSTANDARD && PCI
select FW_LOADER
help
Say Y here if you have a Moxa Intellio multiport serial card.
diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
index 2b75ca12cbc9..a753afcb53b5 100644
--- a/drivers/tty/moxa.c
+++ b/drivers/tty/moxa.c
@@ -355,33 +355,21 @@
#define MAX_PORTS_PER_BOARD 32 /* Don't change this value */
#define MAX_PORTS (MAX_BOARDS * MAX_PORTS_PER_BOARD)
-#define MOXA_IS_320(brd) ((brd)->boardType == MOXA_BOARD_C320_ISA || \
- (brd)->boardType == MOXA_BOARD_C320_PCI)
-
-/*
- * Define the Moxa PCI vendor and device IDs.
- */
-#define MOXA_BUS_TYPE_ISA 0
-#define MOXA_BUS_TYPE_PCI 1
+#define MOXA_IS_320(brd) ((brd)->boardType == MOXA_BOARD_C320_PCI)
enum {
MOXA_BOARD_C218_PCI = 1,
- MOXA_BOARD_C218_ISA,
MOXA_BOARD_C320_PCI,
- MOXA_BOARD_C320_ISA,
MOXA_BOARD_CP204J,
};
static char *moxa_brdname[] =
{
"C218 Turbo PCI series",
- "C218 Turbo ISA series",
"C320 Turbo PCI series",
- "C320 Turbo ISA series",
"CP-204J series",
};
-#ifdef CONFIG_PCI
static const struct pci_device_id moxa_pcibrds[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_C218),
.driver_data = MOXA_BOARD_C218_PCI },
@@ -392,14 +380,12 @@ static const struct pci_device_id moxa_pcibrds[] = {
{ 0 }
};
MODULE_DEVICE_TABLE(pci, moxa_pcibrds);
-#endif /* CONFIG_PCI */
struct moxa_port;
static struct moxa_board_conf {
int boardType;
int numPorts;
- int busType;
unsigned int ready;
@@ -459,9 +445,6 @@ static unsigned int moxaLowWaterChk;
static DEFINE_MUTEX(moxa_openlock);
static DEFINE_SPINLOCK(moxa_lock);
-static unsigned long baseaddr[MAX_BOARDS];
-static unsigned int type[MAX_BOARDS];
-static unsigned int numports[MAX_BOARDS];
static struct tty_port moxa_service_port;
MODULE_AUTHOR("William Chen");
@@ -471,13 +454,6 @@ MODULE_FIRMWARE("c218tunx.cod");
MODULE_FIRMWARE("cp204unx.cod");
MODULE_FIRMWARE("c320tunx.cod");
-module_param_array(type, uint, NULL, 0);
-MODULE_PARM_DESC(type, "card type: C218=2, C320=4");
-module_param_hw_array(baseaddr, ulong, ioport, NULL, 0);
-MODULE_PARM_DESC(baseaddr, "base address");
-module_param_array(numports, uint, NULL, 0);
-MODULE_PARM_DESC(numports, "numports (ignored for C218)");
-
module_param(ttymajor, int, 0);
/*
@@ -723,7 +699,6 @@ static DEFINE_TIMER(moxaTimer, moxa_poll);
static int moxa_check_fw_model(struct moxa_board_conf *brd, u8 model)
{
switch (brd->boardType) {
- case MOXA_BOARD_C218_ISA:
case MOXA_BOARD_C218_PCI:
if (model != 1)
goto err;
@@ -767,7 +742,6 @@ static int moxa_load_bios(struct moxa_board_conf *brd, const u8 *buf,
msleep(2000);
switch (brd->boardType) {
- case MOXA_BOARD_C218_ISA:
case MOXA_BOARD_C218_PCI:
tmp = readw(baseAddr + C218_key);
if (tmp != C218_KeyCode)
@@ -831,7 +805,6 @@ static int moxa_real_load_code(struct moxa_board_conf *brd, const void *ptr,
switch (brd->boardType) {
case MOXA_BOARD_CP204J:
- case MOXA_BOARD_C218_ISA:
case MOXA_BOARD_C218_PCI:
key = C218_key;
loadbuf = C218_LoadBuf;
@@ -896,15 +869,9 @@ static int moxa_real_load_code(struct moxa_board_conf *brd, const void *ptr,
return -EIO;
if (MOXA_IS_320(brd)) {
- if (brd->busType == MOXA_BUS_TYPE_PCI) { /* ASIC board */
- writew(0x3800, baseAddr + TMS320_PORT1);
- writew(0x3900, baseAddr + TMS320_PORT2);
- writew(28499, baseAddr + TMS320_CLOCK);
- } else {
- writew(0x3200, baseAddr + TMS320_PORT1);
- writew(0x3400, baseAddr + TMS320_PORT2);
- writew(19999, baseAddr + TMS320_CLOCK);
- }
+ writew(0x3800, baseAddr + TMS320_PORT1);
+ writew(0x3900, baseAddr + TMS320_PORT2);
+ writew(28499, baseAddr + TMS320_CLOCK);
}
writew(1, baseAddr + Disable_IRQ);
writew(0, baseAddr + Magic_no);
@@ -955,7 +922,6 @@ static int moxa_load_code(struct moxa_board_conf *brd, const void *ptr,
return retval;
switch (brd->boardType) {
- case MOXA_BOARD_C218_ISA:
case MOXA_BOARD_C218_PCI:
case MOXA_BOARD_CP204J:
port = brd->ports;
@@ -1139,7 +1105,6 @@ static int moxa_init_board(struct moxa_board_conf *brd, struct device *dev)
}
switch (brd->boardType) {
- case MOXA_BOARD_C218_ISA:
case MOXA_BOARD_C218_PCI:
file = "c218tunx.cod";
break;
@@ -1225,7 +1190,6 @@ static void moxa_board_deinit(struct moxa_board_conf *brd)
kfree(brd->ports);
}
-#ifdef CONFIG_PCI
static int moxa_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
@@ -1268,7 +1232,6 @@ static int moxa_pci_probe(struct pci_dev *pdev,
board->boardType = board_type;
switch (board_type) {
- case MOXA_BOARD_C218_ISA:
case MOXA_BOARD_C218_PCI:
board->numPorts = 8;
break;
@@ -1280,7 +1243,6 @@ static int moxa_pci_probe(struct pci_dev *pdev,
board->numPorts = 0;
break;
}
- board->busType = MOXA_BUS_TYPE_PCI;
retval = moxa_init_board(board, &pdev->dev);
if (retval)
@@ -1316,14 +1278,10 @@ static struct pci_driver moxa_pci_driver = {
.probe = moxa_pci_probe,
.remove = moxa_pci_remove
};
-#endif /* CONFIG_PCI */
static int __init moxa_init(void)
{
- unsigned int isabrds = 0;
int retval = 0;
- struct moxa_board_conf *brd = moxa_boards;
- unsigned int i;
tty_port_init(&moxa_service_port);
@@ -1352,64 +1310,16 @@ static int __init moxa_init(void)
return -1;
}
- /* Find the boards defined from module args. */
-
- for (i = 0; i < MAX_BOARDS; i++) {
- if (!baseaddr[i])
- break;
- if (type[i] == MOXA_BOARD_C218_ISA ||
- type[i] == MOXA_BOARD_C320_ISA) {
- pr_debug("Moxa board %2d: %s board(baseAddr=%lx)\n",
- isabrds + 1, moxa_brdname[type[i] - 1],
- baseaddr[i]);
- brd->boardType = type[i];
- brd->numPorts = type[i] == MOXA_BOARD_C218_ISA ? 8 :
- numports[i];
- brd->busType = MOXA_BUS_TYPE_ISA;
- brd->basemem = ioremap(baseaddr[i], 0x4000);
- if (!brd->basemem) {
- printk(KERN_ERR "MOXA: can't remap %lx\n",
- baseaddr[i]);
- continue;
- }
- if (moxa_init_board(brd, NULL)) {
- iounmap(brd->basemem);
- brd->basemem = NULL;
- continue;
- }
-
- printk(KERN_INFO "MOXA isa board found at 0x%.8lx and "
- "ready (%u ports, firmware loaded)\n",
- baseaddr[i], brd->numPorts);
-
- brd++;
- isabrds++;
- }
- }
-
-#ifdef CONFIG_PCI
retval = pci_register_driver(&moxa_pci_driver);
- if (retval) {
+ if (retval)
printk(KERN_ERR "Can't register MOXA pci driver!\n");
- if (isabrds)
- retval = 0;
- }
-#endif
return retval;
}
static void __exit moxa_exit(void)
{
- unsigned int i;
-
-#ifdef CONFIG_PCI
pci_unregister_driver(&moxa_pci_driver);
-#endif
-
- for (i = 0; i < MAX_BOARDS; i++) /* ISA boards */
- if (moxa_boards[i].ready)
- moxa_board_deinit(&moxa_boards[i]);
del_timer_sync(&moxaTimer);
--
2.49.0
next prev parent reply other threads:[~2025-03-17 7:01 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 7:00 [PATCH v2 00/31] tty: cleanup no. 99 Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 01/31] tty: convert "TTY Struct Flags" to an enum Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 02/31] tty: audit: do not use N_TTY_BUF_SIZE Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 03/31] tty: caif: " Jiri Slaby (SUSE)
2025-03-20 11:17 ` Simon Horman
2025-03-17 7:00 ` [PATCH v2 04/31] tty: move N_TTY_BUF_SIZE to n_tty Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 05/31] tty: n_tty: use uint for space returned by tty_write_room() Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 06/31] tty: n_tty: simplify process_output() Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 07/31] tty: n_tty: clean up process_output_block() Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 08/31] tty: n_tty: drop n_tty_trace() Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 09/31] tty: n_tty: extract n_tty_continue_cookie() from n_tty_read() Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 10/31] tty: n_tty: extract n_tty_wait_for_input() Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 11/31] tty: n_tty: move more_to_be_read to the end of n_tty_read() Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 12/31] tty: tty_driver: move TTY macros to the top Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 13/31] tty: tty_driver: convert "TTY Driver Flags" to an enum Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 14/31] tty: tty_driver: document both {,__}tty_alloc_driver() properly Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 15/31] tty: tty_driver: introduce TTY driver sub/types enums Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 16/31] tty: serdev: drop serdev_controller_ops::write_room() Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 17/31] tty: mmc: sdio: use bool for cts and remove parentheses Jiri Slaby (SUSE)
2025-03-17 10:50 ` Ulf Hansson
2025-03-17 7:00 ` [PATCH v2 18/31] tty: moxa: drop version dump to logs Jiri Slaby (SUSE)
2025-03-17 7:00 ` Jiri Slaby (SUSE) [this message]
2025-03-17 7:00 ` [PATCH v2 20/31] tty: moxa: carve out special ioctls and extra tty_port Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 21/31] tty: srmcons: fix retval from srmcons_init() Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 22/31] tty: staging/greybus: pass tty_driver flags to tty_alloc_driver() Jiri Slaby (SUSE)
2025-03-17 12:35 ` Alex Elder
2025-03-17 7:00 ` [PATCH v2 23/31] tty: sunsu: drop serial_{in,out}p() Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 24/31] tty: sunsu: remove unused serial_icr_read() Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 25/31] serial: remove redundant tty_port_link_device() Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 26/31] serial: pass struct uart_state to uart_line_info() Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 27/31] serial: 8250: use serial_port_in/out() helpers Jiri Slaby (SUSE)
2025-03-17 7:25 ` Andy Shevchenko
2025-03-17 7:42 ` Jiri Slaby
2025-03-17 7:00 ` [PATCH v2 28/31] serial: 8250_rsa: simplify rsa8250_{request/release}_resource() Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 29/31] serial: 8250_port: do not use goto for UPQ_NO_TXEN_TEST code flow Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 30/31] serial: 8250_port: simplify serial8250_request_std_resource() Jiri Slaby (SUSE)
2025-03-17 7:00 ` [PATCH v2 31/31] serial: switch change_irq and change_port to bool in uart_set_info() Jiri Slaby (SUSE)
2025-03-17 7:03 ` [PATCH v2 00/31] tty: cleanup no. 99 Jiri Slaby
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250317070046.24386-20-jirislaby@kernel.org \
--to=jirislaby@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.