aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantosh Shilimkar <santosh.shilimkar@ti.com>2014-02-24 10:32:59 -0500
committerSantosh Shilimkar <santosh.shilimkar@ti.com>2014-05-08 15:43:33 -0400
commit14f3791439b5a6cf12127fb80204265533d92664 (patch)
tree28059b8ce76be2b98bb4a914d16cc39289dffc52
parent5eb3da7246a5b2dfac9f38a7be62b1a0295584c7 (diff)
ARM: keystone: Update the dma offset for non-dt platform devices
Tested-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
-rw-r--r--arch/arm/mach-keystone/keystone.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c
index 155eb062e8d1..59b8383cbdb0 100644
--- a/arch/arm/mach-keystone/keystone.c
+++ b/arch/arm/mach-keystone/keystone.c
@@ -31,6 +31,27 @@
31#define PLL_RESET BIT(16) 31#define PLL_RESET BIT(16)
32 32
33static void __iomem *keystone_rstctrl; 33static void __iomem *keystone_rstctrl;
34static struct notifier_block platform_nb;
35static unsigned long keystone_dma_pfn_offset __read_mostly;
36
37static int keystone_platform_notifier(struct notifier_block *nb,
38 unsigned long event, void *data)
39{
40 struct device *dev = data;
41
42 if (event != BUS_NOTIFY_ADD_DEVICE)
43 return NOTIFY_DONE;
44
45 if (!dev)
46 return NOTIFY_BAD;
47
48 if (!dev->of_node) {
49 dev->dma_pfn_offset = keystone_dma_pfn_offset;
50 dev_err(dev, "set dma_pfn_offset%08lx\n",
51 dev->dma_pfn_offset);
52 }
53 return NOTIFY_OK;
54}
34 55
35static void __init keystone_init(void) 56static void __init keystone_init(void)
36{ 57{
@@ -45,6 +66,8 @@ static void __init keystone_init(void)
45 pr_warn("ti,keystone-reset iomap error\n"); 66 pr_warn("ti,keystone-reset iomap error\n");
46 67
47 keystone_pm_runtime_init(); 68 keystone_pm_runtime_init();
69 if (platform_nb.notifier_call)
70 bus_register_notifier(&platform_bus_type, &platform_nb);
48 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 71 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
49} 72}
50 73
@@ -88,6 +111,9 @@ static void __init keystone_init_meminfo(void)
88 111
89 /* Populate the arch idmap hook */ 112 /* Populate the arch idmap hook */
90 arch_virt_to_idmap = keystone_virt_to_idmap; 113 arch_virt_to_idmap = keystone_virt_to_idmap;
114 platform_nb.notifier_call = keystone_platform_notifier;
115 keystone_dma_pfn_offset = PFN_DOWN(KEYSTONE_HIGH_PHYS_START -
116 KEYSTONE_LOW_PHYS_START);
91 117
92 pr_info("Switching to high address space at 0x%llx\n", (u64)offset); 118 pr_info("Switching to high address space at 0x%llx\n", (u64)offset);
93} 119}