Skip to content

Commit b228fe1

Browse files
committed
arch: arm: mmu: introduce NORMAL and STRONGLY_ORDERED flags
Add new flags to allow to select normal and strong ordered attributes for non-cacheable memory. This is needed for armV7 to be able to configure all non cacheable memories with another attribute than "device" attribute. Signed-off-by: Arnaud Pouliquen <[email protected]>
1 parent 16f4d6c commit b228fe1

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

include/zephyr/arch/arm/arm_mem.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright (c) 2025 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_ARM_MEM_H_
7+
#define ZEPHYR_INCLUDE_ARCH_ARM_ARM_MEM_H_
8+
9+
/*
10+
* Define ARM specific memory flags used by k_mem_map_phys_bare()
11+
* followed public definitions in include/kernel/mm.h.
12+
*/
13+
14+
/**
15+
* @name optional region type attributes when K_MEM_CACHE_NONE is set
16+
*
17+
* Default is non cacheable device type
18+
*
19+
* @{
20+
*/
21+
22+
/** Non-cacheable region will get device attribute allowing non aligned access */
23+
#define K_MEM_ARM_DEVICE_NC 0
24+
/** Non-cacheable region will get normal attribute allowing non aligned access */
25+
#define K_MEM_ARM_NORMAL_NC BIT(30)
26+
/** Non-cacheable region will get strongly ordered attribute */
27+
#define K_MEM_ARM_STRONGLY_ORDERED_NC BIT(31)
28+
/** Reserved bits for cache modes in k_map() flags argument */
29+
#define K_MEM_ARM_NC_TYPE_MASK (BIT(31) | BIT(30))
30+
31+
/** @} */
32+
33+
#endif /* ZEPHYR_INCLUDE_ARCH_ARM64_ARM_MEM_H_ */

include/zephyr/kernel/mm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include <zephyr/toolchain.h>
1212
#if defined(CONFIG_ARM_MMU) && defined(CONFIG_ARM64)
1313
#include <zephyr/arch/arm64/arm_mem.h>
14+
#elif defined(CONFIG_ARM_AARCH32_MMU)
15+
#include <zephyr/arch/arm/arm_mem.h>
1416
#endif /* CONFIG_ARM_MMU && CONFIG_ARM64 */
1517

1618
#include <zephyr/kernel/internal/mm.h>

0 commit comments

Comments
 (0)