iommu/mediatek: Use the common mtk-memory-port.h
authorYong Wu <yong.wu@mediatek.com>
Mon, 11 Jan 2021 11:18:49 +0000 (19:18 +0800)
committerWill Deacon <will@kernel.org>
Mon, 1 Feb 2021 11:31:16 +0000 (11:31 +0000)
Use the common memory header(larb-port) in the source code.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Link: https://lore.kernel.org/r/20210111111914.22211-9-yong.wu@mediatek.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/mtk_iommu.c
drivers/iommu/mtk_iommu.h
drivers/memory/mtk-smi.c
include/soc/mediatek/smi.h

index 86ab577c952028673fba57d411a5e2642bea948a..f594971dbeb209c770f1175f8ff80f22c8db54e6 100644 (file)
 
 #define MTK_PROTECT_PA_ALIGN                   256
 
-/*
- * Get the local arbiter ID and the portid within the larb arbiter
- * from mtk_m4u_id which is defined by MTK_M4U_ID.
- */
-#define MTK_M4U_TO_LARB(id)            (((id) >> 5) & 0xf)
-#define MTK_M4U_TO_PORT(id)            ((id) & 0x1f)
-
 #define HAS_4GB_MODE                   BIT(0)
 /* HW will use the EMI clock if there isn't the "bclk". */
 #define HAS_BCLK                       BIT(1)
index df32b3e3408b79d32f71ea90dec7e172607bb160..c1584dea66cbed6263ba86cf14565d4f26292045 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/spinlock.h>
 #include <linux/dma-mapping.h>
 #include <soc/mediatek/smi.h>
+#include <dt-bindings/memory/mtk-memory-port.h>
 
 #define MTK_LARB_COM_MAX       8
 #define MTK_LARB_SUBCOM_MAX    4
index ac350f8d1e20ffd1c9856f42951771c6c3772608..89f92fa2afa5d2fafbe2124e0cb524fa5987e18b 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/pm_runtime.h>
 #include <soc/mediatek/smi.h>
 #include <dt-bindings/memory/mt2701-larb-port.h>
+#include <dt-bindings/memory/mtk-memory-port.h>
 
 /* mt8173 */
 #define SMI_LARB_MMU_EN                0xf00
index 5a34b87d89e32fdc7bbea9a138fcc5f80c482f99..9371bf572ab8fa71487277e8fecb24f99501c137 100644 (file)
@@ -11,8 +11,6 @@
 
 #ifdef CONFIG_MTK_SMI
 
-#define MTK_LARB_NR_MAX                16
-
 #define MTK_SMI_MMU_EN(port)   BIT(port)
 
 struct mtk_smi_larb_iommu {