Skip to content

Mxfe sync zc706/zcu102#3009

Merged
buha merged 5 commits intomainfrom
mxfe_sync_zc706
Mar 30, 2026
Merged

Mxfe sync zc706/zcu102#3009
buha merged 5 commits intomainfrom
mxfe_sync_zc706

Conversation

@ranechita
Copy link
Copy Markdown
Contributor

Pull Request Description

Modify ad9081 and hmc7044 to enable support for multi-chip sync and update the project accordingly.

PR Type

  • Bug fix (change that fixes an issue)
  • New feature (change that adds new functionality)
  • Breaking change (has dependencies in other repos or will cause CI to fail)

PR Checklist

  • I have followed the Coding style guidelines
  • I have complied with the Submission Checklist
  • I have performed a self-review of the changes
  • I have commented my code, at least hard-to-understand parts
  • I have build all projects affected by the changes in this PR
  • I have tested in hardware affected projects, at the relevant boards
  • I have signed off all commits from this PR
  • I have updated the documentation (wiki pages, ReadMe etc), if applies

Check if SYNC occurred during synchronizing using EXT SYNC.

Signed-off-by: George Mois <george.mois@analog.com>
danmois
danmois previously approved these changes Mar 20, 2026
@ranechita
Copy link
Copy Markdown
Contributor Author

v2:

  • added README documentation for mcs_gpio

Comment thread drivers/mcs/mcs_gpio/README.rst
Comment thread projects/ad9081/Makefile Outdated
@ranechita
Copy link
Copy Markdown
Contributor Author

v3:

  • fix typo in documentation commit description
  • add mcs gpio initilization example
  • remove unrelated change from Makefile

buha
buha previously approved these changes Mar 20, 2026
@ranechita
Copy link
Copy Markdown
Contributor Author

v4:

  • added mcs to drivers_doc.rst

@buha
Copy link
Copy Markdown
Contributor

buha commented Mar 23, 2026

Documentation still errors out:

ERROR: New component 'mcs_gpio.c' in 'drivers' is missing README.rst file
Please add a README.rst file at: drivers/mcs/mcs_gpio.c/README.rst

danmois
danmois previously approved these changes Mar 23, 2026
Copy link
Copy Markdown
Contributor

@amiclaus amiclaus left a comment

Choose a reason for hiding this comment

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

when adding new drivers you need to follow the standard pattern. drivers/category/driver_name/ this should fix the doc build. on the other hand wondering if we should place or not the mcs under jesd204.

/* NCO Sync */
if (phy->l_f_sync && phy->leader) {
do {
ret = no_os_gpio_get_value(phy->lf_input_pin, &val);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

infinite loop?

ret = no_os_gpio_set_value(phy->lf_output_pin, 1);
if (phy->l_f_sync && !phy->leader)
do {
ret = no_os_gpio_get_value(phy->lf_input_pin, &val);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ditto.

if (ret != 0)
return ret;
if (phy->lf_output_pin)
ret = no_os_gpio_set_value(phy->lf_output_pin, 1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ret is overwritten below.

Comment thread drivers/mcs/mcs_gpio.c Outdated

ret = no_os_gpio_get(&dev->gpio_req, init_param->gpio_req);
if (ret < 0)
return ret;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

memleak.

Comment thread drivers/mcs/mcs_gpio.c Outdated
if (ret < 0)
return ret;
if (dev->gpio_req)
no_os_gpio_direction_output(dev->gpio_req, 0);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

return not handled.

pr_err("Error reading alarm status.\n");
return ret;
}
if (!HMC7044_SYSREF_SYNC_STAT(val))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

no timeout?

Comment thread drivers/mcs/mcs_gpio.c Outdated
pr_debug("%s:%d reason %s\n", __func__, __LINE__,
jesd204_state_op_reason_str(reason));

no_os_gpio_set_value(mcs_gpio->gpio_req, 1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

return values no handled.

};

status = mcs_gpio_init(&mcs_dev, &mcs_gpio_init_params);
if (status) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

odd indentation

Comment thread drivers/mcs/README.rst Outdated
MCS_GPIO Driver Initialization Example
--------------------------------------

.. code-block:: bash
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this should be .. code-block:: c

Comment thread projects/ad9081/src/app.c
#ifdef MCS_CONTINUOUS_SYSREF
status = mcs_gpio_init(&mcs_dev, &mcs_gpio_init_params);
if (status)
printf("mcs_gpio_init() error: %" PRId32 "\n", status);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we continue if errors occur?

@ranechita
Copy link
Copy Markdown
Contributor Author

when adding new drivers you need to follow the standard pattern. drivers/category/driver_name/ this should fix the doc build. on the other hand wondering if we should place or not the mcs under jesd204.

Do you mean the jesd204 folder in drivers/axi_core ? I think it might be confusing because the driver has nothing to do with axi. If you mean no-OS/jesd204 I don't think it would be appropriate because it contains only fsm and core and nothing driver related imo.

There's also the possibility of putting the mcs driver in util or maybe a new folder util/jesd204?

@amiclaus
Copy link
Copy Markdown
Contributor

amiclaus commented Mar 23, 2026

There's also the possibility of putting the mcs driver in util or maybe a new folder util/jesd204?

Yep, makes sense.

danmois added 2 commits March 25, 2026 11:26
Add leader-follower synchronization logic.

Signed-off-by: George Mois <george.mois@analog.com>
Add the driver for a MCS GPIO device that can be part of a JESD
topology.

Signed-off-by: George Mois <george.mois@analog.com>
@ranechita
Copy link
Copy Markdown
Contributor Author

ranechita commented Mar 25, 2026

v5:

  • added timeout to the gpio loops in ad9081
  • handled return codes and addresses memleaks in mcs_gpio
  • fixed indentation and .. code-block:: bash in README
  • moved mcs_gpio driver and readme in separate folder inside mcs
  • returned with error when mcs_gpio_init does not succeed in app.c
  • updated path in driver_doc.rst for mcs_gpio

ranechita and others added 2 commits March 25, 2026 14:33
Add short documentation for mcs_gpio.

Signed-off-by: Ramona Alexandra Nechita <ramona.nechita@analog.com>
Add options for leader-follower single MxFE synchronization.
Add the MCS GPIO to the JESD topology for leader-follower MxFE
synchronization.
Added a MCS_CONTINUOUS_SYSREF variable for the MXFE sync
use case.

Signed-off-by: George Mois <george.mois@analog.com>
@buha buha merged commit ccd42f8 into main Mar 30, 2026
17 of 19 checks passed
@buha buha deleted the mxfe_sync_zc706 branch March 30, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants