diff mbox series

[v1,4/5] soc: mediatek: cmdq: add address shift in jump

Message ID 1607141728-17307-5-git-send-email-yongqiang.niu@mediatek.com (mailing list archive)
State New, archived
Headers show
Series support gce on mt8192 platform | expand

Commit Message

Yongqiang Niu Dec. 5, 2020, 4:15 a.m. UTC
Add address shift when compose jump instruction
to compatible with 35bit format.

Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
---
 drivers/mailbox/mtk-cmdq-mailbox.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Nicolas Boichat Dec. 5, 2020, 7:30 a.m. UTC | #1
On Sat, Dec 5, 2020 at 12:16 PM Yongqiang Niu
<yongqiang.niu@mediatek.com> wrote:
>
> Add address shift when compose jump instruction
> to compatible with 35bit format.

This looks reasonable, but task->cmdq->shift_pa is not new and was
introduced as part of mt6779 GCE support.

Do you want to add a Fixes tag?
Fixes: 0858fde496f8 ("mailbox: cmdq: variablize address shift in platform")

Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>

>
> Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
> ---
>  drivers/mailbox/mtk-cmdq-mailbox.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
> index 1c01fe0..5ed39f8 100644
> --- a/drivers/mailbox/mtk-cmdq-mailbox.c
> +++ b/drivers/mailbox/mtk-cmdq-mailbox.c
> @@ -174,7 +174,8 @@ static void cmdq_task_insert_into_thread(struct cmdq_task *task)
>         dma_sync_single_for_cpu(dev, prev_task->pa_base,
>                                 prev_task->pkt->cmd_buf_size, DMA_TO_DEVICE);
>         prev_task_base[CMDQ_NUM_CMD(prev_task->pkt) - 1] =
> -               (u64)CMDQ_JUMP_BY_PA << 32 | task->pa_base;
> +               (u64)CMDQ_JUMP_BY_PA << 32 |
> +               (task->pa_base >> task->cmdq->shift_pa);
>         dma_sync_single_for_device(dev, prev_task->pa_base,
>                                    prev_task->pkt->cmd_buf_size, DMA_TO_DEVICE);
>
> --
> 1.8.1.1.dirty
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek
Chun-Kuang Hu Dec. 9, 2020, 3:16 p.m. UTC | #2
Hi, Yongqiang:

Nicolas Boichat <drinkcat@chromium.org> 於 2020年12月5日 週六 下午3:30寫道:
>
> On Sat, Dec 5, 2020 at 12:16 PM Yongqiang Niu
> <yongqiang.niu@mediatek.com> wrote:
> >
> > Add address shift when compose jump instruction
> > to compatible with 35bit format.
>
> This looks reasonable, but task->cmdq->shift_pa is not new and was
> introduced as part of mt6779 GCE support.
>
> Do you want to add a Fixes tag?
> Fixes: 0858fde496f8 ("mailbox: cmdq: variablize address shift in platform")

Add this fixes tag, and move this patch out of this series because
this patch is related to all SoC whose shift_pa is not zero.

Regards,
Chun-Kuang.

>
> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
>
> >
> > Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
> > ---
> >  drivers/mailbox/mtk-cmdq-mailbox.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
> > index 1c01fe0..5ed39f8 100644
> > --- a/drivers/mailbox/mtk-cmdq-mailbox.c
> > +++ b/drivers/mailbox/mtk-cmdq-mailbox.c
> > @@ -174,7 +174,8 @@ static void cmdq_task_insert_into_thread(struct cmdq_task *task)
> >         dma_sync_single_for_cpu(dev, prev_task->pa_base,
> >                                 prev_task->pkt->cmd_buf_size, DMA_TO_DEVICE);
> >         prev_task_base[CMDQ_NUM_CMD(prev_task->pkt) - 1] =
> > -               (u64)CMDQ_JUMP_BY_PA << 32 | task->pa_base;
> > +               (u64)CMDQ_JUMP_BY_PA << 32 |
> > +               (task->pa_base >> task->cmdq->shift_pa);
> >         dma_sync_single_for_device(dev, prev_task->pa_base,
> >                                    prev_task->pkt->cmd_buf_size, DMA_TO_DEVICE);
> >
> > --
> > 1.8.1.1.dirty
> > _______________________________________________
> > Linux-mediatek mailing list
> > Linux-mediatek@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-mediatek
>
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek
Yongqiang Niu Dec. 23, 2020, 12:36 a.m. UTC | #3
On Wed, 2020-12-09 at 23:16 +0800, Chun-Kuang Hu wrote:
> Hi, Yongqiang:
> 
> Nicolas Boichat <drinkcat@chromium.org> 於 2020年12月5日 週六 下午3:30寫道:
> >
> > On Sat, Dec 5, 2020 at 12:16 PM Yongqiang Niu
> > <yongqiang.niu@mediatek.com> wrote:
> > >
> > > Add address shift when compose jump instruction
> > > to compatible with 35bit format.
> >
> > This looks reasonable, but task->cmdq->shift_pa is not new and was
> > introduced as part of mt6779 GCE support.
> >
> > Do you want to add a Fixes tag?
> > Fixes: 0858fde496f8 ("mailbox: cmdq: variablize address shift in platform")
> 
> Add this fixes tag, and move this patch out of this series because
> this patch is related to all SoC whose shift_pa is not zero.
> 
> Regards,
> Chun-Kuang.
> 


the next version will move this out of 8192 series and add fixed tags

> >
> > Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
> >
> > >
> > > Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
> > > ---
> > >  drivers/mailbox/mtk-cmdq-mailbox.c | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
> > > index 1c01fe0..5ed39f8 100644
> > > --- a/drivers/mailbox/mtk-cmdq-mailbox.c
> > > +++ b/drivers/mailbox/mtk-cmdq-mailbox.c
> > > @@ -174,7 +174,8 @@ static void cmdq_task_insert_into_thread(struct cmdq_task *task)
> > >         dma_sync_single_for_cpu(dev, prev_task->pa_base,
> > >                                 prev_task->pkt->cmd_buf_size, DMA_TO_DEVICE);
> > >         prev_task_base[CMDQ_NUM_CMD(prev_task->pkt) - 1] =
> > > -               (u64)CMDQ_JUMP_BY_PA << 32 | task->pa_base;
> > > +               (u64)CMDQ_JUMP_BY_PA << 32 |
> > > +               (task->pa_base >> task->cmdq->shift_pa);
> > >         dma_sync_single_for_device(dev, prev_task->pa_base,
> > >                                    prev_task->pkt->cmd_buf_size, DMA_TO_DEVICE);
> > >
> > > --
> > > 1.8.1.1.dirty
> > > _______________________________________________
> > > Linux-mediatek mailing list
> > > Linux-mediatek@lists.infradead.org
> > > http://lists.infradead.org/mailman/listinfo/linux-mediatek
> >
> > _______________________________________________
> > Linux-mediatek mailing list
> > Linux-mediatek@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-mediatek
diff mbox series

Patch

diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
index 1c01fe0..5ed39f8 100644
--- a/drivers/mailbox/mtk-cmdq-mailbox.c
+++ b/drivers/mailbox/mtk-cmdq-mailbox.c
@@ -174,7 +174,8 @@  static void cmdq_task_insert_into_thread(struct cmdq_task *task)
 	dma_sync_single_for_cpu(dev, prev_task->pa_base,
 				prev_task->pkt->cmd_buf_size, DMA_TO_DEVICE);
 	prev_task_base[CMDQ_NUM_CMD(prev_task->pkt) - 1] =
-		(u64)CMDQ_JUMP_BY_PA << 32 | task->pa_base;
+		(u64)CMDQ_JUMP_BY_PA << 32 |
+		(task->pa_base >> task->cmdq->shift_pa);
 	dma_sync_single_for_device(dev, prev_task->pa_base,
 				   prev_task->pkt->cmd_buf_size, DMA_TO_DEVICE);