Conversation
Summary: hw/arm: improve Aspeed Catalina BMC emulation This series improves emulation of the Aspeed-based Catalina BMC machine, mostly around its I2C buses: the GPIO expanders the board relies on and the temperature sensors sitting next to them. The bulk of the work is on the PCA95xx I/O expander models. The existing PCA9552 and PCA9554 drivers only really covered the exact parts a couple of boards happened to use, and some of their register and pin behaviour did not match the datasheets. Catalina needs a few more variants and expects them to act like the real chips, so: - the PCA9552 driver now provides proper PCA9555/PCA9535 types, applies input polarity inversion on reads, and handles the command register as the datasheet describes (auto-increment and wrapping); - the PCA9554 driver gains the 4-bit PCA9536 variant, reflects push-pull outputs back into the input register, and grows an opt-in mode that honours the configured pin direction instead of forcing pins to outputs; - both drivers expose each line as a "pinN" QOM property, which lets an external actor drive an input pin. The property also allows reading the value driven onto an output-configured pin, which is the more useful capability, but nothing exercises it yet. Along the way both models get a fair bit of cleanup (DEFINE_TYPES, the Resettable interface, state moved out of the headers, default descriptions derived from the instantiated type). On the machine itself, Catalina now instantiates its PCA9555 expanders as their own type, gains the NIC and FIO temperature sensors present on real hardware, and drives the pca9554 expander input pins from outside the guest. Finally, the register-level behaviour of both expanders is covered by new qtests. Test Plan: Run QEMU with a Catalina flash image: ./facebook/start-qemu --pkg-dir rebuild-docker -f .../flash-catalina Reviewed By: ifel, jamesatha Differential Revision: D114236127
|
@eblot has exported this pull request. If you are a Meta employee, you can view the originating Diff in D114236127. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
hw/arm: improve Aspeed Catalina BMC emulation
This series improves emulation of the Aspeed-based Catalina BMC machine,
mostly around its I2C buses: the GPIO expanders the board relies on and
the temperature sensors sitting next to them.
The bulk of the work is on the PCA95xx I/O expander models. The existing
PCA9552 and PCA9554 drivers only really covered the exact parts a couple
of boards happened to use, and some of their register and pin behaviour
did not match the datasheets. Catalina needs a few more variants and
expects them to act like the real chips, so:
the PCA9552 driver now provides proper PCA9555/PCA9535 types, applies
input polarity inversion on reads, and handles the command register
as the datasheet describes (auto-increment and wrapping);
the PCA9554 driver gains the 4-bit PCA9536 variant, reflects
push-pull
outputs back into the input register, and grows an opt-in mode that
honours the configured pin direction instead of forcing pins to
outputs;
both drivers expose each line as a "pinN" QOM property, which lets an
external actor drive an input pin. The property also allows reading
the value driven onto an output-configured pin, which is the more
useful capability, but nothing exercises it yet.
Along the way both models get a fair bit of cleanup (DEFINE_TYPES, the
Resettable interface, state moved out of the headers, default
descriptions derived from the instantiated type).
On the machine itself, Catalina now instantiates its PCA9555 expanders
as their own type, gains the NIC and FIO temperature sensors present on
real hardware, and drives the pca9554 expander input pins from outside
the guest.
Finally, the register-level behaviour of both expanders is covered by
new qtests.
Test Plan:
Run QEMU with a Catalina flash image:
./facebook/start-qemu --pkg-dir rebuild-docker -f .../flash-catalina
Reviewed By: ifel, jamesatha
Differential Revision: D114236127