Hello, I have written a model of the Gaisler GRSPW SpaceWire controller for the leon3_generic machine, and I would like to know whether it could be welcome upstream, and how it should be shaped before I send patches.
What it does today (out of tree, on top of stable-11.0): - four GRSPW cores, at 0x80000A00-0x80000D00 with IRQs 10-13, listed in the APB plug&play table (Gaisler device 0x1F) - registers, DMA descriptors, interrupts and time codes, modelled on the GRIP documentation - an RMAP target (ECSS-E-ST-50-52C) on cores 2 and 3, including the 8-bit RMAP CRC that the DMA channel can append and check - the stock RTEMS 6 grspw and grspw_pkt drivers run unmodified It also needs the LEON forced cache miss ASI, which the RTEMS drivers use to read their DMA descriptors. This is a small, independent change that I could send first. The use case is LEON3 flight software development and testing without hardware: the other end of each SpaceWire link is a host program that simulates the equipment connected to the on-board computer. Code, documentation and an RTEMS test suite: https://github.com/stephane-showroom/qemu-spacewire-for-leon3 I know the current version does not follow QEMU conventions. My plan before posting a series is to: - replace the POSIX message queues and the private thread with a chardev backend handled in the main loop - use QEMU types, coding style, trace events and qemu_log_mask - add VMState, a qtest test and documentation in docs/system - split the work: forced cache miss ASI, GRSPW core, RMAP target, leon3_generic wiring, tests and docs My questions: 1. Would a GRSPW model be accepted for leon3_generic? 2. Transport: one chardev per core, or a single chardev multiplexing the four links? I currently multiplex them, so that one host program can simulate the whole environment of the on-board computer. 3. Where should it live: hw/net, hw/misc, or next to the other GRLIB devices? 4. The RMAP target reads and writes guest memory directly. Is address_space_rw() on the system address space the right approach? Any feedback is welcome. Thanks, Stephane GONZALEZ
