renesas-rcar / meta-renesas

MIT License
53 stars 80 forks source link

Renesas-Yocto-v5.1.0 release with Salvator-XS (H3 ES3.0) 8GB board memory issue #30

Open yf13 opened 2 years ago

yf13 commented 2 years ago

Hi,

I am trying the Renesas-Yocto-v5.1.0 release branch with a Salvator-XS (H3 ES3.0) 8GB board. However, using the kernel and .dtb files generated from bitbake core-image-minimal command can only recognize 3.9GB memory after kernel boots.

Then I converted the r8a77951-salvator-xs.dtb to a .dts file and found the memory@ entries add up to 4GB:

$ dtc -I dtb tmp/deploy/images/salvator-x/r8a77951-salvator-xs.dtb -O dts | fgrep -A5 memory@

        memory@48000000 {
                device_type = "memory";
                reg = <0x00 0x48000000 0x00 0x38000000>;
        };

        memory@500000000 {
                device_type = "memory";
                reg = <0x05 0x00 0x00 0x40000000>;
        };

        memory@600000000 {
                device_type = "memory";
                reg = <0x06 0x00 0x00 0x40000000>;
        };

        memory@700000000 {
                device_type = "memory";
                reg = <0x07 0x00 0x00 0x40000000>;
        };

This tells that by default 8GB devices are treated as 4GB in the Renesas-Yocto-v5.1.0 release?

I further edited the memory@xxxx entries in the .dts file to enlarge the length of first entry to 0x78000000 and length of the rest three entries to 0x01 0x00 and then converted it to .dtb file and tried on the target H3 device. This time, I can see kernel reports 6.9GB memory in total. This is better, but there is still 1GB memory not reported by the kernel. I grabbed the /proc/device-tree from the target system and checked it with dtc tool -- this time I saw that the memory@48000000 {} item contains a length of 0x38000000, even though I used the length of 0x78000000.

Could your experts explain how I can get 7.9GB total memory from this Yocto-v5.1.0 kernel?

Regards, yf13

DuyDang007 commented 2 years ago

Hi @yf13 ,

We confirm the issue on v5.1.0 release. It was fixed in v5.5.0 release. Could you try it?

yf13 commented 2 years ago

Hi @DuyDang007,

Thanks for the information.

I tried core-image-minimal recipe in v5.5.0 and generated .dtb files. However, my check with dtc command tells that both r8a77951-salvator-xs.dtb and r8a779m1-salvator-xs.dtb are targeting 4GB boards.

I am unsure what you mean by fixed in v5.5.0.

Did you mean that I shall go ahead and hack these .dtb files with 8GB memory map and try on the device?

Regards, Yanfeng

DuyDang007 commented 2 years ago

Hi @yf13

Linux memory layout was passed from arm-trusted-firmware. Please use arm trusted firmware and also u-boot from v5.5.0

Regards, Duy

yf13 commented 2 years ago

Thanks. Is there any links to any documents regarding this memory layout change? Does that mean memory related parts in kernel .dtb is totally ignored from now on?