]> git.karo-electronics.de Git - karo-tx-uboot.git/commit
sunxi: dram: Remove broken super-standby remnants
authorSiarhei Siamashka <siarhei.siamashka@gmail.com>
Sun, 3 Aug 2014 02:32:40 +0000 (05:32 +0300)
committerHans de Goede <hdegoede@redhat.com>
Tue, 12 Aug 2014 06:42:32 +0000 (08:42 +0200)
commitf2577967738f923571b7156ad46ef91d9fa8d9f8
treebd3294c579c93cd06d2f1bb03b776d0605ddeaee
parent34759d74a386ec82af946c2858935af9327a9f8a
sunxi: dram: Remove broken super-standby remnants

If the dram->ppwrsctl (SDR_DPCR) register has the lowest bit set to 1,
this means that DRAM is currently in self-refresh mode and retaining the
old data. Since we have no idea what to do in this situation yet, just
set this register to 0 and initialize DRAM in the same way as on any
normal reboot (discarding whatever was stored there).

This part of code was apparently used by the Allwinner boot0 bootloader
to handle resume from the so-called super-standby mode. But this
particular code got somehow mangled on the way from the boot0 bootloader
to the u-boot-sunxi bootloader and has no chance of doing anything even
remotely sane. For example:
1. in the original boot0 code we had "mctl_write_w(SDR_DPCR,
   0x16510000)" (write to the register) and in the u-boot it now looks
   like "setbits_le32(&dram->ppwrsctl, 0x16510000)" (set bits in the
   register)
2. in the original boot0 code it was issuing three commands "0x12, 0x17,
   0x13" (Self-Refresh entry, Self-Refresh exit, Refresh), but in the
   u-boot they have become "0x12, 0x12, 0x13" (Self-Refresh entry,
   Self-Refresh entry, Refresh)

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
arch/arm/cpu/armv7/sunxi/dram.c