blob: afdeb32052b72d87061c1ef1d1a64a3a45018f71 [file] [log] [blame]
Thomas Gleixner9c92ab62019-05-29 07:17:56 -07001// SPDX-License-Identifier: GPL-2.0-only
Erik Gillingc5f80062010-01-21 16:53:02 -08002/*
3 * arch/arm/mach-tegra/io.c
4 *
5 * Copyright (C) 2010 Google, Inc.
6 *
7 * Author:
8 * Colin Cross <ccross@google.com>
9 * Erik Gilling <konkers@google.com>
Erik Gillingc5f80062010-01-21 16:53:02 -080010 */
11
Erik Gillingc5f80062010-01-21 16:53:02 -080012#include <linux/init.h>
Erik Gillingc5f80062010-01-21 16:53:02 -080013#include <linux/io.h>
Thierry Redinga0524ac2014-07-11 09:44:49 +020014#include <linux/kernel.h>
15#include <linux/mm.h>
16#include <linux/module.h>
Erik Gillingc5f80062010-01-21 16:53:02 -080017
Erik Gillingc5f80062010-01-21 16:53:02 -080018#include <asm/mach/map.h>
Thierry Redinga0524ac2014-07-11 09:44:49 +020019#include <asm/page.h>
Erik Gillingc5f80062010-01-21 16:53:02 -080020
21#include "board.h"
Stephen Warren2be39c02012-10-04 14:24:09 -060022#include "iomap.h"
Erik Gillingc5f80062010-01-21 16:53:02 -080023
24static struct map_desc tegra_io_desc[] __initdata = {
25 {
Olof Johanssone748b732011-10-09 21:05:44 -070026 .virtual = (unsigned long)IO_PPSB_VIRT,
Erik Gillingc5f80062010-01-21 16:53:02 -080027 .pfn = __phys_to_pfn(IO_PPSB_PHYS),
28 .length = IO_PPSB_SIZE,
29 .type = MT_DEVICE,
30 },
31 {
Olof Johanssone748b732011-10-09 21:05:44 -070032 .virtual = (unsigned long)IO_APB_VIRT,
Erik Gillingc5f80062010-01-21 16:53:02 -080033 .pfn = __phys_to_pfn(IO_APB_PHYS),
34 .length = IO_APB_SIZE,
35 .type = MT_DEVICE,
36 },
37 {
Olof Johanssone748b732011-10-09 21:05:44 -070038 .virtual = (unsigned long)IO_CPU_VIRT,
Erik Gillingc5f80062010-01-21 16:53:02 -080039 .pfn = __phys_to_pfn(IO_CPU_PHYS),
40 .length = IO_CPU_SIZE,
41 .type = MT_DEVICE,
42 },
Colin Crossc231d692010-07-27 21:34:38 -070043 {
Olof Johanssone748b732011-10-09 21:05:44 -070044 .virtual = (unsigned long)IO_IRAM_VIRT,
Colin Crossc231d692010-07-27 21:34:38 -070045 .pfn = __phys_to_pfn(IO_IRAM_PHYS),
46 .length = IO_IRAM_SIZE,
47 .type = MT_DEVICE,
48 },
Erik Gillingc5f80062010-01-21 16:53:02 -080049};
50
51void __init tegra_map_common_io(void)
52{
Stephen Warren7a281062012-10-19 12:27:58 -060053 debug_ll_io_init();
Erik Gillingc5f80062010-01-21 16:53:02 -080054 iotable_init(tegra_io_desc, ARRAY_SIZE(tegra_io_desc));
55}