[SPAM]Re: [PATCH 01/21] dt-binding: memory: mediatek: Add a common larb-port header file

Yong Wu yong.wu at mediatek.com
Mon Jul 13 02:27:41 EDT 2020


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 <yong.wu at mediatek.com>

[...]

> > 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 at mediatek.com>
> > + */
> > +#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
> Linux-mediatek at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek



More information about the linux-arm-kernel mailing list