ARM: sunxi: Add gpio pull-up/down and cleanup pin function definitions

Add definitions for pull-up/downs, and several pin functions used
by various drivers, such as gmac, i2c, and mmc.

Also remove any pin functions not currently used by drivers.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
i2c: sunxi: Use sunxi gpio pin function macros

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
net: sunxi_emac: Use sunxi gpio pin function macros

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
net: sunxi_gmac: Use sunxi gpio pin function macros

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
mmc: sunxi: Use sunxi gpio functions to configure pins

Use the sunxi gpio driver to configure pins, instead of directly
writing magic numbers.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: sunxi: fix sun5i uart1 pin definition name

The pin definition for uart1 was mis-named as uart0.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: fix a typo

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: add a comment about the magic numbers in dram.c

Wording mostly stolen from Henrik in
http://mid.gmane.org/<1394814510.13238.8.camel@localhost>

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Cc: Henrik Nordström <henrik@henriknordstrom.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: mksunxiboot: be silent unless something goes wrong

Also notice that perror includes the ":" after the message but before the errno
str, so omit it from the existing calls.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: mmc: add braces to remove ambiguity

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: dram: checkpatch.pl cleanups

Mainly whitespace. The main construct which it complains about is:
	while(POKE THE HARDWARE);
which obscures the potentially infinite loop, I've rewritten as:
	while(POKE THE HARDWARE)
		;

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: setup environment so initrd and fdt are relocated to safe addresses

Instead of setting CONFIG_SYS_BOOTMAPSZ instead set bootm_size to 512M in the
default environment. This causes boot_start_lmb to use addresses which are
covered by the kernels lowmem mapping, which is required by the boot protocol.

This should mean that workarounds such as fdt_high=ffffffff and
initrd_high=ffffffff are no longer required.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Cc: Tom Rini <trini@ti.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: mmc: defines for various mmc control bits

Mostly derived from existing comments. There are plenty of undefined bits still
though.

Objdump confirms that the resulting binary is identical.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: mmc: defines for clock bits

Objdump confirms no difference in the resulting binary.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: mmc: defines for mmc ctrl and cmd registers

Inferred from Linux driver.

Objdump confirms no change to the resulting binary.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: mmc: refactor enabling/disable DMA accesses

And remove a magic number in the process.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: mmc: defines for rint register bits

Names from Linux driver

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: mmc: defines for status register

Objdump confirms no change to the resulting binary.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: mmc: refactor similar wait loops

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: mmc: checkpatch whitespace fixes

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>