2005-04-16 15:20:36 -07:00
|
|
|
/*
|
|
|
|
* linux/arch/arm/mach-shark/arch.c
|
|
|
|
*
|
|
|
|
* Architecture specific stuff.
|
|
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/interrupt.h>
|
2006-07-01 14:32:37 -07:00
|
|
|
#include <linux/irq.h>
|
2005-04-16 15:20:36 -07:00
|
|
|
#include <linux/sched.h>
|
|
|
|
#include <linux/serial_8250.h>
|
|
|
|
|
|
|
|
#include <asm/setup.h>
|
|
|
|
#include <asm/mach-types.h>
|
|
|
|
#include <asm/io.h>
|
|
|
|
#include <asm/leds.h>
|
|
|
|
#include <asm/param.h>
|
|
|
|
|
|
|
|
#include <asm/mach/map.h>
|
|
|
|
#include <asm/mach/arch.h>
|
|
|
|
#include <asm/mach/time.h>
|
|
|
|
|
|
|
|
static struct plat_serial8250_port serial_platform_data[] = {
|
|
|
|
{
|
|
|
|
.iobase = 0x3f8,
|
|
|
|
.irq = 4,
|
|
|
|
.uartclk = 1843200,
|
2005-07-16 09:17:18 -07:00
|
|
|
.regshift = 0,
|
2005-04-16 15:20:36 -07:00
|
|
|
.iotype = UPIO_PORT,
|
|
|
|
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.iobase = 0x2f8,
|
|
|
|
.irq = 3,
|
|
|
|
.uartclk = 1843200,
|
2005-07-16 09:17:18 -07:00
|
|
|
.regshift = 0,
|
2005-04-16 15:20:36 -07:00
|
|
|
.iotype = UPIO_PORT,
|
|
|
|
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
|
|
|
|
},
|
|
|
|
{ },
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_device serial_device = {
|
|
|
|
.name = "serial8250",
|
2005-09-08 08:04:41 -07:00
|
|
|
.id = PLAT8250_DEV_PLATFORM,
|
2005-04-16 15:20:36 -07:00
|
|
|
.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 = {
|
2005-10-28 07:19:03 -07:00
|
|
|
{
|
|
|
|
.virtual = IO_BASE,
|
|
|
|
.pfn = __phys_to_pfn(IO_START),
|
|
|
|
.length = IO_SIZE,
|
|
|
|
.type = MT_DEVICE
|
|
|
|
}
|
2005-04-16 15:20:36 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
static void __init shark_map_io(void)
|
|
|
|
{
|
|
|
|
iotable_init(shark_io_desc, ARRAY_SIZE(shark_io_desc));
|
|
|
|
}
|
|
|
|
|
|
|
|
#define IRQ_TIMER 0
|
|
|
|
#define HZ_TIME ((1193180 + HZ/2) / HZ)
|
|
|
|
|
|
|
|
static irqreturn_t
|
2006-10-06 10:53:39 -07:00
|
|
|
shark_timer_interrupt(int irq, void *dev_id)
|
2005-04-16 15:20:36 -07:00
|
|
|
{
|
2006-10-06 10:53:39 -07:00
|
|
|
timer_tick();
|
2005-04-16 15:20:36 -07:00
|
|
|
return IRQ_HANDLED;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct irqaction shark_timer_irq = {
|
|
|
|
.name = "Shark Timer Tick",
|
2007-05-08 00:35:39 -07:00
|
|
|
.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
|
2005-06-26 09:06:36 -07:00
|
|
|
.handler = shark_timer_interrupt,
|
2005-04-16 15:20:36 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Set up timer interrupt, and return the current time in seconds.
|
|
|
|
*/
|
|
|
|
static void __init shark_timer_init(void)
|
|
|
|
{
|
|
|
|
outb(0x34, 0x43); /* binary, mode 0, LSB/MSB, Ch 0 */
|
|
|
|
outb(HZ_TIME & 0xff, 0x40); /* LSB of count */
|
|
|
|
outb(HZ_TIME >> 8, 0x40);
|
|
|
|
|
|
|
|
setup_irq(IRQ_TIMER, &shark_timer_irq);
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct sys_timer shark_timer = {
|
|
|
|
.init = shark_timer_init,
|
|
|
|
};
|
|
|
|
|
|
|
|
MACHINE_START(SHARK, "Shark")
|
2005-07-03 09:38:58 -07:00
|
|
|
/* Maintainer: Alexander Schulz */
|
|
|
|
.phys_io = 0x40000000,
|
|
|
|
.io_pg_offst = ((0xe0000000) >> 18) & 0xfffc,
|
|
|
|
.boot_params = 0x08003000,
|
|
|
|
.map_io = shark_map_io,
|
|
|
|
.init_irq = shark_init_irq,
|
2005-04-16 15:20:36 -07:00
|
|
|
.timer = &shark_timer,
|
|
|
|
MACHINE_END
|