[U-Boot] [PATCH v1 4/9] sunxi: initial generic sun7i cpu, board and start of day support

Alex G.
2014-03-15T15:57:28Z

-----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.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJTJHhiAAoJEL0kPHNPXJJKHeQP/ia4JHyieDyrY36hq/ocC/79
DwHxgf9CkvlHP4nBGdGuAiidyJpXbMtLUijbYgvrxIiaUwg831C+AakcZv4KnUTx
r7qQceAL6Yw9YReuPquEn/sj43LiOgOC4oRmwIq6UiUz0MeOwuXWTWa4KxYtG9LR
dkuauOU52EJlg7WJiSF96TainrZ89pADcuUxaq9YNEcZKmcn1SoiHivm6SBB8HBd
q0hDd+cd6ZKIY/YbSdlGctCaZbUfR7qAJSKMksCCecrpyg/eiEdEoYhsm2e30nZU
3LXcM+tJdUxGmlFMkWZYgDRi8nLywr7Lfmmrs+jUDj7BYewOyZNlQhyMROyr6SPP
YmBMDZbF4bDLRnZICCcyqDQbS5vSM1xSSucl6A4upmOBe5DpBbwSWpRCHQ2X8Lhq
L7Si4+JsnHB5zLrjlLwyFHMTHG6Ty2R7DZeRM3SjhPhp93b3mBw2K+wGCp6QG+sv
riGSCjKkBhbQG8UQYAEkwtwfws+pOmkwnkRwdBNy9jxi/xXL4J1E7hgEBbc3pY5E
AVmJEO8Eov9w78E1Tnxr3OMXMltjS4I1BJvwJFADJcS5/PZ9hJCBcA/oLqFXcTH1
lKklPGKGHpSdPxBcpZGMQ4ipP2IVhhz7MFuVWhI7qjUWRNfFG4GmpauqZc6qrceW
qjjxb2PEixZvb4yxLacH
=P4vd
-----END PGP SIGNATURE-----