goldfish.h 738 B

12345678910111213141516171819202122232425262728293031323334
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __LINUX_GOLDFISH_H
  3. #define __LINUX_GOLDFISH_H
  4. #include <linux/kernel.h>
  5. #include <linux/types.h>
  6. #include <linux/io.h>
  7. /* Helpers for Goldfish virtual platform */
  8. static inline void gf_write_ptr(const void *ptr, void __iomem *portl,
  9. void __iomem *porth)
  10. {
  11. const unsigned long addr = (unsigned long)ptr;
  12. writel(lower_32_bits(addr), portl);
  13. #ifdef CONFIG_64BIT
  14. writel(upper_32_bits(addr), porth);
  15. #endif
  16. }
  17. static inline void gf_write_dma_addr(const dma_addr_t addr,
  18. void __iomem *portl,
  19. void __iomem *porth)
  20. {
  21. writel(lower_32_bits(addr), portl);
  22. #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
  23. writel(upper_32_bits(addr), porth);
  24. #endif
  25. }
  26. #endif /* __LINUX_GOLDFISH_H */