Changes to David Gibson's original source to fit into u-boot's environment. No functionality changes.