Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
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
11 changes: 11 additions & 0 deletions arch/arm/core/mmu/arm_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,17 @@ static int __arch_mem_map(void *virt, uintptr_t phys, size_t size, uint32_t flag
switch (flags & K_MEM_CACHE_MASK) {

case K_MEM_CACHE_NONE:
switch (flags & K_MEM_ARM_NC_TYPE_MASK) {
Copy link

Choose a reason for hiding this comment

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

title of the commit is also after the signature:
Signed-off-by: Arnaud Pouliquen [email protected]arch: arm: mmu: allow selecting memory type for non-cacheable memory

case K_MEM_ARM_STRONGLY_ORDERED_NC:
conv_flags |= MT_STRONGLY_ORDERED;
break;
case K_MEM_ARM_NORMAL_NC:
conv_flags |= MT_NORMAL;
break;
default:
conv_flags |= MT_DEVICE;
}
break;
default:
conv_flags |= MT_DEVICE;
break;
Expand Down
33 changes: 33 additions & 0 deletions include/zephyr/arch/arm/arm_mem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2025 STMicroelectronics
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_ARM_MEM_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_ARM_MEM_H_

/*
* Define ARM specific memory flags used by k_mem_map_phys_bare()
* followed public definitions in include/kernel/mm.h.
*/

/**
* @name optional region type attributes when K_MEM_CACHE_NONE is set
*
* Default is non cacheable device type
*
* @{
*/

/** Non-cacheable region will get device attribute allowing non aligned access */
#define K_MEM_ARM_DEVICE_NC 0
/** Non-cacheable region will get normal attribute allowing non aligned access */
#define K_MEM_ARM_NORMAL_NC BIT(30)
/** Non-cacheable region will get strongly ordered attribute */
#define K_MEM_ARM_STRONGLY_ORDERED_NC BIT(31)
/** Reserved bits for cache modes in k_map() flags argument */
#define K_MEM_ARM_NC_TYPE_MASK (BIT(31) | BIT(30))

/** @} */

#endif /* ZEPHYR_INCLUDE_ARCH_ARM64_ARM_MEM_H_ */
Copy link

Choose a reason for hiding this comment

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

-#endif /* ZEPHYR_INCLUDE_ARCH_ARM64_ARM_MEM_H_ */
+#endif /* ZEPHYR_INCLUDE_ARCH_ARM_ARM_MEM_H_ */

2 changes: 2 additions & 0 deletions include/zephyr/kernel/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <zephyr/toolchain.h>
#if defined(CONFIG_ARM_MMU) && defined(CONFIG_ARM64)
#include <zephyr/arch/arm64/arm_mem.h>
#elif defined(CONFIG_ARM_AARCH32_MMU)
#include <zephyr/arch/arm/arm_mem.h>
#endif /* CONFIG_ARM_MMU && CONFIG_ARM64 */

#include <zephyr/kernel/internal/mm.h>
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ manifest:
groups:
- hal
- name: hal_stm32
revision: d768bcbf9b6f75b46eff274b343a9556c0ce108d
revision: b6f03b6efd92da4564b38df8cb54d7dad5f37163
Copy link
Member

Choose a reason for hiding this comment

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

Let's drop this, as this was updated via other PRs

path: modules/hal/stm32
groups:
- hal
Expand Down