Unfortunately, the spinor chip we're using has no reset pin.
I tried to do an experiment in Linux, which is to reset the imx6 without triggering POR in the PMIC. I've tried to reboot imx6 cpu via watchdog timeout, in the same way that the reset command in u-boot is working. Let the wdog timer expire, and you'll get a cpu reset. We know it's working, despite of SPINOR. And we know that since it's just CPU WDOG reset, the power supply is not being reset as well, so the power to the SPINOR is steady. Our suspect is that the lack of reset after power reset to the SPINOR messes it up, and so the reboot in android messes up as well. So I tried to bypass that. If we do this in Linux, SPINOR wouldn't encounter power dips and so we should be able to reboot.
So I did that to Android Linux, I edited the imx2_wdt_restart in imx2_wdt.c. The edits are to set the WT bits in WCR to zero for minimum timeout (0.5s), leave WDA and SRS bits as 1 to deassert them. I also edited the dtsi to use WDOG1 instead of WDOG2, meaning the WDOG_B line we were using, since it's not connected to WDOG1, should never assert. Add to that I've cleared the WDA bit here.
unsigned int wcr_enable = IMX2_WDT_WCR_WDE;
wcr_enable |= IMX2_WDT_WCR_SRS; /* do not assert int reset */
wcr_enable |= IMX2_WDT_WCR_WDA; /* do not assert ext-reset */
regmap_write(wdev->regmap, IMX2_WDT_WCR, wcr_enable);
if (imx2_wdt_is_running(wdev))
imx2_wdt_ping(wdog);
The watchdog indeed timed out (since all printks after imx2_wdt_ping never took place) but it didn't reboot like in u-boot's reset command. Reboot still failed. I checked the waveform to the SPINOR during this time, checking its SPI CLK signal, but there are just very few of them, as if the imx6 stopped communicating with spinor. We are sure we didn't POR'ed the power to the SPINOR.
I checked the oscope waveform in the correct reset case which is U-boot's reset and it showed the imx6 neatly provided a lot lot lot more SPI clock cycles to the SPINOR.
So, is it still the SPINOR that has problem here?