imx8mp U-boot ramoops memory

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

imx8mp U-boot ramoops memory

Jump to solution
1,059 Views
andrej_valek
Contributor V

Dear support!

What I wanted to achieve is to get the persistent memory which could be used for ramoops storage. So I did some testing in U-boot, but each of the memory address which I used was "scrambled" after reset. I tried reset or reset -w commands, but nothing helped. Here is the example of my test:

u-boot=> mw 55100000 10
u-boot=> md 55100000
55100000: 00000010 ffffffff ffffffff ffffffff ................
55100010: ffffffff ffffffff ffffffff ffffffff ................
...
u-boot=> reset
resetting ...
U-Boot SPL 2024.04-4fa57eaf6dd (Feb 19 2026 - 12:49:01 +0000)
DDRINFO: start DRAM init
DDRINFO: DRAM rate 4000MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
DDR configured as dual rank
SEC0: RNG instantiated
Normal Boot
Trying to boot from BOOTROM
Boot Stage: Primary boot Find img info 0x48025a00, size 888
Need continue download 1024
NOTICE: Do not release JR0 to NS as it can be used by HAB
NOTICE: BL31: v2.10.0 (release):android-14.0.0_2.2.0-rc2-0-g7c64d4e86
NOTICE: BL31: Built : 10:35:32, Aug 29 2024

U-Boot 2024.04-4fa57eaf6dd (Feb 19 2026 - 12:49:01 +0000)
CPU: i.MX8MP[8] rev1.1 1600 MHz (running at 1200 MHz)
CPU: Industrial temperature grade (-40C to 105C) at 60C
Reset cause: POR
DRAM: 4 GiB
...
u-boot=> md 55100000
55100000: ffffffff ffffffff ffffffff ffffffff ................
55100010: ffffffff ffffffff ffffffff ffffffff ................
...

Who/where the memory "scrambled" then? ATF, SPL, PMIC or? Which address could be used? Is it even possible to do it on imx8mp machine?

Many thanks,
Andy

Tags (4)
0 Kudos
Reply
1 Solution
575 Views
andrej_valek
Contributor V

Ok, will answer it by myself.

