sunxi: Change default load addresses from 0x50000000 to 0x48000000

0x50000000 is not a valid address on boards which only 256M of RAM
and our standard environment scripts use 0x48000000.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: Move SPL_BSS to below 256M DRAM limit

Some boards have only 256MB DRAM, so putting the SPL_BSS at 0x50000000
puts it outside the DRAM, things likely still work because the addresses
just wrap, but that makes the BSS conflict with the boot_params memory,
potentially breaking falcon boot.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi; Move spl HEAP to DRAM

u-boot does not call mem_malloc_init() until after dram has been setup, so
instead of wasting precious SRAM, simply but the HEAP in DRAM (just below
the BSS segment).

While at it change its size from 2 kB to 512 kB (same size as BSS) as we've
plenty of space in DRAM

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: remove READ_TIMER macro

Marek Vasut requested that this be removed during upstream review.

Since the inverting behaviour is a bit subtle I have decided to make this a
function rather than simply inlining the readl() at each of the users.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: Change default bootm_size to 0x10000000

We've boards which only have 256M of RAM, so using a default bootm_size
of 512M does not seem like a good idea.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: correct pinmux setup

Bo Shen reported that MMC no longer worked after commit ff42704 "sunxi: use
clrsetbit in gpio/pinmux code".

Re-examining those changes shows a couple of bogus changes (forgetting to shift
the value in one, and using the offset instead of the value in another).
Presumably Bo Shen's platform uses a different MMC device to what I tested.

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