I wanted to know the reset cause from U-boot into my operating system, and was hacking to find a way to get this. Maybe this benefits others.
This is the reset cause from u-boot:
U-Boot 2014.07 (Jan 19 2017 - 13:16:57) for F&S
CPU: Freescale i.MX6UL rev1.0 at 396 MHz
Reset: WDOG <- This will change depending on the cause of reset (power off, warm reboot etc)
Board: efusA7UL Rev 1.10 (LAN, WLAN, 1x DRAM)
Since this is reset before the enviroment is initialized, I needed to introduce a new variable, and copy the reset cause there, and then tried to find a sane location to inject it into enviroment variable reset_cause.
I do it during the countdown when booting, and there is probably better places to introduce it.
Once fully booted to Operating system, I use fw_printenv | grep reset_cause to read it, and voila.
Attached patch for u-boot sources from F&S fsimx6ul-V2.0, happy hacking guys!