Commit | Line | Data |
---|---|---|
1da177e4 | 1 | /* |
1da177e4 LT |
2 | * Copyright (C) 2000, 2001 Blue Mug, Inc. All Rights Reserved. |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation; either version 2 of the License, or | |
7 | * (at your option) any later version. | |
1da177e4 | 8 | */ |
2a552891 | 9 | |
1da177e4 | 10 | #include <linux/init.h> |
8d717a52 | 11 | #include <linux/memblock.h> |
1da177e4 | 12 | #include <linux/types.h> |
200daa36 AS |
13 | #include <linux/interrupt.h> |
14 | #include <linux/platform_device.h> | |
1da177e4 LT |
15 | |
16 | #include <asm/setup.h> | |
2a552891 | 17 | #include <asm/mach/map.h> |
1da177e4 | 18 | #include <asm/mach/arch.h> |
2a552891 AS |
19 | #include <asm/mach-types.h> |
20 | ||
21 | #include <mach/hardware.h> | |
1da177e4 LT |
22 | |
23 | #include "common.h" | |
24 | ||
200daa36 AS |
25 | #define VIDEORAM_SIZE SZ_128K |
26 | ||
27 | #define EDB7211_CS8900_BASE (CS2_PHYS_BASE + 0x300) | |
28 | #define EDB7211_CS8900_IRQ (IRQ_EINT3) | |
29 | ||
30 | static struct resource edb7211_cs8900_resource[] __initdata = { | |
31 | DEFINE_RES_MEM(EDB7211_CS8900_BASE, SZ_1K), | |
32 | DEFINE_RES_IRQ(EDB7211_CS8900_IRQ), | |
33 | }; | |
2a552891 AS |
34 | |
35 | static struct map_desc edb7211_io_desc[] __initdata = { | |
36 | { /* Memory-mapped extra keyboard row */ | |
37 | .virtual = IO_ADDRESS(EP7211_PHYS_EXTKBD), | |
38 | .pfn = __phys_to_pfn(EP7211_PHYS_EXTKBD), | |
39 | .length = SZ_1M, | |
40 | .type = MT_DEVICE, | |
2a552891 AS |
41 | }, { /* Flash bank 0 */ |
42 | .virtual = IO_ADDRESS(EP7211_PHYS_FLASH1), | |
43 | .pfn = __phys_to_pfn(EP7211_PHYS_FLASH1), | |
44 | .length = SZ_8M, | |
45 | .type = MT_DEVICE, | |
46 | }, { /* Flash bank 1 */ | |
47 | .virtual = IO_ADDRESS(EP7211_PHYS_FLASH2), | |
48 | .pfn = __phys_to_pfn(EP7211_PHYS_FLASH2), | |
49 | .length = SZ_8M, | |
50 | .type = MT_DEVICE, | |
51 | }, | |
52 | }; | |
53 | ||
54 | void __init edb7211_map_io(void) | |
55 | { | |
56 | clps711x_map_io(); | |
57 | iotable_init(edb7211_io_desc, ARRAY_SIZE(edb7211_io_desc)); | |
58 | } | |
1da177e4 | 59 | |
98c672cf RK |
60 | /* Reserve screen memory region at the start of main system memory. */ |
61 | static void __init edb7211_reserve(void) | |
62 | { | |
2a552891 | 63 | memblock_reserve(PHYS_OFFSET, VIDEORAM_SIZE); |
98c672cf RK |
64 | } |
65 | ||
1da177e4 | 66 | static void __init |
0744a3ee | 67 | fixup_edb7211(struct tag *tags, char **cmdline, struct meminfo *mi) |
1da177e4 LT |
68 | { |
69 | /* | |
70 | * Bank start addresses are not present in the information | |
71 | * passed in from the boot loader. We could potentially | |
72 | * detect them, but instead we hard-code them. | |
73 | * | |
74 | * Banks sizes _are_ present in the param block, but we're | |
75 | * not using that information yet. | |
76 | */ | |
77 | mi->bank[0].start = 0xc0000000; | |
2a552891 | 78 | mi->bank[0].size = SZ_8M; |
1da177e4 | 79 | mi->bank[1].start = 0xc1000000; |
2a552891 | 80 | mi->bank[1].size = SZ_8M; |
1da177e4 LT |
81 | mi->nr_banks = 2; |
82 | } | |
83 | ||
200daa36 AS |
84 | static void __init edb7211_init(void) |
85 | { | |
dd850f12 | 86 | platform_device_register_simple("video-clps711x", 0, NULL, 0); |
200daa36 AS |
87 | platform_device_register_simple("cs89x0", 0, edb7211_cs8900_resource, |
88 | ARRAY_SIZE(edb7211_cs8900_resource)); | |
89 | } | |
90 | ||
1da177e4 | 91 | MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)") |
e9dea0c6 | 92 | /* Maintainer: Jon McClintock */ |
2a552891 | 93 | .atag_offset = VIDEORAM_SIZE + 0x100, |
e9dea0c6 | 94 | .fixup = fixup_edb7211, |
98c672cf | 95 | .reserve = edb7211_reserve, |
200daa36 | 96 | .map_io = edb7211_map_io, |
e9dea0c6 | 97 | .init_irq = clps711x_init_irq, |
1da177e4 | 98 | .timer = &clps711x_timer, |
200daa36 | 99 | .init_machine = edb7211_init, |
6c000712 | 100 | .restart = clps711x_restart, |
1da177e4 | 101 | MACHINE_END |