Commit 113da4d2 authored by Russell King's avatar Russell King

[ARM] Eliminate include/asm-arm/arch-*/serial.h

Convert all platform serial tables to use a serial8250 platform device
rather than declaring a static table in
include/asm-arm/arch-*/serial.h.  This change integrates patches from
Sascha Hauser to update H720x serial support, and Tony Lindgren to
update OMAP serial support.
parent df886b22
......@@ -12,6 +12,7 @@
#include <linux/list.h>
#include <linux/sched.h>
#include <linux/init.h>
#include <linux/serial_8250.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
......@@ -313,6 +314,55 @@ static struct clps7500_timer = {
.offset = ioc_timer_gettimeoffset,
};
static struct plat_serial8250_port serial_platform_data[] = {
{
.mapbase = 0x03010fe0,
.irq = 10,
.uartclk = 1843200,
.regshift = 2,
.iotype = UPIO_MEM,
.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SKIP_TEST,
},
{
.mapbase = 0x03010be0,
.irq = 0,
.uartclk = 1843200,
.regshift = 2,
.iotype = UPIO_MEM,
.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SKIP_TEST,
},
{
.iobase = ISASLOT_IO + 0x2e8,
.irq = 41,
.uartclk = 1843200,
.regshift = 0,
.iotype = UPIO_PORT,
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
},
{
.iobase = ISASLOT_IO + 0x3e8,
.irq = 40,
.uartclk = 1843200,
.regshift = 0,
.iotype = UPIO_PORT,
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
},
{ },
};
static struct platform_device serial_device = {
.name = "serial8250",
.id = 0,
.dev = {
.platform_data = serial_platform_data,
},
};
static int __init clps7500_init(void)
{
return platform_register_device(&serial_device);
}
MACHINE_START(CLPS7500, "CL-PS7500")
MAINTAINER("Philip Blundell")
BOOT_MEM(0x10000000, 0x03000000, 0xe0000000)
......
......@@ -12,6 +12,7 @@
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/serial_8250.h>
#include <linux/init.h>
#include <asm/hardware.h>
......@@ -196,6 +197,41 @@ static struct sys_timer ebsa110_timer = {
.offset = ebsa110_gettimeoffset,
};
static struct plat_serial8250_port serial_platform_data[] = {
{
.iobase = 0x3f8,
.irq = 1,
.uartclk = 1843200,
.regshift = 0,
.iotype = UPIO_PORT,
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
},
{
.iobase = 0x2f8,
.irq = 2,
.uartclk = 1843200,
.regshift = 0,
.iotype = UPIO_PORT,
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
},
{ },
};
static struct platform_device serial_device = {
.name = "serial8250",
.id = 0,
.dev = {
.platform_data = serial_platform_data,
},
};
static int __init ebsa110_init(void)
{
return platform_device_register(&serial_device);
}
arch_initcall(ebsa110_init);
MACHINE_START(EBSA110, "EBSA110")
MAINTAINER("Russell King")
BOOT_MEM(0x00000000, 0xe0000000, 0xe0000000)
......
......@@ -20,6 +20,7 @@
*/
#include <linux/types.h>
#include <linux/init.h>
#include <linux/serial_8250.h>
#include <asm/hardware.h>
#include <asm/setup.h>
......@@ -27,6 +28,36 @@
#include <asm/mach/arch.h>
static struct plat_serial8250_port serial_platform_data[] = {
{
.iobase = 0x3f8,
.irq = IRQ_UARTINT0,
#error FIXME
.uartclk = 0,
.regshift = 0,
.iotype = UPIO_PORT,
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
},
{
.iobase = 0x2f8,
.irq = IRQ_UARTINT1,
#error FIXME
.uartclk = 0,
.regshift = 0,
.iotype = UPIO_PORT,
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
},
{ },
};
static struct platform_device serial_device = {
.name = "serial8250",
.id = 0,
.dev = {
.platform_data = serial_platform_data,
},
};
extern void epxa10db_map_io(void);
extern void epxa10db_init_irq(void);
extern struct sys_timer epxa10db_timer;
......
......@@ -26,3 +26,5 @@ obj-$(CONFIG_ARCH_PERSONAL_SERVER) += personal.o dc21285-timer.o
obj-$(CONFIG_PCI) +=$(pci-y)
obj-$(CONFIG_LEDS) +=$(leds-y)
obj-$(CONFIG_ISA) += isa.o
/*
* linux/arch/arm/mach-footbridge/isa.c
*
* Copyright (C) 2004 Russell King.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/init.h>
#include <linux/serial_8250.h>
#include <asm/irq.h>
static struct plat_serial8250_port serial_platform_data[] = {
{
.iobase = 0x3f8,
.irq = IRQ_ISA_UART,
.uartclk = 1843200,
.regshift = 0,
.iotype = UPIO_PORT,
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
},
{
.iobase = 0x2f8,
.irq = IRQ_ISA_UART2,
.uartclk = 1843200,
.regshift = 0,
.iotype = UPIO_PORT,
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
},
{ },
};
static struct platform_device serial_device = {
.name = "serial8250",
.id = 0,
.dev = {
.platform_data = serial_platform_data,
},
};
static int __init footbridge_isa_init(void)
{
return platform_device_register(&serial_device);
}
arch_initcall(footbridge_isa_init);
......@@ -23,6 +23,7 @@
#include <asm/mach/irq.h>
#include <asm/mach/time.h>
#include <linux/device.h>
#include <linux/serial_8250.h>
static struct resource h7202ps2_resources[] = {
[0] = {
......@@ -44,8 +45,53 @@ static struct platform_device h7202ps2_device = {
.resource = h7202ps2_resources,
};
static struct plat_serial8250_port serial_platform_data[] = {
{
.membase = SERIAL0_BASE,
.irq = IRQ_UART0,
.uartclk = 2*1843200,
.regshift = 2,
.iotype = UPIO_MEM,
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
},
{
.membase = SERIAL1_BASE,
.irq = IRQ_UART1,
.uartclk = 2*1843200,
.regshift = 2,
.iotype = UPIO_MEM,
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
},
{
.membase = SERIAL2_BASE,
.irq = IRQ_UART2,
.uartclk = 2*1843200,
.regshift = 2,
.iotype = UPIO_MEM,
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
},
{
.membase = SERIAL3_BASE,
.irq = IRQ_UART3,
.uartclk = 2*1843200,
.regshift = 2,
.iotype = UPIO_MEM,
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
},
{ },
};
static struct platform_device serial_device = {
.name = "serial8250",
.id = 0,
.dev = {
.platform_data = serial_platform_data,
},
};
static struct platform_device *devices[] __initdata = {
&h7202ps2_device,
&serial_device,
};
extern unsigned long h720x_gettimeoffset(void);
......
......@@ -16,7 +16,7 @@
#include <linux/console.h>
#include <linux/serial.h>
#include <linux/tty.h>
#include <linux/serial_core.h>
#include <linux/serial_8250.h>
#include <linux/serial_reg.h>
#include <asm/hardware.h>
......@@ -307,34 +307,36 @@ void omap_map_io(void)
_omap_map_io();
}
static inline unsigned int omap_serial_in(struct uart_port *up, int offset)
static inline unsigned int omap_serial_in(struct plat_serial8250_port *up,
int offset)
{
offset <<= up->regshift;
return (unsigned int)__raw_readb(up->membase + offset);
}
static inline void omap_serial_outp(struct uart_port *up, int offset, int value)
static inline void omap_serial_outp(struct plat_serial8250_port *p, int offset,
int value)
{
offset <<= up->regshift;
__raw_writeb(value, up->membase + offset);
offset <<= p->regshift;
__raw_writeb(value, p->membase + offset);
}
/*
* Internal UARTs need to be initialized for the 8250 autoconfig to work
* properly.
*/
static void __init omap_serial_reset(struct uart_port *up)
static void __init omap_serial_reset(struct plat_serial8250_port *p)
{
omap_serial_outp(up, UART_OMAP_MDR1, 0x07); /* disable UART */
omap_serial_outp(up, UART_OMAP_MDR1, 0x00); /* enable UART */
omap_serial_outp(p, UART_OMAP_MDR1, 0x07); /* disable UART */
omap_serial_outp(p, UART_OMAP_MDR1, 0x00); /* enable UART */
if (!cpu_is_omap1510()) {
omap_serial_outp(up, UART_OMAP_SYSC, 0x01);
while (!(omap_serial_in(up, UART_OMAP_SYSC) & 0x01));
omap_serial_outp(p, UART_OMAP_SYSC, 0x01);
while (!(omap_serial_in(p, UART_OMAP_SYSC) & 0x01));
}
}
static struct uart_port omap_serial_ports[] = {
static struct plat_serial8250_port serial_platform_data[] = {
{
.membase = (char*)IO_ADDRESS(OMAP_UART1_BASE),
.mapbase = (unsigned long)OMAP_UART1_BASE,
......@@ -343,10 +345,8 @@ static struct uart_port omap_serial_ports[] = {
.iotype = UPIO_MEM,
.regshift = 2,
.uartclk = OMAP16XX_BASE_BAUD * 16,
.line = 0,
.type = PORT_16654,
.fifosize = 64
} , {
},
{
.membase = (char*)IO_ADDRESS(OMAP_UART2_BASE),
.mapbase = (unsigned long)OMAP_UART2_BASE,
.irq = INT_UART2,
......@@ -354,10 +354,8 @@ static struct uart_port omap_serial_ports[] = {
.iotype = UPIO_MEM,
.regshift = 2,
.uartclk = OMAP16XX_BASE_BAUD * 16,
.line = 1,
.type = PORT_16654,
.fifosize = 64
} , {
},
{
.membase = (char*)IO_ADDRESS(OMAP_UART3_BASE),
.mapbase = (unsigned long)OMAP_UART3_BASE,
.irq = INT_UART3,
......@@ -365,10 +363,16 @@ static struct uart_port omap_serial_ports[] = {
.iotype = UPIO_MEM,
.regshift = 2,
.uartclk = OMAP16XX_BASE_BAUD * 16,
.line = 2,
.type = PORT_16654,
.fifosize = 64
}
},
{ },
};
static struct platform_device serial_device = {
.name = "serial8250",
.id = 0,
.dev = {
.platform_data = serial_platform_data,
},
};
/*
......@@ -381,23 +385,26 @@ void __init omap_serial_init(int ports[OMAP_MAX_NR_PORTS])
int i;
if (cpu_is_omap730()) {
omap_serial_ports[0].regshift = 0;
omap_serial_ports[1].regshift = 0;
omap_serial_ports[0].irq = INT_730_UART_MODEM_1;
omap_serial_ports[1].irq = INT_730_UART_MODEM_IRDA_2;
serial_platform_data[0].regshift = 0;
serial_platform_data[1].regshift = 0;
serial_platform_data[0].irq = INT_730_UART_MODEM_1;
serial_platform_data[1].irq = INT_730_UART_MODEM_IRDA_2;
}
if (cpu_is_omap1510()) {
omap_serial_ports[0].uartclk = OMAP1510_BASE_BAUD * 16;
omap_serial_ports[1].uartclk = OMAP1510_BASE_BAUD * 16;
omap_serial_ports[2].uartclk = OMAP1510_BASE_BAUD * 16;
serial_platform_data[0].uartclk = OMAP1510_BASE_BAUD * 16;
serial_platform_data[1].uartclk = OMAP1510_BASE_BAUD * 16;
serial_platform_data[2].uartclk = OMAP1510_BASE_BAUD * 16;
}
for (i = 0; i < OMAP_MAX_NR_PORTS; i++) {
unsigned char reg;
if (ports[i] != 1)
if (ports[i] == 0) {
serial_platform_data[i].membase = 0;
serial_platform_data[i].mapbase = 0;
continue;
}
switch (i) {
case 0:
......@@ -431,11 +438,16 @@ void __init omap_serial_init(int ports[OMAP_MAX_NR_PORTS])
}
break;
}
omap_serial_reset(&omap_serial_ports[i]);
early_serial_setup(&omap_serial_ports[i]);
omap_serial_reset(&serial_platform_data[i]);
}
}
static int __init omap_init(void)
{
return platform_device_register(&serial_device);
}
arch_initcall(omap_init);
#define NO_LENGTH_CHECK 0xffffffff
extern int omap_bootloader_tag_len;
......
......@@ -16,6 +16,7 @@
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/device.h>
#include <linux/serial_8250.h>
#include <asm/elf.h>
#include <asm/io.h>
......@@ -130,9 +131,30 @@ static struct platform_device kbd_device = {
},
};
static struct plat_serial8250_port serial_platform_data[] = {
{
.mapbase = 0x03010fe0,
.irq = 10,
.uartclk = 1843200,
.regshift = 2,
.iotype = UPIO_MEM,
.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SKIP_TEST,
},
{ },
};
static struct platform_device serial_device = {
.name = "serial8250",
.id = 0,
.dev = {
.platform_data = serial_platform_data,
},
};
static struct platform_device *devs[] __initdata = {
&iomd_device,
&kbd_device,
&serial_device,
&acornfb_device,
};
......
......@@ -20,6 +20,7 @@
#include <linux/errno.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/serial_8250.h>
#include <asm/mach-types.h>
#include <asm/hardware.h>
......@@ -32,9 +33,6 @@
#include <asm/mach/map.h>
#include <asm/mach/irq.h>
#include <asm/mach/serial_sa1100.h>
#include <linux/serial_core.h>
#include <linux/serial_reg.h>
#include <asm/arch/serial.h>
#include <asm/io.h>
#include <asm/irq.h>
......@@ -178,6 +176,34 @@ static void trizeps_power_off(void)
PMCR = PMCR_SF;
}
static struct plat_serial8250_port serial_platform_data[] = {
{
.mapbase = TRIZEPS_UART5,
.irq = IRQ_GPIO16,
.uartclk = 24000000,
.regshift = 0,
.iotype = UPIO_PORT,
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
},
{
.mapbase = TRIZEPS_UART6,
.irq = IRQ_GPIO17,
.uartclk = 24000000,
.regshift = 0,
.iotype = UPIO_PORT,
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
},
{ },
};
static struct platform_device serial_device = {
.name = "serial8250",
.id = 0,
.dev = {
.platform_data = serial_platform_data,
},
};
static int __init trizeps_init(void)
{
if (!machine_is_trizeps())
......@@ -201,6 +227,8 @@ static int __init trizeps_init(void)
set_irq_type(IRQ_GPIO16, IRQT_RISING);
set_irq_type(IRQ_GPIO17, IRQT_RISING);
platform_device_register(&serial_device);
return 0;
}
......
......@@ -7,6 +7,7 @@
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/serial_8250.h>
#include <asm/setup.h>
#include <asm/mach-types.h>
......@@ -18,6 +19,46 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
static struct plat_serial8250_port serial_platform_data[] = {
{
.iobase = 0x3f8,
.irq = 4,
.uartclk = 1843200,
.regshift = 2,
.iotype = UPIO_PORT,
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
},
{
.iobase = 0x2f8,
.irq = 3,
.uartclk = 1843200,
.regshift = 2,
.iotype = UPIO_PORT,
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
},
{ },
};
static struct platform_device serial_device = {
.name = "serial8250",
.id = 0,
.dev = {
.platform_data = serial_platform_data,
},
};
static int __init shark_init(void)
{
int ret;
if (machine_is_shark())
ret = platform_device_register(&serial_device);
return ret;
}
arch_initcall(shark_init);
extern void shark_init_irq(void);
static struct map_desc shark_io_desc[] __initdata = {
......
/*
* linux/include/asm-arm/arch-cl7500/serial.h
*
* Copyright (c) 1996 Russell King.
* Copyright (C) 1999 Nexus Electronics Ltd.
*
* Changelog:
* 15-10-1996 RMK Created
* 10-08-1999 PJB Added COM3/COM4 for CL7500
*/
#ifndef __ASM_ARCH_SERIAL_H
#define __ASM_ARCH_SERIAL_H
#include <asm/arch/hardware.h>
/*
* This assumes you have a 1.8432 MHz clock for your UART.
*
* It'd be nice if someone built a serial card with a 24.576 MHz
* clock, since the 16550A is capable of handling a top speed of 1.5
* megabits/second; but this requires the faster clock.
*/
#define BASE_BAUD (1843200 / 16)
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
/* UART CLK PORT IRQ FLAGS */
#define STD_SERIAL_PORT_DEFNS \
{ 0, BASE_BAUD, 0x3F8, 10, STD_COM_FLAGS }, /* ttyS0 */ \
{ 0, BASE_BAUD, 0x2F8, 0, STD_COM_FLAGS }, /* ttyS1 */ \
/* ISA Slot Serial ports */ \
{ 0, BASE_BAUD, ISASLOT_IO + 0x2e8, 41, STD_COM_FLAGS }, /* ttyS2 */ \
{ 0, BASE_BAUD, ISASLOT_IO + 0x3e8, 40, STD_COM_FLAGS }, /* ttyS3 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS4 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS5 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS6 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS7 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS8 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS9 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS10 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS11 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS12 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS13 */
#define EXTRA_SERIAL_PORT_DEFNS
#endif
/*
* linux/include/asm-arm/arch-ebsa110/serial.h
*
* Copyright (C) 1996,1997,1998 Russell King.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Changelog:
* 15-10-1996 RMK Created
*/
#ifndef __ASM_ARCH_SERIAL_H
#define __ASM_ARCH_SERIAL_H
/*
* This assumes you have a 1.8432 MHz clock for your UART.
*
* It'd be nice if someone built a serial card with a 24.576 MHz
* clock, since the 16550A is capable of handling a top speed of 1.5
* megabits/second; but this requires the faster clock.
*/
#define BASE_BAUD (1843200 / 16)
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
/* UART CLK PORT IRQ FLAGS */
#define STD_SERIAL_PORT_DEFNS \
{ 0, BASE_BAUD, 0x3F8, 1, STD_COM_FLAGS }, /* ttyS0 */ \
{ 0, BASE_BAUD, 0x2F8, 2, STD_COM_FLAGS } /* ttyS1 */
#define EXTRA_SERIAL_PORT_DEFNS
#endif
/*
* linux/include/asm-arm/arch-ebsa285/serial.h
*
* Copyright (C) 1996,1997,1998 Russell King.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Changelog:
* 15-10-1996 RMK Created
* 25-05-1998 PJB CATS support
*/
#ifndef __ASM_ARCH_SERIAL_H
#define __ASM_ARCH_SERIAL_H
#include <asm/irq.h>
/*
* This assumes you have a 1.8432 MHz clock for your UART.
*
* It'd be nice if someone built a serial card with a 24.576 MHz
* clock, since the 16550A is capable of handling a top speed of 1.5
* megabits/second; but this requires the faster clock.
*/
#define BASE_BAUD (1843200 / 16)
#define _SER_IRQ0 IRQ_ISA_UART
#define _SER_IRQ1 IRQ_ISA_UART2
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
/* UART CLK PORT IRQ FLAGS */
#define STD_SERIAL_PORT_DEFNS \
{ 0, BASE_BAUD, 0x3F8, _SER_IRQ0, STD_COM_FLAGS }, /* ttyS0 */ \
{ 0, BASE_BAUD, 0x2F8, _SER_IRQ1, STD_COM_FLAGS }, /* ttyS1 */
#define EXTRA_SERIAL_PORT_DEFNS
#endif
/*
* linux/include/asm-arm/arch-epxa10db/serial.h
*
* Copyright (C) 1999 ARM Limited
* Copyright (C) 2001 Altera Corporation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_SERIAL_H
#define __ASM_ARCH_SERIAL_H
#include <asm/arch/platform.h>
#include <asm/irq.h>
/*
* This assumes you have a 1.8432 MHz clock for your UART.
*
* It'd be nice if someone built a serial card with a 24.576 MHz
* clock, since the 16550A is capable of handling a top speed of 1.5
* megabits/second; but this requires the faster clock.
*/
#define BASE_BAUD (1 / 16)
#define _SER_IRQ0 IRQ_UARTINT0
#define _SER_IRQ1 IRQ_UARTINT1
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
/* UART CLK PORT IRQ FLAGS */
#define STD_SERIAL_PORT_DEFNS \
{ 0, BASE_BAUD, 0x3F8, _SER_IRQ0, STD_COM_FLAGS }, /* ttyS0 */ \
{ 0, BASE_BAUD, 0x2F8, _SER_IRQ1, STD_COM_FLAGS }, /* ttyS1 */
#define EXTRA_SERIAL_PORT_DEFNS
#endif
/*
* linux/include/asm-arm/arch-h72x/serial.h
*
* Copyright (C) 2003 Thomas Gleixner <tglx@linutronix.de>
* 2003 Robert Schwebel <r.schwebel@pengutronix.de>
*
* Serial port setup for Hynix boards
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/
#ifndef __ASM_ARCH_SERIAL_H
#define __ASM_ARCH_SERIAL_H
#include <asm/arch/irqs.h>
/*
* Standard COM flags
*/
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
#define RS_TABLE_SIZE
/* Base clock is 3.6864 MHz */
#define BASE_BAUD (115200*2)
#define EXTRA_SERIAL_PORT_DEFNS
/*
* Board dependend defines
*/
#if defined (CONFIG_CPU_H7201)
#define BASE_BAUD_P3C (115200)
#define STD_SERIAL_PORT_DEFNS \
{ \
.baud_base = BASE_BAUD, \
.port = SERIAL0_BASE, \
.iomem_base = (u8*)SERIAL0_BASE, \
.io_type = UPIO_MEM, \
.irq = IRQ_UART0, \
.flags = STD_COM_FLAGS, \
.iomem_reg_shift = 2,\
}, \
{ \
.baud_base = BASE_BAUD, \
.port = SERIAL1_BASE, \
.iomem_base = (u8*)SERIAL1_BASE, \
.io_type = UPIO_MEM, \
.irq = IRQ_UART1, \
.flags = STD_COM_FLAGS, \
.iomem_reg_shift = 2,\
}
#elif defined (CONFIG_CPU_H7202)
#define STD_SERIAL_PORT_DEFNS \
{ \
.baud_base = BASE_BAUD, \
.port = SERIAL0_BASE, \
.iomem_base = (u8*)SERIAL0_BASE, \
.io_type = UPIO_MEM, \
.irq = IRQ_UART0, \
.flags = STD_COM_FLAGS, \
.iomem_reg_shift = 2,\
}, \
{ \
.baud_base = BASE_BAUD, \
.port = SERIAL1_BASE, \
.iomem_base = (u8*)SERIAL1_BASE, \
.io_type = UPIO_MEM, \
.irq = IRQ_UART1, \
.flags = STD_COM_FLAGS, \
.iomem_reg_shift = 2,\
}, \
{ \
.baud_base = BASE_BAUD, \
.port = SERIAL2_BASE, \
.iomem_base = (u8*)SERIAL2_BASE, \
.io_type = UPIO_MEM, \
.irq = IRQ_UART2, \
.flags = STD_COM_FLAGS, \
.iomem_reg_shift = 2,\
}, \
{ \
.baud_base = BASE_BAUD, \
.port = SERIAL3_BASE, \
.iomem_base = (u8*)SERIAL3_BASE, \
.io_type = UPIO_MEM, \
.irq = IRQ_UART3, \
.flags = STD_COM_FLAGS, \
.iomem_reg_shift = 2,\
}
#else
#error machine definition mismatch
#endif
/* __ASM_ARCH_SERIAL_H */
#endif
/*
* linux/include/asm-arm/arch-imx/serial.h
*
* Copyright (C) 1999 ARM Limited
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_SERIAL_H
#define __ASM_ARCH_SERIAL_H
#define STD_SERIAL_PORT_DEFNS
#define EXTRA_SERIAL_PORT_DEFNS
#endif /* __ASM_ARCH_SERIAL_H */
/*
* linux/include/asm-arm/arch-integrator/serial.h
*
* Copyright (C) 1999 ARM Limited
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_SERIAL_H
#define __ASM_ARCH_SERIAL_H
#include <asm/arch/platform.h>
#include <asm/irq.h>
/*
* This assumes you have a 1.8432 MHz clock for your UART.
*
* It'd be nice if someone built a serial card with a 24.576 MHz
* clock, since the 16550A is capable of handling a top speed of 1.5
* megabits/second; but this requires the faster clock.
*/
#define BASE_BAUD (1843200 / 16)
#define _SER_IRQ0 IRQ_UARTINT0
#define _SER_IRQ1 IRQ_UARTINT1
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
/* UART CLK PORT IRQ FLAGS */
#define STD_SERIAL_PORT_DEFNS \
{ 0, BASE_BAUD, 0x3F8, _SER_IRQ0, STD_COM_FLAGS }, /* ttyS0 */ \
{ 0, BASE_BAUD, 0x2F8, _SER_IRQ1, STD_COM_FLAGS }, /* ttyS1 */
#define EXTRA_SERIAL_PORT_DEFNS
#endif
/*
* include/asm-arm/arch-ixp2000/serial.h
*
* Serial port defn for ixp2000 based systems.
*
* Author: Deepak Saxena <dsaxena@plexity.net>
*
* Copyright (c) 2002-2004 MontaVista Software, Inc.
*
* We do not register serial ports staticly b/c there is no easy way
* to autodetect an XScale port. Instead we register them at runtime
* via early_serial_init().
*/
#ifndef _ARCH_SERIAL_H_
#define _ARCH_SERIAL_H_
#define BASE_BAUD (50000000/ 16)
/*
* Currently no IXP2000 systems with > 3 serial ports.
* If you add a system that does, just up this.
*/
#define STD_SERIAL_PORT_DEFNS
#define EXTRA_SERIAL_PORT_DEFNS
#endif // __ARCH_SERIAL_H_
/*
* include/asm-arm/arch-ixp4xx/serial.h
*
* Author: Deepak Saxena <dsaxena@plexity.net>
*
* Copyright (C) 2002-2004 MontaVista Software, Inc.
*
*/
#ifndef _ARCH_SERIAL_H_
#define _ARCH_SERIAL_H_
/*
* We don't hardcode our serial port information but instead
* fill it in dynamically based on our platform in arch->map_io.
* This allows for per-board serial ports w/o a bunch of
* #ifdefs in this file.
*/
#define STD_SERIAL_PORT_DEFNS
#define EXTRA_SERIAL_PORT_DEFNS
/*
* IXP4XX uses 15.6MHz clock for uart
*/
#define BASE_BAUD ( IXP4XX_UART_XTAL / 16 )
#endif // _ARCH_SERIAL_H_
......@@ -281,6 +281,26 @@
#ifndef __ASSEMBLER__
/*
* ---------------------------------------------------------------------------
* Serial ports
* ---------------------------------------------------------------------------
*/
#define OMAP_UART1_BASE (unsigned char *)0xfffb0000
#define OMAP_UART2_BASE (unsigned char *)0xfffb0800
#define OMAP_UART3_BASE (unsigned char *)0xfffb9800
#define OMAP_MAX_NR_PORTS 3
#define OMAP1510_BASE_BAUD (12000000/16)
#define OMAP16XX_BASE_BAUD (48000000/16)
#define is_omap_port(p) ({int __ret = 0; \
if (p == (char*)IO_ADDRESS(OMAP_UART1_BASE) || \
p == (char*)IO_ADDRESS(OMAP_UART2_BASE) || \
p == (char*)IO_ADDRESS(OMAP_UART3_BASE)) \
__ret = 1; \
__ret; \
})
/*
* ---------------------------------------------------------------------------
* Processor specific defines
......
/*
* linux/include/asm-arm/arch-omap/serial.h
*
* BRIEF MODULE DESCRIPTION
* serial definitions
*
* NOTE: There is an error in the description of the transmit trigger levels of
* OMAP5910 TRM from January 2003. The transmit trigger level 56 is not 56 but
* 32, the transmit trigger level 60 is not 60 but 56!
* Additionally, the description of these trigger levels is a little bit
* unclear. The trigger level define the number of EMPTY entries in the FIFO.
* Thus, if TRIGGER_8 is used, an interrupt is requested if 8 FIFO entries are
* empty (and 56 entries are still filled [the FIFO size is 64]). Or: If
* TRIGGER_56 is selected, everytime there are less than 8 characters in the
* FIFO, an interrrupt is spawned. In other words: The trigger number is equal
* the number of characters which can be written without FIFO overrun.
*/
#ifndef __ASM_ARCH_SERIAL_H
#define __ASM_ARCH_SERIAL_H
#define OMAP_UART1_BASE (unsigned char *)0xfffb0000
#define OMAP_UART2_BASE (unsigned char *)0xfffb0800
#define OMAP_UART3_BASE (unsigned char *)0xfffb9800
#define OMAP_MAX_NR_PORTS 3
#define is_omap_port(p) ({int __ret = 0; \
if (p == (char*)IO_ADDRESS(OMAP_UART1_BASE) || \
p == (char*)IO_ADDRESS(OMAP_UART2_BASE) || \
p == (char*)IO_ADDRESS(OMAP_UART3_BASE)) \
__ret = 1; \
__ret; \
})
#ifndef __ASSEMBLY__
#include <asm/arch/hardware.h>
#include <asm/irq.h>
#define OMAP1510_BASE_BAUD (12000000/16)
#define OMAP16XX_BASE_BAUD (48000000/16)
#define UART_SYSC 0x15
#define STD_SERIAL_PORT_DEFNS
#define EXTRA_SERIAL_PORT_DEFNS
#define BASE_BAUD 0
#endif /* __ASSEMBLY__ */
#endif /* __ASM_ARCH_SERIAL_H */
......@@ -20,7 +20,7 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/serial_reg.h>
#include <asm/arch/serial.h>
#include <asm/arch/hardware.h>
unsigned int system_rev;
......
/*
* linux/include/asm-arm/arch-pxa/serial.h
*
* Author: Nicolas Pitre
* Copyright: (C) 2001 MontaVista Software Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <asm/arch/pxa-regs.h>
#define BAUD_BASE 921600
/* Standard COM flags */
#define STD_COM_FLAGS (ASYNC_SKIP_TEST)
#define STD_SERIAL_PORT_DEFNS \
{ \
type: PORT_PXA, \
xmit_fifo_size: 64, \
baud_base: BAUD_BASE, \
iomem_base: &FFUART, \
iomem_reg_shift: 2, \
io_type: SERIAL_IO_MEM, \
irq: IRQ_FFUART, \
flags: STD_COM_FLAGS, \
}, { \
type: PORT_PXA, \
xmit_fifo_size: 64, \
baud_base: BAUD_BASE, \
iomem_base: &STUART, \
iomem_reg_shift: 2, \
io_type: SERIAL_IO_MEM, \
irq: IRQ_STUART, \
flags: STD_COM_FLAGS, \
}, { \
type: PORT_PXA, \
xmit_fifo_size: 64, \
baud_base: BAUD_BASE, \
iomem_base: &BTUART, \
iomem_reg_shift: 2, \
io_type: SERIAL_IO_MEM, \
irq: IRQ_BTUART, \
flags: STD_COM_FLAGS, \
}
#define EXTRA_SERIAL_PORT_DEFNS
/*
* linux/include/asm-arm/arch-rpc/serial.h
*
* Copyright (C) 1996 Russell King.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Changelog:
* 15-10-1996 RMK Created
*/
#ifndef __ASM_ARCH_SERIAL_H
#define __ASM_ARCH_SERIAL_H
/*
* This assumes you have a 1.8432 MHz clock for your UART.
*
* It'd be nice if someone built a serial card with a 24.576 MHz
* clock, since the 16550A is capable of handling a top speed of 1.5
* megabits/second; but this requires the faster clock.
*/
#define BASE_BAUD (1843200 / 16)
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
/* UART CLK PORT IRQ FLAGS */
#define STD_SERIAL_PORT_DEFNS \
{ 0, BASE_BAUD, 0x3F8, 10, STD_COM_FLAGS }, /* ttyS0 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS1 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS2 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS3 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS4 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS5 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS6 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS7 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS8 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS9 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS10 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS11 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS12 */ \
{ 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS } /* ttyS13 */
#define EXTRA_SERIAL_PORT_DEFNS
#endif
/* linux/include/asm-arm/arch-s3c2410/serial.h
*
* (c) 2003 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
*
* S3C2410 - serial port definitions
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Changelog:
* 03-Sep-2003 BJD Created file
* 19-Mar-2004 BJD Removed serial port definitions, inserted elsewhere
*/
#ifndef __ASM_ARCH_SERIAL_H
#define __ASM_ARCH_SERIAL_H
/* Standard COM flags */
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
#define BASE_BAUD ( 1843200 / 16 )
#define STD_SERIAL_PORT_DEFNS
#define EXTRA_SERIAL_PORT_DEFNS
#endif /* __ASM_ARCH_SERIAL_H */
/*
* include/asm-arm/arch-sa1100/serial.h
* (C) 1999 Nicolas Pitre <nico@cam.org>
*
* All this is intended to be used with a 16550-like UART on the SA1100's
* PCMCIA bus. It has nothing to do with the SA1100's internal serial ports.
* This is included by serial.c -- serial_sa1100.c makes no use of it.
*/
#include <linux/config.h>
/* Standard COM flags */
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
/*
* Rather empty table...
* Hardwired serial ports should be defined here.
* PCMCIA will fill it dynamically.
*/
#ifdef CONFIG_SA1100_TRIZEPS
#define STD_SERIAL_PORT_DEFNS \
/* UART CLK PORT IRQ FLAGS */ \
{ 0, 1500000, TRIZEPS_UART5, IRQ_GPIO16, STD_COM_FLAGS }, \
{ 0, 1500000, TRIZEPS_UART6, IRQ_GPIO17, STD_COM_FLAGS }
#else
/*
* This assumes you have a 1.8432 MHz clock for your UART.
*
* It'd be nice if someone built a serial card with a 24.576 MHz
* clock, since the 16550A is capable of handling a top speed of 1.5
* megabits/second; but this requires the faster clock.
*/
#define BASE_BAUD ( 1843200 / 16 )
#define STD_SERIAL_PORT_DEFNS \
/* UART CLK PORT IRQ FLAGS */ \
{ 0, BASE_BAUD, 0, 0, STD_COM_FLAGS }, \
{ 0, BASE_BAUD, 0, 0, STD_COM_FLAGS }, \
{ 0, BASE_BAUD, 0, 0, STD_COM_FLAGS }, \
{ 0, BASE_BAUD, 0, 0, STD_COM_FLAGS }
#endif
#define EXTRA_SERIAL_PORT_DEFNS
/*
* linux/include/asm-arm/arch-ebsa110/serial.h
*
* Copyright (c) 1996,1997,1998 Russell King.
*
* Changelog:
* 15-10-1996 RMK Created
*/
#ifndef __ASM_ARCH_SERIAL_H
#define __ASM_ARCH_SERIAL_H
/*
* This assumes you have a 1.8432 MHz clock for your UART.
*
* It'd be nice if someone built a serial card with a 24.576 MHz
* clock, since the 16550A is capable of handling a top speed of 1.5
* megabits/second; but this requires the faster clock.
*/
#define BASE_BAUD (1843200 / 16)
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
/* UART CLK PORT IRQ FLAGS */
#define STD_SERIAL_PORT_DEFNS \
{ 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
{ 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */
#define EXTRA_SERIAL_PORT_DEFNS
#endif
/*
* linux/include/asm-arm/arch-versatile/serial.h
*
* Copyright (C) 2003 ARM Limited
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_SERIAL_H
#define __ASM_ARCH_SERIAL_H
/*
* This assumes you have a 14.7456 MHz clock UART.
*/
#define BASE_BAUD 115200
/* UART CLK PORT IRQ FLAGS */
#define STD_SERIAL_PORT_DEFNS \
{ 0, BASE_BAUD, 0, 0, ASYNC_SKIP_TEST }, /* ttyS0 */ \
{ 0, BASE_BAUD, 0, 0, ASYNC_SKIP_TEST }, /* ttyS1 */ \
{ 0, BASE_BAUD, 0, 0, ASYNC_SKIP_TEST }, /* ttyS2 */ \
{ 0, BASE_BAUD, 0, 0, ASYNC_SKIP_TEST }, /* ttyS3 */
#define EXTRA_SERIAL_PORT_DEFNS
#endif
......@@ -14,10 +14,6 @@
#ifndef __ASM_SERIAL_H
#define __ASM_SERIAL_H
#include <asm/arch/serial.h>
#define SERIAL_PORT_DFNS \
STD_SERIAL_PORT_DEFNS \
EXTRA_SERIAL_PORT_DEFNS
#define BASE_BAUD (1843200 / 16)
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment