NVIDIA Tegra
NVIDIA DRIVE OS 5.1 Linux

Developer Guide
5.1.0.2 Release


 
PWR_I2C Slaves’ Access to Rich OS
How to unlock access for the native boot configuration
BPMP runtime firmware owns the PWR_I2C bus. Therefore, BPMP acts as a proxy for CPU access to devices on PWR_I2C bus. The CPU initiates device transactions via I2C IPC calls.
To meet platform security requirements, the CPU may not be allowed to change the voltage regulators under BPMP control. For this reason, BPMP runtime firmware implements an I2C firewall that can be configured to filter out specific I2C traffic.
In its simplest form, the firewall is just a list of I2C addresses and register offsets that are denied to the CPU. For information about device tree bindings, refer to the documentation at:
<top>/drive-t186ref-foundation/platform-config/bpmp-dt-bindings/t194/i2c_fw.md
If you need to access the pwr_i2c slaves from the CPU for debugging, make these changes to unlock pwr_i2c access:
1. Open the BPMP firmware device tree file in a text editor. The file’s location is:
<top>/drive-t186ref-foundation/platform-config/bpmp_dtsi/t194/tegra186-platforms/tegra186-max-regulator.dtsi
2. Remove the device tree node i2c_firewall_rules in the parent node i2c5.
3. Save and close the device tree file.
4. Recompile the device tree.
Instructions for compiling the BPMP device tree are in Configuring Power on BPMP Firmware in this guide.
How to unlock access for the Hypervisor boot configuration
For Hypervisor boot with a guest OS you must make the changes described above for the native boot configuration. In addition, you must make the changes described here.
1. Open guest_i2c_ownership.h in a text editor. The file’s location is:
<top>/drive-t186ref-foundation/virtualization/pct/<e3550a01-t186a | e3550a01-t186b | e3550a03-t186a | e3550a03-t186b | p2888-t194>/<vm_guest>/guest_i2c_ownership.h
Where <vm_guest> is the VM guest configuration, for example, linux-linux.
2. Add these elements to the definition of the i2c_ownership array:
I2C_OWNERSHIP(TEGRA_I2C_5, 0x38, VM0),
I2C_OWNERSHIP(TEGRA_I2C_5, 0x39, VM0),
I2C_OWNERSHIP(TEGRA_I2C_5, 0x3a, VM0),
I2C_OWNERSHIP(TEGRA_I2C_5, 0x3b, VM0),
3. Run the Makfile.bind command to recreate the binary image for the foundation components.
For example, to make this change for the p2382-t186 platform with the linux+linux guest configuration, you would edit:
cd <top>/drive-t186ref-foundation/virtualization/pct/p2382-t186/linux-linux/guest_i2c_ownership.h
Then you would find the array that begins at:
struct guest_i2c_mapping i2c_ownership [] __attribute__ ((section("i2c_owner"))) = {
…and you would add four lines shown under step 0, above. Then you would execute bind_partitions.