IMX8mp: NXP’s 6.1.22_2.0.0​ Mickledore galcore.ko kernel panic, gpu_reserved

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

IMX8mp: NXP’s 6.1.22_2.0.0​ Mickledore galcore.ko kernel panic, gpu_reserved

Jump to solution
798 Views
TerryBarnaby1
Contributor IV

Hi, we have a custom imx8mp platform that is in production and working well with a Linux system based on NXP's LF5.10.52_2.1.0 Yocto Hardknott. We are now trying to update the base system to a new one based on NXP’s 6.1.22_2.0.0​ Yocto Mickledore.

This basically works, but the kernel panics on loading the galcore.ko module with an SError. On debugging this issue it looks to be due to the galcore module trying to access LPDDR4 memory that does not exist on our platform. We have 3 GBytes and the imx8mp-evk platform we have based our system on has 6 GBytes. Our system sets up the LPDDR4 memory in uboot with the correct settings (as calibrated) and our board specific DTS sets the memory size etc.

I believe galcore is getting its reserved memory address from the DTS imx8mp.dtsi include and the section:

gpu_reserved: gpu_reserved@100000000 {
no-map;
reg = <0x1 0x00000000 0 0x10000000>;
};

It looks like it is trying to access 0x10000000, but our RAM is 3 GBytes from 0x040000000 to 0x0FFFFFFFF.

Is there any documentation on this gpu_reserved memory setting, like what is the syntax/values, where actually is the settings pointing to in physical memory and how big is it and how much actually needs to be reserved etc ?

0 Kudos
1 Solution
743 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @TerryBarnaby1,

Yes, Your understanding is correct.

Thanks & Regards,
Dhruvit Vasavada

View solution in original post

0 Kudos
5 Replies
764 Views
TerryBarnaby1
Contributor IV

Many thanks.

One other point: is there any particular address this reserved memory should be or is best ?

We have 3 GBytes LPDDR4 and have set, in our boards DTS file:

memory@40000000 {
  device_type = "memory";
  reg = <0x0 0x40000000 0 0x80000000>,
  <0x0 0xC0000000 0 0x40000000>;
};

resmem: reserved-memory {
  gpu_reserved: gpu_reserved@100000000 {
    no-map;
    reg = <0x0 0xC0000000 0 0x10000000>;
  };
};

So we have set the GPU's reserved RAM to start at 2 GBytes. This works fine, but we are unsure of the pros and cons of this.

Also we have added two memory@40000000 "segments", 2G and 1G but we are also unsure if we should have these two segments and what the second one is used for ? We don't use the OPTEE system. Is there any information on this ?

Also can I feedback that I don't think that the "gpu_reserved:" definition should be in the generic imx8mp.dtsi file, I think it should be in one of the board specific files such as imx8mp-evk.dts. The setting assumes the IMX8mp system will have more than 3 GBytes of RAM and many boards won't have this. Also the name "gpu_reserved@100000000" is not ideal encoding the address in the name when it will actually be different in our case.

Cheers

Terry

0 Kudos
755 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @TerryBarnaby1,

I hope you are doing well.

There is no particular address where GPU-reserved memory should be allocated. ideally, it should be allocated in the second half of DRAM. In your case, it is correctly done.

Two memory segments are logical segments, that is because the memory range is divided into i.MX8MP ( 3GB & 5GB )

Screenshot from 2023-10-17 11-08-34.png

I will inform the BSP release team regarding an issue with keeping gpu_reserved node in imx8mp.dtsi

Thanks & Regards,
Dhruvit Vasavada

0 Kudos
750 Views
TerryBarnaby1
Contributor IV

Ok, then I presume I should set:

memory@40000000 {
device_type = "memory";
reg = <0x0 0x40000000 0 0xC0000000>;
};

Then I have only allocated my 3 GBytes as one segment. This assumes that Uboot/Linux does not do something special with the second memory@40000000 segment ?

0 Kudos
744 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @TerryBarnaby1,

Yes, Your understanding is correct.

Thanks & Regards,
Dhruvit Vasavada

0 Kudos
770 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @TerryBarnaby1,

I hope you are doing well.

One needs to change the gpu reserved node for reduced DRAM Size.

reg property of gpu_reserved contains 2 cells each of start address and size.

reg = <0x1 0x00000000 0 0x10000000>;

here first two cells point to the start address of gpu reserved memory in DRAM & last two cells are for size(0 0x10000000>  = 256 MB)

One can refer to 2.2 Cortex-A53 Memory Map in i.MX8MP RM for more information.

Recommended reserved mem size of gpu is 256 MB.

Thanks & Regards,
Dhruvit Vasavada

0 Kudos