LPDDR4x memory size configuration

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPDDR4x memory size configuration

Jump to solution
1,043 Views
bora
Contributor II

I use imx93 for my custom board and with MT53E256M16D1 LPDDR4X RAM. I changed in the device tree 

reserved-memory {
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;

		linux,cma {
			compatible = "shared-dma-pool";
			reusable;
			alloc-ranges = <0 0x80000000 0 0x20000000>;
			size = <0 0x02000000>;
			linux,cma-default;
		};

		ethosu_mem: ethosu_region@80000000 {
			compatible = "shared-dma-pool";
			reusable;
			reg = <0x0 0x80000000 0x0 0x02000000>;
		};

		vdev0vring0: vdev0vring0@84000000 {
			reg = <0 0x84000000 0 0x8000>;
			no-map;
		};

		vdev0vring1: vdev0vring1@84008000 {
			reg = <0 0x84008000 0 0x8000>;
			no-map;
		};

		vdev1vring0: vdev1vring0@84010000 {
			reg = <0 0x84010000 0 0x8000>;
			no-map;
		};

		vdev1vring1: vdev1vring1@84018000 {
			reg = <0 0x84018000 0 0x8000>;
			no-map;
		};

		rsc_table: rsc-table@2021e000 {
			reg = <0 0x2021e000 0 0x1000>;
			no-map;
		};

		vdevbuffer: vdevbuffer@84020000 {
			compatible = "shared-dma-pool";
			reg = <0 0x84020000 0 0x100000>;
			no-map;
		};

		ele_reserved: ele-reserved@84120000 {
			compatible = "shared-dma-pool";
			reg = <0 0x84120000 0 0x100000>;
			no-map;
		};
	};

and in the u-boot I use this header file imx93_evk.h and changed only define PHYS_SDRAM_SIZE

 

but some how I still get memory errors. do I need to change anything ?

Labels (2)
0 Kudos
Reply
1 Solution
788 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @bora,

We have installed the MT53E1G16D1FW-046 memory module on the FRDM board.

I've configured both U-Boot and the Linux Kernel to utilize 512MB of memory.

 

Best regards,
Chavira

View solution in original post

0 Kudos
Reply
7 Replies
1,004 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @bora,

Thank you for contacting NXP Support!

 

The original custom configuration is wrong because it defines CMA’s alloc-ranges to cover the entire DDR (0x80000000–0x9FFFFFFF) while also reserving Ethos-U at 0x80000000–0x81FFFFFF and ELE at 0x84120000, creating overlaps. Additionally, Ethos-U is marked as reusable without no-map, allowing the kernel to reuse that memory, and ELE is not explicitly linked to its driver via memory-region. This breaks memory isolation, can cause corruption and DMA errors, and does not follow NXP’s best practices, which always separate CMA from dedicated pools and place ELE in a safe block outside CMA.

 

Try the next recommendation:

 

    reserved-memory {
        #address-cells = <2>;
        #size-cells   = <2>;
        ranges;

        ethosu_mem: ethosu_region@80000000 {
            compatible = "shared-dma-pool";
            reg = <0 0x80000000 0 0x02000000>;
            no-map;   
        };

        linux,cma {
            compatible = "shared-dma-pool";
            reusable;
            alloc-ranges = <0 0x82000000 0 0x1E000000>;
			size = <0 0x04000000>;
            linux,cma-default;
        };
        vdev0vring0: vdev0vring0@84000000 { reg = <0 0x84000000 0 0x00008000>; no-map; }; /* 32KB */
        vdev0vring1: vdev0vring1@84008000 { reg = <0 0x84008000 0 0x00008000>; no-map; }; /* 32KB */
        vdev1vring0: vdev1vring0@84010000 { reg = <0 0x84010000 0 0x00008000>; no-map; }; /* 32KB */
        vdev1vring1: vdev1vring1@84018000 { reg = <0 0x84018000 0 0x00008000>; no-map; }; /* 32KB */

        vdevbuffer: vdevbuffer@84020000 {
            compatible = "shared-dma-pool";
            reg = <0 0x84020000 0 0x00100000>;
            no-map;
        };

        ele_reserved: ele-reserved@90000000 {
            compatible = "shared-dma-pool";
            reg = <0 0x90000000 0 0x00100000>; 
            no-map;
        };
    };

 

