blob: bb68b4c11afdb882ee8b885c77aa3d6f7b4cc40d [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0 */
Joe Hershberger65b905b2015-03-22 17:08:59 -05002/*
3 * Copyright (c) 2015 National Instruments
4 *
5 * (C) Copyright 2015
6 * Joe Hershberger <joe.hershberger@ni.com>
Joe Hershberger65b905b2015-03-22 17:08:59 -05007 */
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
Tom Rinia4a8ea92023-12-14 13:16:57 -050016#include <linux/types.h>
17
Joe Hershberger65b905b2015-03-22 17:08:59 -050018static inline void *map_sysmem(phys_addr_t paddr, unsigned long len)
19{
20 return (void *)(uintptr_t)paddr;
21}
22
23static inline void unmap_sysmem(const void *vaddr)
24{
25}
26
27static inline phys_addr_t map_to_sysmem(const void *ptr)
28{
29 return (phys_addr_t)(uintptr_t)ptr;
30}
31# endif
32
33#endif /* __MAPMEM_H */