Skip to content

Kbase driver support, U-Boot PD negotiation compatibility - #2

Open
Simon-Hostettler wants to merge 13 commits into
opencca:opencca/nextfrom
Simon-Hostettler:opencca/shostettler/finalized-kbase-cvm-uboot-pd
Open

Kbase driver support, U-Boot PD negotiation compatibility#2
Simon-Hostettler wants to merge 13 commits into
opencca:opencca/nextfrom
Simon-Hostettler:opencca/shostettler/finalized-kbase-cvm-uboot-pd

Conversation

@Simon-Hostettler

Copy link
Copy Markdown
  • GPU passthrough base layer (swiotlb bypass, RAM reservation, NS MMIO registers, gpu_poweron + irq modules, ...) (gated with OPENCCA_DEMO)
  • Full kbase driver import (drivers/gpu/arm) + wiring into build
  • Rockchip SoC support files
  • 6.12 porting fixes
  • USB-C PD negotiation patch to work with U-Boot upgrade

abertschi and others added 13 commits January 22, 2026 14:37
irq.c: A VFIO inspired IRQ router that forwards physical GPU
       IRQs as virtual IRQS into the CVM.

gpu_poweron.c: Setup code from panthor driver to power on MMIO registers.
       The actual driver runs inside the CVM (we dont passthrough
       the power controller so we enable the GPU beforehand).
- We implement demo_ioremap_ns_realm() that creates stage-2
  page mappings for mmio in the CVM (using RMM).

  We keep the mappings hypervisor-shared to reuse vanilla
  rmi_rtt_map_unprotected APIs. This keeps MMIO hypervisor
  shared and demonstrates device prototyping on opencca.

- We identity page map reserved physical memory into CVM.
  This is needed because GPU on RK3588 does not have an SMMU
  for GPU.
Carve out some physical memory for which we assume
IPA = PA in CVM, so GPU can DMA into CVM memory, despite
not having an SMMU.
…ssthrough

When running the panthor driver inside the CVM, ensure
the NS-shared bit is set in the page protection, so we access it through
the NS IPA space. This is necessary because we map the GPU as
hypervisor-shared for the sake of the demo.

We further add workarounds in swiotlb to mark the GPU device
(70000000.gpu) as trusted to bypass bounce buffer restrictions
imposed by CCA CVM.

For this, the GPU device is marked with demo-disable-swiotlb
device tree property to skip swiotlb force bounce for device.

Sample CVM device tree for GPU (see corresponding commit in kvmtool)

gpuclk {
		compatible = "fixed-clock";
		clock-frequency = <0x2faf0800>;
		#clock-cells = <0x00>;
		phandle = <0x1234>;
	};

	regulator-gpu {
		phandle = <0x1235>;
		compatible = "regulator-fixed";
		regulator-name = "vdd_gpu";
		regulator-min-microvolt = <0xcf850>;
		regulator-max-microvolt = <0xcf850>;
		regulator-always-on;
		regulator-boot-on;
	};

	gpu_opp_table {
		compatible = "operating-points-v2";
		phandle = <0x1236>;

		opp-800mhz {
			opp-hz = <0x00 0x2faf0800>;
			opp-microvolt = <0xcf850>;
		};
	};

	gpu@70000000 {
		compatible = "rockchip,rk3588-mali\0arm,mali-valhall";
		reg = <0x00 0x70000000 0x00 0x200000>;
		interrupts = <0x00 0x05 0x04 0x00 0x04 0x04 0x00 0x06 0x04>;
		clocks = <0x1234>;
		mali-supply = <0x1235>;
		clock-names = "core";
		operating-points-v2 = <0x1236>;
		interrupt-names = "job\0mmu\0gpu";
		demo-disable-swiotlb; <-- this
	};
…rockchip 6.1. Includes full drivers/gpu/arm, SoC helpers (pvtm, opp_select, system_monitor, rockchip_sip), associated headers (memory_group_manager, protected_memory_allocator, wakelock, version_compat_defs ...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants