public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stephen Graf <stephen.graf@gmail.com>
To: Andre Przywara <andre.przywara@arm.com>
Cc: Mikhail Kalashnikov <iuncuim@gmail.com>,
	Jagan Teki <jagan@amarulasolutions.com>,
	Vignesh R <vigneshr@ti.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Piotr Oniszczuk <piotr.oniszczuk@gmail.com>,
	u-boot@lists.denx.de, linux-sunxi@lists.linux.dev
Subject: OrangePI Zero3 memory timing testing
Date: Wed, 29 Nov 2023 10:45:55 -0800	[thread overview]
Message-ID: <0560924e-119b-4122-ad5b-bd563554eb10@gmail.com> (raw)
In-Reply-To: <20231128013746.23648d39@slackpad.lan>

Some testing results:

With the default DRAM timing of 30x24=720, most often when my system 
boots it comes up with DRAM 2G, but I have a 1G system. Once in a while 
the boot shows 1G.  When it shows 2G the linux OS also shows 2G and 
continuing does not make much sense.

On one boot where u-boot reported 1G the OS agreed and I ran memtester 
successfully.

If I build u-boot with CONFIG_DRAM_CLK=792 (33*24=792) I have never seen 
my system boot with anything other than DRAM 1G showing in u-boot. I ran 
memtester successfully and this system has been stable running linux 6.6.2.

Andre, if you can put together a few patches I can test them to see 
which works.

If anyone else with different variations of the Zero3 would test with 
the two DRAM timings and report results.

I also use the Zunlong image on occasion and it consistently shows 1G 
and from my poking around I think it runs at a 792 clk.


Console output with DRAM default:

U-Boot 2024.01-rc3-00028-g43f2873fa9-dirty (Nov 28 2023 - 22:46:39 
-0800) Allwinner Technology

CPU:   Allwinner H616 (SUN50I)
Model: OrangePi Zero3
DRAM:  2 GiB

Last login: Wed Nov 29 09:35:15 PST 2023 on ttyS0
root@orangepizero3:~# free -h
                total        used        free      shared  buff/cache 
available
Mem:           1.9Gi       139Mi       1.7Gi       360Ki        82Mi 
   1.7Gi
Swap:             0B          0B          0B


U-Boot 2024.01-rc3-00028-g43f2873fa9-dirty (Nov 28 2023 - 22:46:39 
-0800) Allwinner Technology

CPU:   Allwinner H616 (SUN50I)
Model: OrangePi Zero3
DRAM:  1 GiB

root@orangepizero3:~# free -h
                total        used        free      shared  buff/cache 
available
Mem:           917Mi       137Mi       766Mi       360Ki        79Mi 
   780Mi
Swap:             0B          0B          0B


root@orangepizero3:~# memtester 700M 1
memtester version 4.6.0 (64-bit)
Copyright (C) 2001-2020 Charles Cazabon.
Licensed under the GNU General Public License version 2 (only).

pagesize is 4096
pagesizemask is 0xfffffffffffff000
want 700MB (734003200 bytes)
got  700MB (734003200 bytes), trying mlock ...locked.
Loop 1/1:
   Stuck Address       : ok
   Random Value        : ok
   Compare XOR         : ok
   Compare SUB         : ok
   Compare MUL         : ok
   Compare DIV         : ok
   Compare OR          : ok
   Compare AND         : ok
   Sequential Increment: ok
   Solid Bits          : ok
   Block Sequential    : ok
   Checkerboard        : ok
   Bit Spread          : ok
   Bit Flip            : ok
   Walking Ones        : ok
   Walking Zeroes      : ok
   8-bit Writes        : ok
   16-bit Writes       : ok

Done.

Console output with DRAM clk 792:


U-Boot 2024.01-rc3-00028-g43f2873fa9-dirty (Nov 28 2023 - 21:34:46 
-0800) Allwinner Technology

CPU:   Allwinner H616 (SUN50I)
Model: OrangePi Zero3
DRAM:  1 GiB

root@orangepizero3:~# free -h
                total        used        free      shared  buff/cache 
available
Mem:           917Mi       134Mi       768Mi       360Ki        79Mi 
   782Mi
