NXP i.MX SoC Family/i.MX BSP Porting Guide

i.MX BSP Porting Guide - Memory Assignment

까마귀75 2022. 7. 4. 15:04
728x90
반응형
정보
IMXBSPPG

Rev. LF5.15.5_1.0.0, 31 March 2022를 기준으로 작성

 

Chapter 7 Memory Assignment

7.1 Introduction

i.MX 8QuadMax, i.MX 8QuadXPlus, i.MX 8DXL에서, SCFW는 리소스를 분할하는 파티션 개념을 제공한다. 메모리는 여러 영역으로 분할되고 해당 보안 모드가 있는 특정 소프트웨어 모듈에서만 액세스할 수 있다.

 

일반적으로 AP 코어에는 두 개의 파티션이 있다. 보안 ATF 파티션은 ATFOP-TEE에 대한 중요한 리소스와 메모리를 소유한다. non-secure OS 파티션은 커널 및 U-Boot를 위한 리소스와 메모리를 소유한다. Arm Cortex-M4가 실행 중일 때, Arm Cortex-M4 파티션이 SCFW에 의해 생성되고 리소스와 메모리가 할당된다.

 

일반적인 DDR 메모리는 i.MX 8QuadMax MEK 보드에서 아래 테이블과 같이 할당된다. 굵게 표시된 영역은 Linux 커널에 액세스할 수 있다.

Table 1. DDR memory assignment

Memory Type Start End Partition Reservation Code
DDR 0x80000000 0x8001FFFF Secure AFT Reserved by AFT 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 - -
0x88000000 0x8C000000 Non-secure OS - -

Arm Cortex-M4가 실행 중일 때, 아래의 FlexSPI 메모리는 Arm Cortex-M4 파티션에 할당된다.

Table 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; 
    };
};

 

728x90
반응형