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

soc: atmel: sam/sam0: Add platform specific initialization #61005

Merged

Conversation

nandojve
Copy link
Member

@nandojve nandojve commented Jul 31, 2023

This replace pre kernel initialization by the platform specific initialization call. The platform specific init will configure at very beginning the clocks, flash wait states and cache.

Supersedes #60425

@nandojve nandojve force-pushed the sam/add_platform_specific_init branch from 4810844 to ed4c27d Compare August 1, 2023 08:55
@nandojve nandojve marked this pull request as ready for review August 1, 2023 09:22
@zephyrbot zephyrbot added the platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM) label Aug 1, 2023
@nandojve nandojve requested review from pdgendt and removed request for pdgendt and mnkp August 1, 2023 09:22
@nandojve nandojve added this to the v3.5.0 milestone Aug 1, 2023
pdgendt
pdgendt previously approved these changes Aug 1, 2023
boards/arm/sam_e70_xplained/sam_e70b_xplained_defconfig Outdated Show resolved Hide resolved
boards/arm/sam_e70_xplained/sam_e70_xplained_defconfig Outdated Show resolved Hide resolved
soc/arm/atmel_sam0/common/soc_samd5x.c Show resolved Hide resolved
soc/arm/atmel_sam/sam3x/Kconfig.series Outdated Show resolved Hide resolved
soc/arm/atmel_sam/sam3x/soc.c Show resolved Hide resolved
This update Kconfig.series files to normalize copyright date order from
lower to higher and reorder select entries.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
This reorder <board>_defconfig entries in soc/board, internal and driver
definitions.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
Adjust copyright order by ascending year order.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
This replace pre kernel initialization by the platform specific
initialization call. The platform specific init will configure
at very beginning the clocks, flash wait states and cache.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
The current platform initialization do not take in consideration cache
management for historic reasons. This fixes any miss configuration and
allow users to enable/disable caches at board definition. The default
value is cache disabled and the below examples are for SAMV71 which
have both I/D Cache available:

I Cache only:
CONFIG_CACHE_MANAGEMENT=y
CONFIG_DCACHE=n

D Cache only:
CONFIG_CACHE_MANAGEMENT=y
CONFIG_ICACHE=n

I/D Cache disabled:
CONFIG_ICACHE=n
CONFIG_DCACHE=n

I/D Cache Enabled:
CONFIG_CACHE_MANAGEMENT=y

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
The sam0 CMCC configure Cortex-M cache controller. However, it is not
clear how the cache management should be performed. It is nor clear if
instructions like SCB_EnableICache can be used. In this case, if cache
management should be made only by CMCC it may require a dedicated
implementation.

Besides above, the CPU_CORTEX_M4 do not define cache by default which
can signal a bad configuration in tree since the SOC_SERIES_SAME54 do
not define which caches should be available.

This force cache controller disable to avoid issues.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
Copy link
Member

@attie-argentum attie-argentum left a comment

Choose a reason for hiding this comment

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

Thanks for the changes!

@carlescufi carlescufi merged commit ee15b1f into zephyrproject-rtos:main Aug 4, 2023
26 checks passed
@nandojve nandojve deleted the sam/add_platform_specific_init branch August 4, 2023 08:46
@nandojve nandojve mentioned this pull request Dec 17, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants