summaryrefslogtreecommitdiffstats
path: root/drivers/bus
diff options
context:
space:
mode:
authorSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>2014-09-17 22:22:40 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-09-19 09:47:35 +0200
commit561dfebb4bf57f0d0b02d8fd3dffad01536f5c14 (patch)
tree149e1a8815ed19c8c2677ecb2c460b1ee582d8e4 /drivers/bus
parentf94a71cb514d6dc3a8395f2300c6a680ec6d7e82 (diff)
downloadbarebox-561dfebb4bf57f0d0b02d8fd3dffad01536f5c14.tar.gz
barebox-561dfebb4bf57f0d0b02d8fd3dffad01536f5c14.tar.xz
ARM: mvebu: Add machine compatible to mbus ranges
Multi-SoC support for MVEBU will add mbus ranges for all compiled SoCs. To protect the mbus node of the SoC barebox is executed on from others ranges, pass machine's compatible to mvebu_mbus_add_range and check before applying the fixup. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/bus')
-rw-r--r--drivers/bus/mvebu-mbus.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index b7f78367d4..9dc43011b9 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -744,6 +744,7 @@ static int mvebu_mbus_init(void)
postcore_initcall(mvebu_mbus_init);
struct mbus_range {
+ const char *compatible;
u32 mbusid;
u32 remap;
struct list_head list;
@@ -752,10 +753,11 @@ struct mbus_range {
#define MBUS_ID(t,a) (((t) << 24) | ((attr) << 16))
static LIST_HEAD(mbus_ranges);
-void mvebu_mbus_add_range(u8 target, u8 attr, u32 remap)
+void mvebu_mbus_add_range(const char *compatible, u8 target, u8 attr, u32 remap)
{
struct mbus_range *r = xzalloc(sizeof(*r));
+ r->compatible = strdup(compatible);
r->mbusid = MBUS_ID(target, attr);
r->remap = remap;
list_add_tail(&r->list, &mbus_ranges);
@@ -811,6 +813,8 @@ static int mvebu_mbus_of_fixup(struct device_node *root, void *context)
continue;
list_for_each_entry(r, &mbus_ranges, list) {
+ if (!of_machine_is_compatible(r->compatible))
+ continue;
if (r->mbusid == mbusid)
ranges[n + na + pa - 1] = r->remap;
}