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

Enable AMD 1-wire AXI IP and Zynq GPIO drivers #3795

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

michalsimek
Copy link
Contributor

@michalsimek michalsimek commented Jan 15, 2025

Zynq GPIO driver is used on AMD/Xilinx Kria platform for ETH phy reset.
Macb and PHY drivers are already enabled.
1 wire IP can be used for reading sensors via PMOD connector.

Would be also good to enable these drivers in upcoming 6.12 kernel.

Summary by CodeRabbit

  • New Features
    • Enhanced kernel support for GPIO and 1-wire protocols
    • Added hardware configuration options for specific device interfaces

Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

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

Hi @michalsimek

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant bot marked this pull request as draft January 15, 2025 12:43
@michalsimek michalsimek marked this pull request as ready for review January 15, 2025 12:48
Copy link

coderabbitai bot commented Jan 15, 2025

📝 Walkthrough

Walkthrough

The pull request introduces two new kernel configuration options in the buildroot-external/board/arm-uefi/generic-aarch64/kernel.config file. These additions enhance hardware support by enabling GPIO (Zynq) and 1-wire (AMD AXI) modules in the kernel configuration. The changes are specifically targeted at improving hardware interface capabilities for an ARM UEFI-based generic AArch64 platform.

Changes

File Change Summary
buildroot-external/board/arm-uefi/generic-aarch64/kernel.config Added two kernel configuration modules:
- CONFIG_GPIO_ZYNQ=m (GPIO Zynq support)
- CONFIG_W1_MASTER_AMD_AXI=m (1-wire AMD AXI master support)

Note: Since the changes are straightforward kernel configuration modifications, a sequence diagram is not applicable in this scenario.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@michalsimek michalsimek marked this pull request as draft January 15, 2025 12:57
@michalsimek michalsimek changed the title Enable AMD 1 wire axi IP and TI DP83867 ethernet PHY Enable AMD 1 wire axi IP and and Zynq GPIO drivers Jan 15, 2025
@michalsimek michalsimek marked this pull request as ready for review January 15, 2025 13:52
Copy link
Member

@sairon sairon left a comment

Choose a reason for hiding this comment

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

IIUC the features are to be used in the generic-aarch64 image. In that case I would suggest to apply them in buildroot-external/board/arm-uefi/generic-aarch64/kernel.config. Definitely the CONFIG_GPIO_ZYNQ needs to be moved there, as it depends on CONFIG_ARCH_ZYNQ || CONFIG_ARCH_ZYNQMP and could end up disabled in boards that include device-support.config but do not have that architecture enabled. That would trigger our kernel dotconfig checker in CI. The other option does not have a hard dependency but seems to be ARM-specific as well.

Also, with the options moved to the other fragment, they will be still applied once the Linux 6.12 is merged, without any further changes needed.

@home-assistant home-assistant bot marked this pull request as draft January 15, 2025 14:52
@michalsimek
Copy link
Contributor Author

Yes. Kria is ARM based system. https://www.amd.com/en/products/system-on-modules/kria.html

@sairon
Copy link
Member

sairon commented Jan 15, 2025

Looks better now, thanks. I'm just confused by the comments, how is the 1-wire option related to CAN bus? 🤔

Zynq GPIO driver is used on AMD/Xilinx Kria platform for ETH phy reset.
Macb and PHY drivers are already enabled.
1 wire IP can be used for reading sensors via PMOD connector.
@michalsimek michalsimek marked this pull request as ready for review January 15, 2025 17:22
@home-assistant home-assistant bot requested a review from sairon January 15, 2025 17:22
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 22a637a and fcfb6ff.

📒 Files selected for processing (1)
  • buildroot-external/board/arm-uefi/generic-aarch64/kernel.config (1 hunks)
🔇 Additional comments (1)
buildroot-external/board/arm-uefi/generic-aarch64/kernel.config (1)

64-65: Verify 1-wire dependencies and add documentation.

The AMD AXI 1-wire driver is correctly configured as a module. However, please verify the following:

Consider adding documentation to clarify the intended use:

 # 1-wire
+# CONFIG_W1_MASTER_AMD_AXI: Required for reading sensors via PMOD connector on AMD/Xilinx Kria platform
 CONFIG_W1_MASTER_AMD_AXI=m

Additionally, given the confusion in PR comments about CAN bus relation, please clarify in the PR description that this 1-wire support is independent of CAN functionality.

✅ Verification successful

Dependencies are correctly configured

The AMD AXI 1-wire driver is properly configured as a module, with core 1-wire support (CONFIG_W1) provided by the base device-support.config. The original documentation suggestion remains valid for clarity:

 # 1-wire
