Skip to content

drivers: modem: generalize Quectel BG9X support #93105

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

guildeol-stra
Copy link

@guildeol-stra guildeol-stra commented Jul 14, 2025

Replace specific reference for Quectel BG95 in Modem Cellular with
BG9x, since the setup code should apply for other members of this
family.

Rename the 'quectel,bg95' DTS binding to 'quectel,bg9x' and add
optional 'mdm-reset-gpios' property.

To avoid confusion, delete the old 'quectel,bg9x' DTS binding and its
implementation.

Fixes #93115

Copy link

Hello @guildeol-stra, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

rerickson1
rerickson1 previously approved these changes Jul 14, 2025
@guildeol-stra
Copy link
Author

Hi, @rerickson1

I think the LTS versions could benefit from this. Can this also be backported?

@rerickson1 rerickson1 added bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. labels Jul 14, 2025
@rerickson1
Copy link
Member

Hi, @rerickson1

I think the LTS versions could benefit from this. Can this also be backported?

Does this issue exist in 3.7?

@guildeol-stra
Copy link
Author

Hi, @rerickson1
I think the LTS versions could benefit from this. Can this also be backported?

Does this issue exist in 3.7?

Yes. We use 3.7 as our base version and we first identified the issue there.

@rerickson1
Copy link
Member

Hi, @rerickson1
I think the LTS versions could benefit from this. Can this also be backported?

Does this issue exist in 3.7?

Can you please writeup a issue quick so it can be linked to this PR?
This is the official process that should be followed when including a fix like this.

@rerickson1 rerickson1 added the backport v3.7-branch Request backport to the v3.7-branch label Jul 14, 2025
@guildeol-stra guildeol-stra force-pushed the add_quectel_bg9x_modem_cellular_dts branch from 984c80a to a99767a Compare July 14, 2025 15:16
@guildeol-stra
Copy link
Author

guildeol-stra commented Jul 14, 2025

Hi, @rerickson1
I think the LTS versions could benefit from this. Can this also be backported?

Does this issue exist in 3.7?

Can you please writeup a issue quick so it can be linked to this PR? This is the official process that should be followed when including a fix like this.

Done. Added the link and also amended my commit message because this did not cause a compilation issue, just disabled the config implicitly.

Please let me know if there's anything else needed.

@rerickson1
Copy link
Member

Hi, @rerickson1
I think the LTS versions could benefit from this. Can this also be backported?

Does this issue exist in 3.7?

Can you please writeup a issue quick so it can be linked to this PR? This is the official process that should be followed when including a fix like this.

Done. Added the link and also amended my commit message because this did not cause a compilation issue, just disabled the config implicitly.

Please let me know if there's anything else needed.

Looks good. We'll see if its possible to get this bug fix in for 4.2. If not, it will come after.

Copy link
Contributor

@bjarki-andreasen bjarki-andreasen left a comment

Choose a reason for hiding this comment

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

That was by design :) the bg9x compat is a relic used only by the quectel-bg9x.c driver, modem_cellular (and zephyr in general) requires the devicetree to have specific device compats in the devicetree, like quectel,bg95 (which is why it was added and is used by the modem subsystem)

To elaborate a bit, quectel,bg9x is a malformed devicetree compatible, not a driver :) quectel-bg9x.c and modem_ceullar.c are drivers. These support specific hardware, which is what devicetree compatibles specify. If you have a bg95, or bg96 (something matching the "wildcard" bg9x), that compatible has to be added to zephyr, and the modem_cellular.c driver expanded to support it :)

@rerickson1 rerickson1 removed bug The issue is a bug, or the PR is fixing a bug Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. backport v3.7-branch Request backport to the v3.7-branch labels Jul 14, 2025
@rerickson1
Copy link
Member

That was by design :) the bg9x compat is a relic used only by the quectel-bg9x.c driver, modem_cellular (and zephyr in general) requires the devicetree to have specific device compats in the devicetree, like quectel,bg95 (which is why it was added and is used by the modem subsystem)

To elaborate a bit, quectel,bg9x is a malformed devicetree compatible, not a driver :) quectel-bg9x.c and modem_ceullar.c are drivers. These support specific hardware, which is what devicetree compatibles specify. If you have a bg95, or bg96 (something matching the "wildcard" bg9x), that compatible has to be added to zephyr, and the modem_cellular.c driver expanded to support it :)

And this is why multiple sets of eyes is best! This isn't really a bug then, right? This should technically be a new feature?

@bjarki-andreasen
Copy link
Contributor

That was by design :) the bg9x compat is a relic used only by the quectel-bg9x.c driver, modem_cellular (and zephyr in general) requires the devicetree to have specific device compats in the devicetree, like quectel,bg95 (which is why it was added and is used by the modem subsystem)
To elaborate a bit, quectel,bg9x is a malformed devicetree compatible, not a driver :) quectel-bg9x.c and modem_ceullar.c are drivers. These support specific hardware, which is what devicetree compatibles specify. If you have a bg95, or bg96 (something matching the "wildcard" bg9x), that compatible has to be added to zephyr, and the modem_cellular.c driver expanded to support it :)

And this is why multiple sets of eyes is best! This isn't really a bug then, right? This should technically be a new feature?

I believe so, but, looking at the commit, without modifications to modem_cellular.c, this PR would still not provide support for the bg9x compat, it would build the driver, but no driver would be instantiated, so maybe there's more to it?

@guildeol-stra guildeol-stra force-pushed the add_quectel_bg9x_modem_cellular_dts branch 2 times, most recently from efe651c to 7ff0c68 Compare July 16, 2025 16:15
@guildeol-stra guildeol-stra marked this pull request as draft July 16, 2025 16:15
@guildeol-stra guildeol-stra marked this pull request as ready for review July 16, 2025 16:36
@guildeol-stra guildeol-stra changed the title drivers: modem: Add BG9X Kconfig dependency drivers: modem: generalize Quectel BG9X support Jul 17, 2025
@guildeol-stra guildeol-stra force-pushed the add_quectel_bg9x_modem_cellular_dts branch from e2aef45 to b9fd4ee Compare July 17, 2025 11:31
Copy link
Member

@rerickson1 rerickson1 left a comment

Choose a reason for hiding this comment

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

The quectel-bg9x.c driver cannot be removed without first deprecating it.
Please see: https://docs.zephyrproject.org/latest/develop/api/api_lifecycle.html

@guildeol-stra guildeol-stra marked this pull request as draft July 18, 2025 13:45
Replace specific reference for Quectel BG95 in Modem Cellular with
BG9x, since the setup code should apply for other members of this
family.

Delete the 'quectel,bg95.yaml' DTS binding in favor of a modified
'quectel,bg9x.yaml' that should work for modem_cellular.c and
quectel-bg9x.c.

Signed-off-by: Guilherme Costa <[email protected]>
The modem_cellular implementation should suffice to handle the base
usage of generic BG9x family devices, so deprecate the quectel-bg9x.c
implementation.

Signed-off-by: Guilherme Costa <[email protected]>
@guildeol-stra guildeol-stra force-pushed the add_quectel_bg9x_modem_cellular_dts branch from b9fd4ee to c601d43 Compare July 18, 2025 13:57
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Modem Drivers priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot enable MODEM_CELLULAR with 'quectel,bg9x' compatible
3 participants