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