diff options
author | Alison Wang <b18965@freescale.com> | 2015-05-13 01:46:13 (GMT) |
---|---|---|
committer | Zhengxiong Jin <Jason.Jin@freescale.com> | 2015-05-19 02:32:35 (GMT) |
commit | 7b56cb1a1eeef645883d26783e8e8e2306a0e334 (patch) | |
tree | 46266ed129d42e6247538885e0b91b01b117a890 /arch | |
parent | 62a2834a53c4d172063e06350905c31fdd29f066 (diff) | |
download | linux-fsl-qoriq-7b56cb1a1eeef645883d26783e8e8e2306a0e334.tar.xz |
arm: ls1021a: add platform notifier for dma-coherent requirement
This patch adds platform notifier for dma-coherent requirement.
Structure arm_coherent_dma_ops is used instead of arm_dma_ops.
Signed-off-by: Alison Wang <alison.wang@freescale.com>
Change-Id: I55e755b5ead1cb50ff9ca2e6838588a04e5ea9e7
Reviewed-on: http://git.am.freescale.net:8181/36291
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Reviewed-by: Zhengxiong Jin <Jason.Jin@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-imx/mach-ls1021a.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mach-ls1021a.c b/arch/arm/mach-imx/mach-ls1021a.c index 3692dd0..dbb0256 100644 --- a/arch/arm/mach-imx/mach-ls1021a.c +++ b/arch/arm/mach-imx/mach-ls1021a.c @@ -10,13 +10,36 @@ #include <linux/clk-provider.h> #include <linux/clockchips.h> #include <linux/clocksource.h> +#include <linux/dma-mapping.h> #include <linux/of_platform.h> #include <asm/mach/arch.h> #include "common.h" +static int ls1021a_platform_notifier(struct notifier_block *nb, + unsigned long event, void *__dev) +{ + struct device *dev = __dev; + + if (event != BUS_NOTIFY_ADD_DEVICE) + return NOTIFY_DONE; + + if (of_device_is_compatible(dev->of_node, "fsl,etsec2")) + set_dma_ops(dev, &arm_coherent_dma_ops); + else if (of_property_read_bool(dev->of_node, "dma-coherent")) + set_dma_ops(dev, &arm_coherent_dma_ops); + + return NOTIFY_OK; +} + +static struct notifier_block ls1021a_platform_nb = { + .notifier_call = ls1021a_platform_notifier, +}; + static void __init ls1021a_init_machine(void) { + bus_register_notifier(&platform_bus_type, &ls1021a_platform_nb); + mxc_arch_reset_init_dt(); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); } |