CV-Bowen opened a new pull request, #22478:
URL: https://github.com/apache/nuttx/pull/22478

   ## Summary
   
   `ivshmem` is now a bus any backend can put devices on, but PCI is the only
   backend. QEMU has a second one: `ivshmem-flat`, the same ivshmem register
   block and shared memory as plain MMIO regions plus one IRQ, for machines
   without a PCI bus.
   
   - `drivers/ivshmem: add the QEMU ivshmem-flat backend`: 
`ivshmem_flat_register()`
     takes the register block, the shared memory and an optional doorbell IRQ,
     and registers the device on the ivshmem bus. The doorbell is a write to the
     doorbell register; a device without an IRQ has no doorbell, and the drivers
     on top poll, the same as `ivshmem-plain` without an MSI-X BAR. The peer id
     is read from the IVPOSITION register, and a value other than 0 or 1 falls
     back to polling.
   - `drivers/devicetree: find ivshmem-flat devices in the device tree`:
     `fdt_ivshmem_flat_devices_register()` scans for `qemu,ivshmem-flat` nodes.
     `reg[0]` is the register block, `reg[1]` the shared memory; a node without
     `interrupts` has no doorbell, and `ivshmem-id`, when present, is the bus 
id.
     Their `reg` is relative to the parent bus (the QEMU platform bus), which
     `fdt_get_reg_base*()` returns untranslated, so it is walked through the
     parent's `ranges`.
   
   ## Impact
   
   - New public header `include/nuttx/ivshmem_flat.h` and Kconfig option
     `IVSHMEM_FLAT`. Nothing selects it; a board has to.
   - No behaviour change for the PCI backend: the two commits only add a backend
     and its device tree hook. `IVSHMEM` and `RPTUN_IVSHMEM` are untouched.
   
   ## Testing
   
   Host: Ubuntu 22.04.5 LTS x86_64; arm-none-eabi-gcc 10.3-2021.10.
   
   **Build with the new code compiled in**: `qemu-armv7a:rpserver` plus
   `CONFIG_IVSHMEM_FLAT=y` (that configuration already has `CONFIG_DEVICE_TREE`,
   `CONFIG_IVSHMEM` and `CONFIG_PCI_IVSHMEM`). 0 warnings, 0 errors;
   `drivers/ivshmem_flat.o` and `drivers/fdt_ivshmem_flat.o` are both built.
   
   **Baseline**: `sim:rpserver`/`rpproxy` and `qemu-armv8a:rpserver`/`rpproxy`
   boot and pass the rpmsg cases (dump, ping, rpmsgfs).
   
   **Runtime**: not exercised. There is no in-tree board with an
   `ivshmem-flat` device yet - the machine that has one is the M-profile QEMU
   platform whose board support is not in this tree - so the backend is compiled
   but not run here.
   
   checkpatch passes on both commits.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to