Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Kumar Gala | 63240ba | 2008-12-13 17:20:28 -0600 | [diff] [blame] | 2 | #ifndef __ADDR_MAP_H |
| 3 | #define __ADDR_MAP_H |
| 4 | |
| 5 | /* |
| 6 | * Copyright 2008 Freescale Semiconductor, Inc. |
Kumar Gala | 63240ba | 2008-12-13 17:20:28 -0600 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #include <asm/types.h> |
| 10 | |
Bin Meng | b561563 | 2021-02-25 17:22:33 +0800 | [diff] [blame] | 11 | struct addrmap { |
| 12 | phys_addr_t paddr; |
| 13 | phys_size_t size; |
| 14 | unsigned long vaddr; |
| 15 | }; |
| 16 | |
Simon Glass | 2819961 | 2022-07-13 06:06:58 -0600 | [diff] [blame] | 17 | #ifdef CONFIG_ADDR_MAP |
Bin Meng | b561563 | 2021-02-25 17:22:33 +0800 | [diff] [blame] | 18 | extern struct addrmap address_map[CONFIG_SYS_NUM_ADDR_MAP]; |
Simon Glass | 2819961 | 2022-07-13 06:06:58 -0600 | [diff] [blame] | 19 | #endif |
Bin Meng | b561563 | 2021-02-25 17:22:33 +0800 | [diff] [blame] | 20 | |
Bin Meng | c40131a | 2021-02-25 17:22:32 +0800 | [diff] [blame] | 21 | phys_addr_t addrmap_virt_to_phys(void *vaddr); |
| 22 | void *addrmap_phys_to_virt(phys_addr_t paddr); |
| 23 | void addrmap_set_entry(unsigned long vaddr, phys_addr_t paddr, |
| 24 | phys_size_t size, int idx); |
Kumar Gala | 63240ba | 2008-12-13 17:20:28 -0600 | [diff] [blame] | 25 | |
| 26 | #endif |