mbox series

[v5,0/4] MT8188 SMI SUPPORT

Message ID 20220817124608.10062-1-chengci.xu@mediatek.com (mailing list archive)
Headers show
Series MT8188 SMI SUPPORT | expand

Message

Chengci.Xu Aug. 17, 2022, 12:46 p.m. UTC
This patchset adds MT8188 SMI support.

MT8188, similar to mt8195, there are two SMI-common HW, one is for
VDO(video output), the other is for VPP(video processing pipe). They
connect with different SMI-larbs, then some setting(bus_sel) is
different.

The connection between SMI and MM IOMMU could be something like this:

  IOMMU(VDO)           IOMMU(VPP)
     |                    |
SMI_COMMON_VDO       SMI_COMMON_VPP
----------------     ----------------
  |     |   ...       |     |    ...
larb0 larb2 ...     larb1 larb3  ...

Another change is that the register about enable/disable iommu is in
security world. We add some SMC command to set it. And we add a return
value for configure port function because SMC call may fail.

changes since v5:
  - base on tag: next-20220817.
  - return the result of config_port directly in mtk_smi_larb_resume().
  - update the comments about flag MTK_SMI_FLAG_CFG_PORT_SEC_CTL.
  - put the code about CFG_PORT_SEC_CTL before SMI_LARB_NONSEC_CON.
  - remove the unnecessary type conversion of larb->mmu.

changes since v4:
  - base on tag: next-20220728.
  - new patch[2/4] to add return value for all config port function.
  - rename enum IOMMU_ATF_CMD to a lower case: iommu_atf_cmd.
  - rename MTK_SMI_FLAG_SEC_REG to MTK_SMI_FLAG_CFG_PORT_SEC_CTL.
  - rename IOMMU_ATF_CMD_COUNT to IOMMU_ATF_CMD_MAX.
  - add some comment for why still need write SMI_LARB_NONSEC_CON.
  - return an error(-EINVAL) when enable iommu failed by SMC call.
  - put enum iommu_atf_cmd inside the macro CONFIG_MTK_SMI.

changes since v3:
  - base on tag: next-20220726.
  - no code change just remove the change-id in patch [2/3].

changes since v2:
  - base on tag: next-20220722.
  - move some included header to the source file that use them.

changes since v1:
  - base on tag: next-20220720.
  - adds MT8188 SMI support.

Chengci.Xu (4):
  dt-bindings: memory: mediatek: Add mt8188 smi binding
  memory: mtk-smi: Add return value for configure port function
  memory: mtk-smi: Add enable IOMMU SMC command for MM master
  memory: mtk-smi: mt8188: Add SMI Support

 .../mediatek,smi-common.yaml                  |   4 +-
 .../memory-controllers/mediatek,smi-larb.yaml |   3 +
 drivers/memory/mtk-smi.c                      | 109 ++++++++++++++++--
 include/linux/soc/mediatek/mtk_sip_svc.h      |   3 +
 include/soc/mediatek/smi.h                    |   5 +
 5 files changed, 114 insertions(+), 10 deletions(-)

Comments

Krzysztof Kozlowski Aug. 30, 2022, 5:58 p.m. UTC | #1
On Wed, 17 Aug 2022 20:46:04 +0800, Chengci.Xu wrote:
> This patchset adds MT8188 SMI support.
> 
> MT8188, similar to mt8195, there are two SMI-common HW, one is for
> VDO(video output), the other is for VPP(video processing pipe). They
> connect with different SMI-larbs, then some setting(bus_sel) is
> different.
> 
> [...]

Applied, thanks!

[1/4] dt-bindings: memory: mediatek: Add mt8188 smi binding
      https://git.kernel.org/krzk/linux-mem-ctrl/c/9d9fde47430298455544b283cffa390c40d58bfc
[2/4] memory: mtk-smi: Add return value for configure port function
      https://git.kernel.org/krzk/linux-mem-ctrl/c/8c1561edc0692fa8e321daf2777c3c32454b5748
[3/4] memory: mtk-smi: Add enable IOMMU SMC command for MM master
      https://git.kernel.org/krzk/linux-mem-ctrl/c/4e508b259ed02f5fa608cdd83b817a7f49c22271
[4/4] memory: mtk-smi: mt8188: Add SMI Support
      https://git.kernel.org/krzk/linux-mem-ctrl/c/673e71df5ccfaefeb32bb5b3130a5d397b742194

Best regards,