1 1
Anders

How to make ESPRESSObin v7 stable?

Recommended Posts

OK -  kernel 4.4.52-armada-17.10.4-g719fc86-dirty  has some other known (dts) issues.

 

We need to identify the patch Armbian is missing ...

Share this post


Link to post
Share on other sites
(edited)

> We need to identify the patch Armbian is missing ...

I though that would be simple. Turns out it is not. How to build 4.4.52 is documented here http://wiki.espressobin.net/tiki-index.php?page=Build+From+Source+-+Kernel but the code is vastly different from whats in mainline Linux.

Ex, this patch sounds interesting:

commit 6640985b0697f08d5106e6c4cd66dc61ec5e6a2d
Author: Victor Gu <xigu@marvell.com>
Date:   Wed Sep 20 10:00:49 2017 +0800

    fix: regulator: armada-37xx: overwrite CPU voltage values in 1000MHZ
    
    The original CPU voltage values from load 1 to load 3 are too low for
    EspressoBin board with Armada-37xx SoC when CPU is 1000MHZ, which leads
    to instability that CPU gets stuck soon during dynamic voltage scaling.
    In order to fix this issue, this patch adds the compatible string for
    EspressoBin AVS, and update the CPU voltage values from load 1 to load 3
    in 1000MHZ mode accordingly, the value is updated from original 1.05v
    to 1.108v.
    
    Change-Id: Iae22cb3bb243b3345e7426e859313139637f09e7
    Signed-off-by: Victor Gu <xigu@marvell.com>

diff --git a/Documentation/devicetree/bindings/regulator/armada3700-regulator.txt b/Documentation/devicetree/bindings/regulator/armada3700-regulator.txt
index 7ed7a619..5a853dd6 100644
--- a/Documentation/devicetree/bindings/regulator/armada3700-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/armada3700-regulator.txt
@@ -1,7 +1,7 @@
 Marvell Armada 3700 voltage regulator by AVS
 
 Required properties:
-- compatible: must be "marvell,armada-3700-avs"
+- compatible: must be "marvell,armada-3700-avs" or "marvell,armada-3700-espressobin-avs"
 - reg: avs register address, which is used to control CPU voltage
 - clocks: CPU core clock to get the MAX CPU frequency
 - any required generic properties defined in regulator.txt
diff --git a/drivers/regulator/armada-37xx-regulator.c b/drivers/regulator/armada-37xx-regulator.c
index bd3b9504..1185f6a5 100644
--- a/drivers/regulator/armada-37xx-regulator.c
+++ b/drivers/regulator/armada-37xx-regulator.c
@@ -274,6 +274,7 @@ static int armada_3700_avs_probe(struct platform_device *pdev)
        struct regulator_config config = { };
        struct regulator_dev *rdev;
        u32 max_cpu_freq;
