phys2bus.c 338 B

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