Flashing the PCIe Switch Configuration/Firmware from NVIDIA DRIVE Xavier A 
This document describes the process of flashing or later updating the PCIe switch configuration on NVIDIA DRIVE™ Xavier A using Microsemi’s Switchtec management interface.
Note:  | The flashing procedure described in this document is applicable only to Xavier A. The utility switchtec-user used to flash the PCIe switch configuration/firmware is present in the target root fs at: /lib/firmware/pcie-switch/tools/prebuilt/switchtec  | 
Prerequisites
Load the switchtec-kernel module:
modprobe switchtec
~/switchtec-user$ lsmod | grep switchtec 
switchtec              17539  0
To flash the PCIe switch firmware/configuration file using switchtec-user, the following prerequisites are required:
•	Load the switchtec-kernel driver.
•	Expose the current PCIe configuration management end point (EP) or non-transparent (NT) EP to the root complex.
•	If management EP is present, the following is seen from lspci output:
0000:01:00.1 Memory controller: PMC-Sierra Inc. Device 8534
•	If NT EP is present, the following is seen in lspci output:
0000:01:00.1 Bridge: PMC-Sierra Inc. Device 8534
Updating the PCIe Switch Configuration
Use the following switchtec commands to update the PCIe configuration on Xavier A.
1.	Change directory to tool location:
nvidia@tegra-ubuntu:~$ cd /lib/firmware/pcie-switch/tools/prebuilt/
2.	Display the help menu:
nvidia@tegra-ubuntu:~$./switchtec
 
switchtec-0.9.5-rc1
Usage: switchtec <command> [<device>] [OPTIONS]
Where <device> is a switchtec device such as /dev/switchtec0.
3.	List the devices:
nvidia@tegra-ubuntu:/lib/firmware/pcie-switch/tools/prebuilt/$ ./switchtec list
switchtec0              PFX 64XG3       RevB    1.08 B058       0000:01:00.1
4.	Set switchtec0 as default:
root@tegra-ubuntu:/lib/firmware/pcie-switch/tools/prebuilt/# export SWITCHTEC_DEV=/dev/switchtec0
5.	Verify firmware information:
root@tegra-ubuntu:/lib/firmware/pcie-switch/tools/prebuilt/# ./switchtec fw-info
 
Currently Running:
  IMG Version: 1.08 BD58
Active Partition:
  BOOT  Version: 1.08 B058      CRC: 725a8d2e   (RO)
  IMG   Version: 1.08 BD58      CRC: 1ef507d3   (Running)
  CFG   Version: 1.08 B3F08     CRC: ab96224d   (Running)
Inactive Partition:
  IMG   Version: 1.08 B058      CRC: 75ee068d
  CFG   Version: 1.08 B058      CRC: da85e9de
6.	Update firmware:
root@tegra-ubuntu:/lib/firmware/pcie-switch/tools/prebuilt/# ./switchtec fw-update <config_file>
 
Writing the following firmware image to /dev/switchtec0.
File:     usecase7.0.pmc
Type:     DAT
Version:  1.08 B3F08
Img Len:  0x494a
CRC:      0xbfbb33c4
Do you want to continue? [y/N] y
 100% [===============================================] Time: 0:00:00   29kB/s 
 
Active Partition:
  BOOT  Version: 1.08 B058      CRC: 725a8d2e   (RO)
  IMG   Version: 1.08 BD58      CRC: 1ef507d3   (Running)
  CFG   Version: 1.08 B3F08     CRC: bfbb33c4
Inactive Partition:
  IMG   Version: 1.08 B058      CRC: 75ee068d
  CFG   Version: 1.08 B3F08     CRC: ab96224d   (Running)
 
Where <config file> refers to the new configuration to be updated.
7.	The configuration files are available in the following location:
<top>/drive-t186ref-foundation/firmwares/bin/t19x/microsemi/pcie/bins/e3550/config_files/pm8534
8.	The configuration files in rootfs are available in the following location:
/lib/firmware/pcie-switch/e3550/config_files/pm8534
9.	After flashing the new switch configuration, power cycle/reboot the board.
This step ensures that the switch is booted with the latest configuration file and all root complex devices are running with the new topology.
To verify, execute the following command:
root@tegra-ubuntu:/lib/firmware/pcie-switch/tools/prebuilt/# ./switchtec fw-info /dev/switchtec0
 
Currently Running:
  IMG Version: 1.08 BD58
Active Partition:
  BOOT  Version: 1.08 B058      CRC: 725a8d2e   (RO)
  IMG   Version: 1.08 BD58      CRC: 1ef507d3   (Running)
  CFG   Version: 1.08 B3F08     CRC: bfbb33c4   (Running)
Inactive Partition:
  IMG   Version: 1.08 B058      CRC: 75ee068d
  CFG   Version: 1.08 B3F08     CRC: ab96224d
 
As you can see from the message above, after the reboot, the new configuration flashed in the active partition is running.