blob: 2835c150c3ff0a89dc8f1a9628f2b3f3f0b0ed42 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Alan425f3742014-04-28 20:47:36 +01002#ifndef __LINUX_GOLDFISH_H
3#define __LINUX_GOLDFISH_H
4
5/* Helpers for Goldfish virtual platform */
6
Peter Senna Tschudin07d783f2015-05-19 11:44:46 +02007static inline void gf_write_ptr(const void *ptr, void __iomem *portl,
8 void __iomem *porth)
Alan425f3742014-04-28 20:47:36 +01009{
Peter Senna Tschudin07d783f2015-05-19 11:44:46 +020010 writel((u32)(unsigned long)ptr, portl);
Alan Cox8d9e9852014-05-19 14:34:09 +010011#ifdef CONFIG_64BIT
Peter Senna Tschudin07d783f2015-05-19 11:44:46 +020012 writel((unsigned long)ptr >> 32, porth);
Alan425f3742014-04-28 20:47:36 +010013#endif
14}
15
Peter Senna Tschudin07d783f2015-05-19 11:44:46 +020016static 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
Alan425f3742014-04-28 20:47:36 +010027#endif /* __LINUX_GOLDFISH_H */