If you are using optee you should update the ddr size in the next file too:

https://github.com/nxp-imx/imx-optee-os/blob/e0a3e77735941e6057a1994a576b83a93ea0bdb9/core/arch/arm/...

 

Best Regards,
Chavira

 

0 Kudos
Reply
979 Views
bora
Contributor II
Thank you for the configuration now gallium softpipe works for the qt6, but how can I make it work via llvmpipe ? I still get segmentation fault, do you know maybe the packages I need to install?
0 Kudos
Reply
958 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @bora,

I haven’t used LLVMpipe personally, but based on what I found online, the limited amount of RAM on your board might be the issue. Since LLVMpipe performs 3D rendering using the CPU instead of a GPU, it typically requires more memory to handle the workload efficiently. With low RAM, the system may struggle to render graphics smoothly.

 

 

0 Kudos
Reply
894 Views
bora
Contributor II
I get this error :
root@imx93-11x11-lpddr4x-evk:/usr/share/examples/widgets/widgets/calendarwidget/bin# dmesg | grep fdt
[ 0.000000] OF: fdt: Reserved memory: failed to reserve memory for node 'ethosu_region@80000000': base 0x0000000080000000, size 32 MiB

is it relevant ?
0 Kudos
Reply
841 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @bora,

 

I tested the following Device Tree configuration using the iMX93-FRDM board:

	reserved-memory {
        #address-cells = <2>;
        #size-cells   = <2>;
        ranges;

        linux,cma {
            compatible = "shared-dma-pool";
            reg = <0 0x88000000 0 0x04000000>;   /* 64 MB @ 0x8800_0000 */
            reusable;
            linux,cma-default;
        };

        /* Ethos-U: mover lejos del arranque del kernel (32 MB) */
        ethosu_mem: ethosu_region@8c000000 {
            compatible = "shared-dma-pool";
            reg = <0 0x8c000000 0 0x02000000>;   
            no-map;                               
        };

        vdev0vring0: vdev0vring0@84000000 { reg = <0 0x84000000 0 0x00008000>; no-map; };
        vdev0vring1: vdev0vring1@84008000 { reg = <0 0x84008000 0 0x00008000>; no-map; };
        vdev1vring0: vdev1vring0@84010000 { reg = <0 0x84010000 0 0x00008000>; no-map; };
        vdev1vring1: vdev1vring1@84018000 { reg = <0 0x84018000 0 0x00008000>; no-map; };

        rsc_table: rsc-table@2021e000 { reg = <0 0x2021e000 0 0x00001000>; no-map; }; /* OCRAM */

        vdevbuffer: vdevbuffer@84020000 {
            compatible = "shared-dma-pool";
            reg = <0 0x84020000 0 0x00100000>;   /* 1 MB */
            no-map;
        };

        ele_reserved: ele-reserved@90000000 {
            compatible = "shared-dma-pool";
            reg = <0 0x90000000 0 0x00100000>;   /* 1 MB @ 0x9000_0000 */
            no-map;
        };
    };



No errors are observed:

Chavira_0-1761666429986.png

Chavira_1-1761666458518.png

 

Best Regards,

Chavira

0 Kudos
Reply
797 Views
bora
Contributor II
0 Kudos
Reply
789 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @bora,

We have installed the MT53E1G16D1FW-046 memory module on the FRDM board.

I've configured both U-Boot and the Linux Kernel to utilize 512MB of memory.

 

Best regards,
Chavira

0 Kudos
Reply