[PATCH v8 02/20] mailbox: mtk-cmdq: Refine DMA address handling for the command buffer
AngeloGioacchino Del Regno
angelogioacchino.delregno at collabora.com
Mon Oct 20 03:04:44 PDT 2025
Il 17/10/25 08:44, Jason-JH Lin ha scritto:
> GCE can only fetch the command buffer address from a 32-bit register.
> Some SoCs support a 35-bit command buffer address for GCE, which
> requires a right shift of 3 bits before setting the address into
> the 32-bit register. A comment has been added to the header of
> cmdq_get_shift_pa() to explain this requirement.
>
> To prevent the GCE command buffer address from being DMA mapped beyond
> its supported bit range, the DMA bit mask for the device is set during
> initialization.
>
> Additionally, to ensure the correct shift is applied when setting or
> reading the register that stores the GCE command buffer address,
> new APIs, cmdq_convert_gce_addr() and cmdq_revert_gce_addr(), have
> been introduced for consistent operations on this register.
>
> The variable type for the command buffer address has been standardized
> to dma_addr_t to prevent handling issues caused by type mismatches.
>
> Fixes: 0858fde496f8 ("mailbox: cmdq: variablize address shift in platform")
> Signed-off-by: Jason-JH Lin <jason-jh.lin at mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
More information about the Linux-mediatek
mailing list