All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
To: u-boot@lists.denx.de
Subject: [PATCH 2/2] usb: xhci: Load Raspberry Pi 4 VL805's firmware
Date: Wed, 29 Apr 2020 12:10:33 +0200	[thread overview]
Message-ID: <ccb334b3589ffa0c1fe8aa63cc8d46b231e62c6f.camel@suse.de> (raw)
In-Reply-To: <44226fe2-feff-307d-a78b-a89b0765332f@denx.de>

On Tue, 2020-04-28 at 19:59 +0200, Marek Vasut wrote:
> On 4/28/20 7:44 PM, Nicolas Saenz Julienne wrote:
> > When needed, RPi4's co-processor (called VideoCore) has to be instructed
> > to load VL805's firmware (the chip providing xHCI support). VideCore's
> > firmware expects the board's PCIe bus to be already configured in order
> > for it to load the xHCI chip firmware. So we have to make sure this
> > happens in between the PCIe configuration and xHCI startup.
> > 
> > Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> > ---
> >  drivers/usb/host/xhci-pci.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> > index c1f60da541..5c17ea6932 100644
> > --- a/drivers/usb/host/xhci-pci.c
> > +++ b/drivers/usb/host/xhci-pci.c
> > @@ -11,6 +11,8 @@
> >  #include <usb.h>
> >  #include <usb/xhci.h>
> >  
> > +#include <asm/arch/msg.h>
> > +
> >  static void xhci_pci_init(struct udevice *dev, struct xhci_hccr **ret_hccr,
> >  			  struct xhci_hcor **ret_hcor)
> >  {
> > @@ -18,6 +20,10 @@ static void xhci_pci_init(struct udevice *dev, struct
> > xhci_hccr **ret_hccr,
> >  	struct xhci_hcor *hcor;
> >  	u32 cmd;
> >  
> > +#ifdef CONFIG_BCM2711
> > +	bcm2711_load_vl805_firmware();
> > +#endif
> > +
> >  	hccr = (struct xhci_hccr *)dm_pci_map_bar(dev,
> >  			PCI_BASE_ADDRESS_0, PCI_REGION_MEM);
> >  	hcor = (struct xhci_hcor *)((uintptr_t) hccr +
> 
> I think socfpga arria10 has some firmware loader implementation that is
> generic, so can't we use that ?

I don't think so. I've been told the firmware upgrade protocol is private and
specific to the VL80X family of devices. The Raspberry Pi foundation decided to
implement it in their closed source VideoCore firmware. All we have access to
from arm is this mailbox interface where we just trigger the process.

Then there's an extra potential issue as it's the RPi4 co-processor firmware
image that contains VL805's firmware. We'd had to somehow extract it from
there every time they update it.

As a recap of what's happening here:
 - arm configures PCI
 - arm triggers VL805 firmware reload
 - VideoCore somehow transfers firmware (trough PCI) into VL805 if no EEPROM
   present
 - VL805 is up and running
 - arm can carry on with xHCI init

Note that all this is only relevant if you have newer revision of the board. So
most people will not need it right now. But as it becomes more widespread we'll
start seeing complaints.

Regards,
Nicolas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200429/a05a0776/attachment.sig>

  reply	other threads:[~2020-04-29 10:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 17:44 [PATCH 0/2] Raspberry Pi 4 VL805 firmware load Nicolas Saenz Julienne
2020-04-28 17:44 ` [PATCH 1/2] arm: rpi: Add function to trigger VL805's " Nicolas Saenz Julienne
2020-04-28 17:44 ` [PATCH 2/2] usb: xhci: Load Raspberry Pi 4 VL805's firmware Nicolas Saenz Julienne
2020-04-28 17:59   ` Marek Vasut
2020-04-29 10:10     ` Nicolas Saenz Julienne [this message]
2020-04-29 12:05       ` Marek Vasut
2020-04-29 12:36         ` Nicolas Saenz Julienne
2020-04-29 12:37           ` Marek Vasut
2020-04-29 13:04             ` Nicolas Saenz Julienne
2020-04-29  6:18   ` Marek Szyprowski
2020-04-29 11:19     ` Nicolas Saenz Julienne
2020-04-29  6:51   ` Bin Meng
2020-04-29 10:53     ` Nicolas Saenz Julienne

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=ccb334b3589ffa0c1fe8aa63cc8d46b231e62c6f.camel@suse.de \
    --to=nsaenzjulienne@suse.de \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.