diff mbox

[U-Boot,v2,12/23] sunxi: provide default DRAM config for sun50i in Kconfig

Message ID 1480902750-839-13-git-send-email-andre.przywara@arm.com
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Commit Message

Andre Przywara Dec. 5, 2016, 1:52 a.m. UTC
To avoid enumerating the very same DRAM values in defconfig files
for each and every Allwinner A64 board out there, let's put some sane
default values in the Kconfig file.
Boards with different needs can override them at any time.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 board/sunxi/Kconfig           | 2 ++
 configs/pine64_plus_defconfig | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Simon Glass Dec. 5, 2016, 6:25 a.m. UTC | #1
On 4 December 2016 at 18:52, Andre Przywara <andre.przywara@arm.com> wrote:
> To avoid enumerating the very same DRAM values in defconfig files
> for each and every Allwinner A64 board out there, let's put some sane
> default values in the Kconfig file.
> Boards with different needs can override them at any time.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  board/sunxi/Kconfig           | 2 ++
>  configs/pine64_plus_defconfig | 2 --
>  2 files changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Maxime Ripard Dec. 6, 2016, 10:56 a.m. UTC | #2
On Mon, Dec 05, 2016 at 01:52:19AM +0000, Andre Przywara wrote:
> To avoid enumerating the very same DRAM values in defconfig files
> for each and every Allwinner A64 board out there, let's put some sane
> default values in the Kconfig file.
> Boards with different needs can override them at any time.

Did you check other boards to see what their values were before
calling it a default?

Thanks,
Maxime
Andre Przywara Dec. 6, 2016, 11:21 a.m. UTC | #3
Hi,

On 06/12/16 10:56, Maxime Ripard wrote:
> On Mon, Dec 05, 2016 at 01:52:19AM +0000, Andre Przywara wrote:
>> To avoid enumerating the very same DRAM values in defconfig files
>> for each and every Allwinner A64 board out there, let's put some sane
>> default values in the Kconfig file.
>> Boards with different needs can override them at any time.
> 
> Did you check other boards to see what their values were before
> calling it a default?

I sampled all the boards (two ;-) I have access to and got a 100%
coverage ;-)
As far as I know, this 672 MHz seems to be an Allwinner recommendation,
though it needs to be worked out how stable this is under load.
I have no idea if the ZQ value is similarly common.

If you have any other data, I am all ears and happy to use a different
safe default if this is the intention.
But we could use a "most common value" approach here to avoid pointless
defconfig entries with the same value for lots of boards, so even if
there are board with can't do 672 MHz, for instance, we still put it in
Kconfig and let that one board override it.

Cheers,
Andre.
Maxime Ripard Dec. 12, 2016, 12:33 p.m. UTC | #4
On Tue, Dec 06, 2016 at 11:21:26AM +0000, Andre Przywara wrote:
> Hi,
> 
> On 06/12/16 10:56, Maxime Ripard wrote:
> > On Mon, Dec 05, 2016 at 01:52:19AM +0000, Andre Przywara wrote:
> >> To avoid enumerating the very same DRAM values in defconfig files
> >> for each and every Allwinner A64 board out there, let's put some sane
> >> default values in the Kconfig file.
> >> Boards with different needs can override them at any time.
> > 
> > Did you check other boards to see what their values were before
> > calling it a default?
> 
> I sampled all the boards (two ;-) I have access to and got a 100%
> coverage ;-)
> As far as I know, this 672 MHz seems to be an Allwinner recommendation,
> though it needs to be worked out how stable this is under load.
> I have no idea if the ZQ value is similarly common.
> 
> If you have any other data, I am all ears and happy to use a different
> safe default if this is the intention.
> But we could use a "most common value" approach here to avoid pointless
> defconfig entries with the same value for lots of boards, so even if
> there are board with can't do 672 MHz, for instance, we still put it in
> Kconfig and let that one board override it.

Fair enough.

Maxime
diff mbox

Patch

diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index ba72e76..d477925 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -159,6 +159,7 @@  config DRAM_CLK
 	default 792 if MACH_SUN9I
 	default 312 if MACH_SUN6I || MACH_SUN8I
 	default 360 if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I
+	default 672 if MACH_SUN50I
 	---help---
 	Set the dram clock speed, valid range 240 - 480 (prior to sun9i),
 	must be a multiple of 24. For the sun9i (A80), the tested values
@@ -178,6 +179,7 @@  config DRAM_ZQ
 	default 123 if MACH_SUN4I || MACH_SUN5I || MACH_SUN6I || MACH_SUN8I
 	default 127 if MACH_SUN7I
 	default 4145117 if MACH_SUN9I
+	default 3881915 if MACH_SUN50I
 	---help---
 	Set the dram zq value.
 
diff --git a/configs/pine64_plus_defconfig b/configs/pine64_plus_defconfig
index ea53b96..ebc24b8 100644
--- a/configs/pine64_plus_defconfig
+++ b/configs/pine64_plus_defconfig
@@ -2,8 +2,6 @@  CONFIG_ARM=y
 CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN50I=y
-CONFIG_DRAM_CLK=672
-CONFIG_DRAM_ZQ=3881915
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pine64-plus"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_CONSOLE_MUX=y