Copied from U-Boot v2014.10 and changed to use getopt instead of handcrafted parsing. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>