+       int idx;
 
        avs = devm_kzalloc(&pdev->dev, sizeof(*avs), GFP_KERNEL);
        if (!avs) {
@@ -315,6 +316,13 @@ static int armada_3700_avs_probe(struct platform_device *pdev)
                avs->freq_level = CPU_FREQ_LEVEL_800MHZ;
        } else if (max_cpu_freq == CPU_FREQ_1000MHZ) {
                avs->freq_level = CPU_FREQ_LEVEL_1000MHZ;
+               /*
+                * Overwrite the VDD values from load 1 to load 3 in 1000MHZ
+                * for EspressoBin, otherwize the CPU gets stuck.
+                */
+               if (of_device_is_compatible(np, "marvell,armada-3700-espressobin-avs"))
+                       for (idx = VDD_SET1; idx <= VDD_SET3; idx++)
+                               voltage_m_tbl[avs->freq_level][idx] = 1108;
        } else if (max_cpu_freq == CPU_FREQ_1200MHZ) {
                avs->freq_level = CPU_FREQ_LEVEL_1200MHZ;
        } else {
@@ -399,6 +407,7 @@ static const struct dev_pm_ops armada_3700_avs_pm_ops = {
 
 static const struct of_device_id armada3700_avs_of_match[] = {
        { .compatible = "marvell,armada-3700-avs", },
+       { .compatible = "marvell,armada-3700-espressobin-avs", },
        {}
 };

But the file drivers/regulator/armada-37xx-regulator.c is nowhere to be found in mainline or espressobin kernels.

 

 

Also I just tried building Linux 5.2.0-rc4-next-20190614, which runs fine, and reports 1GHz but 7zip still reports 800MHz.

Edited by Anders
Remove irelevant bug. Linux 5.2.0-rc4-next-20190614.

Share this post


Link to post
Share on other sites
39 minutes ago, Anders said:

Also I just tried building Linux 5.2.0-rc2-next-20190531, which fails on boot:

 

Did you try this with the 800_800 or 600_600 bootloader  ?

Share this post


Link to post
Share on other sites
(edited)
1 hour ago, ebin-dev said:

Did you try this with the 800_800 or 600_600 bootloader  ?

With 800_800 it works fine so far. Some strange messages in dmesg though: http://ix.io/1KDu

They may be actual bugs in linux-next though (including the "Kernel stack is corrupted in: write_irq_affinity" error) https://lkml.org/lkml/2019/5/31/761

 

Do you want me to test 600_600 as well?

Edited by Anders
Add link to mailing list

Share this post


Link to post
Share on other sites
1 hour ago, Anders said:

With 800_800 it works fine so far. Some strange messages in dmesg though: http://ix.io/1KDu

 

Do you want me to test 600_600 as well? 

 

No thanks - that's fine so far.

Share this post


Link to post
Share on other sites
On 6/1/2019 at 4:25 PM, ebin-dev said:

 

No thanks - that's fine so far.

 

If you have some time for further tests on your V7 Espresso you could switch to kernel 4.14.79 (it is the current kernel provided by Marvell, cpufreq patch is not applied): in ‘armbian-config‘ switch to stable builds (select System->Stable) and if the process is finished, switch from next to other kernels (System->Other kernels-> 4.14.79). 

 

Edit: Marvells kernel 4.14.79 is an option - it ist stable at least on V5 EspressoBins with bootloader 1000_800. But the real CPU frequency reported by 7zip is also only 800MHz instead of 1000MHz (same behaviour as kernel 4.19.4x and 5.x)

Share this post


Link to post
Share on other sites

Here's an update:

I've been running Armbian with nightly kernels, (currently on 4.19.50-mvebu64) and flash-image-ddr4-1g-1cs-800_800-2019-05-21.bin uboot entirely stable for some time now. The only two remaining problems being:

1) U-boot sometimes get stuck. I just reset the board until it boots.

2) With flash-image-ddr4-1g-1cs-1000_800-2019-05-21.bin I'm not getting 1GHz. (Also tested with 5.2.0-rc4-next-20190614).

 

To help address the last problem, I just posted in the Espressobin forums: http://espressobin.net/forums/topic/mainline-linux-not-running-at-1ghz/

 

Hopefully someone is able to reach out to Marvell and make them fix the bug.

 

Thanks for all the help so far :)

Share this post


Link to post
Share on other sites

Just to let you know: I sent back the V7, got a refund (I had it ordered at Amazon, so it wasn't an issue) and ordered a V5 directly at Globalscale, which arrived quickly. It's running on conservative 800MHz Armbian for now (I am more interested in stability than excessive speed) and seems stable (uptime 37h by now), giving me good speeds over GBitEthernet of almost 80MB/s with an old SATA HDD. So I guess this will be the prototype for my Simple Home Server start-up!

Share this post


Link to post
Share on other sites

So.. guys, i see here that you also have a problem of boot getting stuck very early in the process.


my v7 board is stuck here

TIM-1.0
WTMI-devel-18.12.1-e6bb176
WTMI: system early-init
SVC REV: 5, CPU VDD voltage: 1.155V

 

more often than not (i'd say s a 70% chance of getting stuck here). Once it boots it is relatively stable with Buster.

How did you solve this issue?

 

Also, i do have the same problem of CPU not working higher than 800MHz.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
1 1