1 /* linux/drivers/serial/bast_sio.c
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
6 * http://www.simtec.co.uk/products/EB2410ITX/
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 * 23-Sep-2004 BJD Added copyright header
14 * 23-Sep-2004 BJD Added serial port remove code
17 #include <linux/module.h>
18 #include <linux/config.h>
19 #include <linux/kernel.h>
20 #include <linux/init.h>
21 #include <linux/tty.h>
22 #include <linux/serial.h>
23 #include <linux/serial_core.h>
24 #include <linux/types.h>
27 #include <asm/serial.h>
28 #include <asm/mach-types.h>
30 #include <asm/arch/map.h>
31 #include <asm/arch/irqs.h>
32 #include <asm/arch/bast-map.h>
33 #include <asm/arch/bast-irq.h>
35 static int __init serial_bast_register(unsigned long port, unsigned int irq)
37 struct serial_struct serial_req;
39 serial_req.flags = UPF_AUTOPROBE | UPF_SHARE_IRQ;
40 serial_req.baud_base = BASE_BAUD;
42 serial_req.io_type = UPIO_MEM;
43 serial_req.iomap_base = port;
44 serial_req.iomem_base = ioremap(port, 0x10);
45 serial_req.iomem_reg_shift = 0;
47 return register_serial(&serial_req);
50 #define SERIAL_BASE (S3C2410_CS2 + BAST_PA_SUPERIO)
52 static int port[2] = { -1, -1 };
54 static int __init serial_bast_init(void)
56 if (machine_is_bast()) {
57 port[0] = serial_bast_register(SERIAL_BASE + 0x2f8, IRQ_PCSERIAL1);
58 port[1] = serial_bast_register(SERIAL_BASE + 0x3f8, IRQ_PCSERIAL2);
64 static void __exit serial_bast_exit(void)
67 unregister_serial(port[0]);
69 unregister_serial(port[1]);
73 module_init(serial_bast_init);
74 module_exit(serial_bast_exit);
76 MODULE_LICENSE("GPL");
77 MODULE_AUTHOR("Ben Dooks, ben@simtec.co.uk");
78 MODULE_DESCRIPTION("BAST Onboard Serial setup");