-
Notifications
You must be signed in to change notification settings - Fork 7.8k
soc: microchip: Introduce pic32cxsg sg41 #86952
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?
soc: microchip: Introduce pic32cxsg sg41 #86952
Conversation
dts/arm/microchip/pic32cxsg.dtsi
Outdated
|
||
id: device_id@8061fc { | ||
compatible = "atmel,sam0-id"; | ||
reg = <0x008061FC 0x4>, |
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.
double space after equals
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.
not addressed
soc/microchip/pic32cxsg/Kconfig
Outdated
# Microchip PIC32CXSG MCU family configuration options | ||
|
||
# Copyright (c) 2024 Microchip | ||
# 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.
# Microchip PIC32CXSG MCU family configuration options | |
# Copyright (c) 2024 Microchip | |
# SPDX-License-Identifier: Apache-2.0 | |
# Microchip PIC32CXSG MCU family configuration options | |
# Copyright (c) 2024 Microchip | |
# SPDX-License-Identifier: Apache-2.0 |
having all headers the same would be nice
* | ||
* 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.
this file already exists, move the existing file to a common place and include it
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.
what could be a common place for 2 different vendors?
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.
atmel is microchip so it can be microchip, or maybe even soc/common
drivers/serial/Kconfig.pic32cxsg
Outdated
This option enables the SERCOMx USART driver for Microchip PIC32CXSG MCUs. | ||
|
||
config UART_PIC32CXSG_ASYNC | ||
bool "Async UART support for Microchip PIC32CXSG series." |
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.
bool "Async UART support for Microchip PIC32CXSG series." | |
bool "Async UART support for Microchip PIC32CXSG series" |
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.
not fixed?
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.
all images -> webp then use https://tinypng.com/
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.
not addressed
Supported Features | ||
================== | ||
|
||
The pic32cxsg41_cult board configuration supports the following hardware |
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.
The pic32cxsg41_cult board configuration supports the following hardware | |
The ``pic32cxsg41_cult`` board supports the following hardware |
fb11141
to
7ff07ad
Compare
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.
fix raised issues
@nordicjm please clarify your issues pertaining to:
Note. this file was fixed as follows:
not addressed Thank you. |
5856d44#diff-7862f1c4371a54c6987f57ec439dff007b41c783916fd8a9fa40dab8b6ea433eR84 double space after equals, original comment raised, not fixed comment raised, still not fixed 5856d44#diff-7862f1c4371a54c6987f57ec439dff007b41c783916fd8a9fa40dab8b6ea433eR170 nodes should be disabled in files in dts folder then enabled by the board, nodes that do not have 4ecdf64#diff-b4bd73e4a70f8a965919730caf1e466cef1f54de68132c629187f352e1562506R16 Missing newline, between elements, original comment raised, still not fixed etc. |
@nandojve @nordicjm @scottwcpg @TheSilverBB We force pushed more changes on 04/15/2025, Zephyr ran validation tests afterwards. |
You need to resolve the conflicts and force push again. Please share more details if you still experience issues |
@nandojve @scottwcpg @nordicjm @TheSilverBB |
I don't think there should be anything special about a "windows" or a "WSL" repo. Just sync / force push the changes you made to this PR's branch? |
@kartben |
7ff07ad
to
138a957
Compare
@nandojve We want to kill this PR and start over, using WSL. If we separate into different PRs, would this help ? We add soc, dts, etc.. |
Hi @MyGh64605 ,
My afraid is that if you close this and open another PR that will be the 4th attempt. This means that mostly on each changes that we request you open a new PR and we lost all the history. In my impression, the way you are managing the git workflow is not OK. I work with people everyday and I don't this kind of problems. for example, you could copy the content from the problematic machine and transfer to another one to send the new content. git is a very reliable tool and if you know it well you know that content don't vanish. Try to check your git reflog for instance.
I believe that documentation is clear about this and we should only bring content that can be build. At moment, the most painful job in Zephyr is bring a new SoC. It is really exhausting and I'm not the only one that think that this should be changed to allow somehow easy adoption. On my perspective the content that is on this PR is the minimum to introduce the platform in a way that you can use it. What is necessary is figure out how you can review the request in 24h and send the updates ASAP. In regards to close this PR and open a new one I'll abstain myself and let that to @nordicjm and @kartben to decide. |
Yeah please just fix the pr as-is, don't care how you do it on your choice of OS but millions of people use github and are able to submit PRs so fix your environment and update the PR but do not close this and open a duplicate PR, that's not helpful to anyone |
92df3a3
to
c22e022
Compare
@nandojve @scottwcpg @nordicjm @TheSilverBB |
Can press that button whenever you feel it is ready to review, it will then ping people asking to review |
@nordicjm Thank you very much for all your time in reviewing this PR. We feel the same pain as you. We believe all raised issues are now addressed. |
Hi Michael , Please, reorder the commit in the following order:
After reorder, you should extract DTS information from commits with other content. This will result in more commits as below:
In the Make sure that all devicetree nodes are ordered by address, not name. |
Can you add an alias for one of the built-in LEDs? Currently blinky does not build for this board |
Short Answer: No. Long Answer: Later. |
e0da164
to
455db95
Compare
@nandojve @kartben @NhMchp @parthitce @nordicjm |
If the HAL changes / PR is already merged, please update the manifest and rebase this PR. This will help the CI pass fully. |
Addition of pic32cxsg modules Kconfig Signed-off-by: Michael D Sherwood <[email protected]>
Addition of pic32cxsg 'dtsi' files Signed-off-by: Michael D Sherwood <[email protected]>
455db95
to
e6b42ca
Compare
@parthitce @nandojve @TheSilverBB |
@nandojve @NhMchp The HAL hash code has been updated. Please press the Resolve Conflicts button. |
bool "The external 32 kHz crystal oscillator" | ||
depends on DT_HAS_ATMEL_SAM0_OSC32KCTRL_ENABLED | ||
help | ||
Say y to enable the external 32 kHZ crystal oscillator at | ||
startup. This can then be selected as the main clock source | ||
for the SOC. |
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 does this need to be a Kconfig if the crystal is enabled or disabled in devicetree? If the node is there and has status okay that that means it's present and should be used
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.
@nordicjm Your request has been incorporated, Please mark as Resolved. Thanks.
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.
@nordicjm Updated Kconfig.pic32cxsg and removed the ones you pointed out. The remaining setting is set to y if osc32kctrl DT node is enabled.
#define TCC3 (0x42001000) /**< \brief (TCC3) APB Base Address */ | ||
#define TCC4 (0x43001000) /**< \brief (TCC4) APB Base Address */ | ||
#define TRNG (0x42002800) /**< \brief (TRNG) APB Base Address */ | ||
#define USB (0x41000000) /**< \brief (USB) APB Base Address */ |
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 cannot imagine the use case for these defines. That is what DT_INST_REG_ADDR(n) is for in the drivers. There is no way the soc.h could have something like #define USB
.
By the way, the Doxygen comments in soc.h are absolutely pointless.
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 probably comes from the DFP pack for the device. These macros are intended for compatibility with other compiler toolchains outside of Zephyr.
The way I understand it, the direction going forward is to keep the DFP packs as unedited in Zephyr as possible, so it is easy to upgrade them, but to store them into the hal project, rather than mainline. Perhaps the DFP files should be placed there, and soc.h should only include the appropriate header? Here's a snippet of my WIP soc.h, for reference:
#if defined(CONFIG_SOC_PIC32CM5112GC00100)
#define __PIC32CM5112GC00100__
#elif defined(CONFIG_SOC_PIC32CM5112GC00064)
#define __PIC32CM5112GC00064__
#elif defined(CONFIG_SOC_PIC32CM5112GC00048)
#define __PIC32CM5112GC00048__
#else
#error Device not supported
#endif
#include <pic32c.h>
(Inside pic32c.h, the DFP macros grab the correct includes / definitions for the specific 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.
@jfischer-no I removed all the defines except two: MCLK and GCLK which are required by the Atmel SAM0 UART driver. MCLK and GCLK get their values using DT_REG_ADDR().
Addition of pic32cxsg current family of devices Signed-off-by: Michael D Sherwood <[email protected]>
Added pinctrl node to PIC32CXSG dtsi without driver compatible Signed-off-by: Michael Sherwood <[email protected]>
Addition of pic32cxsg pin control including yaml, bindings, Kconfig, Signed-off-by: Michael D Sherwood <[email protected]>
Use microchip pic32cxsg compatiable for sercom Signed-off-by: Michael Sherwood <[email protected]>
Addition of pic32cxsg serial driver, Kconfig, yaml Signed-off-by: Michael D Sherwood <[email protected]>
Addition of pic32cxsg SG41 Curiosity Ultra board Signed-off-by: Michael D Sherwood <[email protected]>
e6b42ca
to
daa9f91
Compare
|
config HAS_PIC32C_HAL | ||
bool "Microchip PIC32C HAL drivers support" |
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.
where is this used? And why does it have a prompt?
config HAS_PIC32CXSG_HAL | ||
bool "Microchip PIC32CXSG HAL drivers support" | ||
select HAS_CMSIS_CORE | ||
depends on SOC_FAMILY_MICROCHIP_PIC32CXSG |
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.
where is this used? And why does it have a prompt?
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SOC_FAMILY_MICROCHIP_PIC32CXSG | ||
select PIC32C |
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.
It seems that you want select options to your HAL based in the family. Why not just select all this options in the module itself, something like:
config PIC32C
bool
select HAS_CMSIS_CORE
config HAS_PIC32C_HAL
bool
select PIC32C
config HAS_PIC32CXSG_HAL
bool
select HAS_PIC32C_HAL
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SOC_FAMILY_MICROCHIP_PIC32CXSG | ||
select PIC32C |
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.
What you want is define all the HAL at once. This can be achieved by
- select PIC32C
+ select HAS_PIC32CXSG_HAL
|
||
/ { | ||
soc { | ||
nvmctrl@41004000 { |
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.
Order by memory address. This is the devicetree standard we use.
Review all to make sure we did not missed any.
|
||
if SOC_FAMILY_MICROCHIP_PIC32CXSG | ||
|
||
config SOC_MICROCHIP_PIC32CXSG_XOSC32K |
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.
Since it is on devicetree, this config is useless and must be dropped.
@@ -0,0 +1,404 @@ | |||
/* | |||
* Copyright (c) 2024 Microchip |
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 you copy and rename, you should keep original copyrights.
Add original copyrights.
# Copyright (c) 2024 Microchip | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
description: Microchip PIC32CXSG SERCOM UART driver |
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 is the devicetree binding, should be in the previous commit.
@@ -64,6 +64,7 @@ zephyr_library_sources_ifdef(CONFIG_UART_NUMICRO uart_numicro.c) | |||
zephyr_library_sources_ifdef(CONFIG_UART_NXP_S32_LINFLEXD uart_nxp_s32_linflexd.c) | |||
zephyr_library_sources_ifdef(CONFIG_UART_OPENTITAN uart_opentitan.c) | |||
zephyr_library_sources_ifdef(CONFIG_UART_PDL_INFINEON_CAT1 uart_ifx_cat1_pdl.c) | |||
zephyr_library_sources_ifdef(CONFIG_UART_PIC32CXSG uart_sam0.c) |
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 driver support only one binding at moment.
zephyr/drivers/serial/uart_sam0.c
Line 8 in aa6f87d
#define DT_DRV_COMPAT atmel_sam0_uart |
&tcc0 { | ||
compatible = "atmel,sam0-tcc-pwm"; | ||
|
||
/* Gives a maximum period of 1.1s for 120MHz main clock */ | ||
|
||
prescaler = <8>; | ||
|
||
#pwm-cells = <2>; | ||
|
||
pinctrl-0 = <&pwm_default>; | ||
pinctrl-names = "default"; | ||
status = "okay"; | ||
}; |
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.
The only drivers that should be available are pinctrl and serial. Drop all others.
|
||
zephyr_sources(soc_port.c) | ||
|
||
zephyr_sources_ifdef(CONFIG_BOOTLOADER_BOSSA bossa.c) |
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 should be dropped for now. When you add on a board (another PR) you can add here.
# Copyright (c) 2024 Microchip | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if ETH_SAM_GMAC |
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 is not essential.
Commits for pic32cxsg SG41 Curiosity Ultra board, 'Hello World' basics, arm, pinctrl, serial, board