• Guenter Roeck's avatar
    xtensa: xtfpga: Try software restart before simulating CPU reset · 012e9745
    Guenter Roeck authored
    Rebooting xtensa images loaded with the '-kernel' option in qemu does
    not work. When executing a reboot command, the qemu session either hangs
    or experiences an endless sequence of error messages.
    
      Kernel panic - not syncing: Unrecoverable error in exception handler
    
    Reset code jumps to the CPU restart address, but Linux can not recover
    from there because code and data in the kernel init sections have been
    discarded and overwritten at this point.
    
    XTFPGA platforms have a means to reset the CPU by writing 0xdead into a
    specific FPGA IO address. When used in QEMU the kernel image loaded with
    the '-kernel' option gets restored to its original state allowing the
    machine to boot successfully.
    
    Use that mechanism to attempt a platform reset. If it does not work,
    fall back to the existing mechanism.
    Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
    012e9745
setup.c 6.49 KB