Skip to content

boards: raspberrypi: rpi_pico: Remove i2c1 node (again) #79461

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

soburi
Copy link
Member

@soburi soburi commented Oct 5, 2024

Zephyr's default settings usually enable only the minimum of
peripherals, and rpi_pico already has i2c0 enabled.
Remove the i2c1 node configuration.

I've dealt in a82cc22,
but it was added again by mistake. I'll delete it again.

@zephyrbot
Copy link
Collaborator

zephyrbot commented Oct 5, 2024

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@zephyrbot zephyrbot added manifest manifest-hal_rpi_pico DNM This PR should not be merged (Do Not Merge) labels Oct 5, 2024
@soburi soburi added the platform: Raspberry Pi Pico Raspberry Pi Pico (RPi Pico) label Oct 5, 2024
@soburi soburi force-pushed the pico_remove_i2c1_default branch from cc53c57 to 42c1d0f Compare October 6, 2024 14:14
Copy link

github-actions bot commented Dec 6, 2024

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Dec 6, 2024
@github-actions github-actions bot closed this Dec 21, 2024
@soburi soburi reopened this Dec 24, 2024
@soburi soburi force-pushed the pico_remove_i2c1_default branch from 42c1d0f to 9379088 Compare December 24, 2024 03:10
@zephyrbot zephyrbot removed manifest manifest-hal_rpi_pico DNM This PR should not be merged (Do Not Merge) labels Dec 24, 2024
@soburi soburi marked this pull request as ready for review December 24, 2024 06:29
@zephyrbot zephyrbot added the area: Shields Shields (add-on boards) label Dec 24, 2024
@soburi soburi removed the Stale label Dec 24, 2024
kartben
kartben previously approved these changes Dec 24, 2024
@kartben
Copy link
Collaborator

kartben commented Dec 26, 2024

Actually looking at this again, what was wrong in your opinion with having the nodes present but disabled by default?

@soburi
Copy link
Member Author

soburi commented Dec 26, 2024

Actually looking at this again, what was wrong in your opinion with having the nodes present but disabled by default?

https://datasheets.raspberrypi.com/pico/Pico-R3-A4-Pinout.pdf

In the pinout diagram, UART0, I2C0, and SPI0 are shown in dark colors, and are the general default pinmux. This is generally a shared understanding among users. However, there are no clear defaults for other peripherals, so I think it is better to leave them as they are.

Copy link
Collaborator

@ajf58 ajf58 left a comment

Choose a reason for hiding this comment

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

I agree with @kartben , at most I would disable the node.

More generally, the docs are left wanting on this:

Unless explicitly recommended otherwise by this section, leave peripherals and their drivers disabled by default.

Leaving drivers disabled makes sense to me: it reduces compilation time, which is often a pain port ("Why does hello world need so many files to compile?!" is a oft-heard complaint).

I'm not sure what benefit having nodes disabled by default benefits anyone, or why the project dictates this: board authors/contributors can define a functioning combination of peripherals + pin muxing, and disabling nodes in an app-specific overlay is just as easy/hard as enabling them.

Comment on lines -26 to -33
i2c1_default: i2c1_default {
group1 {
pinmux = <I2C1_SDA_P6>, <I2C1_SCL_P7>;
input-enable;
input-schmitt-enable;
};
};

Copy link
Collaborator

Choose a reason for hiding this comment

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

The pico-examples use the same pinmux for I2C1 as was defined before this PR, i.e. using GPIO6 and GPIO7. I think that the vendor's examples should be considered a strong enough precedent.

Copy link
Member Author

Choose a reason for hiding this comment

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

@ajf58 @kartben

#45131 (comment)

This topic has already been discussed and agreed upon, and it violates that, so it needs to be restored.
If you would like to raise a separate issue to re-enable it, that is welcome.

Copy link
Member Author

Choose a reason for hiding this comment

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

@petejohanson @carlescufi @yonsch

I'm sorry to bring up an old topic, but I would like to consult with someone who reviewed a similar issue in the past.

The board's pinctrl settings are preferred to be "minimal", and rpi_pico also follows this policy, as stated in [the past discussion https://github.com//pull/45131#discussion_r872782328.

Due to my carelessness in this review #60384 , I re-added the i2c1 settings, However as stated in the discussion above, there is already a consensus among developers to keep it minimal, so I think it would be better to revert (delete) it.
This also aims to keep the shield definition neutral.

@ajf58 seems to have a different opinion, but since it would overwrite the current consensus, I think it would be better to discuss it as a separate issue.

I would like to hear your opinion on this point.

@kartben kartben assigned soburi and unassigned kartben Jan 15, 2025
@soburi soburi requested a review from ThreeEights February 15, 2025 06:51
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Apr 17, 2025
@soburi soburi marked this pull request as draft April 20, 2025 07:54
@soburi soburi force-pushed the pico_remove_i2c1_default branch from 9379088 to d724f42 Compare April 20, 2025 07:57
soburi added 2 commits April 20, 2025 17:46
As you can see from the pinout definition at
https://datasheets.raspberrypi.com/pico/Pico-R3-A4-Pinout.pdf,
Pico does not have a standard location for i2c1.

Therefore, defining `pico_i2c1` as a standard definition does not match
the reality and would only complicate the situation.
Therefore, delete the definition of `pico_i2c1`.

If you use i2c1 with a shield, create a boards directory on each shield
and define pinctrl for each board.

For waveshare_ups, I added configure explicitly for i2c1 here

Signed-off-by: TOKITA Hiroshi <[email protected]>
Zephyr's default settings usually enable only the minimum of
peripherals, and rpi_pico already has `i2c0` enabled.
Remove the `i2c1` node configuration.

I've dealt in a82cc22,
but it was added again by mistake. I'll delete it again.

Signed-off-by: TOKITA Hiroshi <[email protected]>
@soburi soburi force-pushed the pico_remove_i2c1_default branch from d724f42 to 397b442 Compare April 20, 2025 08:46
@github-actions github-actions bot removed the Stale label Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Shields Shields (add-on boards) platform: Raspberry Pi Pico Raspberry Pi Pico (RPi Pico)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants