From 88b58d2ed0edd3280bdfedf908825da7d5732e8b Mon Sep 17 00:00:00 2001 From: Juan Pablo Ruiz Date: Thu, 30 Jan 2025 00:34:02 +0200 Subject: [PATCH] netvm: enable on the new fw baseline. 1. fix uarti passthrough for nvidia Jetpack 6 2. disable pci_acs_override patch 0001-pci-add-pci_acs_override-for-pci-passthrough.patch not needed for Jetpack 36.4.3. PCI passthrough on NX working ok without this patch. 3. add 8 sec delay for nvidia pci passthrough - Add 8 seconds delay to wait for PCI devices to get full enumerated - Remove deprecated kernel parameters for PCI passthrough 4. disable uarti passthrough - The uarti passthrough is currently broken due we need to add a fixed device tree to the netvm that affects it normal behavior. Signed-off-by: Juan Pablo Ruiz --- ...pci_acs_override-for-pci-passthrough.patch | 153 ------- .../nx-netvm-ethernet-pci-passthrough.nix | 15 +- .../common/bpmp-virt-common/default.nix | 8 +- .../passthrough/uarti-net-vm/default.nix | 54 ++- .../uarti-net-vm/tegra234-netvm.dts | 403 ++++++++++++++++++ .../uarti-net-vm/uarti_pt_host_overlay.dts | 9 +- targets/nvidia-jetson-orin/flake-module.nix | 6 +- 7 files changed, 452 insertions(+), 196 deletions(-) delete mode 100644 modules/reference/hardware/jetpack-microvm/0001-pci-add-pci_acs_override-for-pci-passthrough.patch create mode 100644 modules/reference/hardware/jetpack/nvidia-jetson-orin/virtualization/passthrough/uarti-net-vm/tegra234-netvm.dts diff --git a/modules/reference/hardware/jetpack-microvm/0001-pci-add-pci_acs_override-for-pci-passthrough.patch b/modules/reference/hardware/jetpack-microvm/0001-pci-add-pci_acs_override-for-pci-passthrough.patch deleted file mode 100644 index d9dcab606..000000000 --- a/modules/reference/hardware/jetpack-microvm/0001-pci-add-pci_acs_override-for-pci-passthrough.patch +++ /dev/null @@ -1,153 +0,0 @@ -From 5899496e787686c0983c3e9a6b96d5a4edcb07cb Mon Sep 17 00:00:00 2001 -From: Juan Pablo Ruiz -Date: Wed, 29 Jan 2025 10:06:38 +0200 -Subject: [PATCH 1/1] pci: add pci_acs_override for pci passthrough - -Co-authored-by: Emrah Billur -Signed-off-by: Juan Pablo Ruiz ---- - .../admin-guide/kernel-parameters.txt | 8 ++ - drivers/pci/quirks.c | 101 ++++++++++++++++++ - 2 files changed, 109 insertions(+) - -diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt -index d83a3f47e200..06828b0d77cf 100644 ---- a/Documentation/admin-guide/kernel-parameters.txt -+++ b/Documentation/admin-guide/kernel-parameters.txt -@@ -4304,6 +4304,14 @@ - nomsi [MSI] If the PCI_MSI kernel config parameter is - enabled, this kernel boot option can be used to - disable the use of MSI interrupts system-wide. -+ pci_acs_override [PCIE] Override missing PCIe ACS support for: -+ downstream -+ All downstream ports - full ACS capabilities -+ multifunction -+ Add multifunction devices - multifunction ACS subset -+ id:nnnn:nnnn -+ Specific device - full ACS capabilities -+ Specified as vid:did (vendor/device ID) in hex - noioapicquirk [APIC] Disable all boot interrupt quirks. - Safety option to keep boot IRQs enabled. This - should never be necessary. -diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c -index 54061b65a2b7..f4e5904d8a68 100644 ---- a/drivers/pci/quirks.c -+++ b/drivers/pci/quirks.c -@@ -3740,6 +3740,106 @@ static void quirk_no_bus_reset(struct pci_dev *dev) - dev->dev_flags |= PCI_DEV_FLAGS_NO_BUS_RESET; - } - -+static bool acs_on_downstream; -+static bool acs_on_multifunction; -+ -+#define NUM_ACS_IDS 16 -+struct acs_on_id { -+ unsigned short vendor; -+ unsigned short device; -+}; -+static struct acs_on_id acs_on_ids[NUM_ACS_IDS]; -+static u8 max_acs_id; -+ -+static __init int pcie_acs_override_setup(char *p) -+{ -+ if (!p) -+ return -EINVAL; -+ -+ while (*p) { -+ if (!strncmp(p, "downstream", 10)) -+ acs_on_downstream = true; -+ if (!strncmp(p, "multifunction", 13)) -+ acs_on_multifunction = true; -+ if (!strncmp(p, "id:", 3)) { -+ char opt[5]; -+ int ret; -+ long val; -+ -+ if (max_acs_id >= NUM_ACS_IDS - 1) { -+ pr_warn("Out of PCIe ACS override slots (%d)\n", -+ NUM_ACS_IDS); -+ goto next; -+ } -+ -+ p += 3; -+ snprintf(opt, 5, "%s", p); -+ ret = kstrtol(opt, 16, &val); -+ if (ret) { -+ pr_warn("PCIe ACS ID parse error %d\n", ret); -+ goto next; -+ } -+ acs_on_ids[max_acs_id].vendor = val; -+ -+ p += strcspn(p, ":"); -+ if (*p != ':') { -+ pr_warn("PCIe ACS invalid ID\n"); -+ goto next; -+ } -+ -+ p++; -+ snprintf(opt, 5, "%s", p); -+ ret = kstrtol(opt, 16, &val); -+ if (ret) { -+ pr_warn("PCIe ACS ID parse error %d\n", ret); -+ goto next; -+ } -+ acs_on_ids[max_acs_id].device = val; -+ max_acs_id++; -+ } -+next: -+ p += strcspn(p, ","); -+ if (*p == ',') -+ p++; -+ } -+ -+ if (acs_on_downstream || acs_on_multifunction || max_acs_id) -+ pr_warn("Warning: PCIe ACS overrides enabled; This may allow non-IOMMU protected peer-to-peer DMA\n"); -+ -+ return 0; -+} -+early_param("pcie_acs_override", pcie_acs_override_setup); -+ -+static int pcie_acs_overrides(struct pci_dev *dev, u16 acs_flags) -+{ -+ int i; -+ -+ /* Never override ACS for legacy devices or devices with ACS caps */ -+ if (!pci_is_pcie(dev) || -+ pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ACS)) -+ return -ENOTTY; -+ -+ for (i = 0; i < max_acs_id; i++) -+ if (acs_on_ids[i].vendor == dev->vendor && -+ acs_on_ids[i].device == dev->device) -+ return 1; -+ -+ switch (pci_pcie_type(dev)) { -+ case PCI_EXP_TYPE_DOWNSTREAM: -+ case PCI_EXP_TYPE_ROOT_PORT: -+ if (acs_on_downstream) -+ return 1; -+ break; -+ case PCI_EXP_TYPE_ENDPOINT: -+ case PCI_EXP_TYPE_UPSTREAM: -+ case PCI_EXP_TYPE_LEG_END: -+ case PCI_EXP_TYPE_RC_END: -+ if (acs_on_multifunction && dev->multifunction) -+ return 1; -+ } -+ -+ return -ENOTTY; -+} - /* - * Some NVIDIA GPU devices do not work with bus reset, SBR needs to be - * prevented for those affected devices. -@@ -5157,6 +5257,7 @@ static const struct pci_dev_acs_enabled { - { PCI_VENDOR_ID_ZHAOXIN, PCI_ANY_ID, pci_quirk_zhaoxin_pcie_ports_acs }, - /* Wangxun nics */ - { PCI_VENDOR_ID_WANGXUN, PCI_ANY_ID, pci_quirk_wangxun_nic_acs }, -+ { PCI_ANY_ID, PCI_ANY_ID, pcie_acs_overrides }, - { 0 } - }; - --- -2.34.1 - diff --git a/modules/reference/hardware/jetpack-microvm/nx-netvm-ethernet-pci-passthrough.nix b/modules/reference/hardware/jetpack-microvm/nx-netvm-ethernet-pci-passthrough.nix index beaaee15f..c6e54599c 100644 --- a/modules/reference/hardware/jetpack-microvm/nx-netvm-ethernet-pci-passthrough.nix +++ b/modules/reference/hardware/jetpack-microvm/nx-netvm-ethernet-pci-passthrough.nix @@ -19,19 +19,8 @@ in path = "0008:01:00.0"; } ]; - microvm.kernelParams = [ - "pci=nomsi" - "pcie_acs_override=downstream,multifunction" - ]; - } - ]; - - boot.kernelPatches = [ - { - name = "nx-pci-passthrough-patch"; - # This patch uses Alex Williamson's patch for enabling overrides for missing ACS capabilities on pci - # bus which could be accessed from following link: https://lkml.org/lkml/2013/5/30/513 - patch = ./0001-pci-add-pci_acs_override-for-pci-passthrough.patch; + # Add 8 seconds delay to wait for PCI devices to get full enumerated + microvm.preStart = "/bin/sh -c 'sleep 8'"; } ]; diff --git a/modules/reference/hardware/jetpack/nvidia-jetson-orin/virtualization/common/bpmp-virt-common/default.nix b/modules/reference/hardware/jetpack/nvidia-jetson-orin/virtualization/common/bpmp-virt-common/default.nix index 905ed42c3..875af9b8c 100644 --- a/modules/reference/hardware/jetpack/nvidia-jetson-orin/virtualization/common/bpmp-virt-common/default.nix +++ b/modules/reference/hardware/jetpack/nvidia-jetson-orin/virtualization/common/bpmp-virt-common/default.nix @@ -38,10 +38,10 @@ in TEGRA_BPMP_HOST_PROXY = lib.mkDefault no; }; } - # { - # name = "Vfio_platform Reset Required False"; - # patch = ./patches/0002-vfio_platform-reset-required-false.patch; - # } + { + name = "Vfio_platform Reset Required False"; + patch = ./patches/0002-vfio_platform-reset-required-false.patch; + } # { # name = "Bpmp Support Virtualization"; # patch = ./patches/0003-bpmp-support-bpmp-virt.patch; diff --git a/modules/reference/hardware/jetpack/nvidia-jetson-orin/virtualization/passthrough/uarti-net-vm/default.nix b/modules/reference/hardware/jetpack/nvidia-jetson-orin/virtualization/passthrough/uarti-net-vm/default.nix index f2611cd95..debc8a001 100644 --- a/modules/reference/hardware/jetpack/nvidia-jetson-orin/virtualization/passthrough/uarti-net-vm/default.nix +++ b/modules/reference/hardware/jetpack/nvidia-jetson-orin/virtualization/passthrough/uarti-net-vm/default.nix @@ -8,6 +8,32 @@ }: let cfg = config.ghaf.hardware.nvidia.passthroughs.uarti_net_vm; + + # Derivation to build the GPU-VM guest device tree + netvm-dtb = pkgs.stdenv.mkDerivation { + name = "netvm-dtb"; + phases = [ "unpackPhase" "buildPhase" "installPhase" ]; + src = ./tegra234-netvm.dts; + nativeBuildInputs = with pkgs; [ + dtc + ]; + unpackPhase = '' + cp $src ./tegra234-netvm.dts + ''; + buildPhase = '' + $CC -E -nostdinc \ + -I${config.boot.kernelPackages.nvidia-modules.src}/hardware/nvidia/t23x/nv-public/include/nvidia-oot \ + -I${config.boot.kernelPackages.nvidia-modules.src}/hardware/nvidia/t23x/nv-public/include/kernel \ + -undef -D__DTS__ \ + -x assembler-with-cpp \ + tegra234-netvm.dts > preprocessed.dts + dtc -I dts -O dtb -o tegra234-netvm.dtb preprocessed.dts + ''; + installPhase = '' + mkdir -p $out + cp tegra234-netvm.dtb $out/ + ''; + }; in { options.ghaf.hardware.nvidia.passthroughs.uarti_net_vm.enable = lib.mkOption { @@ -19,7 +45,7 @@ in config = lib.mkIf cfg.enable { services.udev.extraRules = '' # Make group kvm all devices that bind to vfio in iommu group 59 - SUBSYSTEM=="vfio",KERNEL=="59",GROUP="kvm" + SUBSYSTEM=="vfio",GROUP="kvm" ''; ghaf.hardware.nvidia.virtualization.enable = true; @@ -34,7 +60,7 @@ in extraArgs = [ # Add custom dtb to Net-VM with 31d0000.serial in platform devices "-dtb" - "${config.hardware.deviceTree.package}/tegra234-p3701-ghaf-net-vm.dtb" + "${netvm-dtb.out}/tegra234-netvm.dtb" # Add UARTI (31d0000.serial) as passtrhough device "-device" "vfio-platform,host=31d0000.serial" @@ -50,13 +76,6 @@ in # Make sure that Net-VM runs after the binding services are enabled systemd.services."microvm@net-vm".after = [ "bindSerial31d0000.service" ]; - boot.kernelPatches = [ - # { - # name = "Add Net-VM device tree with UARTI in platform devices"; - # patch = ./patches/net_vm_dtb_with_uarti.patch; - # } - ]; - systemd.services.bindSerial31d0000 = { description = "Bind UARTI to the vfio-platform driver"; wantedBy = [ "multi-user.target" ]; @@ -75,16 +94,11 @@ in # Enable hardware.deviceTree for handle host dtb overlays hardware.deviceTree.enable = true; - # Apply the device tree overlay only to tegra234-p3701-host-passthrough.dtb - # hardware.deviceTree.overlays = [ - # { - # name = "uarti_pt_host_overlay"; - # dtsFile = ./uarti_pt_host_overlay.dts; - - # # Apply overlay only to host passthrough device tree - # # TODO: make this avaliable if PCI passthrough is disabled - # filter = "tegra234-p3701-host-passthrough.dtb"; - # } - # ]; + hardware.deviceTree.overlays = [ + { + name = "uarti_pt_host_overlay"; + dtsFile = ./uarti_pt_host_overlay.dts; + } + ]; }; } diff --git a/modules/reference/hardware/jetpack/nvidia-jetson-orin/virtualization/passthrough/uarti-net-vm/tegra234-netvm.dts b/modules/reference/hardware/jetpack/nvidia-jetson-orin/virtualization/passthrough/uarti-net-vm/tegra234-netvm.dts new file mode 100644 index 000000000..119a25a7d --- /dev/null +++ b/modules/reference/hardware/jetpack/nvidia-jetson-orin/virtualization/passthrough/uarti-net-vm/tegra234-netvm.dts @@ -0,0 +1,403 @@ +/dts-v1/; + +/ { + interrupt-parent = <0x8002>; + model = "linux,dummy-virt"; + #size-cells = <0x02>; + #address-cells = <0x02>; + compatible = "linux,dummy-virt"; + + psci { + migrate = <0xc4000005>; + cpu_on = <0xc4000003>; + cpu_off = <0x84000002>; + cpu_suspend = <0xc4000001>; + method = "hvc"; + compatible = "arm,psci-1.0\0arm,psci-0.2\0arm,psci"; + }; + + memory@40000000 { + numa-node-id = <0x00>; + reg = <0x00 0x40000000 0x00 0x20000000>; + device_type = "memory"; + }; + + platform-bus@c000000 { + interrupt-parent = <0x8002>; + ranges = <0x00 0x00 0xc000000 0x2000000>; + #address-cells = <0x01>; + #size-cells = <0x01>; + compatible = "qemu,platform\0simple-bus"; + + uarti: serial@c000000 { + compatible = "arm,sbsa-uart"; + current-speed = <0x1c200>; + interrupts = <0x00 0x70 0x04>; + reg = <0x00000000 0x10000>; + status = "okay"; + }; + }; + + fw-cfg@9020000 { + dma-coherent; + reg = <0x00 0x9020000 0x00 0x18>; + compatible = "qemu,fw-cfg-mmio"; + }; + + virtio_mmio@a000000 { + dma-coherent; + interrupts = <0x00 0x10 0x01>; + reg = <0x00 0xa000000 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a000200 { + dma-coherent; + interrupts = <0x00 0x11 0x01>; + reg = <0x00 0xa000200 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a000400 { + dma-coherent; + interrupts = <0x00 0x12 0x01>; + reg = <0x00 0xa000400 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a000600 { + dma-coherent; + interrupts = <0x00 0x13 0x01>; + reg = <0x00 0xa000600 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a000800 { + dma-coherent; + interrupts = <0x00 0x14 0x01>; + reg = <0x00 0xa000800 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a000a00 { + dma-coherent; + interrupts = <0x00 0x15 0x01>; + reg = <0x00 0xa000a00 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a000c00 { + dma-coherent; + interrupts = <0x00 0x16 0x01>; + reg = <0x00 0xa000c00 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a000e00 { + dma-coherent; + interrupts = <0x00 0x17 0x01>; + reg = <0x00 0xa000e00 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a001000 { + dma-coherent; + interrupts = <0x00 0x18 0x01>; + reg = <0x00 0xa001000 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a001200 { + dma-coherent; + interrupts = <0x00 0x19 0x01>; + reg = <0x00 0xa001200 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a001400 { + dma-coherent; + interrupts = <0x00 0x1a 0x01>; + reg = <0x00 0xa001400 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a001600 { + dma-coherent; + interrupts = <0x00 0x1b 0x01>; + reg = <0x00 0xa001600 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a001800 { + dma-coherent; + interrupts = <0x00 0x1c 0x01>; + reg = <0x00 0xa001800 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a001a00 { + dma-coherent; + interrupts = <0x00 0x1d 0x01>; + reg = <0x00 0xa001a00 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a001c00 { + dma-coherent; + interrupts = <0x00 0x1e 0x01>; + reg = <0x00 0xa001c00 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a001e00 { + dma-coherent; + interrupts = <0x00 0x1f 0x01>; + reg = <0x00 0xa001e00 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a002000 { + dma-coherent; + interrupts = <0x00 0x20 0x01>; + reg = <0x00 0xa002000 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a002200 { + dma-coherent; + interrupts = <0x00 0x21 0x01>; + reg = <0x00 0xa002200 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a002400 { + dma-coherent; + interrupts = <0x00 0x22 0x01>; + reg = <0x00 0xa002400 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a002600 { + dma-coherent; + interrupts = <0x00 0x23 0x01>; + reg = <0x00 0xa002600 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a002800 { + dma-coherent; + interrupts = <0x00 0x24 0x01>; + reg = <0x00 0xa002800 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a002a00 { + dma-coherent; + interrupts = <0x00 0x25 0x01>; + reg = <0x00 0xa002a00 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a002c00 { + dma-coherent; + interrupts = <0x00 0x26 0x01>; + reg = <0x00 0xa002c00 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a002e00 { + dma-coherent; + interrupts = <0x00 0x27 0x01>; + reg = <0x00 0xa002e00 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a003000 { + dma-coherent; + interrupts = <0x00 0x28 0x01>; + reg = <0x00 0xa003000 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a003200 { + dma-coherent; + interrupts = <0x00 0x29 0x01>; + reg = <0x00 0xa003200 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a003400 { + dma-coherent; + interrupts = <0x00 0x2a 0x01>; + reg = <0x00 0xa003400 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a003600 { + dma-coherent; + interrupts = <0x00 0x2b 0x01>; + reg = <0x00 0xa003600 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a003800 { + dma-coherent; + interrupts = <0x00 0x2c 0x01>; + reg = <0x00 0xa003800 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a003a00 { + dma-coherent; + interrupts = <0x00 0x2d 0x01>; + reg = <0x00 0xa003a00 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a003c00 { + dma-coherent; + interrupts = <0x00 0x2e 0x01>; + reg = <0x00 0xa003c00 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + virtio_mmio@a003e00 { + dma-coherent; + interrupts = <0x00 0x2f 0x01>; + reg = <0x00 0xa003e00 0x00 0x200>; + compatible = "virtio,mmio"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + poweroff { + gpios = <0x8004 0x03 0x00>; + linux,code = <0x74>; + label = "GPIO Key Poweroff"; + }; + }; + + pl061@9030000 { + phandle = <0x8004>; + clock-names = "apb_pclk"; + clocks = <0x8000>; + interrupts = <0x00 0x07 0x04>; + gpio-controller; + #gpio-cells = <0x02>; + compatible = "arm,pl061\0arm,primecell"; + reg = <0x00 0x9030000 0x00 0x1000>; + }; + + pcie@10000000 { + interrupt-map-mask = <0x1800 0x00 0x00 0x07>; + interrupt-map = <0x00 0x00 0x00 0x01 0x8002 0x00 0x00 0x00 0x03 0x04 0x00 0x00 0x00 0x02 0x8002 0x00 0x00 0x00 0x04 0x04 0x00 0x00 0x00 0x03 0x8002 0x00 0x00 0x00 0x05 0x04 0x00 0x00 0x00 0x04 0x8002 0x00 0x00 0x00 0x06 0x04 0x800 0x00 0x00 0x01 0x8002 0x00 0x00 0x00 0x04 0x04 0x800 0x00 0x00 0x02 0x8002 0x00 0x00 0x00 0x05 0x04 0x800 0x00 0x00 0x03 0x8002 0x00 0x00 0x00 0x06 0x04 0x800 0x00 0x00 0x04 0x8002 0x00 0x00 0x00 0x03 0x04 0x1000 0x00 0x00 0x01 0x8002 0x00 0x00 0x00 0x05 0x04 0x1000 0x00 0x00 0x02 0x8002 0x00 0x00 0x00 0x06 0x04 0x1000 0x00 0x00 0x03 0x8002 0x00 0x00 0x00 0x03 0x04 0x1000 0x00 0x00 0x04 0x8002 0x00 0x00 0x00 0x04 0x04 0x1800 0x00 0x00 0x01 0x8002 0x00 0x00 0x00 0x06 0x04 0x1800 0x00 0x00 0x02 0x8002 0x00 0x00 0x00 0x03 0x04 0x1800 0x00 0x00 0x03 0x8002 0x00 0x00 0x00 0x04 0x04 0x1800 0x00 0x00 0x04 0x8002 0x00 0x00 0x00 0x05 0x04>; + #interrupt-cells = <0x01>; + ranges = <0x1000000 0x00 0x00 0x00 0x3eff0000 0x00 0x10000 0x2000000 0x00 0x10000000 0x00 0x10000000 0x00 0x2eff0000 0x3000000 0x80 0x00 0x80 0x00 0x80 0x00>; + reg = <0x40 0x10000000 0x00 0x10000000>; + msi-map = <0x00 0x8003 0x00 0x10000>; + dma-coherent; + bus-range = <0x00 0xff>; + linux,pci-domain = <0x00>; + #size-cells = <0x02>; + #address-cells = <0x03>; + device_type = "pci"; + compatible = "pci-host-ecam-generic"; + }; + + pl031@9010000 { + clock-names = "apb_pclk"; + clocks = <0x8000>; + interrupts = <0x00 0x02 0x04>; + reg = <0x00 0x9010000 0x00 0x1000>; + compatible = "arm,pl031\0arm,primecell"; + }; + + pl011@9000000 { + clock-names = "uartclk\0apb_pclk"; + clocks = <0x8000 0x8000>; + interrupts = <0x00 0x01 0x04>; + reg = <0x00 0x9000000 0x00 0x1000>; + compatible = "arm,pl011\0arm,primecell"; + }; + + pmu { + interrupts = <0x01 0x07 0x04>; + compatible = "arm,armv8-pmuv3"; + }; + + intc@8000000 { + phandle = <0x8002>; + reg = <0x00 0x8000000 0x00 0x10000 0x00 0x80a0000 0x00 0xf60000>; + #redistributor-regions = <0x01>; + compatible = "arm,gic-v3"; + ranges; + #size-cells = <0x02>; + #address-cells = <0x02>; + interrupt-controller; + #interrupt-cells = <0x03>; + + its@8080000 { + phandle = <0x8003>; + reg = <0x00 0x8080000 0x00 0x20000>; + #msi-cells = <0x01>; + msi-controller; + compatible = "arm,gic-v3-its"; + }; + }; + + flash@0 { + bank-width = <0x04>; + reg = <0x00 0x00 0x00 0x4000000 0x00 0x4000000 0x00 0x4000000>; + compatible = "cfi-flash"; + }; + + cpus { + #size-cells = <0x00>; + #address-cells = <0x01>; + + cpu-map { + + socket0 { + + cluster0 { + + core0 { + cpu = <0x8001>; + }; + }; + }; + }; + + cpu@0 { + phandle = <0x8001>; + numa-node-id = <0x00>; + reg = <0x00>; + compatible = "arm,arm-v8"; + device_type = "cpu"; + }; + }; + + timer { + interrupts = <0x01 0x0d 0x04 0x01 0x0e 0x04 0x01 0x0b 0x04 0x01 0x0a 0x04>; + always-on; + compatible = "arm,armv8-timer\0arm,armv7-timer"; + }; + + apb-pclk { + phandle = <0x8000>; + clock-output-names = "clk24mhz"; + clock-frequency = <0x16e3600>; + #clock-cells = <0x00>; + compatible = "fixed-clock"; + }; + + chosen { + linux,initrd-end = <0x00 0x48e68d46>; + linux,initrd-start = <0x00 0x48000000>; + bootargs = "console=ttyAMA0 reboot=t panic=-1 loglevel=4 init=/nix/store/ygzbib5kmqc4ffmmnd6lclga4fq73ngy-nixos-system-net-vm-23.11pre-git/init regInfo=/nix/store/jma8cq84vbxjzhzwcidw0lpqc3fpfw5i-closure-info/registration"; + stdout-path = "/pl011@9000000"; + rng-seed = <0x54924b6e 0x299b1a4d 0xf0a6795d 0xd346c073 0xe484a1ae 0x334ba8a5 0xe5e9b9f 0x856453b0>; + kaslr-seed = <0x981c9928 0x20d330ce>; + }; +}; diff --git a/modules/reference/hardware/jetpack/nvidia-jetson-orin/virtualization/passthrough/uarti-net-vm/uarti_pt_host_overlay.dts b/modules/reference/hardware/jetpack/nvidia-jetson-orin/virtualization/passthrough/uarti-net-vm/uarti_pt_host_overlay.dts index 319cf9e54..d4123f341 100644 --- a/modules/reference/hardware/jetpack/nvidia-jetson-orin/virtualization/passthrough/uarti-net-vm/uarti_pt_host_overlay.dts +++ b/modules/reference/hardware/jetpack/nvidia-jetson-orin/virtualization/passthrough/uarti-net-vm/uarti_pt_host_overlay.dts @@ -6,18 +6,19 @@ /dts-v1/; /plugin/; -#include +#include /{ overlay-name = "UARTI passthrough on host"; - compatible = "nvidia,p3737-0000+p3701-0000"; + compatible = "nvidia,p3701-0000"; fragment@0 { target = <&uarti>; __overlay__ { - compatible = "arm,dummy"; - iommus = <&smmu_niso0 TEGRA_SID_NISO1_SMMU_TEST>; + compatible = "nvidia,dummy"; + iommus = <&smmu_niso0 TEGRA234_SID_PASSTHROUGH>; status = "okay"; + dma-coherent; }; }; }; \ No newline at end of file diff --git a/targets/nvidia-jetson-orin/flake-module.nix b/targets/nvidia-jetson-orin/flake-module.nix index 4d2461d52..b15334715 100644 --- a/targets/nvidia-jetson-orin/flake-module.nix +++ b/targets/nvidia-jetson-orin/flake-module.nix @@ -61,7 +61,7 @@ let hardware.nvidia.orin = { enable = true; somType = som; - agx.enableNetvmWlanPCIPassthrough = som == "agx"; + agx.enableNetvmWlanPCIPassthrough = som == "agx"; nx.enableNetvmEthernetPCIPassthrough = som == "nx"; }; @@ -69,7 +69,9 @@ let virtualization.enable = true; virtualization.host.bpmp.enable = false; passthroughs.host.uarta.enable = false; - passthroughs.uarti_net_vm.enable = som == "agx"; + # TODO: uarti passthrough is currently broken, it will be enabled + # later after a further analysis. + passthroughs.uarti_net_vm.enable = false; }; virtualization = {