Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions soc/microchip/pic32cxsg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Makefile - Microchip PIC32CXSG MCU family

# Copyright (c) 2024 Microchip
# SPDX-License-Identifier: Apache-2.0

zephyr_include_directories(${ZEPHYR_BASE}/drivers)

add_subdirectory(common)
add_subdirectory(${SOC_SERIES})
14 changes: 14 additions & 0 deletions soc/microchip/pic32cxsg/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Microchip PIC32CXSG MCU family configuration options
# Copyright (c) 2024 Microchip
# SPDX-License-Identifier: Apache-2.0

config SOC_FAMILY_MICROCHIP_PIC32CXSG
select PIC32C
Copy link
Member

Choose a reason for hiding this comment

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

@MyGh64605 ,

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

Copy link
Member

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

select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE

if SOC_FAMILY_MICROCHIP_PIC32CXSG

rsource "common/Kconfig.pic32cxsg"
rsource "*/Kconfig"

endif # SOC_FAMILY_MICROCHIP_PIC32CXSG
24 changes: 24 additions & 0 deletions soc/microchip/pic32cxsg/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Microchip PIC32CXSG MCU family default configuration options

# Copyright (c) 2024 Microchip

# SPDX-License-Identifier: Apache-2.0

if SOC_FAMILY_MICROCHIP_PIC32CXSG

rsource "*/Kconfig.defconfig"

config GPIO
default y

config SYS_CLOCK_HW_CYCLES_PER_SEC
default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency)

if USB_DEVICE_DRIVER

config HEAP_MEM_POOL_ADD_SIZE_SOC
def_int 1024

endif # USB_DEVICE_DRIVER

endif # SOC_FAMILY_MICROCHIP_PIC32CXSG
13 changes: 13 additions & 0 deletions soc/microchip/pic32cxsg/Kconfig.soc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Microchip PIC32CXSG MCU family

# Copyright (c) 2024 Microchip

# SPDX-License-Identifier: Apache-2.0

config SOC_FAMILY_MICROCHIP_PIC32CXSG
bool

config SOC_FAMILY
default "microchip_pic32cxsg" if SOC_FAMILY_MICROCHIP_PIC32CXSG

rsource "*/Kconfig.soc"
14 changes: 14 additions & 0 deletions soc/microchip/pic32cxsg/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Makefile - Microchip PIC32CXSG MCU family
#
# Copyright (c) 2024 Microchip
# SPDX-License-Identifier: Apache-2.0

zephyr_sources(soc_port.c)

zephyr_sources_ifdef(CONFIG_BOOTLOADER_BOSSA bossa.c)
Copy link
Member

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.


zephyr_sources_ifdef(CONFIG_SOC_FAMILY_MICROCHIP_PIC32CXSG soc_pic32cxsg.c)

zephyr_include_directories(.)

set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")
15 changes: 15 additions & 0 deletions soc/microchip/pic32cxsg/common/Kconfig.pic32cxsg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (c) 2024 Microchip

# SPDX-License-Identifier: Apache-2.0

if SOC_FAMILY_MICROCHIP_PIC32CXSG

config SOC_MICROCHIP_PIC32CXSG_XOSC32K
Copy link
Member

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.

bool "The external 32 kHz crystal oscillator"
default y if DT_HAS_ATMEL_SAM0_OSC32KCTRL_ENABLED
help
Enable gclk device tree node to use 32K crystal
as clock source. If not enabled the soc will be
configured for internal oscillator.

endif
Loading