+# CONFIG_W1_MASTER_AMD_AXI: Required for reading sensors via PMOD connector on AMD/Xilinx Kria platform
 CONFIG_W1_MASTER_AMD_AXI=m
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for required 1-wire dependencies in kernel config
# Expected: CONFIG_W1 should be enabled, CONFIG_W1_SLAVE_THERM might be needed for temperature sensors

# Search for W1 core config
echo "Checking W1 core configuration:"
rg -l 'CONFIG_W1=y' || echo "CONFIG_W1 not found"

# Search for W1 slave temp sensor config (if needed)
echo "Checking W1 temperature sensor configuration:"
rg -l 'CONFIG_W1_SLAVE_THERM=m' || echo "CONFIG_W1_SLAVE_THERM not found"

Length of output: 502


Script:

#!/bin/bash
# Check if device-support.config is included and search for all W1 configs
echo "Checking generic-aarch64 kernel config contents:"
cat buildroot-external/board/arm-uefi/generic-aarch64/kernel.config

echo -e "\nChecking for W1 configs in generic-aarch64:"
rg "CONFIG_W1" buildroot-external/board/arm-uefi/generic-aarch64/kernel.config || echo "No W1 configs found"

Length of output: 1586

Comment on lines +61 to +62
# GPIO support
CONFIG_GPIO_ZYNQ=m
Copy link

@coderabbitai coderabbitai bot Jan 15, 2025

Choose a reason for hiding this comment

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

💡 Codebase verification

Missing critical dependencies for Zynq GPIO driver

The Zynq GPIO driver (CONFIG_GPIO_ZYNQ) requires the following dependencies which are not configured:

  • CONFIG_GPIO_CORE: Required for basic GPIO subsystem support
  • CONFIG_OF: Required for device tree support

Please add these configurations to ensure the Zynq GPIO driver functions correctly for Ethernet PHY reset on the Kria platform:

+# GPIO core support
+CONFIG_GPIO_CORE=y
+# Device Tree support
+CONFIG_OF=y
 # GPIO support
 # CONFIG_GPIO_ZYNQ: Required for Ethernet PHY reset on AMD/Xilinx Kria platform
 CONFIG_GPIO_ZYNQ=m
🔗 Analysis chain

Verify GPIO core dependencies and add documentation.

The Zynq GPIO driver is correctly configured as a module. However, please verify the following:

Consider adding a comment explaining the Kria platform requirement:

 # GPIO support
+# CONFIG_GPIO_ZYNQ: Required for Ethernet PHY reset on AMD/Xilinx Kria platform
 CONFIG_GPIO_ZYNQ=m
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for required GPIO dependencies in kernel config
# Expected: CONFIG_GPIO_CORE and CONFIG_OF should be enabled

# Search for GPIO core config
echo "Checking GPIO core configuration:"
rg -l 'CONFIG_GPIO_CORE=y' || echo "CONFIG_GPIO_CORE not found"

# Search for OF (Open Firmware) config
echo "Checking OF configuration:"
rg -l 'CONFIG_OF=y' || echo "CONFIG_OF not found"

Length of output: 298


Script:

#!/bin/bash
# Broader search for GPIO and OF configurations
echo "Checking for any GPIO core settings:"
rg -l 'CONFIG_GPIO_CORE[= ]' || echo "No GPIO core config found"

echo -e "\nChecking for any OF settings:"
rg -l 'CONFIG_OF[= ]' || echo "No OF config found"

echo -e "\nChecking for related GPIO configs:"
rg 'CONFIG_GPIO' buildroot-external/board/arm-uefi/generic-aarch64/kernel.config

echo -e "\nChecking for config includes:"
rg '^source|^\.include' buildroot-external/board/arm-uefi/generic-aarch64/kernel.config

Length of output: 670

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sairon Do you want me to do suggested changes by bot? CONFIG_OF is already enabled and CONFIG_GPIO_CORE doesn't exist in v6.6 or v6.12.

Copy link

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Member

Choose a reason for hiding this comment

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

@michalsimek No need, unfortunately, Coderabbit is not particularly good at knowing Linux in detail. Sometimes it helps but here it's really hallucinating, just ignore it. The dependencies of the added options are met, so LGTM.

@sairon sairon added board/generic-aarch64 Generic aarch64 machine linux Linux kernel related issue labels Jan 15, 2025
@sairon sairon changed the title Enable AMD 1 wire axi IP and and Zynq GPIO drivers Enable AMD 1-wire AXI IP and Zynq GPIO drivers Jan 15, 2025
Copy link
Member

@sairon sairon left a comment

Choose a reason for hiding this comment

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

Looks good now, thanks!

@sairon sairon merged commit b8b1e25 into home-assistant:dev Jan 15, 2025
3 checks passed
@sairon sairon mentioned this pull request Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
board/generic-aarch64 Generic aarch64 machine cla-signed linux Linux kernel related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants