2005-04-17 00:20:36 +02:00
|
|
|
/*
|
|
|
|
* 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>
|
2009-12-24 13:52:44 +01:00
|
|
|
#include <asm/hardware/dec21285.h>
|
|
|
|
|
|
|
|
#include "common.h"
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2007-09-30 18:39:05 +02:00
|
|
|
static struct resource rtc_resources[] = {
|
|
|
|
[0] = {
|
|
|
|
.start = 0x70,
|
|
|
|
.end = 0x73,
|
|
|
|
.flags = IORESOURCE_IO,
|
|
|
|
},
|
|
|
|
[1] = {
|
|
|
|
.start = IRQ_ISA_RTC_ALARM,
|
|
|
|
.end = IRQ_ISA_RTC_ALARM,
|
|
|
|
.flags = IORESOURCE_IRQ,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_device rtc_device = {
|
|
|
|
.name = "rtc_cmos",
|
|
|
|
.id = -1,
|
|
|
|
.resource = rtc_resources,
|
|
|
|
.num_resources = ARRAY_SIZE(rtc_resources),
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct resource serial_resources[] = {
|
|
|
|
[0] = {
|
|
|
|
.start = 0x3f8,
|
|
|
|
.end = 0x3ff,
|
|
|
|
.flags = IORESOURCE_IO,
|
|
|
|
},
|
|
|
|
[1] = {
|
|
|
|
.start = 0x2f8,
|
|
|
|
.end = 0x2ff,
|
|
|
|
.flags = IORESOURCE_IO,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
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",
|
2005-09-08 17:04:41 +02:00
|
|
|
.id = PLAT8250_DEV_PLATFORM,
|
2005-04-17 00:20:36 +02:00
|
|
|
.dev = {
|
|
|
|
.platform_data = serial_platform_data,
|
|
|
|
},
|
2007-09-30 18:39:05 +02:00
|
|
|
.resource = serial_resources,
|
|
|
|
.num_resources = ARRAY_SIZE(serial_resources),
|
2005-04-17 00:20:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
static int __init footbridge_isa_init(void)
|
|
|
|
{
|
2009-12-24 13:52:44 +01:00
|
|
|
int err = 0;
|
2007-09-30 18:39:05 +02:00
|
|
|
|
2009-12-24 13:52:44 +01:00
|
|
|
if (!footbridge_cfn_mode())
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* Personal server doesn't have RTC */
|
|
|
|
if (!machine_is_personal_server()) {
|
|
|
|
isa_rtc_init();
|
|
|
|
err = platform_device_register(&rtc_device);
|
|
|
|
if (err)
|
|
|
|
printk(KERN_ERR "Unable to register RTC device: %d\n", err);
|
|
|
|
}
|
2007-09-30 18:39:05 +02:00
|
|
|
err = platform_device_register(&serial_device);
|
|
|
|
if (err)
|
|
|
|
printk(KERN_ERR "Unable to register serial device: %d\n", err);
|
|
|
|
return 0;
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
arch_initcall(footbridge_isa_init);
|