blob: 59dec3bd07053c78da7a16f49f0333ef2888ca45 [file] [log] [blame]
Alexander Shiyan2a552892012-10-10 19:45:33 +04001/*
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 Shiyan200daa32012-11-17 17:57:07 +040013#include <linux/interrupt.h>
14#include <linux/platform_device.h>
Alexander Shiyan2a552892012-10-10 19:45:33 +040015
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 Shiyan200daa32012-11-17 17:57:07 +040025#define VIDEORAM_SIZE SZ_128K
26
27#define EDB7211_CS8900_BASE (CS2_PHYS_BASE + 0x300)
28#define EDB7211_CS8900_IRQ (IRQ_EINT3)
29
30static struct resource edb7211_cs8900_resource[] __initdata = {
31 DEFINE_RES_MEM(EDB7211_CS8900_BASE, SZ_1K),
32 DEFINE_RES_IRQ(EDB7211_CS8900_IRQ),
33};
Alexander Shiyan2a552892012-10-10 19:45:33 +040034
35static 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 Shiyan2a552892012-10-10 19:45:33 +040041 }, { /* 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
54void __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. */
61static void __init edb7211_reserve(void)
62{
63 memblock_reserve(PHYS_OFFSET, VIDEORAM_SIZE);
64}
65
66static void __init
67fixup_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 Shiyan200daa32012-11-17 17:57:07 +040084static void __init edb7211_init(void)
85{
Alexander Shiyandd850f12012-11-17 17:57:09 +040086 platform_device_register_simple("video-clps711x", 0, NULL, 0);
Alexander Shiyan200daa32012-11-17 17:57:07 +040087 platform_device_register_simple("cs89x0", 0, edb7211_cs8900_resource,
88 ARRAY_SIZE(edb7211_cs8900_resource));
89}
90
Alexander Shiyan2a552892012-10-10 19:45:33 +040091MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
92 /* Maintainer: Jon McClintock */
93 .atag_offset = VIDEORAM_SIZE + 0x100,
94 .fixup = fixup_edb7211,
Alexander Shiyan2a552892012-10-10 19:45:33 +040095 .reserve = edb7211_reserve,
Alexander Shiyan200daa32012-11-17 17:57:07 +040096 .map_io = edb7211_map_io,
Alexander Shiyan2a552892012-10-10 19:45:33 +040097 .init_irq = clps711x_init_irq,
98 .timer = &clps711x_timer,
Alexander Shiyan200daa32012-11-17 17:57:07 +040099 .init_machine = edb7211_init,
Alexander Shiyan2a552892012-10-10 19:45:33 +0400100 .restart = clps711x_restart,
101MACHINE_END