soc: mediatek: mtk-cmdq: Add cmdq_pkt_poll_addr() function
authorJason-JH.Lin <jason-jh.lin@mediatek.com>
Thu, 7 Mar 2024 01:34:57 +0000 (09:34 +0800)
committerAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tue, 23 Apr 2024 10:16:55 +0000 (12:16 +0200)
commit400e2fa8058e7032974a892c7336b3ea20e24cfd
tree522d7bdaa076e4c85c4f7abd7f28a0a404d5b439
parent263801f8e5a159cff2dfbc2a1d9cf9f1afecfa81
soc: mediatek: mtk-cmdq: Add cmdq_pkt_poll_addr() function

Add cmdq_pkt_poll_addr function to support CMDQ user making
an instruction for polling a specific address of hardware rigster
to check the value with or without mask.

POLL is a legacy operation in GCE, so it does not support SPR and
CMDQ_CODE_LOGIC. To support polling the register address which doesn't
have the subsys id, CMDQ users need to make an instruction with GPR and
CMDQ_CODE_MASK operation to move the register address to be poll into GPR.
Then users can make an POLL instruction with GPR to poll the register
address assigned in previous instruction.

Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20240307013458.23550-4-jason-jh.lin@mediatek.com
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
drivers/soc/mediatek/mtk-cmdq-helper.c
include/linux/soc/mediatek/mtk-cmdq.h