u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: "Ivan T. Ivanov" <iivanov@suse.de>
To: Stefan Wahren <wahrenst@gmx.net>
Cc: Florian Fainelli <florian.fainelli@broadcom.com>,
	 Matthias Brugger <mbrugger@suse.com>,
	Peter Robinson <pbrobinson@gmail.com>,
	 Dmitry Malkin <dmitry@bedrocksystems.com>,
	Thomas Fitzsimmons <fitzsim@fitzsim.org>,
	 Peng Fan <peng.fan@nxp.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	 Anatolij Gustschin <agust@denx.de>,
	u-boot@lists.denx.de
Subject: Re: [PATCH v3 5/7] mmc: bcmstb: Add support for bcm2712 SD controller
Date: Fri, 22 Dec 2023 10:22:51 +0200	[thread overview]
Message-ID: <ae2fhlqdltlrdkbaai7s3b7rqz44xxmabb6klqsnf2rez7vvjb@hkhxm42xpn3x> (raw)
In-Reply-To: <db91a259-d504-4e8b-8178-dad3e5709b93@gmx.net>

On 12-21 16:39, Stefan Wahren wrote:
> To: Florian Fainelli <florian.fainelli@broadcom.com>,  "Ivan T. Ivanov"
> > 
> > On 12/18/2023 10:03 PM, Ivan T. Ivanov wrote:
> > > Borrow SD quirks from vendor Linux driver.
> > > 
> > > "BCM2712 unfortunately carries with it a perennial bug with the SD
> > > controller register interface present on previous chips
> > > (2711/2709/2708).
> > > Accesses must be dword-sized and a read-modify-write cycle to the 32-bit
> > > registers containing the COMMAND, TRANSFER_MODE, BLOCK_SIZE and
> > > BLOCK_COUNT registers tramples the upper/lower 16 bits of data written.
> > > BCM2712 does not seem to need the extreme delay between each write as on
> > > previous chips, just the serialisation of writes to these registers in a
> > > single 32-bit operation."
> > > 
> > > Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
> > 
> > This is diverging from the Linux sdhci-brcmstb.c driver where no such
> > quirk needs to be carried out, rather the logic for such quirks has
> > been present in sdhci-iproc.c...
> 
> it seems this patch based the downstream kernel changes [1].

Yep.

> I would
> suggest to use an existing driver which already handle this bug
> (iproc_sdhci or bcm2835_sdhci).
> 
> Does the Rpi 5 still works, if the compatible "brcm,bcm2712-sdhci" is
> added to mmc/iproc_sdhci.c?

No, it is not working :-)

Even after I added shadow variables usage in iproc_readw, which do not
have it.

Even after I used hard coded values for "clock-freq-min-max", which are
missing in RPi5 device tree.

Even after I added 2712 specific "cfg" space initialization procedure
from the brcnstb driver.

On the other hand they are some tuning procedures in iproc driver
which I am not sure that are relevant for 2712 controller.

And the diff stat is getting bigger that equivalent for brcmstb driver.

To me it is  a bit easier to add 2712 support to brcmstb driver,
because it will be easier to follow any vendor Linux driver changes.

It looks like hardware engineers are just making the same mistake
when integrating 2712 SDHCI controller as for IPROC controller.

Regards,
Ivan

> 
> [1] -
> https://github.com/raspberrypi/linux/commit/b627647c4500d39cb026924b608841fdf4d4d7e9

  reply	other threads:[~2023-12-22  8:22 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-18 21:03 [PATCH v3 0/7] rpi5: initial support Ivan T. Ivanov
2023-12-18 21:03 ` [PATCH v3 1/7] rpi5: add initial memory map for bcm2712 Ivan T. Ivanov
2023-12-18 22:25   ` Stefan Wahren
2023-12-19  8:40     ` Ivan T. Ivanov
2023-12-20  4:45   ` Simon Glass
2023-12-20  8:12     ` Ivan T. Ivanov
2023-12-20 12:08   ` Ivan T . Ivanov
2023-12-18 21:03 ` [PATCH v3 2/7] rpi5: Use devicetree as alternative way to read IO base addresses Ivan T. Ivanov
2023-12-22 11:08   ` Matthias Brugger
2023-12-18 21:03 ` [PATCH v3 3/7] rpi5: Use devicetree to retrieve board revision Ivan T. Ivanov
2023-12-22 11:28   ` Matthias Brugger
2023-12-18 21:03 ` [PATCH v3 4/7] bcm2835: brcm, bcm2708-fb device is using r5g6b5 format Ivan T. Ivanov
2023-12-18 22:32   ` [PATCH v3 4/7] bcm2835: brcm,bcm2708-fb " Stefan Wahren
2023-12-19  8:51     ` Ivan T. Ivanov
2023-12-19 10:35       ` Stefan Wahren
2023-12-20  8:51       ` Matthias Brugger
2023-12-21 13:51         ` Ivan T. Ivanov
2023-12-18 21:03 ` [PATCH v3 5/7] mmc: bcmstb: Add support for bcm2712 SD controller Ivan T. Ivanov
2023-12-21 15:13   ` Florian Fainelli
2023-12-21 15:39     ` Stefan Wahren
2023-12-22  8:22       ` Ivan T. Ivanov [this message]
2023-12-18 21:03 ` [PATCH v3 6/7] configs: rpi_arm64: enable SDHCI BCMSTB driver Ivan T. Ivanov
2023-12-18 21:03 ` [PATCH v3 7/7] pci: pcie-brcmstb: Add bcm2712 PCIe controller support Ivan T. Ivanov
2023-12-22 11:46   ` Matthias Brugger
2023-12-21 13:42 ` [PATCH v3 0/7] rpi5: initial support Stefan Agner
2023-12-21 13:51   ` Matthias Brugger
2023-12-22 12:19 ` Marc Zyngier
2023-12-22 12:33   ` Ivan T. Ivanov
2023-12-22 12:44     ` Marc Zyngier

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=ae2fhlqdltlrdkbaai7s3b7rqz44xxmabb6klqsnf2rez7vvjb@hkhxm42xpn3x \
    --to=iivanov@suse.de \
    --cc=agust@denx.de \
    --cc=dmitry@bedrocksystems.com \
    --cc=fitzsim@fitzsim.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=jh80.chung@samsung.com \
    --cc=mbrugger@suse.com \
    --cc=pbrobinson@gmail.com \
    --cc=peng.fan@nxp.com \
    --cc=u-boot@lists.denx.de \
    --cc=wahrenst@gmx.net \
    /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;
as well as URLs for NNTP newsgroup(s).