Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Joe Hershberger | 65b905b | 2015-03-22 17:08:59 -0500 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2015 National Instruments |
| 4 | * |
| 5 | * (C) Copyright 2015 |
| 6 | * Joe Hershberger <joe.hershberger@ni.com> |
Joe Hershberger | 65b905b | 2015-03-22 17:08:59 -0500 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef __MAPMEM_H |
| 10 | #define __MAPMEM_H |
| 11 | |
| 12 | /* Define a null map_sysmem() if the architecture doesn't use it */ |
| 13 | # ifdef CONFIG_ARCH_MAP_SYSMEM |
| 14 | #include <asm/io.h> |
| 15 | # else |
| 16 | static inline void *map_sysmem(phys_addr_t paddr, unsigned long len) |
| 17 | { |
| 18 | return (void *)(uintptr_t)paddr; |
| 19 | } |
| 20 | |
| 21 | static inline void unmap_sysmem(const void *vaddr) |
| 22 | { |
| 23 | } |
| 24 | |
| 25 | static inline phys_addr_t map_to_sysmem(const void *ptr) |
| 26 | { |
| 27 | return (phys_addr_t)(uintptr_t)ptr; |
| 28 | } |
| 29 | # endif |
| 30 | |
| 31 | #endif /* __MAPMEM_H */ |