Re: [PATCH v3 1/4] usb: xhci: add firmware loader for uPD720201 and uPD720202 w/o ROM

From: Vinod Koul
Date: Wed Jun 26 2019 - 03:10:15 EST


On 24-06-19, 11:41, Vinod Koul wrote:
> From: Christian Lamparter <chunkeey@xxxxxxxxxxxxxx>
>
> This patch adds a firmware loader for the uPD720201K8-711-BAC-A
> and uPD720202K8-711-BAA-A variant. Both of these chips are listed
> in Renesas' R19UH0078EJ0500 Rev.5.00 "User's Manual: Hardware" as
> devices which need the firmware loader on page 2 in order to
> work as they "do not support the External ROM".
>
> The "Firmware Download Sequence" is describe in chapter
> "7.1 FW Download Interface" R19UH0078EJ0500 Rev.5.00 page 131.
>
> The firmware "K2013080.mem" is available from a USB3.0 Host to
> PCIe Adapter (PP2U-E card) "Firmware download" archive. An
> alternative version can be sourced from Netgear's WNDR4700 GPL
> archives.
>
> The release notes of the PP2U-E's "Firmware Download" ver 2.0.1.3
> (2012-06-15) state that the firmware is for the following devices:
> - uPD720201 ES 2.0 sample whose revision ID is 2.
> - uPD720201 ES 2.1 sample & CS sample & Mass product, ID is 3.
> - uPD720202 ES 2.0 sample & CS sample & Mass product, ID is 2.
>
> Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>
> Signed-off-by: Christian Lamparter <chunkeey@xxxxxxxxxxxxxx>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx>
> [vkoul: fixed comments:
> used macros for timeout count and delay
> removed renesas_fw_alive_check
> cleaned renesas_fw_callback
> removed recurion for renesas_fw_download
> added MODULE_FIRMWARE
> removed length check]
> Tested-by: Christian Lamparter <chunkeey@xxxxxxxxx>
> Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx>
> ---
> drivers/usb/host/xhci-pci.c | 454 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 454 insertions(+)
>
> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> index c2fe218e051f..89ca46dd6825 100644
> --- a/drivers/usb/host/xhci-pci.c
> +++ b/drivers/usb/host/xhci-pci.c
> @@ -12,6 +12,8 @@
> #include <linux/slab.h>
> #include <linux/module.h>
> #include <linux/acpi.h>
> +#include <linux/firmware.h>
> +#include <linux/unaligned/access_ok.h>
>
> #include "xhci.h"
> #include "xhci-trace.h"
> @@ -55,6 +57,9 @@
> #define PCI_DEVICE_ID_AMD_PROMONTORYA_1 0x43bc
> #define PCI_DEVICE_ID_ASMEDIA_1042A_XHCI 0x1142
>
> +#define RENESAS_RETRY 1000
> +#define RENESAS_DELAY 10

So some devices are exhibiting failure on both ROM programming as well
as RAM load with messages:

ROM Download Step 34 failed at position 136 bytes
Firmware Download Step 2 failed at position 8 bytes with (-110)

So I am going to revert to older delay values! With those we dont get a
failures. yeah looks like ROM load takes a while on these

Thanks

--
~Vinod