Commit 99d55c05 authored by Ben Dooks's avatar Ben Dooks Committed by Russell King

[ARM PATCH] 2235/1: S3C2410 - new serial driver - core updates (2/4)

Patch from Ben Dooks

Update the arch/arm/mach-s3c2410 core files for the
new serial port bits, and fix the bugs with s3c2440
handling.

Signed-off-by: Ben Dooks
Signed-off-by: Russell King
parent 47831a65
......@@ -32,8 +32,14 @@
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/arch/regs-serial.h>
#include "devs.h"
/* Serial port registrations */
struct platform_device *s3c24xx_uart_devs[3];
/* USB Host Controller */
static struct resource s3c_usb_resource[] = {
......
......@@ -16,6 +16,7 @@
* 18-Jan-2004 BJD Added serial port configuration
* 21-Aug-2004 BJD Added new struct s3c2410_board handler
* 28-Sep-2004 BJD Updates for new serial port bits
* 04-Nov-2004 BJD Updated UART configuration process
*/
#include <linux/kernel.h>
......@@ -43,10 +44,6 @@
int s3c2410_clock_tick_rate = 12*1000*1000; /* current timers at 12MHz */
/* serial port setup */
struct s3c2410_uartcfg *s3c2410_uartcfgs;
/* Initial IO mappings */
static struct map_desc s3c2410_iodesc[] __initdata = {
......@@ -141,12 +138,10 @@ void __init s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no)
struct platform_device *platdev;
int uart;
s3c2410_uartcfgs = cfg; /* compatibility */
for (uart = 0; uart < no; uart++, cfg++) {
platdev = uart_devices[cfg->hwport];
s3c2410_uart_devices[uart] = platdev;
s3c24xx_uart_devs[uart] = platdev;
platdev->dev.platform_data = cfg;
}
......@@ -199,10 +194,7 @@ void __init s3c2410_map_io(struct map_desc *mach_desc, int mach_size)
int __init s3c2410_init(void)
{
int ret;
printk("S3C2410: Initialising architecture\n");
ret = platform_add_devices(uart_devices, ARRAY_SIZE(uart_devices));
return ret;
return platform_add_devices(s3c24xx_uart_devs, s3c2410_uart_count);
}
......@@ -14,6 +14,7 @@
* 12-Oct-2004 BJD Moved clock info out to clock.c
* 01-Nov-2004 BJD Fixed clock build code
* 09-Nov-2004 BJD Added sysdev for power management
* 04-Nov-2004 BJD New serial registration
*/
#include <linux/kernel.h>
......@@ -129,6 +130,25 @@ static struct platform_device *uart_devices[] __initdata = {
&s3c_uart2
};
/* uart initialisation */
static int __initdata s3c2440_uart_count;
void __init s3c2440_init_uarts(struct s3c2410_uartcfg *cfg, int no)
{
struct platform_device *platdev;
int uart;
for (uart = 0; uart < no; uart++, cfg++) {
platdev = uart_devices[cfg->hwport];
s3c24xx_uart_devs[uart] = platdev;
platdev->dev.platform_data = cfg;
}
s3c2440_uart_count = uart;
}
/* s3c2440 specific clock sources */
static struct clk s3c2440_clk_cam = {
......@@ -259,9 +279,8 @@ int __init s3c2440_init(void)
if (ret != 0)
printk(KERN_ERR "failed to register sysdev for s3c2440\n");
if (ret != 0)
ret = platform_add_devices(uart_devices,
ARRAY_SIZE(uart_devices));
if (ret == 0)
ret = platform_add_devices(s3c24xx_uart_devs, s3c2440_uart_count);
return ret;
}
......@@ -11,8 +11,13 @@
*
* Modifications:
* 24-Aug-2004 BJD Start of S3C2440 CPU support
* 04-Nov-2004 BJD Added s3c2440_init_uarts()
*/
struct s3c2410_uartcfg;
extern void s3c2440_init_irq(void);
extern void s3c2440_init_time(void);
extern void s3c2440_init_uarts(struct s3c2410_uartcfg *cfg, int no);
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