phys2bus.c 345 B

12345678910111213141516171819202122
  1. /*
  2. * Copyright 2015 Stephen Warren
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <config.h>
  7. #include <phys2bus.h>
  8. unsigned long phys_to_bus(unsigned long phys)
  9. {
  10. #ifndef CONFIG_BCM2835
  11. return 0xc0000000 | phys;
  12. #else
  13. return 0x40000000 | phys;
  14. #endif
  15. }
  16. unsigned long bus_to_phys(unsigned long bus)
  17. {
  18. return bus & ~0xc0000000;
  19. }