Loading arch/arm/mach-msm/include/mach/iommu.h +4 −0 Original line number Diff line number Diff line Loading @@ -364,6 +364,10 @@ static inline int msm_soc_version_supports_iommu_v0(void) return 0; } #endif int msm_iommu_get_scm_call_avail(void); void msm_iommu_check_scm_call_avail(void); u32 msm_iommu_get_mair0(void); u32 msm_iommu_get_mair1(void); u32 msm_iommu_get_prrr(void); Loading drivers/iommu/msm_iommu-v1.c +6 −15 Original line number Diff line number Diff line /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -297,7 +297,6 @@ static void __reset_iommu(void __iomem *base) mb(); } #ifdef CONFIG_IOMMU_NON_SECURE static void __reset_iommu_secure(void __iomem *base) { SET_NSACR(base, 0); Loading @@ -319,23 +318,14 @@ static void __program_iommu_secure(void __iomem *base) SET_NSCR0_CLIENTPD(base, 0); } #else static inline void __reset_iommu_secure(void __iomem *base) { } static inline void __program_iommu_secure(void __iomem *base) { } #endif /* * May only be called for non-secure iommus */ static void __program_iommu(void __iomem *base) { __reset_iommu(base); if (!msm_iommu_get_scm_call_avail()) __reset_iommu_secure(base); SET_CR0_SMCFCFG(base, 1); Loading @@ -347,6 +337,7 @@ static void __program_iommu(void __iomem *base) SET_CR0_GFRE(base, 1); SET_CR0_CLIENTPD(base, 0); if (!msm_iommu_get_scm_call_avail()) __program_iommu_secure(base); mb(); /* Make sure writes complete before returning */ Loading drivers/iommu/msm_iommu_dev-v1.c +13 −3 Original line number Diff line number Diff line /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -126,6 +126,11 @@ static void __put_bus_vote_client(struct msm_iommu_drvdata *drvdata) drvdata->bus_client = 0; } /* * CONFIG_IOMMU_NON_SECURE allows us to override the secure * designation of SMMUs in device tree. With this config enabled * all SMMUs will be programmed by this driver. */ #ifdef CONFIG_IOMMU_NON_SECURE static inline void get_secure_id(struct device_node *node, struct msm_iommu_drvdata *drvdata) Loading @@ -141,12 +146,15 @@ static inline void get_secure_ctx(struct device_node *node, static void get_secure_id(struct device_node *node, struct msm_iommu_drvdata *drvdata) { of_property_read_u32(node, "qcom,iommu-secure-id", &drvdata->sec_id); if (msm_iommu_get_scm_call_avail()) of_property_read_u32(node, "qcom,iommu-secure-id", &drvdata->sec_id); } static void get_secure_ctx(struct device_node *node, struct msm_iommu_ctx_drvdata *ctx_drvdata) { if (msm_iommu_get_scm_call_avail()) ctx_drvdata->secure_context = of_property_read_bool(node, "qcom,secure-context"); } Loading Loading @@ -597,6 +605,8 @@ static int __init msm_iommu_driver_init(void) { int ret; msm_iommu_check_scm_call_avail(); msm_set_iommu_access_ops(&iommu_access_ops_v1); msm_iommu_sec_set_access_ops(&iommu_access_ops_v1); Loading drivers/iommu/msm_iommu_sec.c +11 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ static struct iommu_access_ops *iommu_access_ops; static int is_secure; static const struct of_device_id msm_smmu_list[] = { { .compatible = "qcom,msm-smmu-v1", }, Loading Loading @@ -787,6 +788,16 @@ static phys_addr_t msm_iommu_get_pt_base_addr(struct iommu_domain *domain) return 0; } void msm_iommu_check_scm_call_avail(void) { is_secure = scm_is_call_available(SCM_SVC_MP, IOMMU_SECURE_CFG); } int msm_iommu_get_scm_call_avail(void) { return is_secure; } static struct iommu_ops msm_iommu_ops = { .domain_init = msm_iommu_domain_init, .domain_destroy = msm_iommu_domain_destroy, Loading Loading
arch/arm/mach-msm/include/mach/iommu.h +4 −0 Original line number Diff line number Diff line Loading @@ -364,6 +364,10 @@ static inline int msm_soc_version_supports_iommu_v0(void) return 0; } #endif int msm_iommu_get_scm_call_avail(void); void msm_iommu_check_scm_call_avail(void); u32 msm_iommu_get_mair0(void); u32 msm_iommu_get_mair1(void); u32 msm_iommu_get_prrr(void); Loading
drivers/iommu/msm_iommu-v1.c +6 −15 Original line number Diff line number Diff line /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -297,7 +297,6 @@ static void __reset_iommu(void __iomem *base) mb(); } #ifdef CONFIG_IOMMU_NON_SECURE static void __reset_iommu_secure(void __iomem *base) { SET_NSACR(base, 0); Loading @@ -319,23 +318,14 @@ static void __program_iommu_secure(void __iomem *base) SET_NSCR0_CLIENTPD(base, 0); } #else static inline void __reset_iommu_secure(void __iomem *base) { } static inline void __program_iommu_secure(void __iomem *base) { } #endif /* * May only be called for non-secure iommus */ static void __program_iommu(void __iomem *base) { __reset_iommu(base); if (!msm_iommu_get_scm_call_avail()) __reset_iommu_secure(base); SET_CR0_SMCFCFG(base, 1); Loading @@ -347,6 +337,7 @@ static void __program_iommu(void __iomem *base) SET_CR0_GFRE(base, 1); SET_CR0_CLIENTPD(base, 0); if (!msm_iommu_get_scm_call_avail()) __program_iommu_secure(base); mb(); /* Make sure writes complete before returning */ Loading
drivers/iommu/msm_iommu_dev-v1.c +13 −3 Original line number Diff line number Diff line /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -126,6 +126,11 @@ static void __put_bus_vote_client(struct msm_iommu_drvdata *drvdata) drvdata->bus_client = 0; } /* * CONFIG_IOMMU_NON_SECURE allows us to override the secure * designation of SMMUs in device tree. With this config enabled * all SMMUs will be programmed by this driver. */ #ifdef CONFIG_IOMMU_NON_SECURE static inline void get_secure_id(struct device_node *node, struct msm_iommu_drvdata *drvdata) Loading @@ -141,12 +146,15 @@ static inline void get_secure_ctx(struct device_node *node, static void get_secure_id(struct device_node *node, struct msm_iommu_drvdata *drvdata) { of_property_read_u32(node, "qcom,iommu-secure-id", &drvdata->sec_id); if (msm_iommu_get_scm_call_avail()) of_property_read_u32(node, "qcom,iommu-secure-id", &drvdata->sec_id); } static void get_secure_ctx(struct device_node *node, struct msm_iommu_ctx_drvdata *ctx_drvdata) { if (msm_iommu_get_scm_call_avail()) ctx_drvdata->secure_context = of_property_read_bool(node, "qcom,secure-context"); } Loading Loading @@ -597,6 +605,8 @@ static int __init msm_iommu_driver_init(void) { int ret; msm_iommu_check_scm_call_avail(); msm_set_iommu_access_ops(&iommu_access_ops_v1); msm_iommu_sec_set_access_ops(&iommu_access_ops_v1); Loading
drivers/iommu/msm_iommu_sec.c +11 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ static struct iommu_access_ops *iommu_access_ops; static int is_secure; static const struct of_device_id msm_smmu_list[] = { { .compatible = "qcom,msm-smmu-v1", }, Loading Loading @@ -787,6 +788,16 @@ static phys_addr_t msm_iommu_get_pt_base_addr(struct iommu_domain *domain) return 0; } void msm_iommu_check_scm_call_avail(void) { is_secure = scm_is_call_available(SCM_SVC_MP, IOMMU_SECURE_CFG); } int msm_iommu_get_scm_call_avail(void) { return is_secure; } static struct iommu_ops msm_iommu_ops = { .domain_init = msm_iommu_domain_init, .domain_destroy = msm_iommu_domain_destroy, Loading