Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A64-uQ7 support and more reliable clock-setup #2

Closed
wants to merge 3 commits into from

Conversation

ptomsich
Copy link

@ptomsich ptomsich commented Feb 2, 2017

Andre,

Here's the changes we have in our tree for the A64-uQ7 (Lynx).
Note that the changes to the init-sequence and clocking significantly improve the reliability of the boot process.

Cheers,
Philipp.

Philipp Tomsich added 3 commits February 2, 2017 23:49
Increasing the operating clocks may increase the current draw (or
require a higher voltage for certain voltage rails).  To ensure that
we never run into a problem in this area, the initialisation sequence
is reordered to first perform the PMIC setup and then reprogram the
clocking.

X-AffectedPlatforms: A64-uQ7
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Initialisation of clocks on Allwinner's CPUs has always been a bit tricky and
should follow the following guidance:
1. Bus clock dividers should be adjusted first to keep the bus clocks within
   their operating limits for both the new frequency _before_ changing
   the PLL (compare to section 3.3.6.2. in the A64 User's Guide v1.0).
2. PLLs should first be setup (with the enable-bit cleared), then be enabled
   and finally polled for the stable-bit to indicate the a PLL lock (compare
   how boot0 and Allwinner's linux releases have been changing PLLs for the
   A31 and subsequent chips).
3. Additionally Allwinner always injects extra delays after the PLL lock has
   triggered and after the clock source is changed.

Without these changes, the A64 will not reliably come up beyond the clock
initialisation w/ the recurrence of failure differing between individual
parts (i.e. seemingly process-dependent).

Note, that these changes and the observed failures are in line with our
experience on the A31 and A80.

X-AffectedPlatforms: A64-uQ7
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
For the A64-uQ7 we should set up DCDC5 (DDR) to 1.36V and DCDC4 to 1.2V
(for the Micrel GbE PHY).  Note that a higher DCDC5 setting (i.e. 1.5V)
will also work safely, but we expect a power-saving under high system load
from using the lower DDR3L voltage supported by our RAM.

Per my discussion with Andre, board-specific power initialisation should
eventually be conditionalised on the FDT, as seen by the ATF.  However,
this will require the ATF to be rebased to a more current ATF source
bae first.

X-AffectedPlatforms: A64-uQ7
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Copy link
Owner

@apritzel apritzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is DCDC4 on per default on your board? The manual isn't clear about the reset state.
Also do you connect the DC5SET correctly (to VINT) on your board? In this case we should not need to actually program DCDC5. I do this just because the Pine64 got this obviously wrong (floating=1.24V instead of 1.36V). I changed my branch already to only correct from 1.24V to 1.36V to cover this case, which should work on any board (except for those using LPDDR3).
Also please add a comments about the DCDC4 enabling.
And please understand that I can't merge this before we can somehow detect boards.

Thanks! Andre

Copy link
Owner

@apritzel apritzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks pretty good, but I need to digest the details first and merge it with my changes I made meanwhile.
Do you have an idea why we actually need to change the CPU clock source to LOSC for the change? This PLL should be able to do this while being live, right? At least this is my understanding of "supports dynamic frequency scaling" from the manual.

Thanks,
Andre.

@ptomsich
Copy link
Author

ptomsich commented Feb 3, 2017 via email

@ptomsich
Copy link
Author

ptomsich commented Feb 3, 2017 via email

@apritzel
Copy link
Owner

I merged the first two patches, while doing some cosmetic changes and dropping the (broken) CPU frequency print.
For the board specific setup, you could check out the sunxi64-beta U-Boot branch I just pushed on how to read the DT name from the SPL header to get the board name and do board specific setup tasks.

@apritzel apritzel closed this Feb 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants