blob: 8e4318bf5fdc42b1701e6684090631d8d13a03d4 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Stephen Warren79340db2015-03-24 20:07:34 -06002/*
3 * Copyright 2015 Stephen Warren
Stephen Warren79340db2015-03-24 20:07:34 -06004 */
5
6#include <config.h>
7#include <phys2bus.h>
8
9unsigned long phys_to_bus(unsigned long phys)
10{
Stephen Warrened7481c2016-03-16 21:40:56 -060011#ifndef CONFIG_BCM2835
Stephen Warren79340db2015-03-24 20:07:34 -060012 return 0xc0000000 | phys;
13#else
14 return 0x40000000 | phys;
15#endif
16}
17
18unsigned long bus_to_phys(unsigned long bus)
19{
20 return bus & ~0xc0000000;
21}