This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM625: AM625 , OPEEE occupation Memory is 64 MB , can we reduce this section?

Part Number: AM625

Champs:

Since the Optee occupied 64MB Flash in the kernel, my cust is asking if they can reduce this as 32MB or 16MB?

If yes, how?

If no, why?

We have studied several docuements + E2E, it seems there is a patch for AM64.

But, we don't see how to reduce the Optee from 64 MB to 32 or 16MB.

please comment.

Thanks.

BR Rio

  • Hi Rio,

    Since the Optee occupied 64MB Flash in the kernel

    Can you please point to me where the 64MB comes from? I am not sure which component you refer to and you meant its size in the Flash storage or footprint in DDR?

  • Hi Bin:

    Long time no see.

    My cust is asking the below Red part.

    24576 KB = 24MB DDR occupation.

    Can we reduce this size?

    My Cust is only having 512MB DDR, so, they want to reserve more of other tasks running.

    BTW, we need to keep the Security HS-SE enable feature for this Cust using.

    Thanks.

    BR Rio

    [    0.000000] Reserved memory: created CMA memory pool at 0x0000000091200000, size 128 MiB

    [    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool

    [    0.000000] OF: reserved mem: 0x0000000091200000..0x00000000991fffff (131072 KiB) map reusable linux,cma

    [    0.000000] OF: reserved mem: 0x000000009e800000..0x000000009fffffff (24576 KiB) nomap non-reusable optee@9e800000

    [    0.000000] OF: reserved mem: 0x0000000080000000..0x000000008007ffff (512 KiB) nomap non-reusable tfa@80000000

    [    0.000000] OF: reserved mem: 0x000000009c400000..0x000000009c6fffff (3072 KiB) nomap non-reusable framebuffer@9c400000

    [    0.000000] OF: reserved mem: 0x000000009c700000..0x000000009c7fffff (1024 KiB) map non-reusable ramoops@9c700000

    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009c800000, size 3 MiB

    [    0.000000] OF: reserved mem: initialized node ipc-memories@9c800000, compatible id shared-dma-pool

    [    0.000000] OF: reserved mem: 0x000000009c800000..0x000000009cafffff (3072 KiB) nomap non-reusable ipc-memories@9c800000

    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009cb00000, size 1 MiB

    [    0.000000] OF: reserved mem: initialized node m4f-dma-memory@9cb00000, compatible id shared-dma-pool

    [    0.000000] OF: reserved mem: 0x000000009cb00000..0x000000009cbfffff (1024 KiB) nomap non-reusable m4f-dma-memory@9cb00000

    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009cc00000, size 14 MiB

    [    0.000000] OF: reserved mem: initialized node m4f-memory@9cc00000, compatible id shared-dma-pool

    [    0.000000] OF: reserved mem: 0x000000009cc00000..0x000000009d9fffff (14336 KiB) nomap non-reusable m4f-memory@9cc00000

    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009da00000, size 1 MiB

    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@9da00000, compatible id shared-dma-pool

    [    0.000000] OF: reserved mem: 0x000000009da00000..0x000000009dafffff (1024 KiB) nomap non-reusable r5f-dma-memory@9da00000

    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009db00000, size 12 MiB

    [    0.000000] OF: reserved mem: initialized node r5f-memory@9db00000, compatible id shared-dma-pool

    [    0.000000] OF: reserved mem: 0x000000009db00000..0x000000009e6fffff (12288 KiB) nomap non-reusable r5f-memory@9db00000

                     

  • Hi Rio,

    512MB DDR should be plenty for Linux applications on AM64x processors. But if the customer's use case is really short by this 24MB memory used by OPTEE and their application doesn't use runtime security related features, they can remove the OPTEE component to free this 24MB DDR region.

    We don't provide support for optimizing OPTEE memory footprint.

  • Hi Bin:

    Sorry, this is for AM62 case, not the AM64.

    Please comment if we still have no chance for reducing the space this OPTTE.

    Thanks.

    BR Rio

  • Hi Rio,

    The OPTEE component for AM64x and AM62x is pretty much the same. My response above is applicable to AM62x too.

  • Hi Bin:

    We have fixed this, so, this ticket can be closed, thanks.

    BR Rio

  • Hi Rio,

    Can you please explain how it was fixed?

  • Hi Bin:

    We patched as the below.

    BR Rio

    diff --git a/arch/arm64/boot/dts/vendor/your-board.dts b/arch/arm64/boot/dts/vendor/your-board.dts

    index 1234567..abcdef8 100644

    --- a/arch/arm64/boot/dts/vendor/your-board.dts

    +++ b/arch/arm64/boot/dts/vendor/your-board.dts

    @@ -15,9 +15,9 @@

                                 #size-cells = <2>;

                                 ranges;

     

    -                            optee@9e800000 {

    +                           optee@9f000000 {

                                                compatible = "rmem-of-byw-ee", "optee";

    -                                           reg = <0x00 0x9e800000 0x00 0x01800000>; /* 24 MiB */

    +                                          reg = <0x00 0x9f000000 0x00 0x01000000>; /* Reduced to 16 MiB */

                                                no-map;

                                 };

                  };

  • How is the size 0x01000000 (16MB) determined?

  • God feeling TBH, 

    As long as it can be reduced enough, my cust is okay.

    They have tested it BTW.

    Br Rio