aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-tcc8k/io.c
blob: 9b39d7fa658fd19d7708c46b0d4e4501f0228d33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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
59
60
61
62
/*
 * linux/arch/arm/mach-tcc8k/io.c
 *
 * (C) 2009 Hans J. Koch <hjk@linutronix.de>
 *
 * derived from TCC83xx io.c
 * Copyright (C) Telechips, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>

#include <asm/mach/map.h>

#include <mach/tcc8k-regs.h>

/*
 * The machine specific code may provide the extra mapping besides the
 * default mapping provided here.
 */
static struct map_desc tcc8k_io_desc[] __initdata = {
	{
		.virtual	= (unsigned long)CS1_BASE_VIRT,
		.pfn		= __phys_to_pfn(CS1_BASE),
		.length		= CS1_SIZE,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)AHB_PERI_BASE_VIRT,
		.pfn		= __phys_to_pfn(AHB_PERI_BASE),
		.length		= AHB_PERI_SIZE,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)APB0_PERI_BASE_VIRT,
		.pfn		= __phys_to_pfn(APB0_PERI_BASE),
		.length		= APB0_PERI_SIZE,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)APB1_PERI_BASE_VIRT,
		.pfn		= __phys_to_pfn(APB1_PERI_BASE),
		.length		= APB1_PERI_SIZE,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)EXT_MEM_CTRL_BASE_VIRT,
		.pfn		= __phys_to_pfn(EXT_MEM_CTRL_BASE),
		.length		= EXT_MEM_CTRL_SIZE,
		.type		= MT_DEVICE,
	},
};

/*
 * Maps common IO regions for tcc8k.
 *
 */
void __init tcc8k_map_common_io(void)
{
	iotable_init(tcc8k_io_desc, ARRAY_SIZE(tcc8k_io_desc));
}