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