Skip to content

adrv9009 parser#20

Merged
tfcollins merged 17 commits intoanalogdevicesinc:mainfrom
liambeguin:lvb/adrv9009-parser
Sep 19, 2023
Merged

adrv9009 parser#20
tfcollins merged 17 commits intoanalogdevicesinc:mainfrom
liambeguin:lvb/adrv9009-parser

Conversation

@liambeguin
Copy link
Contributor

small rework of the already existing PR #18.

I'm not really sure about the cli part or how we want to do that part, but it gave me something to test with.
I'm happy to rework this more, and take over the cleanup part.

@tfcollins tfcollins self-assigned this Aug 31, 2023
@tfcollins
Copy link
Collaborator

Will review when back in the office. We are out this week (and some of next). Thanks for the PR :)

@liambeguin liambeguin force-pushed the lvb/adrv9009-parser branch from d41ee6b to 0b0d394 Compare August 31, 2023 15:44
Comment on lines +455 to +461
def profile2dt(ctx, profile):
"""Generate devicetree from Profile Configuration Wizard files
"""
adrv = adidt.adrv9009_pcbz()
adrv.parse_profile(profile)
adrv.gen_dt()
print(f'Wrote {adrv.output_filename}')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be more generic. Eventually we'll need to support other profiles. Can you change this to use something like ast.literal_eval or eval to take like the part or board name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tfcollins, apologies for the delay I was away for a few days.

This needs to be more generic. Eventually we'll need to support other profiles.

Understood, I'll make the change.

I was also working on a parser for talise_config.c that I'll add to this MR. I think it can help fill more fields in the devicetree template.

@liambeguin
Copy link
Contributor Author

For some of these parameters (mostly for jesd204), it seems like the DT has to match what is set in the vivado project.

Would it be possible to expose those in axi registers, and have the driver read them during the probe? I know that these have to be set for different drivers i.e. the FPGA cores and the 9009 for example, but wouldn't that be easier now with the jesd204-fsm code?

@tfcollins
Copy link
Collaborator

For some of these parameters (mostly for jesd204), it seems like the DT has to match what is set in the vivado project.

Would it be possible to expose those in axi registers, and have the driver read them during the probe? I know that these have to be set for different drivers i.e. the FPGA cores and the 9009 for example, but wouldn't that be easier now with the jesd204-fsm code?

Yes a big chunk of the JESD config is defined at synthesis time but its not globally true. We tend to give as much detail about the hardware in the devicetree as practical so things are not ambiguous. Having all this information available beforehand is useful for other debugging in the system as well. Technically you can also bring up a design without JESD cores in the FPGA (possibly existing somewhere else) and you would still need this information to perform some tasks.

@liambeguin
Copy link
Contributor Author

Yes a big chunk of the JESD config is defined at synthesis time but its not globally true

I see, that makes more sense now.

It can get a bit hard to wrap your head around all these configurations, and which tool to use for which parameters. Hopefully with this, we can try to automate some of that process, and help others too :)

tfcollins and others added 17 commits September 19, 2023 17:56
Signed-off-by: Travis F. Collins <travis.collins@analog.com>
Signed-off-by: Travis F. Collins <travis.collins@analog.com>
Use lpbkAdcProfile instead of FIR filter coefs

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Add support for ADI's ADRV9009-PCBZ FMC card.
The devicetree was taken as-is from the kernel tree.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Add a new command to generate devicetree files from a profile.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
In preparation for the addition of the AD9528 parser, move Profile
Wizard code to it's own file.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Signed-off-by: Liam Beguin <liambeguin@gmail.com>
In some cases, it seems like the channel enable options might not be
defined. Catch those instances and default to off.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Replace test data with default ADRV9009 profile from the Profile Wizard.
This profile was generated with the "Write AD9528 settings to file"
option in preparation for the addition of that feature.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
The Profile Wizard can be made to export a profile for the ad9528 clock
buffer. Add support for parsing the profile and generating devicetree
files.
Some parameters are part of the profile, but can't be edited in the GUI
including hardware configurations such as single-ended/differential
and buffer modes.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
The profile tool (and the no-OS implementation) seem to allow
sysrefNshotMode=0 which is undefined according to the datasheet of the
ad9528.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Signed-off-by: Liam Beguin <liambeguin@gmail.com>
TES (Transceiver Evaluation Software) can be used to generate filters,
and JESD204 configurations. It support a few output formats including a
talise_config.c file. This adds a basic parser to read the talInit data
structure which will be used to fill more parameter in the adrv9009
devicetree template.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Add a cli option to parse a talise_config.c file, and add it's jesd204
components to the devicetree output.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
@liambeguin
Copy link
Contributor Author

@tfcollins, I updated the original code with your suggestion using eval and adding --board to the global cli context.

This also adds:

  • a parser for the ad9528 Profile wizard output
  • a basic parser for the talise_config.c file from the TES application
    • I tried using something like pycparser, but I didn't find it much simpler than this implementation.

Your original commit was marked as WIP, were there other changes you wanted to make? I could have a look at that, or just drop [WIP] .

I'm not totally convinced by the profile2dt name, if someone has a better suggestion I'll take it. Not the most important thing though..

@tfcollins tfcollins self-requested a review September 19, 2023 23:56
@tfcollins tfcollins merged commit 83c81e0 into analogdevicesinc:main Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants