Skip to content

Commit e9081b5

Browse files
committed
merge: 'upstream' into pst-v4.3.99 zephyrproject-rtos#8
2 parents 9b5086c + d02cdc7 commit e9081b5

111 files changed

Lines changed: 1762 additions & 851 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

MAINTAINERS.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3476,7 +3476,7 @@ NVMEM:
34763476
collaborators:
34773477
- henrikbrixandersen
34783478
files:
3479-
- doc/services/nvmem/
3479+
- doc/services/storage/nvmem/
34803480
- dts/bindings/nvmem/
34813481
- include/zephyr/devicetree/nvmem.h
34823482
- include/zephyr/nvmem.h
@@ -4586,7 +4586,7 @@ Retention:
45864586
- dts/bindings/retention/
45874587
- include/zephyr/retention/
45884588
- subsys/retention/
4589-
- doc/services/retention/
4589+
- doc/services/storage/retention/
45904590
labels:
45914591
- "area: Retention"
45924592

arch/arm/include/cortex_m/dwt.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static inline void dwt_access(bool ena)
8282
static inline int z_arm_dwt_init(void)
8383
{
8484
/* Enable tracing */
85-
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
85+
DCB->DEMCR |= DCB_DEMCR_TRCENA_Msk;
8686

8787
/* Unlock DWT access if any */
8888
dwt_access(true);
@@ -149,7 +149,7 @@ static inline void z_arm_dwt_enable_debug_monitor(void)
149149
* unpredictable if the DebugMonitor exception is triggered. We
150150
* assert that the CPU is in normal mode.
151151
*/
152-
__ASSERT((CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) == 0,
152+
__ASSERT((DCB->DHCSR & DCB_DHCSR_C_DEBUGEN_Msk) == 0,
153153
"Cannot enable DBM when CPU is in Debug mode\n");
154154

155155
#if defined(CONFIG_ARMV8_M_SE) && !defined(CONFIG_ARM_NONSECURE_FIRMWARE)
@@ -160,7 +160,7 @@ static inline void z_arm_dwt_enable_debug_monitor(void)
160160
* when enabling the DebugMonitor exception, assert that
161161
* it is not targeting the Non Secure domain.
162162
*/
163-
__ASSERT((CoreDebug->DEMCR & DCB_DEMCR_SDME_Msk) != 0, "DebugMonitor targets Non-Secure\n");
163+
__ASSERT((DCB->DEMCR & DCB_DEMCR_SDME_Msk) != 0, "DebugMonitor targets Non-Secure\n");
164164
#endif
165165

166166
/* The DebugMonitor handler priority is set already
@@ -169,7 +169,7 @@ static inline void z_arm_dwt_enable_debug_monitor(void)
169169
*/
170170

171171
/* Enable debug monitor exception triggered on debug events */
172-
CoreDebug->DEMCR |= CoreDebug_DEMCR_MON_EN_Msk;
172+
DCB->DEMCR |= DCB_DEMCR_MON_EN_Msk;
173173
}
174174

175175
#endif /* CONFIG_CORTEX_M_DWT */

arch/xtensa/core/ptables.c

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@
6767
/** Construct a page table entry (PTE) */
6868
#define PTE(paddr, ring, attr) PTE_WITH_BCKUP(paddr, ring, attr, RING_KERNEL, PTE_ATTR_ILLEGAL)
6969

70+
/** Get the Physical Page Number from a PTE */
71+
#define PTE_PPN_GET(pte) ((pte) & XTENSA_MMU_PTE_PPN_MASK)
72+
73+
/** Set the Physical Page Number in a PTE */
74+
#define PTE_PPN_SET(pte, ppn) \
75+
(((pte) & ~XTENSA_MMU_PTE_PPN_MASK) | ((ppn) & XTENSA_MMU_PTE_PPN_MASK))
76+
7077
/** Get the attributes from a PTE */
7178
#define PTE_ATTR_GET(pte) (((pte) & PTE_ATTR_MASK) >> PTE_ATTR_SHIFT)
7279

@@ -388,7 +395,7 @@ static void map_memory_range(const uint32_t start, const uint32_t end,
388395
PTE((uint32_t)l2_table, RING_KERNEL, XTENSA_MMU_PAGE_TABLE_ATTR);
389396
}
390397

391-
l2_table = (uint32_t *)(xtensa_kernel_ptables[l1_pos] & XTENSA_MMU_PTE_PPN_MASK);
398+
l2_table = (uint32_t *)PTE_PPN_GET(xtensa_kernel_ptables[l1_pos]);
392399
l2_table[l2_pos] = pte;
393400
}
394401
}
@@ -552,7 +559,7 @@ static bool l2_page_table_map(uint32_t *l1_table, void *vaddr, uintptr_t phys,
552559
}
553560
#endif
554561

