
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 03/14/2014 09:17 AM, Tom Rini wrote:
On Fri, Mar 14, 2014 at 10:33:46AM +0000, Ian Campbell wrote:
+#ifdef CONFIG_SPL_BUILD +void sunxi_board_init(void) +{ + int power_failed = 0; + unsigned long ramsize; + + printf("DRAM:"); + ramsize = sunxi_dram_init(); + if (!ramsize) { + printf(" ?"); + ramsize = sunxi_dram_init(); + } + if (!ramsize) { + printf(" ?"); + ramsize = sunxi_dram_init(); + }
We have to try 3 times? What?
TLDR: only needs to be called once.
I have no idea why this is here. We use the same raminit code in coreboot, and it works when we call it the first time. The raminit code we had when this was written was not tuned to use proper delays. I imagine whoever initially wrote this triple-play, was dealing with finicky raminit code, and found out that calling it a few times worked. I think it's safe to remove tries 2 and 3.
- /* + * Only clock up the CPU to full speed if we are
reasonably + * assured it's being powered with suitable core voltage + */ + if (!power_failed) + clock_set_pll1(912000000);
Define that please.
TLDR: This does not belong in this patch
power_failed was a flag returned by the Power Manager Unit code (PMU). The PMU on these boards is used to ramp up the CPU voltage. You need that to be able to get to full clock without hanging. power_failed lets us know if something went wrong with the PMU setup and we should leave the clocks the way they were. I think this should be added in the patch which adds the power setup.