Warning for kernel porters - apparent brick-like symptoms!
I have been modifying the Sony kernel sources, and porting our 4.1 kernel to a 4.2 CAF branch to be used with CyanogenMod 10.1 and above. We will eventually
receive Android 4.3 direct from Sony, and therefore suitable kernel sources, but if we can beat them to it, why not?
However our Xperia SP has a very temperamental screen, it really needs a perfect frame buffer or it will crap out on you with no apparent way back.
If you flash a kernel with a broken frame buffer (a kernel that does not send the correct signals to the display), you will see nothing on the screen, sometimes random vertical lines, then your device will get into a low level bootloop, (ADB will not be available) and even if you flash a working kernel from a factory image this will not recover the device.
Basically, the screen gets stuck in a non-functional state, the device is able to detect this and immediately hard resets, so your device seems hard bricked.
Fortunately, Sony build into their factory images a special lock that, on first boot, nothing
can cause the device to shut down or reboot. Therefore to break this hard brick, you need to do a full wipe with flashtool.
On reboot the screen will still be broken, but it will do a full boot (you will eventually hear touch sounds when pressing the screen). You can now hit the power button to switch off the display, hit it again and your screen should, finally, come back to life.
* * * * * * * * * *
Why does this happen? My guess is that a specific set of commands must be used to control the display. Any deviation from that set and the screen gets stuck in a non-functional state, and the only way to recover is to eventually send the correct off/on sequence to it.
However this can only happen from a working rom, but due to the auto detect of the broken screen and hard reset (forcing the hardware to switch off without sending an off command to the screen), this can only happen after a full wipe to recreate the first boot sequence.
Therefore if you are experimenting with the kernel you need to be aware of this... 'feature' and that luckily there is a way to recover from it.
I have needed to recover my device three times now with this method and I haven't even owned it for a week yet. I have never seen such behaviour on any of the other devices I have worked on, so this is going to make kernel porting a tricky and tedious affair. The fact that the screen 'remembers' your bad kernel even after you flash a good one is pretty disturbing. (I even left my Xperia SP powered off for over an hour to see if the lack of power would reset the screen, but no change)