Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Alan | 425f374 | 2014-04-28 20:47:36 +0100 | [diff] [blame] | 2 | #ifndef __LINUX_GOLDFISH_H |
| 3 | #define __LINUX_GOLDFISH_H |
| 4 | |
| 5 | /* Helpers for Goldfish virtual platform */ |
| 6 | |
Peter Senna Tschudin | 07d783f | 2015-05-19 11:44:46 +0200 | [diff] [blame] | 7 | static inline void gf_write_ptr(const void *ptr, void __iomem *portl, |
| 8 | void __iomem *porth) |
Alan | 425f374 | 2014-04-28 20:47:36 +0100 | [diff] [blame] | 9 | { |
Peter Senna Tschudin | 07d783f | 2015-05-19 11:44:46 +0200 | [diff] [blame] | 10 | writel((u32)(unsigned long)ptr, portl); |
Alan Cox | 8d9e985 | 2014-05-19 14:34:09 +0100 | [diff] [blame] | 11 | #ifdef CONFIG_64BIT |
Peter Senna Tschudin | 07d783f | 2015-05-19 11:44:46 +0200 | [diff] [blame] | 12 | writel((unsigned long)ptr >> 32, porth); |
Alan | 425f374 | 2014-04-28 20:47:36 +0100 | [diff] [blame] | 13 | #endif |
| 14 | } |
| 15 | |
Peter Senna Tschudin | 07d783f | 2015-05-19 11:44:46 +0200 | [diff] [blame] | 16 | static inline void gf_write_dma_addr(const dma_addr_t addr, |
| 17 | void __iomem *portl, |
| 18 | void __iomem *porth) |
| 19 | { |
| 20 | writel((u32)addr, portl); |
| 21 | #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT |
| 22 | writel(addr >> 32, porth); |
| 23 | #endif |
| 24 | } |
| 25 | |
| 26 | |
Alan | 425f374 | 2014-04-28 20:47:36 +0100 | [diff] [blame] | 27 | #endif /* __LINUX_GOLDFISH_H */ |