diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1998-08-25 09:12:35 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1998-08-25 09:12:35 +0000 |
commit | c7fc24dc4420057f103afe8fc64524ebc25c5d37 (patch) | |
tree | 3682407a599b8f9f03fc096298134cafba1c9b2f /drivers/acorn/char | |
parent | 1d793fade8b063fde3cf275bf1a5c2d381292cd9 (diff) |
o Merge with Linux 2.1.116.
o New Newport console code.
o New G364 console code.
Diffstat (limited to 'drivers/acorn/char')
-rw-r--r-- | drivers/acorn/char/.cvsignore | 5 | ||||
-rw-r--r-- | drivers/acorn/char/Config.in | 4 | ||||
-rw-r--r-- | drivers/acorn/char/Makefile | 32 | ||||
-rw-r--r-- | drivers/acorn/char/serial-atomwide.c | 20 | ||||
-rw-r--r-- | drivers/acorn/char/serial-card.c | 107 | ||||
-rw-r--r-- | drivers/acorn/char/serial-dualsp.c | 17 |
6 files changed, 185 insertions, 0 deletions
diff --git a/drivers/acorn/char/.cvsignore b/drivers/acorn/char/.cvsignore new file mode 100644 index 000000000..b566130de --- /dev/null +++ b/drivers/acorn/char/.cvsignore @@ -0,0 +1,5 @@ +.depend +.*.flags +conmakehash +consolemap_deftbl.c +uni_hash.tbl diff --git a/drivers/acorn/char/Config.in b/drivers/acorn/char/Config.in new file mode 100644 index 000000000..cbd70732d --- /dev/null +++ b/drivers/acorn/char/Config.in @@ -0,0 +1,4 @@ +if [ "$CONFIG_SERIAL" != "n" ]; then + tristate ' Atomwide serial port support' CONFIG_ATOMWIDE_SERIAL + tristate ' Dual serial port support' CONFIG_DUALSP_SERIAL +fi diff --git a/drivers/acorn/char/Makefile b/drivers/acorn/char/Makefile new file mode 100644 index 000000000..ffc01825f --- /dev/null +++ b/drivers/acorn/char/Makefile @@ -0,0 +1,32 @@ +# +# Makefile for the kernel character device drivers. +# +# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file). +# +# Note 2! The CFLAGS definitions are now inherited from the +# parent makes.. +# + +L_TARGET := acorn-char.a +M_OBJS := +L_OBJS := + +ifeq ($(CONFIG_ATOMWIDE_SERIAL),y) + L_OBJS += serial-atomwide.o +else + ifeq ($(CONFIG_ATOMWIDE_SERIAL),m) + M_OBJS += serial-atomwide.o + endif +endif + +ifeq ($(CONFIG_DUALSP_SERIAL),y) + L_OBJS += serial-dualsp.o +else + ifeq ($(CONFIG_DUALSP_SERIAL),m) + M_OBJS += serial-dualsp.o + endif +endif + +include $(TOPDIR)/Rules.make diff --git a/drivers/acorn/char/serial-atomwide.c b/drivers/acorn/char/serial-atomwide.c new file mode 100644 index 000000000..f9bef2dd8 --- /dev/null +++ b/drivers/acorn/char/serial-atomwide.c @@ -0,0 +1,20 @@ +/* + * linux/arch/arm/drivers/char/serial-atomwide.c + * + * Copyright (c) 1996 Russell King. + * + * Changelog: + * 02-05-1996 RMK Created + * 07-05-1996 RMK Altered for greater number of cards. + * 30-07-1996 RMK Now uses generic card code. + */ + +#define MY_CARD_LIST { MANU_ATOMWIDE, PROD_ATOMWIDE_3PSERIAL } +#define MY_NUMPORTS 3 +#define MY_BAUD_BASE (7372800 / 16) +#define MY_INIT atomwide_serial_init +#define MY_BASE_ADDRESS(ec) \ + ecard_address ((ec), ECARD_IOC, ECARD_SLOW) + (0x2000 >> 2) +#define MY_PORT_ADDRESS(port,cardaddr) \ + ((cardaddr) + 0x200 - (port) * 0x100) +#include "serial-card.c" diff --git a/drivers/acorn/char/serial-card.c b/drivers/acorn/char/serial-card.c new file mode 100644 index 000000000..10fe5db73 --- /dev/null +++ b/drivers/acorn/char/serial-card.c @@ -0,0 +1,107 @@ +/* + * linux/arch/arm/drivers/char/serial-module.c + * + * Copyright (c) 1996 Russell King. + * + * A generic handler of serial expansion cards that use 16550s or + * the like. + * + * Definitions: + * MY_PRODS Product numbers to identify this card by + * MY_MANUS Manufacturer numbers to identify this card by + * MY_NUMPORTS Number of ports per card + * MY_BAUD_BASE Baud base for the card + * MY_INIT Initialisation routine name + * MY_BASE_ADDRESS(ec) Return base address for ports + * MY_PORT_ADDRESS + * (port,cardaddr) Return address for port using base address + * from above. + * + * Changelog: + * 30-07-1996 RMK Created + * 22-04-1998 RMK Removed old register_pre_init_serial + */ +#include <linux/module.h> +#include <linux/serial.h> +#include <linux/errno.h> +#include <asm/ecard.h> + +#ifndef NUM_SERIALS +#define NUM_SERIALS MY_NUMPORTS * MAX_ECARDS +#endif + +#ifdef MODULE +static int __serial_ports[NUM_SERIALS]; +static int __serial_pcount; +static struct expansion_card *expcard[MAX_ECARDS]; +#define ADD_ECARD(ec,card) expcard[(card)] = (ec) +#define ADD_PORT(port) __serial_ports[__serial_pcount++] = (port) +#undef MY_INIT +#define MY_INIT init_module +#else +#define ADD_ECARD(ec,card) +#define ADD_PORT(port) +#endif + +static const card_ids serial_cids[] = { MY_CARD_LIST, { 0xffff, 0xffff } }; + +static inline int serial_register_onedev (unsigned long port, int irq) +{ + struct serial_struct req; + + req.baud_base = MY_BAUD_BASE; + req.irq = irq; + req.port = port; + req.flags = 0; + + return register_serial(&req); +} + +int MY_INIT (void) +{ + int card = 0; + + ecard_startfind (); + + do { + struct expansion_card *ec; + unsigned long cardaddr; + int port; + + ec = ecard_find (0, serial_cids); + if (!ec) + break; + + cardaddr = MY_BASE_ADDRESS(ec); + + for (port = 0; port < MY_NUMPORTS; port ++) { + int line; + + line = serial_register_onedev (MY_PORT_ADDRESS(port, cardaddr), ec->irq); + if (line < 0) + break; + ADD_PORT(line); + } + + if (port) { + ecard_claim (ec); + ADD_ECARD(ec, card); + } else + break; + } while (++card < MAX_ECARDS); + return card ? 0 : -ENODEV; +} + +#ifdef MODULE +void cleanup_module (void) +{ + int i; + + for (i = 0; i < __serial_pcount; i++) + unregister_serial (__serial_ports[i]); + + for (i = 0; i < MAX_ECARDS; i++) + if (expcard[i]) + ecard_release (expcard[i]); +} +#endif diff --git a/drivers/acorn/char/serial-dualsp.c b/drivers/acorn/char/serial-dualsp.c new file mode 100644 index 000000000..6a9df7599 --- /dev/null +++ b/drivers/acorn/char/serial-dualsp.c @@ -0,0 +1,17 @@ +/* + * linux/arch/arm/drivers/char/serial-dualsp.c + * + * Copyright (c) 1996 Russell King. + * + * Changelog: + * 30-07-1996 RMK Created + */ +#define MY_CARD_LIST { MANU_SERPORT, PROD_SERPORT_DSPORT } +#define MY_NUMPORTS 2 +#define MY_BAUD_BASE (3686400 / 16) +#define MY_INIT dualsp_serial_init +#define MY_BASE_ADDRESS(ec) \ + ecard_address (ec, ECARD_IOC, ECARD_SLOW) + (0x2000 >> 2) +#define MY_PORT_ADDRESS(port,cardaddress) \ + ((cardaddress) + (port) * 8) +#include "serial-card.c" |