555-
l2_table = (uint32_t *)(l1_table[l1_pos] & XTENSA_MMU_PTE_PPN_MASK);
562+
l2_table = (uint32_t *)PTE_PPN_GET(l1_table[l1_pos]);
556563
l2_table[l2_pos] = PTE(phys, is_user ? RING_USER : RING_KERNEL, attrs);
557564

558565
if (IS_ENABLED(PAGE_TABLE_IS_CACHED)) {
@@ -732,7 +739,7 @@ static void l2_page_table_unmap(uint32_t *l1_table, void *vaddr)
732739
dup_l2_table_if_needed(l1_table, l1_pos);
733740
#endif
734741

735-
l2_table = (uint32_t *)(l1_table[l1_pos] & XTENSA_MMU_PTE_PPN_MASK);
742+
l2_table = (uint32_t *)PTE_PPN_GET(l1_table[l1_pos]);
736743

737744
if (IS_ENABLED(PAGE_TABLE_IS_CACHED)) {
738745
sys_cache_data_invd_range((void *)&l2_table[l2_pos], sizeof(l2_table[0]));
@@ -1072,8 +1079,7 @@ static uint32_t *dup_l1_table(void)
10721079
uint32_t *l2_table, *src_l2_table;
10731080
bool l2_need_dup = false;
10741081

1075-
src_l2_table = (uint32_t *)(xtensa_kernel_ptables[l1_pos] &
1076-
XTENSA_MMU_PTE_PPN_MASK);
1082+
src_l2_table = (uint32_t *)PTE_PPN_GET(xtensa_kernel_ptables[l1_pos]);
10771083

10781084
/* Need to check if the L2 table has been modified between boot and
10791085
* this function call. We do not want to inherit any changes in
@@ -1097,7 +1103,7 @@ static uint32_t *dup_l1_table(void)
10971103
* duplicate the L2 table.
10981104
*/
10991105
vaddr = vaddr_from_pt_pos(l1_pos, l2_pos);
1100-
if ((src_l2_table[l2_pos] & XTENSA_MMU_PTE_PPN_MASK) != vaddr) {
1106+
if (PTE_PPN_GET(src_l2_table[l2_pos]) != vaddr) {
11011107
l2_need_dup = true;
11021108
break;
11031109
}
@@ -1129,7 +1135,7 @@ static void dup_l2_table_if_needed(uint32_t *l1_table, uint32_t l1_pos)
11291135
{
11301136
uint32_t *l2_table, *src_l2_table;
11311137

1132-
src_l2_table = (uint32_t *)(l1_table[l1_pos] & XTENSA_MMU_PTE_PPN_MASK);
1138+
src_l2_table = (uint32_t *)PTE_PPN_GET(l1_table[l1_pos]);
11331139

11341140
if (l2_page_tables_counter[l2_table_to_counter_pos(src_l2_table)] == 1) {
11351141
/* Only one user of L2 table, no need to duplicate. */
@@ -1214,13 +1220,14 @@ static void region_map_update(uint32_t *l1_table, uintptr_t start,
12141220
dup_l2_table_if_needed(l1_table, l1_pos);
12151221
#endif
12161222

1217-
l2_table = (uint32_t *)(l1_table[l1_pos] & XTENSA_MMU_PTE_PPN_MASK);
1223+
l2_table = (uint32_t *)PTE_PPN_GET(l1_table[l1_pos]);
12181224

12191225
if (IS_ENABLED(PAGE_TABLE_IS_CACHED)) {
12201226
sys_cache_data_invd_range((void *)&l2_table[l2_pos], sizeof(l2_table[0]));
12211227
}
12221228

12231229
pte = l2_table[l2_pos];
1230+
pte = PTE_PPN_SET(pte, start + offset);
12241231

12251232
if ((option & OPTION_RESTORE_ATTRS) == OPTION_RESTORE_ATTRS) {
12261233
new_attrs = PTE_BCKUP_ATTR_GET(pte);
@@ -1430,7 +1437,7 @@ static bool page_validate(uint32_t *ptables, uint32_t page, uint8_t ring, bool w
14301437
return false;
14311438
}
14321439

1433-
l2_table = (uint32_t *)(ptables[l1_pos] & XTENSA_MMU_PTE_PPN_MASK);
1440+
l2_table = (uint32_t *)PTE_PPN_GET(ptables[l1_pos]);
14341441
pte = l2_table[l2_pos];
14351442

14361443
if (is_pte_illegal(pte)) {

boards/arduino/portenta_c33/arduino_portenta_c33.dts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
};
3838

3939
led2: led2 {
40-
gpios = <&ioport4 0 GPIO_ACTIVE_HIGH>;
40+
gpios = <&ioport4 0 GPIO_ACTIVE_LOW>;
4141
label = "LEDG";
4242
};
4343

4444
led3: led3 {
45-
gpios = <&ioport8 0 GPIO_ACTIVE_HIGH>;
45+
gpios = <&ioport8 0 GPIO_ACTIVE_LOW>;
4646
label = "LEDB";
4747
};
4848
};

boards/arm/mps2/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44

55
config BOARD_MPS2
66
select HAS_COVERAGE_SUPPORT
7-
select QEMU_TARGET if BOARD_MPS2_AN385 || BOARD_MPS2_AN521_CPU0 || BOARD_MPS2_AN521_CPU0_NS || BOARD_MPS2_AN521_CPU1
7+
select QEMU_TARGET if BOARD_MPS2_AN385 || BOARD_MPS2_AN386 || \
8+
BOARD_MPS2_AN521_CPU0 || BOARD_MPS2_AN521_CPU0_NS || BOARD_MPS2_AN521_CPU1
89
select TRUSTED_EXECUTION_NONSECURE if BOARD_MPS2_AN521_CPU0_NS

boards/arm/mps2/board.cmake

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,20 @@ elseif(CONFIG_BOARD_MPS2_AN383)
1515
set(SUPPORTED_EMU_PLATFORMS armfvp)
1616
set(ARMFVP_BIN_NAME FVP_MPS2_Cortex-M0plus)
1717
set(ARMFVP_FLAGS
18-
-C armcortexm0plusct.NUM_MPU_REGION=8
19-
-C armcortexm0plusct.USER=1
20-
-C armcortexm0plusct.VTOR=1
21-
)
18+
-C armcortexm0plusct.NUM_MPU_REGION=8
19+
-C armcortexm0plusct.USER=1
20+
-C armcortexm0plusct.VTOR=1
21+
)
2222
elseif(CONFIG_BOARD_MPS2_AN386)
23-
set(SUPPORTED_EMU_PLATFORMS armfvp)
23+
set(SUPPORTED_EMU_PLATFORMS qemu armfvp)
2424
set(ARMFVP_BIN_NAME FVP_MPS2_Cortex-M4)
25+
set(QEMU_CPU_TYPE_${ARCH} cortex-m4)
26+
set(QEMU_FLAGS_${ARCH}
27+
-cpu ${QEMU_CPU_TYPE_${ARCH}}
28+
-machine mps2-an386
29+
-nographic
30+
-vga none
31+
)
2532
elseif(CONFIG_BOARD_MPS2_AN500)
2633
set(SUPPORTED_EMU_PLATFORMS armfvp)
2734
set(ARMFVP_BIN_NAME FVP_MPS2_Cortex-M7)

boards/arm/mps2/mps2_an386.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: ARM V2M MPS2-an386
33
type: mcu
44
arch: arm
55
simulation:
6+
- name: qemu
67
- name: armfvp
78
exec: FVP_MPS2_Cortex-M4
89
toolchain:

boards/arm/mps2/mps2_an386_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#
66

77
CONFIG_RUNTIME_NMI=y
8+
CONFIG_QEMU_ICOUNT_SHIFT=7
89

910
# GPIOs
1011
CONFIG_GPIO=y
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 Microchip Technology Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_SAM_E54_CULT
5+
select SOC_ATSAME54P20A
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2025 Microchip Technology Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

0 commit comments

Comments
 (0)