On Sun, 2020-07-12 at 20:06 +0200, Matthias Brugger wrote: > > On 11/07/2020 08:48, Yong Wu wrote: > > 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 <[email protected]>
[...] > > 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 <[email protected]> > > + */ > > +#ifndef __DTS_MTK_IOMMU_PORT_H_ > > +#define __DTS_MTK_IOMMU_PORT_H_ > > + > > +#define MTK_LARB_NR_MAX 16 > > include/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, > Matthias > > > + > > +#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 > [email protected] > http://lists.infradead.org/mailman/listinfo/linux-mediatek _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
