]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
425f3740 A |
2 | #ifndef __LINUX_GOLDFISH_H |
3 | #define __LINUX_GOLDFISH_H | |
4 | ||
68275680 | 5 | #include <linux/kernel.h> |
72755eed RK |
6 | #include <linux/types.h> |
7 | #include <linux/io.h> | |
8 | ||
425f3740 A |
9 | /* Helpers for Goldfish virtual platform */ |
10 | ||
07d783fd PST |
11 | static inline void gf_write_ptr(const void *ptr, void __iomem *portl, |
12 | void __iomem *porth) | |
425f3740 | 13 | { |
68275680 RK |
14 | const unsigned long addr = (unsigned long)ptr; |
15 | ||
da31de35 | 16 | __raw_writel(lower_32_bits(addr), portl); |
8d9e9857 | 17 | #ifdef CONFIG_64BIT |
da31de35 | 18 | __raw_writel(upper_32_bits(addr), porth); |
425f3740 A |
19 | #endif |
20 | } | |
21 | ||
07d783fd PST |
22 | static inline void gf_write_dma_addr(const dma_addr_t addr, |
23 | void __iomem *portl, | |
24 | void __iomem *porth) | |
25 | { | |
da31de35 | 26 | __raw_writel(lower_32_bits(addr), portl); |
07d783fd | 27 | #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT |
da31de35 | 28 | __raw_writel(upper_32_bits(addr), porth); |
07d783fd PST |
29 | #endif |
30 | } | |
31 | ||
32 | ||
425f3740 | 33 | #endif /* __LINUX_GOLDFISH_H */ |