Re: [SPAM]Re: [PATCH 01/21] dt-binding: memory: mediatek: Add a common larb-port header file
From: Yong Wu <yong.wu@mediatek.com>
Date: 2020-07-13 06:29:57
Also in:
linux-iommu, linux-mediatek
On Sun, 2020-07-12 at 20:06 +0200, Matthias Brugger wrote:
On 11/07/2020 08:48, Yong Wu wrote:quoted
Put all the macros about smi larb/port togethers, this is a preparing patch for extending LARB_NR and adding new dom-id support. Signed-off-by: Yong Wu <yong.wu@mediatek.com>
[...]
quoted
diff --git a/include/dt-bindings/memory/mtk-smi-larb-port.h b/include/dt-bindings/memory/mtk-smi-larb-port.h new file mode 100644 index 000000000000..2ec7fe5ce4e9 --- /dev/null +++ b/include/dt-bindings/memory/mtk-smi-larb-port.h@@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2020 MediaTek Inc. + * Author: Yong Wu <yong.wu@mediatek.com> + */ +#ifndef __DTS_MTK_IOMMU_PORT_H_ +#define __DTS_MTK_IOMMU_PORT_H_ + +#define MTK_LARB_NR_MAX 16include/soc/mediatek/smi.h has the very same define. Should smi.h include this file?
If smi.h include this file, it also is ok. then these two files(mtk_iommu.h and mtk_smi.c) don't need include this. the MTK_LARB_NR_MAX only is used in mtk_iommu.h and mtk_smi.c directly, thus I use that two files include this file currently. locally I think it may be helpful for readable. is this ok?
Regards, Matthiasquoted
+ +#define MTK_M4U_ID(larb, port) (((larb) << 5) | (port)) +#define MTK_M4U_TO_LARB(id) (((id) >> 5) & 0xf) +#define MTK_M4U_TO_PORT(id) ((id) & 0x1f) + +#endif_______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek
_______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel