diff mbox series

remoteproc: mediatek: Increase MT8188 SCP core0 DRAM size

Message ID 20240606090609.3199-1-jason-ch.chen@mediatek.corp-partner.google.com (mailing list archive)
State New
Headers show
Series remoteproc: mediatek: Increase MT8188 SCP core0 DRAM size | expand

Commit Message

jason-ch chen June 6, 2024, 9:06 a.m. UTC
From: Jason Chen <Jason-ch.Chen@mediatek.com>

Increase MT8188 SCP core0 DRAM size for HEVC driver.

Signed-off-by: Jason Chen <Jason-ch.Chen@mediatek.com>
---
 drivers/remoteproc/mtk_scp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

AngeloGioacchino Del Regno June 6, 2024, 11 a.m. UTC | #1
Il 06/06/24 11:06, jason-ch chen ha scritto:
> From: Jason Chen <Jason-ch.Chen@mediatek.com>
> 
> Increase MT8188 SCP core0 DRAM size for HEVC driver.
> 

....so the second core only gets a maximum of 0x200000 of SRAM?
I'm not sure how useful is the secondary SCP core, at this point, with so little
available SRAM but... okay, as you wish.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


> Signed-off-by: Jason Chen <Jason-ch.Chen@mediatek.com>
> ---
>   drivers/remoteproc/mtk_scp.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> index b885a9a041e4..2119fc62c3f2 100644
> --- a/drivers/remoteproc/mtk_scp.c
> +++ b/drivers/remoteproc/mtk_scp.c
> @@ -1390,7 +1390,7 @@ static const struct mtk_scp_sizes_data default_scp_sizes = {
>   };
>   
>   static const struct mtk_scp_sizes_data mt8188_scp_sizes = {
> -	.max_dram_size = 0x500000,
> +	.max_dram_size = 0x800000,
>   	.ipi_share_buffer_size = 600,
>   };
>
Mathieu Poirier June 10, 2024, 4:34 p.m. UTC | #2
On Thu, Jun 06, 2024 at 01:00:11PM +0200, AngeloGioacchino Del Regno wrote:
> Il 06/06/24 11:06, jason-ch chen ha scritto:
> > From: Jason Chen <Jason-ch.Chen@mediatek.com>
> > 
> > Increase MT8188 SCP core0 DRAM size for HEVC driver.

This is telling me _what_ gets done rather than _why_ it gets done.

> > 
> 
> ....so the second core only gets a maximum of 0x200000 of SRAM?
> I'm not sure how useful is the secondary SCP core, at this point, with so little
> available SRAM but... okay, as you wish.
> 
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> 
> 
> > Signed-off-by: Jason Chen <Jason-ch.Chen@mediatek.com>
> > ---
> >   drivers/remoteproc/mtk_scp.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> > index b885a9a041e4..2119fc62c3f2 100644
> > --- a/drivers/remoteproc/mtk_scp.c
> > +++ b/drivers/remoteproc/mtk_scp.c
> > @@ -1390,7 +1390,7 @@ static const struct mtk_scp_sizes_data default_scp_sizes = {
> >   };
> >   static const struct mtk_scp_sizes_data mt8188_scp_sizes = {
> > -	.max_dram_size = 0x500000,
> > +	.max_dram_size = 0x800000,

Do you require to fix a "reserved-memory" node in a device tree file to account
for this?

Thanks,
Mathieu

> >   	.ipi_share_buffer_size = 600,
> >   };
> 
>
Jason Chen June 27, 2024, 2:31 a.m. UTC | #3
Hi Mathieu,

Sorry for the late response.

On Mon, 2024-06-10 at 10:34 -0600, Mathieu Poirier wrote:
>  	 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  On Thu, Jun 06, 2024 at 01:00:11PM +0200, AngeloGioacchino Del Regno
> wrote:
> > Il 06/06/24 11:06, jason-ch chen ha scritto:
> > > From: Jason Chen <Jason-ch.Chen@mediatek.com>
> > > 
> > > Increase MT8188 SCP core0 DRAM size for HEVC driver.
> 
> This is telling me _what_ gets done rather than _why_ it gets done.
> 
I will modify the commit message in the next version.

> > > 
> > 
> > ....so the second core only gets a maximum of 0x200000 of SRAM?
> > I'm not sure how useful is the secondary SCP core, at this point,
> with so little
> > available SRAM but... okay, as you wish.
> > 
> > Reviewed-by: AngeloGioacchino Del Regno <
> angelogioacchino.delregno@collabora.com>
> > 
> > 
> > > Signed-off-by: Jason Chen <Jason-ch.Chen@mediatek.com>
> > > ---
> > >   drivers/remoteproc/mtk_scp.c | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/remoteproc/mtk_scp.c
> b/drivers/remoteproc/mtk_scp.c
> > > index b885a9a041e4..2119fc62c3f2 100644
> > > --- a/drivers/remoteproc/mtk_scp.c
> > > +++ b/drivers/remoteproc/mtk_scp.c
> > > @@ -1390,7 +1390,7 @@ static const struct mtk_scp_sizes_data
> default_scp_sizes = {
> > >   };
> > >   static const struct mtk_scp_sizes_data mt8188_scp_sizes = {
> > > -.max_dram_size = 0x500000,
> > > +.max_dram_size = 0x800000,
> 
> Do you require to fix a "reserved-memory" node in a device tree file
> to account
> for this?

Using a "reserved-memory" node to calculate max_dram_size presents
challenges due to alignment requirements in dma_alloc_coherent().

For example, 

static const struct mtk_scp_sizes_data mt8188_scp_c1_sizes = {
        .max_dram_size = 0xA00000,
        .ipi_share_buffer_size = 600,
};

We require 2560 pages (10M) for SCP core1 usage, but alignment
constraints necessitate searching for a free region of 2^12 pages
(16M). This misalignment between the reserved 10M and the required 16M
prevents successful allocation.

Adjusting the reserved memory to 16M for core1 would lead to a 6M
wastage. To avoid this, reserving a larger memory block is advisable.
This block can be partially used by SCP core1, with the remainder
allocated to feature drivers. Consequently, setting the max_dram_size
in SCP configurations is a practical solution to meet these
requirements.

Thanks,
Jason
> 
> Thanks,
> Mathieu
> 
> > >   .ipi_share_buffer_size = 600,
> > >   };
> > 
> >
diff mbox series

Patch

diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
index b885a9a041e4..2119fc62c3f2 100644
--- a/drivers/remoteproc/mtk_scp.c
+++ b/drivers/remoteproc/mtk_scp.c
@@ -1390,7 +1390,7 @@  static const struct mtk_scp_sizes_data default_scp_sizes = {
 };
 
 static const struct mtk_scp_sizes_data mt8188_scp_sizes = {
-	.max_dram_size = 0x500000,
+	.max_dram_size = 0x800000,
 	.ipi_share_buffer_size = 600,
 };