Thomas Gleixner | 9c92ab6 | 2019-05-29 07:17:56 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Erik Gilling | c5f8006 | 2010-01-21 16:53:02 -0800 | [diff] [blame] | 2 | /* |
| 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 Gilling | c5f8006 | 2010-01-21 16:53:02 -0800 | [diff] [blame] | 10 | */ |
| 11 | |
Erik Gilling | c5f8006 | 2010-01-21 16:53:02 -0800 | [diff] [blame] | 12 | #include <linux/init.h> |
Erik Gilling | c5f8006 | 2010-01-21 16:53:02 -0800 | [diff] [blame] | 13 | #include <linux/io.h> |
Thierry Reding | a0524ac | 2014-07-11 09:44:49 +0200 | [diff] [blame] | 14 | #include <linux/kernel.h> |
| 15 | #include <linux/mm.h> |
| 16 | #include <linux/module.h> |
Erik Gilling | c5f8006 | 2010-01-21 16:53:02 -0800 | [diff] [blame] | 17 | |
Erik Gilling | c5f8006 | 2010-01-21 16:53:02 -0800 | [diff] [blame] | 18 | #include <asm/mach/map.h> |
Thierry Reding | a0524ac | 2014-07-11 09:44:49 +0200 | [diff] [blame] | 19 | #include <asm/page.h> |
Erik Gilling | c5f8006 | 2010-01-21 16:53:02 -0800 | [diff] [blame] | 20 | |
| 21 | #include "board.h" |
Stephen Warren | 2be39c0 | 2012-10-04 14:24:09 -0600 | [diff] [blame] | 22 | #include "iomap.h" |
Erik Gilling | c5f8006 | 2010-01-21 16:53:02 -0800 | [diff] [blame] | 23 | |
| 24 | static struct map_desc tegra_io_desc[] __initdata = { |
| 25 | { |
Olof Johansson | e748b73 | 2011-10-09 21:05:44 -0700 | [diff] [blame] | 26 | .virtual = (unsigned long)IO_PPSB_VIRT, |
Erik Gilling | c5f8006 | 2010-01-21 16:53:02 -0800 | [diff] [blame] | 27 | .pfn = __phys_to_pfn(IO_PPSB_PHYS), |
| 28 | .length = IO_PPSB_SIZE, |
| 29 | .type = MT_DEVICE, |
| 30 | }, |
| 31 | { |
Olof Johansson | e748b73 | 2011-10-09 21:05:44 -0700 | [diff] [blame] | 32 | .virtual = (unsigned long)IO_APB_VIRT, |
Erik Gilling | c5f8006 | 2010-01-21 16:53:02 -0800 | [diff] [blame] | 33 | .pfn = __phys_to_pfn(IO_APB_PHYS), |
| 34 | .length = IO_APB_SIZE, |
| 35 | .type = MT_DEVICE, |
| 36 | }, |
| 37 | { |
Olof Johansson | e748b73 | 2011-10-09 21:05:44 -0700 | [diff] [blame] | 38 | .virtual = (unsigned long)IO_CPU_VIRT, |
Erik Gilling | c5f8006 | 2010-01-21 16:53:02 -0800 | [diff] [blame] | 39 | .pfn = __phys_to_pfn(IO_CPU_PHYS), |
| 40 | .length = IO_CPU_SIZE, |
| 41 | .type = MT_DEVICE, |
| 42 | }, |
Colin Cross | c231d69 | 2010-07-27 21:34:38 -0700 | [diff] [blame] | 43 | { |
Olof Johansson | e748b73 | 2011-10-09 21:05:44 -0700 | [diff] [blame] | 44 | .virtual = (unsigned long)IO_IRAM_VIRT, |
Colin Cross | c231d69 | 2010-07-27 21:34:38 -0700 | [diff] [blame] | 45 | .pfn = __phys_to_pfn(IO_IRAM_PHYS), |
| 46 | .length = IO_IRAM_SIZE, |
| 47 | .type = MT_DEVICE, |
| 48 | }, |
Erik Gilling | c5f8006 | 2010-01-21 16:53:02 -0800 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | void __init tegra_map_common_io(void) |
| 52 | { |
Stephen Warren | 7a28106 | 2012-10-19 12:27:58 -0600 | [diff] [blame] | 53 | debug_ll_io_init(); |
Erik Gilling | c5f8006 | 2010-01-21 16:53:02 -0800 | [diff] [blame] | 54 | iotable_init(tegra_io_desc, ARRAY_SIZE(tegra_io_desc)); |
| 55 | } |