blob: 265a099cd3b83dce18e24a36e37d6038e25fc7d0 [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __LINUX_GOLDFISH_H
3#define __LINUX_GOLDFISH_H
4
5#include <linux/kernel.h>
6#include <linux/types.h>
7#include <linux/io.h>
8
9/* Helpers for Goldfish virtual platform */
10
11static inline void gf_write_ptr(const void *ptr, void __iomem *portl,
12 void __iomem *porth)
13{
14 const unsigned long addr = (unsigned long)ptr;
15
16 writel(lower_32_bits(addr), portl);
17#ifdef CONFIG_64BIT
18 writel(upper_32_bits(addr), porth);
19#endif
20}
21
22static inline void gf_write_dma_addr(const dma_addr_t addr,
23 void __iomem *portl,
24 void __iomem *porth)
25{
26 writel(lower_32_bits(addr), portl);
27#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
28 writel(upper_32_bits(addr), porth);
29#endif
30}
31
32
33#endif /* __LINUX_GOLDFISH_H */