Skip to content

Conversation

@jmaksymowicz
Copy link
Contributor

Description

For I2C, UART and SPI drivers MUX and ISEL configuration options were added so that signal pins of these peripherals can be redefined at compile time. Additionally, UART driver was updated to support DTE mode in which TX and RX pins are swapped.

clang-format was applied to imx6ull-ecspi code in a separate commit to make it clear which changes are just formatting and which change the program's logic.

Motivation and Context

JIRA: SEN-40

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: armv7a7-imx6ull-evk

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

Add option to configure mux and input selection settings at compile
time.
Set previous settings as defaults for backwards compatibility.

JIRA: SEN-40
Add option to configure mux and input selection settings at compile
time.
Set previous settings as defaults for backwards compatibility.
Add option to start in DTE mode (swap TX and RX signals).

JIRA: SEN-40
Add option to configure mux and input selection settings at compile
time.
Set previous settings as defaults for backwards compatibility.
Add option for a mux to not be configured.

JIRA: SEN-40
@jmaksymowicz jmaksymowicz requested a review from Darchiv December 17, 2025 18:04
@gemini-code-assist
Copy link

Summary of Changes

Hello @jmaksymowicz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the flexibility of peripheral pin configurations for I2C, UART, and SPI drivers on the i.MX6ULL platform. By externalizing pin multiplexing and input selection settings into compile-time configurable macros, developers can now easily adapt these drivers to various hardware layouts without modifying core driver logic. Additionally, the UART driver gains a new DTE mode, offering more versatile serial communication options. These changes aim to improve maintainability and adaptability of the board support package.

Highlights

  • Configurable Pin Assignments: Introduced new configuration options for I2C, UART, and SPI drivers, allowing their signal pins (MUX and ISEL settings) to be redefined at compile time using CONFIG_* macros.
  • UART DTE Mode Support: The UART driver has been updated to support Data Terminal Equipment (DTE) mode, which allows for swapping the TX and RX pins, configurable via a new command-line option.
  • Code Formatting: Applied clang-format to the imx6ull-ecspi driver to improve code style and readability, separated into a distinct commit.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces valuable compile-time configuration options for I2C, UART, and SPI peripheral pins, enhancing the flexibility of the drivers. It also adds support for DTE mode in the UART driver. The changes are well-implemented, including the use of static const for read-only data, which improves code quality. My review includes one suggestion to reduce code duplication by moving common macros to a shared header.

Comment on lines +30 to +31
#define XCAT2(a, b) a##b
#define PCTL(x) XCAT2(pctl_, x)

Choose a reason for hiding this comment

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

medium

These helper macros (XCAT2, PCTL) are also defined in libecspi.c and imx6ull-uart.c. To avoid code duplication and improve maintainability, consider moving them to a common header file, for example a new platform utilities header or an existing one like <phoenix/arch/armv7a/imx6ull/imx6ull.h>.

@github-actions
Copy link

Unit Test Results

8 541 tests   - 921   8 015 ✅  - 858   49m 42s ⏱️ - 1m 23s
  512 suites  -  49     525 💤  -  64 
    1 files   ±  0       1 ❌ +  1 

For more details on these failures, see this check.

Results for commit 7e36d63. ± Comparison against base commit 630b3e1.

This pull request removes 921 tests.
phoenix-rtos-tests/cpp/hello-cpp ‑ armv7m7-imxrt117x-evk:phoenix-rtos-tests/cpp/hello-cpp
phoenix-rtos-tests/initfini/main ‑ armv7m7-imxrt117x-evk:phoenix-rtos-tests/initfini/main
phoenix-rtos-tests/ioctl/unit ‑ armv7m7-imxrt117x-evk:phoenix-rtos-tests/ioctl/unit.ioctl.data_in
phoenix-rtos-tests/ioctl/unit ‑ armv7m7-imxrt117x-evk:phoenix-rtos-tests/ioctl/unit.ioctl.data_in_big
phoenix-rtos-tests/ioctl/unit ‑ armv7m7-imxrt117x-evk:phoenix-rtos-tests/ioctl/unit.ioctl.data_inout
phoenix-rtos-tests/ioctl/unit ‑ armv7m7-imxrt117x-evk:phoenix-rtos-tests/ioctl/unit.ioctl.data_inout_big
phoenix-rtos-tests/ioctl/unit ‑ armv7m7-imxrt117x-evk:phoenix-rtos-tests/ioctl/unit.ioctl.data_out
phoenix-rtos-tests/ioctl/unit ‑ armv7m7-imxrt117x-evk:phoenix-rtos-tests/ioctl/unit.ioctl.data_out_big
phoenix-rtos-tests/ioctl/unit ‑ armv7m7-imxrt117x-evk:phoenix-rtos-tests/ioctl/unit.ioctl.in_val
phoenix-rtos-tests/ioctl/unit ‑ armv7m7-imxrt117x-evk:phoenix-rtos-tests/ioctl/unit.ioctl.invalid_req
…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants