swetland/omap4boot — pull request #11 by kousu (2014-11-29 11:22:57+00:00)
Title: Repair this program for 2015.

Per #8, I've committed @dmitry-pervushin's fix to the asm code (which I would have had no idea how to fix, so thanks Dimitry), and I've also dug deep with packet sniffers and solved why this version wasn't booting my phone and @wkpark's was: this version was not giving the 2nd stage time to orient itself. The 2nd stage is running on a slower machine than my (and probably your) host, and can be swamped out and confused if you talk to it too quickly; also the USB endpoint should be reopened to notify the 2nd stage that it has someone to talk to; with the `sleep()` but without the reopen, _mostly_ the boot goes properly, but sometimes it fails. Adding the reopen makes it so far 100% reliable for me. Plus [TI does it too](https://gforge.ti.com/gf/project/flash/scmsvn/?action=browse&path=%2Ftrunk%2Fomapflash%2Fhost%2Fpheriphalboot.c&annotate=5#l877).

I hae *not* edited the Makefile in this patch, because I do not know if the `arm-eabi-` -> `arm-none-eabi-` change was archlinux specific or broader.