Skip to content
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

DT-related fixes in UART driver for CC13xx/CC26xx #25647

Merged
merged 2 commits into from
May 27, 2020

Conversation

vanti
Copy link
Collaborator

@vanti vanti commented May 27, 2020

The existing driver code, after changes from the recent DT rework, does
not allow UART1 to be enabled when UART0 is not. This is because there
is an implicit assumption that DT instance 0 corresponds to UART0 and
DT instance 1 corresponds to UART1.

In particular, the power configuration is dependent on which UART is physically used.
In order to allow DT_INST_FOREACH_STATUS_OKAY() to iterate through
instances without the assumption that index 0 corresponds to UART0
(which would be incorrect in the case when only UART1 is enabled),
we need to check the base address to identify which UART is being dealt
with.

There also does not seem to be a simple way to express the fact that UART1
can be initialized later at the POST_KERNEL level. The existing code
is wrong in the sense that it always initializes DT instance 1 later,
instead of doing it for UART1 (which may not be instance 1).
In addition, UART instances on other platforms are
also initialized at the PRE_KERNEL_1 level regardless of the instance
index, so let's do the same on this platform for consistency.

vanti added 2 commits May 26, 2020 22:22
The power configuration is dependent on which UART is physically used.
In order to allow DT_INST_FOREACH_STATUS_OKAY() to iterate through
instances without the assumption that index 0 corresponds to UART0
(which would be incorrect in the case when only UART1 is enabled),
we need to check the base address to identify which UART is being dealt
with.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
There does not seem to be a simple way to express the fact that UART1
can be initialized later at the POST_KERNEL level. The existing code
is wrong in the sense that it always initializes DT instance 1 later,
instead of doing it for UART1 (which may not be instance 1).

In addition, UART instances on other platforms are
also initialized at the PRE_KERNEL_1 level regardless of the instance
index, so let's do the same on this platform for consistency.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
@vanti vanti requested a review from bwitherspoon as a code owner May 27, 2020 05:36
@vanti vanti requested a review from galak May 27, 2020 05:46
@galak galak added this to the v2.3.0 milestone May 27, 2020
@galak galak added area: Devicetree area: UART Universal Asynchronous Receiver-Transmitter bug The issue is a bug, or the PR is fixing a bug labels May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Devicetree area: UART Universal Asynchronous Receiver-Transmitter bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants