edb7211.c 2.7 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5 6 7 8
/*
 *  Copyright (C) 2000, 2001 Blue Mug, Inc.  All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 */
9

L
Linus Torvalds 已提交
10
#include <linux/init.h>
11
#include <linux/memblock.h>
L
Linus Torvalds 已提交
12
#include <linux/types.h>
13 14
#include <linux/interrupt.h>
#include <linux/platform_device.h>
L
Linus Torvalds 已提交
15 16

#include <asm/setup.h>
17
#include <asm/mach/map.h>
L
Linus Torvalds 已提交
18
#include <asm/mach/arch.h>
19 20 21
#include <asm/mach-types.h>

#include <mach/hardware.h>
L
Linus Torvalds 已提交
22 23 24

#include "common.h"

25 26 27 28 29 30 31 32 33
#define VIDEORAM_SIZE		SZ_128K

#define EDB7211_CS8900_BASE	(CS2_PHYS_BASE + 0x300)
#define EDB7211_CS8900_IRQ	(IRQ_EINT3)

static struct resource edb7211_cs8900_resource[] __initdata = {
	DEFINE_RES_MEM(EDB7211_CS8900_BASE, SZ_1K),
	DEFINE_RES_IRQ(EDB7211_CS8900_IRQ),
};
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58

static struct map_desc edb7211_io_desc[] __initdata = {
	{	/* Memory-mapped extra keyboard row */
		.virtual	= IO_ADDRESS(EP7211_PHYS_EXTKBD),
		.pfn		= __phys_to_pfn(EP7211_PHYS_EXTKBD),
		.length		= SZ_1M,
		.type		= MT_DEVICE,
	}, {	/* Flash bank 0 */
		.virtual	= IO_ADDRESS(EP7211_PHYS_FLASH1),
		.pfn		= __phys_to_pfn(EP7211_PHYS_FLASH1),
		.length		= SZ_8M,
		.type		= MT_DEVICE,
	}, {	/* Flash bank 1 */
		.virtual	= IO_ADDRESS(EP7211_PHYS_FLASH2),
		.pfn		= __phys_to_pfn(EP7211_PHYS_FLASH2),
		.length		= SZ_8M,
		.type		= MT_DEVICE,
	},
};

void __init edb7211_map_io(void)
{
	clps711x_map_io();
	iotable_init(edb7211_io_desc, ARRAY_SIZE(edb7211_io_desc));
}
L
Linus Torvalds 已提交
59

60 61 62
/* Reserve screen memory region at the start of main system memory. */
static void __init edb7211_reserve(void)
{
63
	memblock_reserve(PHYS_OFFSET, VIDEORAM_SIZE);
64 65
}

L
Linus Torvalds 已提交
66
static void __init
67
fixup_edb7211(struct tag *tags, char **cmdline, struct meminfo *mi)
L
Linus Torvalds 已提交
68 69 70 71 72 73 74 75 76 77
{
	/*
	 * Bank start addresses are not present in the information
	 * passed in from the boot loader.  We could potentially
	 * detect them, but instead we hard-code them.
	 *
	 * Banks sizes _are_ present in the param block, but we're
	 * not using that information yet.
	 */
	mi->bank[0].start = 0xc0000000;
78
	mi->bank[0].size = SZ_8M;
L
Linus Torvalds 已提交
79
	mi->bank[1].start = 0xc1000000;
80
	mi->bank[1].size = SZ_8M;
L
Linus Torvalds 已提交
81 82 83
	mi->nr_banks = 2;
}

84 85 86 87 88 89
static void __init edb7211_init(void)
{
	platform_device_register_simple("cs89x0", 0, edb7211_cs8900_resource,
					ARRAY_SIZE(edb7211_cs8900_resource));
}

L
Linus Torvalds 已提交
90
MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
91
	/* Maintainer: Jon McClintock */
92
	.atag_offset	= VIDEORAM_SIZE + 0x100,
93
	.fixup		= fixup_edb7211,
94
	.reserve	= edb7211_reserve,
95
	.map_io		= edb7211_map_io,
96
	.init_irq	= clps711x_init_irq,
L
Linus Torvalds 已提交
97
	.timer		= &clps711x_timer,
98
	.init_machine	= edb7211_init,
99
	.restart	= clps711x_restart,
L
Linus Torvalds 已提交
100
MACHINE_END