need a better SMN addressing mechanism
At Oxide, we've been working a lot with the AMD SMN addressing implementation beyond just what we see in
zen_umc. As part of this, we've tried a few different incremental attempts at improving the register definitions and how to make this usable, deal with the complexities of different functional groups, and try to end up with something that is still fairly usable and less error-prone.
The note from the folks working on it as to our specific approach was:
Instead of trying to explain a rather convoluted collection of very long, hard-to-read macros, I'm going to follow the lead in the generic amdzen UMC driver. We'll use inline functions specific to each functional unit to compute individual SMN addresses and much shorter macros to obtain the final ones. Checking the correctness of the definitions and instance numbers will be simpler and more explicit this way, which should also make it easier to understand if something goes wrong.
This will also put us on track to move the Milan-specific headers into generic locations once model-specificity is factored out, with all the SMN consumers looking more or less similar.
We've already seen this approach work for us and have subsequently extended it a bit to also deal with different sized apertures where if you read the wrong size, the hardware will barf, and enforce this. So we've found that this approach has been working for us and does seem to be amenable to our continued use and evolution.
Updated by Electric Monk 3 months ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit ba215efe42e70993d3838f7af671f9d9fc0ebc33 Author: Keith M Wesolowski <email@example.com> Date: 2022-09-11T04:06:00.000Z 14936 need a better SMN addressing mechanism Reviewed by: Robert Mustacchi <firstname.lastname@example.org> Reviewed by: Andy Fiddaman <email@example.com> Approved by: Garrett D'Amore <firstname.lastname@example.org>