import of ftp.dlink.com/GPL/DSMG-600_reB/ppclinux.tar.gz
[linux-2.4.21-pre4.git] / arch / arm / mach-sa1100 / victor.c
1 /*
2  * linux/arch/arm/mach-sa1100/victor.c
3  *
4  * Author: Nicolas Pitre
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
10
11 #include <linux/init.h>
12 #include <linux/kernel.h>
13 #include <linux/delay.h>
14 #include <linux/pm.h>
15 #include <linux/tty.h>
16
17 #include <asm/hardware.h>
18 #include <asm/setup.h>
19
20 #include <asm/mach/arch.h>
21 #include <asm/mach/map.h>
22 #include <asm/mach/serial_sa1100.h>
23
24 #include "generic.h"
25
26
27 static void victor_power_off(void)
28 {
29         /* switch off power supply */
30         mdelay(2000);
31         GPCR = GPIO_GPIO23;
32         while (1);
33 }
34
35 static int __init victor_init(void)
36 {
37         pm_power_off = victor_power_off;
38         return 0;
39 }
40
41 __initcall(victor_init);
42
43
44 static void __init
45 fixup_victor(struct machine_desc *desc, struct param_struct *params,
46              char **cmdline, struct meminfo *mi)
47 {
48         SET_BANK( 0, 0xc0000000, 4*1024*1024 );
49         mi->nr_banks = 1;
50
51         ROOT_DEV = MKDEV( 60, 2 );
52
53         /* Get command line parameters passed from the loader (if any) */
54         if( *((char*)0xc0000000) )
55                 strcpy( *cmdline, ((char *)0xc0000000) );
56
57         /* power off if any problem */
58         strcat( *cmdline, " panic=1" );
59 }
60
61 static struct map_desc victor_io_desc[] __initdata = {
62  /* virtual     physical    length      domain     r  w  c  b */
63   { 0xe8000000, 0x00000000, 0x00200000, DOMAIN_IO, 0, 1, 0, 0 }, /* Flash */
64   LAST_DESC
65 };
66
67 static void __init victor_map_io(void)
68 {
69         sa1100_map_io();
70         iotable_init(victor_io_desc);
71
72         sa1100_register_uart(0, 3);
73 }
74
75 MACHINE_START(VICTOR, "VisuAide Victor")
76         BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
77         FIXUP(fixup_victor)
78         MAPIO(victor_map_io)
79         INITIRQ(sa1100_init_irq)
80 MACHINE_END