Alexander Shiyan | 2a55289 | 2012-10-10 19:45:33 +0400 | [diff] [blame] | 1 | /* |
| 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. |
| 8 | */ |
| 9 | |
| 10 | #include <linux/init.h> |
| 11 | #include <linux/memblock.h> |
| 12 | #include <linux/types.h> |
Alexander Shiyan | 200daa3 | 2012-11-17 17:57:07 +0400 | [diff] [blame] | 13 | #include <linux/interrupt.h> |
| 14 | #include <linux/platform_device.h> |
Alexander Shiyan | 2a55289 | 2012-10-10 19:45:33 +0400 | [diff] [blame] | 15 | |
| 16 | #include <asm/setup.h> |
| 17 | #include <asm/mach/map.h> |
| 18 | #include <asm/mach/arch.h> |
| 19 | #include <asm/mach-types.h> |
| 20 | |
| 21 | #include <mach/hardware.h> |
| 22 | |
| 23 | #include "common.h" |
| 24 | |
Alexander Shiyan | 200daa3 | 2012-11-17 17:57:07 +0400 | [diff] [blame] | 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 | }; |
Alexander Shiyan | 2a55289 | 2012-10-10 19:45:33 +0400 | [diff] [blame] | 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, |
Alexander Shiyan | 2a55289 | 2012-10-10 19:45:33 +0400 | [diff] [blame] | 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 | } |
| 59 | |
| 60 | /* Reserve screen memory region at the start of main system memory. */ |
| 61 | static void __init edb7211_reserve(void) |
| 62 | { |
| 63 | memblock_reserve(PHYS_OFFSET, VIDEORAM_SIZE); |
| 64 | } |
| 65 | |
| 66 | static void __init |
| 67 | fixup_edb7211(struct tag *tags, char **cmdline, struct meminfo *mi) |
| 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; |
| 78 | mi->bank[0].size = SZ_8M; |
| 79 | mi->bank[1].start = 0xc1000000; |
| 80 | mi->bank[1].size = SZ_8M; |
| 81 | mi->nr_banks = 2; |
| 82 | } |
| 83 | |
Alexander Shiyan | 200daa3 | 2012-11-17 17:57:07 +0400 | [diff] [blame] | 84 | static void __init edb7211_init(void) |
| 85 | { |
Alexander Shiyan | dd850f1 | 2012-11-17 17:57:09 +0400 | [diff] [blame^] | 86 | platform_device_register_simple("video-clps711x", 0, NULL, 0); |
Alexander Shiyan | 200daa3 | 2012-11-17 17:57:07 +0400 | [diff] [blame] | 87 | platform_device_register_simple("cs89x0", 0, edb7211_cs8900_resource, |
| 88 | ARRAY_SIZE(edb7211_cs8900_resource)); |
| 89 | } |
| 90 | |
Alexander Shiyan | 2a55289 | 2012-10-10 19:45:33 +0400 | [diff] [blame] | 91 | MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)") |
| 92 | /* Maintainer: Jon McClintock */ |
| 93 | .atag_offset = VIDEORAM_SIZE + 0x100, |
| 94 | .fixup = fixup_edb7211, |
Alexander Shiyan | 2a55289 | 2012-10-10 19:45:33 +0400 | [diff] [blame] | 95 | .reserve = edb7211_reserve, |
Alexander Shiyan | 200daa3 | 2012-11-17 17:57:07 +0400 | [diff] [blame] | 96 | .map_io = edb7211_map_io, |
Alexander Shiyan | 2a55289 | 2012-10-10 19:45:33 +0400 | [diff] [blame] | 97 | .init_irq = clps711x_init_irq, |
| 98 | .timer = &clps711x_timer, |
Alexander Shiyan | 200daa3 | 2012-11-17 17:57:07 +0400 | [diff] [blame] | 99 | .init_machine = edb7211_init, |
Alexander Shiyan | 2a55289 | 2012-10-10 19:45:33 +0400 | [diff] [blame] | 100 | .restart = clps711x_restart, |
| 101 | MACHINE_END |