Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Stephen Warren | 79340db | 2015-03-24 20:07:34 -0600 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2015 Stephen Warren |
Stephen Warren | 79340db | 2015-03-24 20:07:34 -0600 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <config.h> |
| 7 | #include <phys2bus.h> |
| 8 | |
| 9 | unsigned long phys_to_bus(unsigned long phys) |
| 10 | { |
Stephen Warren | ed7481c | 2016-03-16 21:40:56 -0600 | [diff] [blame] | 11 | #ifndef CONFIG_BCM2835 |
Stephen Warren | 79340db | 2015-03-24 20:07:34 -0600 | [diff] [blame] | 12 | return 0xc0000000 | phys; |
| 13 | #else |
| 14 | return 0x40000000 | phys; |
| 15 | #endif |
| 16 | } |
| 17 | |
| 18 | unsigned long bus_to_phys(unsigned long bus) |
| 19 | { |
| 20 | return bus & ~0xc0000000; |
| 21 | } |