Swap:             0B          0B          0B


root@orangepizero3:~# memtester 700M 1
memtester version 4.6.0 (64-bit)
Copyright (C) 2001-2020 Charles Cazabon.
Licensed under the GNU General Public License version 2 (only).

pagesize is 4096
pagesizemask is 0xfffffffffffff000
want 700MB (734003200 bytes)
got  700MB (734003200 bytes), trying mlock ...locked.
Loop 1/1:
   Stuck Address       : ok
   Random Value        : ok
   Compare XOR         : ok
   Compare SUB         : ok
   Compare MUL         : ok
   Compare DIV         : ok
   Compare OR          : ok
   Compare AND         : ok
   Sequential Increment: ok
   Solid Bits          : ok
   Block Sequential    : ok
   Checkerboard        : ok
   Bit Spread          : ok
   Bit Flip            : ok
   Walking Ones        : ok
   Walking Zeroes      : ok
   8-bit Writes        : ok
   16-bit Writes       : ok

Done.


On 2023-11-27 5:37 p.m., Andre Przywara wrote:

> 
> This symptom is pretty surely not directly related to the DRAM
> frequency, it's caused by a missing barrier or delay *somewhere*.
> People report that this is fixed by adding another "dsb();" at the
> beginning of the mctl_mem_matches() function, but I don't have a good
> explanation why exactly there, and would like to avoid submitting
> patches that "just seem to work (TM)".
> 
> If I find some time, I will try to setup some automated environment
> where I can run some experiments with different barrier locations.
> I can offer some rationale for putting it at the end of the function(s)
> that call mctl_mem_matches(), so hope that this fixes it.
> 
> Cheers,
> Andre
> 

  parent reply	other threads:[~2023-11-29 18:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14  1:31 [PATCH 0/3] sunxi: add OrangePi Zero 3 board support Andre Przywara
2023-11-14  1:31 ` [PATCH 1/3] mtd: spi-nor: Add support for zBIT ZB25VQ128 Andre Przywara
2023-11-14  1:31 ` [PATCH 2/3] sunxi: H616: remove default AXP305 selection Andre Przywara
2023-11-14 13:24   ` Jaehoon Chung
2023-11-14  1:31 ` [PATCH 3/3] sunxi: H616: Add OrangePi Zero 3 board support Andre Przywara
2023-11-25 17:43   ` Mikhail Kalashnikov
2023-11-26  0:23     ` Andre Przywara
2023-11-26  4:27       ` Stephen Graf
2023-11-26 12:23         ` Andre Przywara
2023-11-27 20:21           ` Stephen Graf
2023-11-27 22:31             ` Stephen Graf
2023-11-28  1:37               ` Andre Przywara
2023-11-28  2:35                 ` Stephen Graf
2023-11-28  6:03                 ` Stephen Graf
2023-11-28 20:07                 ` mdt_debug write Stephen Graf
2023-11-29 23:57                   ` Andre Przywara
2023-11-30  0:20                     ` Stephen Graf
2023-11-30  1:13                     ` Stephen Graf
2023-12-01  0:27                       ` Andre Przywara
2023-12-01 18:50                         ` [PATCH 1/1] correct documentation for SPI flashing Stephen Graf
2023-12-03 23:40                           ` Andre Przywara
2023-11-29 18:45                 ` Stephen Graf [this message]
2023-11-30  0:10                   ` OrangePI Zero3 memory timing testing Andre Przywara
2023-11-30  1:15                     ` Siarhei Siamashka
2023-11-28  1:29             ` [PATCH 3/3] sunxi: H616: Add OrangePi Zero 3 board support Andre Przywara
2023-11-26 13:30       ` Mikhail Kalashnikov
2023-11-26 11:45     ` Bob McChesney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0560924e-119b-4122-ad5b-bd563554eb10@gmail.com \
    --to=stephen.graf@gmail.com \
    --cc=andre.przywara@arm.com \
    --cc=iuncuim@gmail.com \
    --cc=jagan@amarulasolutions.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jh80.chung@samsung.com \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=piotr.oniszczuk@gmail.com \
    --cc=u-boot@lists.denx.de \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox