import of upstream 2.4.34.4 from kernel.org
[linux-2.4.git] / arch / arm / mach-sa1100 / pleb.c
1 /*
2  * linux/arch/arm/mach-sa1100/pleb.c
3  */
4
5 #include <linux/init.h>
6 #include <linux/kernel.h>
7 #include <linux/tty.h>
8
9 #include <asm/hardware.h>
10 #include <asm/setup.h>
11
12 #include <asm/mach/arch.h>
13 #include <asm/mach/map.h>
14 #include <asm/mach/serial_sa1100.h>
15
16 #include "generic.h"
17
18 static void __init
19 fixup_pleb(struct machine_desc *desc, struct param_struct *params,
20            char **cmdline, struct meminfo *mi)
21 {
22         SET_BANK(0, 0xc0000000, 16*1024*1024);
23         SET_BANK(1, 0xc8000000, 16*1024*1024);
24         SET_BANK(2, 0xd0000000, 16*1024*1024);
25         SET_BANK(3, 0xd8000000, 16*1024*1024);
26
27         /* make this 4 a second memory card is used to make 64MB */
28         /* make it 1 if a 16MB memory card is used */
29         mi->nr_banks = 2; /* Default 32MB */
30
31         ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
32         setup_ramdisk(1, 0, 0, 8192);
33         setup_initrd(0xc0400000, 4*1024*1024);
34 }
35
36 static struct map_desc pleb_io_desc[] __initdata = {
37  /* virtual     physical    length      domain     r  w  c  b */
38   { 0xe8000000, 0x00000000, 0x00400000, DOMAIN_IO, 0, 1, 0, 0 }, /* main flash memory */
39   { 0xe8400000, 0x08000000, 0x00400000, DOMAIN_IO, 0, 1, 0, 0 }, /* main flash, alternative location */
40   LAST_DESC
41 };
42
43 static void __init pleb_map_io(void)
44 {
45         sa1100_map_io();
46         iotable_init(pleb_io_desc);
47
48         sa1100_register_uart(0, 3);
49         sa1100_register_uart(1, 1);
50         GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD);
51         GPDR |= GPIO_UART_TXD;
52         GPDR &= ~GPIO_UART_RXD;
53         PPAR |= PPAR_UPR;
54 }
55
56 MACHINE_START(PLEB, "PLEB")
57         BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
58         FIXUP(fixup_pleb)
59         MAPIO(pleb_map_io)
60         INITIRQ(sa1100_init_irq)
61 MACHINE_END