-
Notifications
You must be signed in to change notification settings - Fork 8.3k
boards: infineon: Add support for Infineon CAT2 based boards #98564
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
base: main
Are you sure you want to change the base?
boards: infineon: Add support for Infineon CAT2 based boards #98564
Conversation
nordicjm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
split into proper commits e.g. for adding soc, for adding board, look at https://docs.zephyrproject.org/latest/contribute/style/kconfig.html and read and apply rules before re-requesting review
929d3b7 to
2ce5f0a
Compare
dfcbfbf to
c8effe6
Compare
5bf7770 to
8d4df53
Compare
8d4df53 to
b42f3ce
Compare
56cd6da to
0de383f
Compare
soc/infineon/cat2/CMakeLists.txt
Outdated
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| add_subdirectory(${SOC_SERIES}) | ||
| zephyr_compile_definitions($<UPPER_CASE:${CONFIG_SOC}>_${CONFIG_SOC_PART_NUMBER}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this required? is it not taken care by the infineon_kconfig.h?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is removed from the CMakeLists.txt.
| # Copyright (c) 2025 Infineon Technologies AG, | ||
| # or an affiliate of Infineon Technologies AG. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use psoc4 instead of cat2 for folder names as well as other places (like variable names)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced cat2 with psoc4 as suggested in all places.
| - hal | ||
| - name: hal_infineon | ||
| revision: f3c571f772209b5970bdd1806da641244b5c4c38 | ||
| revision: 2d37de92236ea62b80562e7381ff43d9522dbbad |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use pull/34 till its merged into hal_infineon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got merged so no changes done
modules/hal_infineon/CMakeLists.txt
Outdated
| OR CONFIG_SOC_FAMILY_INFINEON_CAT1 | ||
| OR CONFIG_SOC_FAMILY_INFINEON_EDGE) | ||
| OR CONFIG_SOC_FAMILY_INFINEON_EDGE | ||
| OR CONFIG_SOC_FAMILY_INFINEON_CAT2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| OR CONFIG_SOC_FAMILY_INFINEON_CAT2) | |
| OR CONFIG_SOC_FAMILY_INFINEON_PSOC4) |
Please make this change throughout the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed CAT2 to PSCO4 throughout the PR.
modules/hal_infineon/Kconfig
Outdated
| config USE_INFINEON_LP_COMP | ||
| bool | ||
| help | ||
| Enable LP-Comp (Low-Power Comparator) HAL module driver for Infineon devices | ||
|
|
||
| config USE_INFINEON_MSCLP | ||
| bool | ||
| help | ||
| Enable MSCLP (Multi-Speed Clock Low-Power) HAL module driver for Infineon devices | ||
|
|
||
| config USE_INFINEON_TCPWM_QUADDEC | ||
| bool | ||
| help | ||
| Enable Timer (Timer/Counter/PWM Quadrature Decoder) HAL module driver for | ||
| Infineon devices | ||
|
|
||
| config USE_INFINEON_SMARTIO | ||
| bool | ||
| help | ||
| Enable Smart-IO module driver for Infineon devices |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend dropping these since these peripherals are not yet supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropped above mentioned peripherals.
| zephyr_library_compile_definitions(CONFIG_SOC_PART_NUMBER) | ||
| zephyr_library_compile_definitions_ifdef(CONFIG_SOC_FAMILY_INFINEON_CAT2 $<UPPER_CASE:${CONFIG_SOC}>) | ||
|
|
||
| # Generate PDL specific define (w. *_device) for SOC module | ||
| zephyr_library_compile_definitions_ifdef(CONFIG_SOC_PART_NUMBER ${CONFIG_SOC_PART_NUMBER}_device) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| zephyr_library_compile_definitions(CONFIG_SOC_PART_NUMBER) | |
| zephyr_library_compile_definitions_ifdef(CONFIG_SOC_FAMILY_INFINEON_CAT2 $<UPPER_CASE:${CONFIG_SOC}>) | |
| # Generate PDL specific define (w. *_device) for SOC module | |
| zephyr_library_compile_definitions_ifdef(CONFIG_SOC_PART_NUMBER ${CONFIG_SOC_PART_NUMBER}_device) | |
| zephyr_library_compile_definitions(CONFIG_SOC_PART_NUMBER) | |
| zephyr_library_compile_definitions($<UPPER_CASE:${CONFIG_SOC}>) | |
| zephyr_library_compile_definitions(${CONFIG_SOC_PART_NUMBER}_device) |
Remove redundant checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
|
|
||
| # Include directories | ||
| zephyr_include_directories(${pdl_drv_dir}/include) | ||
| zephyr_include_directories_ifdef(CONFIG_SOC_FAMILY_INFINEON_CAT2 ${pdl_dev_dir}/include) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking for CONFIG_SOC_FAMILY_INFINEON_CAT2 is redundant since this file is included only if its CONFIG_SOC_FAMILY_INFINEON_CAT2. Please update throughout the file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| description: Infineon Serial Communication Blocks (SCB) node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need a separate binding file for UART?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed using existing one
| .. target-notes:: | ||
|
|
||
| .. _cy8cproto_041tp Board Website: | ||
| https://www.infineon.com/assets/row/public/documents/30/57/infineon-psoc-4100t-plus-architecture-trm-additionaltechnicalinformation-en.pdf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link points to the TRM for the PSOC 4100T Plus MCU, not the board website.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Placed the link for cy8cproto_041tp Board Website
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file looks like a duplicate of options defined in Kconfig.ifx_cat1, so I don't think this file is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the Kconfig.ifx_cat2 file.
| #if defined(CONFIG_SOC_FAMILY_INFINEON_CAT2) | ||
| Cy_SysClk_ImoEnable(); | ||
| int err = Cy_SysClk_ImoSetFrequency(config->rate); | ||
|
|
||
| if (err != CY_SYSCLK_SUCCESS) { | ||
| printk("Failed to set IMO frequency with (error: %d)\n", err); | ||
| return -EIO; | ||
| } | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these use device tree (as done for clk_pilo) instead of soc family for better portability between devices?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cy_SysClk_ImoSetFrequency is not there in cat1 so checked with dts above this case, as well as used psoc4 for checking imo set freq alone.
| #if !defined(CONFIG_SOC_FAMILY_INFINEON_CAT2) | ||
| case IFX_IHO: | ||
| Cy_SysClk_IhoEnable(); | ||
| break; | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these use device tree (as done for clk_pilo) instead of soc family for better portability between devices?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
used dts to check, changed
| #define CONVERT_UART_STOP_BITS_Z_TO_CY(sb) \ | ||
| (((sb) <= UART_CFG_STOP_BITS_2) ? stop_bits_lut[(sb)] : CY_SCB_UART_STOP_BITS_1) | ||
|
|
||
| #define CONVERT_UART_DATA_BITS_Z_TO_CY(db) \ | ||
| (((db) <= UART_CFG_DATA_BITS_9) ? data_bits_lut[(db)] : 1U) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than fail silently in the case of misconfiguration, it'd be better to log a warning or provide some other feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the code to use LOG_WRN
| .. _cy8cproto_041tp Board Website: | ||
| https://www.infineon.com/assets/row/public/documents/30/57/infineon-psoc-4100t-plus-architecture-trm-additionaltechnicalinformation-en.pdf | ||
|
|
||
| .. _ModusToolbox: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Placed given link for ModusToolbox
| https://softwaretools.infineon.com/tools/com.ifx.tb.tool.modustoolbox | ||
|
|
||
| .. _ModusToolbox Programming Tools: | ||
| https://softwaretools.infineon.com/tools/com.ifx.tb.tool.modustoolboxprogtools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Placed above given link for ModusToolbox Programming Tool
| #if !defined(CONFIG_SOC_SERIES_PSOC4100TP) | ||
| .rxFifoTriggerLevel = 63UL, | ||
| #else | ||
| .rxFifoTriggerLevel = 7, | ||
| #endif | ||
| .rxFifoIntEnableMask = 0UL, | ||
| #if !defined(CONFIG_SOC_SERIES_PSOC4100TP) | ||
| .txFifoTriggerLevel = 63UL, | ||
| #else | ||
| .txFifoTriggerLevel = 0, | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than use hardcoded magic numbers here that differ between parts, I'd rather see #define values. I think it makes the structure definition more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced the hard-coded values with macros.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pinmux definitions are missing for 44-pin and 48-pin parts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Included pinmux definitions for 44-pin variant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pinmux definitions are missing for 44-pin and 48-pin parts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Included pinmux definitions for 48-pin variant.
| #define CONVERT_UART_PARITY_Z_TO_CY(parity) (parity_lut[(parity)]) | ||
|
|
||
| #define CONVERT_UART_STOP_BITS_Z_TO_CY(sb) \ | ||
| (((sb) <= UART_CFG_STOP_BITS_2) ? stop_bits_lut[(sb)] : CY_SCB_UART_STOP_BITS_1) | ||
|
|
||
| #define CONVERT_UART_DATA_BITS_Z_TO_CY(db) \ | ||
| (((db) <= UART_CFG_DATA_BITS_9) ? data_bits_lut[(db)] : 1U) | ||
|
|
||
| #define IFX_UART_BAUD_DIFF(actual, baud) \ | ||
| (((actual) > (baud)) ? (((actual) * 100U - (baud) * 100U) / (baud)) \ | ||
| : (((baud) * 100U - (actual) * 100U) / (baud))) | ||
|
|
||
| #define IFX_UART_DIVIDER(freq, baud, oversample) \ | ||
| (((freq) + (((baud) * (oversample)) / 2U)) / ((baud) * (oversample))) | ||
|
|
||
| #define IFX_UART_MEM_WIDTH(cfg) \ | ||
| (((cfg).dataWidth <= CY_SCB_BYTE_WIDTH) ? (CY_SCB_CTRL_MEM_WIDTH_BYTE) \ | ||
| : (CY_SCB_CTRL_MEM_WIDTH_HALFWORD)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these are being pulled out of the code, I think it would be better to turn them into inline functions instead of macros. I find inline functions to be more readable and more maintainable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the code to replace the macros with static inline functions as recommended.
4cd4833 to
a84336e
Compare
a84336e to
3fd22d4
Compare
Update hal_infineon revision to add PSOC4 family support Signed-off-by: Dharun krithik k <[email protected]> Signed-off-by: Sayooj K Karun <[email protected]> Signed-off-by: Deepika aerlync <[email protected]>
Add Kconfig configuration support for PSoC4 family in hal_infineon module. Signed-off-by: Manojkumar Konisetty <[email protected]> Signed-off-by: Sayooj K Karun <[email protected]> Signed-off-by: Deepika aerlync <[email protected]>
Add CMake build configuration support for PSoC4 PDL and templates. Signed-off-by: Manojkumar Konisetty <[email protected]> Signed-off-by: Sayooj K Karun <[email protected]> Signed-off-by: Deepika aerlync <[email protected]>
3fd22d4 to
e560bfd
Compare
Add base devicetree support for Infineon PSoC4100TP series including: - Core SoC devicetree (psoc4100tp.dtsi) - CM0+ core configuration (psoc4100tp.cm0p.dtsi) - Pin package variants (44-TQFP, 48-QFN, 48-TQFP, 64-TQFP) - System clocks configuration (system_clocks.dtsi) Signed-off-by: Manojkumar Konisetty <[email protected]> Signed-off-by: Sayooj K Karun <[email protected]> Signed-off-by: Deepika aerlync <[email protected]>
Add devicetree support for CY8C4146 MPN variants including: - AXI packages (T403, T413, T453) - AZI packages (T403-T455) - AZQ packages (T413, T453) - LQI packages (T403, T413, T453) Signed-off-by: Manojkumar Konisetty <[email protected]> Signed-off-by: Sayooj K Karun <[email protected]> Signed-off-by: Deepika aerlync <[email protected]>
Add devicetree support for CY8C4147 MPN variants including: - AXI packages (T403-T493) - AZI packages (T403-T475) - AZQ packages (T415-T495) - LQI packages (T403-T473) - LQQ package (T493) Signed-off-by: Manojkumar Konisetty <[email protected]> Signed-off-by: Sayooj K Karun <[email protected]> Signed-off-by: Deepika aerlync <[email protected]>
Add SoC port for the Infineon PSoC4100TP series, including: - Core initialization - Kconfig files - YAML device definitions - SoC-specific pin control configuration Signed-off-by: Manojkumar Konisetty <[email protected]> Signed-off-by: Sayooj K Karun <[email protected]> Signed-off-by: Deepika aerlync <[email protected]>
Add board porting for the Infineon CY8CPROTO-041TP evaluation kit: - Board devicetree and pinctrl configuration - Kconfig and YAML definitions - Documentation - Support for west build, west flash, and west debug (OpenOCD) Signed-off-by: Manojkumar Konisetty <[email protected]> Signed-off-by: Sayooj K Karun <[email protected]> Signed-off-by: Deepika aerlync <[email protected]>
Add clock control driver support for Infineon PSoC4: - Fixed clock driver (clock_control_ifx_fixed_clock.c) - Fixed factor clock driver (clock_control_ifx_fixed_factor_clock.c) - Peripheral clock driver (clock_control_ifx_peri_clock.c) - CAT1 clock control header Provides clock initialization and management based on devicetree configuration. Signed-off-by: Dharun krithik k <[email protected]> Signed-off-by: Sayooj K Karun <[email protected]> Signed-off-by: Manojkumar Konisetty <[email protected]> Signed-off-by: Deepika aerlync <[email protected]>
Add initial implementation of the Infineon PSOC4 UART driver based on the Peripheral Driver Library (PDL) for PSOC4 (PSoC 4100TP) devices. Features: - UART transmit and receive using PDL SCB UART APIs - Configurable baud rate, parity, stop bits, and data bits from devicetree - Pinctrl integration for TX/RX pins - Support for Zephyr console and shell subsystems - Build-time validation for UART configuration parameters Signed-off-by: Dharun krithik k <[email protected]> Signed-off-by: Sayooj K Karun <[email protected]> Signed-off-by: Manojkumar Konisetty <[email protected]> Signed-off-by: Deepika aerlync <[email protected]>
e560bfd to
124a2f5
Compare
|



Introduce CY8CPROTO_041TP EVK
Add support for Infineon CAT2 HAL