SoC : : Architecture/: : i.MX

i.MX 9 BSP Porting Guide - Memory Assignment

Jay.P Morgan 2024. 4. 30. 23:37

 

  7.1 Intro

 

  i.MX 8QuadMax, i.MX 8QuadXPlus 및 i.MX 8DXL에서 SCFW는 리소스를 분할하는 파티션 개념을 제공합니다. 메모리는 여러 영역으로 나누어져 있으며, 해당 보안 모드를 사용하는 특정 소프트웨어 모듈에서만 액세스할 수 있습니다.
  일반적으로 AP 코어에는 두 개의 파티션이 있습니다. 보안 ATF 파티션은 ATF 및 OP-TEE에 대한 중요한 리소스와 메모리를 소유합니다. 비보안 OS 파티션은 커널 및 UBoot에 대한 리소스와 메모리를 소유합니다. Arm Cortex-M4가 실행되면 SCFW에 의해 Arm Cortex-M4 파티션이 생성되고 리소스와 메모리가 할당됩니다.
  일반적인 DDR 메모리는 i.MX 8QuadMax MEK 보드에 다음 표와 같이 할당됩니다. 굵게 표시된 영역은 Linux 커널에서 액세스할 수 있습니다.

 

표 1. DDR memory assignment

Memory Type Start End Partition Reservation Code
DDR 0x80000000 0x8001FFFF Secure ATF Reserved by ATF  
mx8_ partition_ resources
 
0x80020000 0x801FFFFF Non-secure OS Reserved by U-
Boot
dram_init_ banksize
 
0x80200000 0x87FFFFFF Non-secure OS - -
0x88000000 0x887FFFFF M4_0 Reserved by SCFW and U-Boot for Cortex-M4 SCFW:
board_ system_ config
U-Boot:
#define
 BOOTAUX_
RESERVED_

 

          MEM_BASE
 0x88000000
#define
 BOOTAUX_
RESERVED_
MEM_SIZE
 0x08000000
 
0x88800000 0x8FFFFFFF M4_1 Reserved by SCFW and U-Boot for Cortex-M4 SCFW:
board_ system_ config
U-Boot:
#define
 BOOTAUX_
RESERVED_
MEM_BASE
 0x88000000
#define
 BOOTAUX_
RESERVED_
MEM_SIZE
 0x08000000
 
0x90000000 0xFDFFFFFF Non-secure OS - -
0xFE000000 0xFFBFFFFF Secure ATF Reserved by ATF for OPTEE mx8_ partition_ resources
 
0xFFC00000 0xFFFFFFFF Non-secure OS - -
0x880000000 0x8C0000000 Non-secure OS - -

 

표 2. FlexSPI memory assignment

Memory Type Start End Partition Reservation Code
FlexSPI 0x08081000 0x08180FFF M4_0 Reserved by
SCFW for M4_0
 
board_ system_ config
 
0x08181000 0x08181FFF M4_1 Reserved by
SCFW for M4_1
board_ system_ config
 

 

 

커널에서 VPU/RPMSG/DSP 드라이버는 DTB에 DDR 메모리를 예약합니다. 시스템은 이러한 영역에서 메모리를 할당할 수 없습니다. 사용자는 아래와 같이 예약된 메모리 노드에서 이를 찾을 수 있습니다.

reserved-memory {   #address-cells = <2>;
  #size-cells = <2>;
  ranges;
  /*
*	reserved-memory layout
*	0x8800_0000 ~ 0x8FFF_FFFF is reserved for M4   * Shouldn't be used at A core and Linux side.
   *
   */
  decoder_boot: decoder_boot@0x84000000 {
    no-map;
    reg = <0 0x84000000 0 0x2000000>;
  };
  encoder_boot: encoder_boot@0x86000000 {
    no-map;
    reg = <0 0x86000000 0 0x400000>;
  };
  rpmsg_reserved: rpmsg@0x90000000 {
    no-map;
    reg = <0 0x90000000 0 0x400000>;
  };
  rpmsg_dma_reserved:rpmsg_dma@0x90400000 {
    compatible = "shared-dma-pool";
    no-map;
    reg = <0 0x90400000 0 0x1C00000>;
  };
  decoder_rpc: decoder_rpc@0x92000000 {
    no-map;
    reg = <0 0x92000000 0 0x200000>;
  };
  encoder_rpc: encoder_rpc@0x92200000 {
    no-map;
    reg = <0 0x92200000 0 0x200000>;
  };
  dsp_reserved: dsp@0x92400000 {
    no-map;
    reg = <0 0x92400000 0 0x2000000>;
  };
  encoder_reserved: encoder_reserved@0x94400000 {
    no-map;
    reg = <0 0x94400000 0 0x800000>;
  };
  /* global autoconfigured region for contiguous allocations */
  linux,cma {
    compatible = "shared-dma-pool";
    reusable;
    size = <0 0x3c000000>;
    alloc-ranges = <0 0x96000000 0 0x3c000000>;
    linux,cma-default;
  };
};