unsigned __vexpress_get_site(struct device *dev, struct device_node *node) { u32 site = 0; WARN_ON(dev && node && dev->of_node != node); if (dev && !node) node = dev->of_node; if (node) { vexpress_sysreg_find_prop(node, "arm,vexpress,site", &site); } else if (dev && dev->bus == &platform_bus_type) { struct platform_device *pdev = to_platform_device(dev); if (pdev->num_resources == 1 && pdev->resource[0].flags == IORESOURCE_BUS) site = pdev->resource[0].start; } else if (dev && strncmp(dev_name(dev), "ct:", 3) == 0) { site = VEXPRESS_SITE_MASTER; } if (site == VEXPRESS_SITE_MASTER) site = vexpress_master_site; return site; }
unsigned __vexpress_get_site(struct vmm_device *dev, struct vmm_devtree_node *node) { u32 site = 0; WARN_ON(dev && node && dev->of_node != node); if (dev && !node) node = dev->of_node; if (node) { vexpress_sysreg_find_prop(node, "arm,vexpress,site", &site); } else if (dev && strncmp(dev->name, "ct:", 3) == 0) { site = VEXPRESS_SITE_MASTER; } if (site == VEXPRESS_SITE_MASTER) site = vexpress_master_site; return site; }