blob: 895fcb872f6a375876fdd05c5fe73714871fbc00 [file] [log] [blame]
Simon Glass744d9852011-10-10 08:22:14 +00001/*
2 * Copyright (c) 2011 The Chromium OS Authors.
3 *
Wolfgang Denk3765b3e2013-10-07 13:07:26 +02004 * SPDX-License-Identifier: GPL-2.0+
Simon Glass744d9852011-10-10 08:22:14 +00005 */
6
Simon Glassa733b062013-04-26 02:53:43 +00007#ifndef __SANDBOX_ASM_IO_H
8#define __SANDBOX_ASM_IO_H
9
Simon Glass744d9852011-10-10 08:22:14 +000010/*
11 * Given a physical address and a length, return a virtual address
12 * that can be used to access the memory range with the caching
13 * properties specified by "flags".
14 */
15#define MAP_NOCACHE (0)
16#define MAP_WRCOMBINE (0)
17#define MAP_WRBACK (0)
18#define MAP_WRTHROUGH (0)
19
20void *map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags);
21
22/*
23 * Take down a mapping set up by map_physmem().
24 */
25static inline void unmap_physmem(void *vaddr, unsigned long flags)
26{
27
28}
Simon Glass4213fc22013-02-24 17:33:14 +000029
30/* For sandbox, we want addresses to point into our RAM buffer */
31static inline void *map_sysmem(phys_addr_t paddr, unsigned long len)
32{
33 return map_physmem(paddr, len, MAP_WRBACK);
34}
35
36static inline void unmap_sysmem(const void *vaddr)
37{
38}
Simon Glass781adb52013-04-20 08:42:37 +000039
40/* Map from a pointer to our RAM buffer */
Simon Glassed072b92013-11-07 09:31:58 -070041phys_addr_t map_to_sysmem(const void *ptr);
Simon Glassa733b062013-04-26 02:53:43 +000042
Simon Glass42d3b292014-06-11 23:29:43 -060043/* Define nops for sandbox I/O access */
44#define readb(addr) 0
45#define readw(addr) 0
46#define readl(addr) 0
47#define writeb(v, addr)
48#define writew(v, addr)
49#define writel(v, addr)
50
51#include <iotrace.h>
52
Simon Glassa733b062013-04-26 02:53:43 +000053#endif