ioremap.h 791 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef BCM63XX_IOREMAP_H_
  2. #define BCM63XX_IOREMAP_H_
  3. #include <bcm63xx_cpu.h>
  4. static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size)
  5. {
  6. return phys_addr;
  7. }
  8. static inline int is_bcm63xx_internal_registers(phys_t offset)
  9. {
  10. switch (bcm63xx_get_cpu_id()) {
  11. case BCM6338_CPU_ID:
  12. case BCM6345_CPU_ID:
  13. case BCM6348_CPU_ID:
  14. case BCM6358_CPU_ID:
  15. if (offset >= 0xfff00000)
  16. return 1;
  17. break;
  18. }
  19. return 0;
  20. }
  21. static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size,
  22. unsigned long flags)
  23. {
  24. if (is_bcm63xx_internal_registers(offset))
  25. return (void __iomem *)offset;
  26. return NULL;
  27. }
  28. static inline int plat_iounmap(const volatile void __iomem *addr)
  29. {
  30. return is_bcm63xx_internal_registers((unsigned long)addr);
  31. }
  32. #endif /* BCM63XX_IOREMAP_H_ */