---------------------------------------------------------------------------
How to apply FW Download function to Linux OS.
---------------------------------------------------------------------------
1) Copy "renesas" directory including firmware file to to "/lib/firmware".
Note: Please check if the firmware version is latest or not.
When you change the firmware file from K2011070.mem to the latest
version, you need to change "renesas/K2011070.mem" in the
xhci-fwdload.c to new firmware file name(Ex. Kxxxxxxx.mem).
#define XHCI_FWFILENAME_720201_202ES20 "renesas/Kxxxxxxx.mem"
2) Copy xhci-fwdload.h and xhci-fwdload.c to
"/usr/src/kernels/linux/drivers/usb/host".
3) Modify the following three files.
1)"/usr/src/kernels/linux/drivers/usb/host/Makefile"
Add "xhci-fwdload.o" at the end of line starting with "xhci-hcd-objs: =".
Refer to merged_files/X.X.X.X/Makefile.
2)"/usr/src/kernels/linux/drivers/usb/host/xhci.h"
Add "#include "xhic-fwdload.h" " at the beginning of the xhci.h file.
Add variable member "struct firmware * firmware_pointer"
in the "struct xhci_hcd".
Refer to merged_files/X.X.X.X/xhci.h.
3)"/usr/src/kernels/linux/drivers/usb/host/xhci-pci.c"
Add "XHCI_FWDOWNLOAD(hcd);" to beginning of xhci_pci_setup() function.
If xhci_pci_resume() function exists,
add "XHCI_FWRELOAD(hcd);" at the beginning of the function, and
If xhci_pci_remove() function exists,
add "XHCI_FWUNLOAD(pci_get_drvdata(dev));" at the beginning of the function.
If xhci_pci_remove() function does not exists,
add "XHCI_FWUNLOAD (hcd) at the next line of "XHCI_FWDOWNLOAD (hcd) in the
xhci_pci_setup() function.
Refer to merged_files/x.x.x.x/xhci-pci.c
4)"/usr/src/kernels/linux/drivers/usb/host/xhci.c"
If xhci_pci_resume function exits,
modify the following codes at the if(!hibernated){}block.
before)
if (handshake(xhci, &xhci->op_regs->status,
STS_RESTORE, 0, 10*100)) {
after)
if (handshake(xhci, &xhci->op_regs->status,
STS_RESTORE, 0, 50*100)) {
4) Compile kernel and install
# make
# make moudles_install
# make install