-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sw,multitop] port hmac_enc_test to devicetables #26244
base: master
Are you sure you want to change the base?
Conversation
97d43ca
to
aae4868
Compare
// Claim the IRQ at the PLIC. | ||
dif_rv_plic_irq_id_t plic_irq_id; | ||
CHECK_DIF_OK(dif_rv_plic_irq_claim(&rv_plic, kPlicTarget, &plic_irq_id)); | ||
|
||
// Get the peripheral the IRQ belongs to, and the ID of the IRQ fired | ||
peripheral_serviced = dt_plic_id_to_instance_id(plic_irq_id); | ||
dt_hmac_irq_t irq = dt_hmac_irq_from_plic_id(kHmacDt, plic_irq_id); | ||
irq_serviced = irq; | ||
|
||
// Acknowledge the IRQ at the peripheral if the IRQ is of the event type. | ||
dif_irq_type_t type; | ||
CHECK_DIF_OK(dif_hmac_irq_get_type(&hmac, irq, &type)); | ||
if (type == kDifIrqTypeEvent) { | ||
CHECK_DIF_OK(dif_hmac_irq_acknowledge(&hmac, irq)); | ||
} | ||
|
||
// Complete the IRQ at the PLIC. | ||
CHECK_DIF_OK(dif_rv_plic_irq_complete(&rv_plic, kPlicTarget, plic_irq_id)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, not sure about the best thing to do, but I don't think duplicating ISR testutils is ideal.. If we do this for each IP then we will end up with a lot of verbose code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I told @AlexJones0 to do that for now because the isr testutils are not ported to multitop yet. Also as an aside, the isr testutils as defined just don't make sense, we should probably change them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also keep this PR open until we have ported the testutils.
The `isr_testutils` API is not yet ported to DT, and this test only uses a small subset of the functionality exposed by `isr_testutils_hmac_isr`. So, for this test, we manually replace this function call with a few lines of equivalent dt code to keep the test passing. Since we no longer use `isr_testutils`, this drops the corresponding `isr_ctx` and `hmac_ctx` structs in favour of simplifying the test implementation. Signed-off-by: Alex Jones <[email protected]>
aae4868
to
c019c67
Compare
Fix #26215
This PR ports the
hmac_enc_test
to use the devicetables API so that it no longer depends on Earlgrey-specific constants. The test remains passing on Earlgrey on FPGA (fpga_cw310_rom_with_fake_keys
), and will compile for Darjeeling viaSee the commit message for more details about replacing the
isr_testutils
API call.