
============ Information =========
Factory secure key provisioning is method to securely provision the
fuse data and keys data on factory floor. To know more about FSKP
procedure please refer NVIDIA PDK documentation. This scope of the
document is limited to host drivers installation if required.

============ Host Requirements ============

Linux Host :-
----------

* Ubuntu 16.04
* Python version 3
* libusb-1.0.21 or greater

Windows Host :-
------------

* Windows 7 or 10 (32 bit or 64 bit)
* 7z utility installed.
* Python version 3 installed.

* Install NVIDIA recovery usb driver (Only once per host)
** Manually install driver from external/windows-nvusb-driver
*** How to use NvidiaUsb.inf to install the usb driver
    1.  Extract the tarball fskp_fuseburn_py-*.tgz
    2.  Go to extacted directory
        drive-t186ref-foundation\tools\flashtools\fuseburn\external\windows-nvusb-driver
        and copy the path from explorer address bar.
    3.  Connect the target USB recovery cable to Windows host and
        put target in recovery mode (How to configure the Tegra
        target system to be in boot recovery mode is beyond the
        scope of this doc. Please refer your board guide for
        putting target in recovery)
    4.  If the driver for the Nvidia target connected is not already
        installed on host, Windows will detect a new device and start
        searching online for device drivers. Click on driver
        installation icon in Notification area on taskbar and click
        on skip online search and close.
    5.  Open device manager and expand “Other devices”, you will
        find APX device.
    6.  Right click and click on “Update Driver Software”
    7.  Select “Browse my computer for driver software”
    8.  You can either Browse the directory pointed in step 2 or
        you can paste the path copied in step 2. Check Include
        sub folders. Click Next
    9.  On Windows 7 you will get a Security warning about Windows
        can’t verify the publisher, ignore it as the driver are
        signed for Windows 10  and click on “Install this driver
        software anyway”
    10. Once the installation starts, it might take a *long* time -
        as much as 15 minutes.  Please be patient, this installer has
        coinstallers that installs the entire WDF framework - if
        already not installed
    11. On successful installation, the target board will enumerate
        as “NVIDIA USB Boot-recovery driver for Mobile devices”.
        Click close.

============ Executing fskp fuseburn script ====

Windows :-
-------
1. Extract fuseburn-*.tgz using 7zip
2. cd drive-t186ref-foundation\tools\flashtools\fuseburn
3. run fskp_fuseburn.bat --help
4. run fskp_fuseburn.bat as required. eg. fskp_fuseburn.bat --keyindex <fskp_idx> --key <fskp.key file> --fusefile <fuse_data.xml file> --test

Linux :-
-----
There are two ways to execute fskp script

* Extracting the tar zip file
1. Extract tar ball. e.g. tar -xzvf  fskp_fuseburn_py-5.0.11-0.1.tgz
2. cd drive-t186ref-foundation/tools/flashtools/fuseburn
3. python3 fskp_fuseburn.py --help
4. python3 fskp_fuseburn.py as required. eg. fskp_fuseburn.py --keyindex <fskp_idx> --key <fskp.key file> --fusefile <fuse_data.xml file> --test

* Install Nvidia Foundation PDK
1. bash drive-t186ref-foundation-5.0.11-*-release-pdk.run
2. follow the steps from step 2. as mentioned above in "Extracting the tar zip file" heading
