blob: 93e080b39cf6c09f7c310dcb31194962e67e92b3 [file] [log] [blame]
Alan425f3742014-04-28 20:47:36 +01001#ifndef __LINUX_GOLDFISH_H
2#define __LINUX_GOLDFISH_H
3
4/* Helpers for Goldfish virtual platform */
5
Peter Senna Tschudin07d783f2015-05-19 11:44:46 +02006static inline void gf_write_ptr(const void *ptr, void __iomem *portl,
7 void __iomem *porth)
Alan425f3742014-04-28 20:47:36 +01008{
Peter Senna Tschudin07d783f2015-05-19 11:44:46 +02009 writel((u32)(unsigned long)ptr, portl);
Alan Cox8d9e9852014-05-19 14:34:09 +010010#ifdef CONFIG_64BIT
Peter Senna Tschudin07d783f2015-05-19 11:44:46 +020011 writel((unsigned long)ptr >> 32, porth);
Alan425f3742014-04-28 20:47:36 +010012#endif
13}
14
Peter Senna Tschudin07d783f2015-05-19 11:44:46 +020015static inline void gf_write_dma_addr(const dma_addr_t addr,
16 void __iomem *portl,
17 void __iomem *porth)
18{
19 writel((u32)addr, portl);
20#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
21 writel(addr >> 32, porth);
22#endif
23}
24
25
Alan425f3742014-04-28 20:47:36 +010026#endif /* __LINUX_GOLDFISH_H */