Three components (U-Boot, Kernel and ATF) have to touched to make it really working.

  • U-boot + Kernel (DTB)
 &wdog1 {
-	 fsl,ext-reset-output;
+	 // fsl,ext-reset-output;
	 pinctrl-names = "default";
	 pinctrl-0 = <&pinctrl_wdog>;
	 status = "okay";
  • ATF (platform_def.h) 
- #define IMX_WDOG_B_RESET
+ // #define IMX_WDOG_B_RESET

After that, ramoops should survive the reboot.

BR,
Andy

View solution in original post

0 Kudos
Reply
5 Replies
576 Views
andrej_valek
Contributor V

Ok, will answer it by myself.

Three components (U-Boot, Kernel and ATF) have to touched to make it really working.

  • U-boot + Kernel (DTB)
 &wdog1 {
-	 fsl,ext-reset-output;
+	 // fsl,ext-reset-output;
	 pinctrl-names = "default";
	 pinctrl-0 = <&pinctrl_wdog>;
	 status = "okay";
  • ATF (platform_def.h) 
- #define IMX_WDOG_B_RESET
+ // #define IMX_WDOG_B_RESET

After that, ramoops should survive the reboot.

BR,
Andy

0 Kudos
Reply
1,040 Views
Oswalag
NXP TechSupport
NXP TechSupport

Hello,

Did you add the .dts node for that? please refer to the following example of implementation:  

https://embear.ch/posts/using-ramoops/ 

0 Kudos
Reply
1,021 Views
andrej_valek
Contributor V

Hello,

Sure, I started with using it with correct way via DTB in Linux. But when I rebooted the board, nothing has been written into this section. So I was thinking someone has to "scramble" the memory. So I moved one level down into U-boot. There I also tried to define the "reserved-memory", but it didn't help. As I said, I tried multiple memory addresses (55110000, 944400000, ...) based on:

3d800000-3dbfffff : 3d800000.ddr-pmu ddr-pmu@3d800000
40000000-54ffffff : System RAM
  48210000-4975ffff : Kernel code
  49760000-49adffff : reserved
  49ae0000-49d1ffff : Kernel data
  4ffed000-4fffcfff : reserved
55000000-5510ffff : reserved
55110000-553fffff : System RAM
55400000-554fffff : reserved
55500000-7fffffff : System RAM
80000000-80ffffff : reserved
81000000-923fffff : System RAM
92400000-943fffff : reserved
94400000-ffffffff : System RAM
  c0000000-ffffffff : reserved
100000000-10fffffff : reserved
  100000000-10fffffff : gcContMem
110000000-13fffffff : System RAM
  13b0ec000-13f7fffff : reserved
  13f827000-13f827fff : reserved
  13f82a000-13f82cfff : reserved
  13f82d000-13f841fff : reserved
  13f842000-13f88ffff : reserved
  13f890000-13fffffff : reserved
reserved-memory {
	#address-cells = <2>;
	#size-cells = <2>;
	ranges;

	ramoops: ramoops@94400000 {
		compatible = "ramoops";
		reg = <0 0x94400000 0 0x00100000>; // 1MB at 0x94400000
		record-size = <0x10000>; // 64kB per record
		console-size = <0x10000>; // 64kB for console
		ftrace-size = <0x40000>; // 256kB for ftrace output
		pmsg-size = <0x10000>; // 64kB for user messages
	};
};

I would say the problem has to be somewhere deeper, that the memory is reset, maybe PMIC? If yes, where/how to configure it to not do a DRAM power cycle.

BR,
Andy

0 Kudos
Reply
969 Views
Oswalag
NXP TechSupport
NXP TechSupport

Hello,

 

I understand, unfortunately ramoops is not implemented in our BSP, toradex did it so it would be better if you ask them for the implementation on their BSP.  

0 Kudos
Reply
946 Views
andrej_valek
Contributor V

Hello,

not sure if this a Toradex' related problem, while it could be somewhere in ATF or... which is a NXP part. On the other hand someone else was asking the same there https://community.toradex.com/t/pstore-and-ramoops-on-verdin-imx8mp-and-ivy-dev-board/29567/6 but no response... . Do you know where they did it then?

Thanks,
Andy

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2322086%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Eimx8mp%20U-boot%20ramoops%20memory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2322086%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EDear%20support!%3C%2FP%3E%3CP%3EWhat%20I%20wanted%20to%20achieve%20is%20to%20get%20the%20persistent%20memory%20which%20could%20be%20used%20for%20ramoops%20storage.%20So%20I%20did%20some%20testing%20in%20U-boot%2C%20but%20each%20of%20the%20memory%20address%20which%20I%20used%20was%20%22scrambled%22%20after%20reset.%20I%20tried%20%3CEM%3Ereset%3C%2FEM%3E%20or%20%3CEM%3Ereset%20-w%3C%2FEM%3E%20commands%2C%20but%20nothing%20helped.%20Here%20is%20the%20example%20of%20my%20test%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Eu-boot%3D%26gt%3B%20mw%2055100000%2010%0Au-boot%3D%26gt%3B%20md%2055100000%0A55100000%3A%2000000010%20ffffffff%20ffffffff%20ffffffff%20................%0A55100010%3A%20ffffffff%20ffffffff%20ffffffff%20ffffffff%20................%0A...%0Au-boot%3D%26gt%3B%20reset%0Aresetting%20...%3C%2FCODE%3E%3C%2FPRE%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3EU-Boot%20SPL%202024.04-4fa57eaf6dd%20(Feb%2019%202026%20-%2012%3A49%3A01%20%2B0000)%0ADDRINFO%3A%20start%20DRAM%20init%0ADDRINFO%3A%20DRAM%20rate%204000MTS%0ADDRINFO%3Addrphy%20calibration%20done%0ADDRINFO%3A%20ddrmix%20config%20done%0ADDR%20configured%20as%20dual%20rank%0ASEC0%3A%20RNG%20instantiated%0ANormal%20Boot%0ATrying%20to%20boot%20from%20BOOTROM%0ABoot%20Stage%3A%20Primary%20boot%20Find%20img%20info%200x48025a00%2C%20size%20888%0ANeed%20continue%20download%201024%0ANOTICE%3A%20Do%20not%20release%20JR0%20to%20NS%20as%20it%20can%20be%20used%20by%20HAB%0ANOTICE%3A%20BL31%3A%20v2.10.0%20(release)%3Aandroid-14.0.0_2.2.0-rc2-0-g7c64d4e86%0ANOTICE%3A%20BL31%3A%20Built%20%3A%2010%3A35%3A32%2C%20Aug%2029%202024%0A%0AU-Boot%202024.04-4fa57eaf6dd%20(Feb%2019%202026%20-%2012%3A49%3A01%20%2B0000)%0ACPU%3A%20i.MX8MP%5B8%5D%20rev1.1%201600%20MHz%20(running%20at%201200%20MHz)%0ACPU%3A%20Industrial%20temperature%20grade%20(-40C%20to%20105C)%20at%2060C%0AReset%20cause%3A%20POR%0ADRAM%3A%204%20GiB%0A...%0Au-boot%3D%26gt%3B%20md%2055100000%0A55100000%3A%20ffffffff%20ffffffff%20ffffffff%20ffffffff%20................%0A55100010%3A%20ffffffff%20ffffffff%20ffffffff%20ffffffff%20................%0A...%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EWho%2Fwhere%20the%20memory%20%22scrambled%22%20then%3F%20ATF%2C%20SPL%2C%20PMIC%20or%3F%20Which%20address%20could%20be%20used%3F%20Is%20it%20even%20possible%20to%20do%20it%20on%20imx8mp%20machine%3F%3C%2FP%3E%3CP%3EMany%20thanks%2C%3CBR%20%2F%3EAndy%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2322086%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ei.MX%208M%20%7C%20i.MX%208M%20Mini%20%7C%20i.MX%208M%20Nano%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELinux%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPMIC%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EYocto%20Project%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2322416%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx8mp%20U-boot%20ramoops%20memory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2322416%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3ESure%2C%20I%20started%20with%20using%20it%20with%20correct%20way%20via%20DTB%20in%20Linux.%20But%20when%20I%20rebooted%20the%20board%2C%20nothing%20has%20been%20written%20into%20this%20section.%20So%20I%20was%20thinking%20someone%20has%20to%20%22scramble%22%20the%20memory.%20So%20I%20moved%20one%20level%20down%20into%20U-boot.%20There%20I%20also%20tried%20to%20define%20the%20%22reserved-memory%22%2C%20but%20it%20didn't%20help.%20As%20I%20said%2C%20I%20tried%20multiple%20memory%20addresses%20(55110000%2C%20944400000%2C%20...)%20based%20on%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E3d800000-3dbfffff%20%3A%203d800000.ddr-pmu%20ddr-pmu%403d800000%0A40000000-54ffffff%20%3A%20System%20RAM%0A%20%2048210000-4975ffff%20%3A%20Kernel%20code%0A%20%2049760000-49adffff%20%3A%20reserved%0A%20%2049ae0000-49d1ffff%20%3A%20Kernel%20data%0A%20%204ffed000-4fffcfff%20%3A%20reserved%0A55000000-5510ffff%20%3A%20reserved%0A55110000-553fffff%20%3A%20System%20RAM%0A55400000-554fffff%20%3A%20reserved%0A55500000-7fffffff%20%3A%20System%20RAM%0A80000000-80ffffff%20%3A%20reserved%0A81000000-923fffff%20%3A%20System%20RAM%0A92400000-943fffff%20%3A%20reserved%0A94400000-ffffffff%20%3A%20System%20RAM%0A%20%20c0000000-ffffffff%20%3A%20reserved%0A100000000-10fffffff%20%3A%20reserved%0A%20%20100000000-10fffffff%20%3A%20gcContMem%0A110000000-13fffffff%20%3A%20System%20RAM%0A%20%2013b0ec000-13f7fffff%20%3A%20reserved%0A%20%2013f827000-13f827fff%20%3A%20reserved%0A%20%2013f82a000-13f82cfff%20%3A%20reserved%0A%20%2013f82d000-13f841fff%20%3A%20reserved%0A%20%2013f842000-13f88ffff%20%3A%20reserved%0A%20%2013f890000-13fffffff%20%3A%20reserved%3C%2FCODE%3E%3C%2FPRE%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Ereserved-memory%20%7B%0A%09%23address-cells%20%3D%20%26lt%3B2%26gt%3B%3B%0A%09%23size-cells%20%3D%20%26lt%3B2%26gt%3B%3B%0A%09ranges%3B%0A%0A%09ramoops%3A%20ramoops%4094400000%20%7B%0A%09%09compatible%20%3D%20%22ramoops%22%3B%0A%09%09reg%20%3D%20%26lt%3B0%200x94400000%200%200x00100000%26gt%3B%3B%20%2F%2F%201MB%20at%200x94400000%0A%09%09record-size%20%3D%20%26lt%3B0x10000%26gt%3B%3B%20%2F%2F%2064kB%20per%20record%0A%09%09console-size%20%3D%20%26lt%3B0x10000%26gt%3B%3B%20%2F%2F%2064kB%20for%20console%0A%09%09ftrace-size%20%3D%20%26lt%3B0x40000%26gt%3B%3B%20%2F%2F%20256kB%20for%20ftrace%20output%0A%09%09pmsg-size%20%3D%20%26lt%3B0x10000%26gt%3B%3B%20%2F%2F%2064kB%20for%20user%20messages%0A%09%7D%3B%0A%7D%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EI%20would%20say%20the%20problem%20has%20to%20be%20somewhere%20deeper%2C%20that%20the%20memory%20is%20reset%2C%20maybe%20PMIC%3F%20If%20yes%2C%20where%2Fhow%20to%20configure%20it%20to%20not%20do%20a%20DRAM%20power%20cycle.%3C%2FP%3E%3CP%3EBR%2C%3CBR%20%2F%3EAndy%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2322099%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx8mp%20U-boot%20ramoops%20memory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2322099%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3EDid%20you%20add%20the%20.dts%20node%20for%20that%3F%20please%20refer%20to%20the%20following%20example%20of%20implementation%3A%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fembear.ch%2Fposts%2Fusing-ramoops%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fembear.ch%2Fposts%2Fusing-ramoops%2F%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2325664%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx8mp%20U-boot%20ramoops%20memory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2325664%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EI%20understand%2C%20unfortunately%20ramoops%20is%20not%20implemented%20in%20our%20BSP%2C%26nbsp%3B%3CSPAN%3Etoradex%20did%20it%20so%20it%20would%20be%20better%20if%20you%20ask%20them%20for%20the%20implementation%20on%20their%20BSP.%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2326083%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx8mp%20U-boot%20ramoops%20memory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2326083%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3Enot%20sure%20if%20this%20a%20Toradex'%20related%20problem%2C%20while%20it%20could%20be%20somewhere%20in%20ATF%20or...%20which%20is%20a%20NXP%20part.%20On%20the%20other%20hand%20someone%20else%20was%20asking%20the%20same%20there%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.toradex.com%2Ft%2Fpstore-and-ramoops-on-verdin-imx8mp-and-ivy-dev-board%2F29567%2F6%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fcommunity.toradex.com%2Ft%2Fpstore-and-ramoops-on-verdin-imx8mp-and-ivy-dev-board%2F29567%2F6%3C%2FA%3E%26nbsp%3Bbut%20no%20response...%20.%20Do%20you%20know%20where%20they%20did%20it%20then%3F%3C%2FP%3E%3CP%3EThanks%2C%3CBR%20%2F%3EAndy%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2339167%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx8mp%20U-boot%20ramoops%20memory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2339167%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EOk%2C%20will%20answer%20it%20by%20myself.%3C%2FP%3E%3CP%3EThree%20components%20(U-Boot%2C%20Kernel%20and%20ATF)%20have%20to%20touched%20to%20make%20it%20really%20working.%3C%2FP%3E%3CUL%3E%3CLI%3EU-boot%20%2B%20Kernel%20(DTB)%3C%2FLI%3E%3C%2FUL%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%20%26amp%3Bwdog1%20%7B%0A-%09%20fsl%2Cext-reset-output%3B%0A%2B%09%20%2F%2F%20fsl%2Cext-reset-output%3B%0A%09%20pinctrl-names%20%3D%20%22default%22%3B%0A%09%20pinctrl-0%20%3D%20%26lt%3B%26amp%3Bpinctrl_wdog%26gt%3B%3B%0A%09%20status%20%3D%20%22okay%22%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CUL%3E%3CLI%3EATF%20(platform_def.h)%26nbsp%3B%3C%2FLI%3E%3C%2FUL%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E-%20%23define%20IMX_WDOG_B_RESET%0A%2B%20%2F%2F%20%23define%20IMX_WDOG_B_RESET%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EAfter%20that%2C%20ramoops%20should%20survive%20the%20reboot.%3C%2FP%3E%3CP%3EBR%2C%3CBR%20%2F%3EAndy%3C%2FP%3E%3C%2FLINGO-BODY%3E