There are two main parts to get it to work, 1) most of the register
accesses need to be word sized, other than the config register which
needs to be byte aligned, and 2) we don't need the platform driver
for this to work on the Foundation Model, allow it to be NULL.
Details
Details
- Reviewers
- None
- Commits
- rS275640: Update the virtio driver to work on the ARM AArch64 Foundation Model.
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
Comment Actions
sys/dev/virtio/mmio/virtio_mmio.c | ||
---|---|---|
141 | why to check if (sc->platform != NULL) ? There are empty functions defined in virtio_mmio_if.m for that case. |
sys/dev/virtio/mmio/virtio_mmio.c | ||
---|---|---|
141 | These functions only work when sc->platform points to a valid device. When it's NULL the kernel tries to access the pointer causing an exception and panic. The alternative to this check would be to create a dummy platform device with a very low priority. |
Comment Actions
Follow the virtqueue configuration process. This fixes the driver on later revisions of the Foundation Model.
Comment Actions
It looks fine to me. I guess the vtmmio_vq_intr() function is slightly misnamed now though. How about just vtmmio_intr()?
I think there is still a couple of places that we could better comply with the spec, but they don't seem to be too important as long as it is working.