Skip to content

Commit ee29b61

Browse files
committed
merge: 'upstream' into pst-v4.3.99 zephyrproject-rtos#7
2 parents 1e08993 + e3ef835 commit ee29b61

File tree

1,054 files changed

+5320
-1736
lines changed

Some content is hidden

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

1,054 files changed

+5320
-1736
lines changed

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,13 @@ compiler_simple_options(simple_options)
311311
toolchain_linker_add_compiler_options(${simple_options})
312312

313313
if(CONFIG_LTO)
314-
zephyr_compile_options($<TARGET_PROPERTY:compiler,optimization_lto>)
315-
add_link_options($<TARGET_PROPERTY:linker,lto_arguments>)
314+
if(CONFIG_LTO_SINGLE_THREADED)
315+
zephyr_compile_options($<TARGET_PROPERTY:compiler,optimization_lto_st>)
316+
add_link_options($<TARGET_PROPERTY:linker,lto_arguments_st>)
317+
else()
318+
zephyr_compile_options($<TARGET_PROPERTY:compiler,optimization_lto>)
319+
add_link_options($<TARGET_PROPERTY:linker,lto_arguments>)
320+
endif()
316321
endif()
317322

318323
if(CONFIG_STD_C23)

Kconfig.zephyr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,14 @@ config LTO
531531
help
532532
This option enables Link Time Optimization.
533533

534+
config LTO_SINGLE_THREADED
535+
bool "Single-threaded LTO"
536+
depends on LTO
537+
help
538+
This option instructs the linker to use a single thread to process
539+
LTO. See the following issue for more info:
540+
https://github.com/zephyrproject-rtos/sdk-ng/issues/1038
541+
534542
config COMPILER_WARNINGS_AS_ERRORS
535543
bool "Treat warnings as errors"
536544
help

MAINTAINERS.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,7 @@ Bluetooth Qualification:
685685
collaborators:
686686
- Thalley
687687
- jhedberg
688+
- alxelax
688689
files:
689690
- doc/connectivity/bluetooth/autopts/
690691
- tests/bluetooth/qualification/

arch/arm/core/cortex_a_r/thread.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,18 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
107107
#endif /* FP_GUARD_EXTRA_SIZE */
108108
#endif /* CONFIG_MPU_STACK_GUARD */
109109

110+
#if defined(CONFIG_ARM_STORE_EXC_RETURN) || defined(CONFIG_USERSPACE)
111+
thread->arch.mode = 0;
112+
#if defined(CONFIG_ARM_STORE_EXC_RETURN)
113+
thread->arch.mode_exc_return = DEFAULT_EXC_RETURN;
114+
#endif
115+
#if FP_GUARD_EXTRA_SIZE > 0
116+
if ((thread->base.user_options & K_FP_REGS) != 0) {
117+
thread->arch.mode |= Z_ARM_MODE_MPU_GUARD_FLOAT_Msk;
118+
}
119+
#endif
120+
#endif
121+
110122
iframe = Z_STACK_PTR_TO_FRAME(struct __basic_sf, stack_ptr);
111123
#if defined(CONFIG_USERSPACE)
112124
thread->arch.priv_stack_start = 0;
@@ -144,17 +156,6 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
144156
thread->callee_saved.psp = (uint32_t)iframe;
145157
thread->arch.basepri = 0;
146158

147-
#if defined(CONFIG_ARM_STORE_EXC_RETURN) || defined(CONFIG_USERSPACE)
148-
thread->arch.mode = 0;
149-
#if defined(CONFIG_ARM_STORE_EXC_RETURN)
150-
thread->arch.mode_exc_return = DEFAULT_EXC_RETURN;
151-
#endif
152-
#if FP_GUARD_EXTRA_SIZE > 0
153-
if ((thread->base.user_options & K_FP_REGS) != 0) {
154-
thread->arch.mode |= Z_ARM_MODE_MPU_GUARD_FLOAT_Msk;
155-
}
156-
#endif
157-
#endif
158159
/*
159160
* initial values in all other registers/thread entries are
160161
* irrelevant.

arch/arm/core/cortex_m/thread.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,18 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, char *sta
115115
#endif /* FP_GUARD_EXTRA_SIZE */
116116
#endif /* CONFIG_MPU_STACK_GUARD */
117117

118+
#if defined(CONFIG_ARM_STORE_EXC_RETURN) || defined(CONFIG_USERSPACE)
119+
thread->arch.mode = 0;
120+
#if defined(CONFIG_ARM_STORE_EXC_RETURN)
121+
thread->arch.mode_exc_return = DEFAULT_EXC_RETURN;
122+
#endif
123+
#if FP_GUARD_EXTRA_SIZE > 0
124+
if ((thread->base.user_options & K_FP_REGS) != 0) {
125+
thread->arch.mode |= Z_ARM_MODE_MPU_GUARD_FLOAT_Msk;
126+
}
127+
#endif
128+
#endif
129+
118130
iframe = Z_STACK_PTR_TO_FRAME(struct __basic_sf, stack_ptr);
119131
#if defined(CONFIG_USERSPACE)
120132
thread->arch.priv_stack_start = 0;
@@ -141,17 +153,6 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, char *sta
141153
thread->callee_saved.psp = (uint32_t)iframe;
142154
thread->arch.basepri = 0;
143155

144-
#if defined(CONFIG_ARM_STORE_EXC_RETURN) || defined(CONFIG_USERSPACE)
145-
thread->arch.mode = 0;
146-
#if defined(CONFIG_ARM_STORE_EXC_RETURN)
147-
thread->arch.mode_exc_return = DEFAULT_EXC_RETURN;
148-
#endif
149-
#if FP_GUARD_EXTRA_SIZE > 0
150-
if ((thread->base.user_options & K_FP_REGS) != 0) {
151-
thread->arch.mode |= Z_ARM_MODE_MPU_GUARD_FLOAT_Msk;
152-
}
153-
#endif
154-
#endif
155156
#ifdef CONFIG_ARM_PAC_PER_THREAD
156157
/* Generate PAC key and save it in thread context to be set later
157158
* when the thread is actually switched in

arch/riscv/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,14 @@ config PMP_GRANULARITY
410410
(ie 4, 8, 16, ...), but if neither TOR mode nor NA4 mode is
411411
supported, the minimum granularity is 8.
412412

413+
config PMP_NO_LOCK_GLOBAL
414+
bool "Do not lock the global PMP entries"
415+
select PMP_KERNEL_MODE_DYNAMIC
416+
help
417+
Configure the PMP entries as unlocked (L=0) to implement PMP relative
418+
features. This allows application to dynamically reconfigure PMP
419+
entries without requiring hard reset.
420+
413421
endif #RISCV_PMP
414422

415423
config PMP_STACK_GUARD

arch/riscv/core/pmp.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -521,14 +521,15 @@ void z_riscv_pmp_init(void)
521521
* Use a PMP slot to make region (starting at address 0x0) inaccessible
522522
* for detecting null pointer dereferencing.
523523
*/
524-
set_pmp_entry(&index, PMP_NONE | PMP_L,
524+
set_pmp_entry(&index, PMP_NONE | COND_CODE_1(CONFIG_PMP_NO_LOCK_GLOBAL, (0x0), (PMP_L)),
525525
0,
526526
CONFIG_NULL_POINTER_EXCEPTION_REGION_SIZE,
527527
pmp_addr, pmp_cfg, ARRAY_SIZE(pmp_addr));
528528
#endif
529529

530530
/* The read-only area is always there for every mode */
531-
set_pmp_entry(&index, PMP_R | PMP_X | PMP_L,
531+
set_pmp_entry(&index,
532+
PMP_R | PMP_X | COND_CODE_1(CONFIG_PMP_NO_LOCK_GLOBAL, (0x0), (PMP_L)),
532533
(uintptr_t)__rom_region_start,
533534
(size_t)__rom_region_size,
534535
pmp_addr, pmp_cfg, ARRAY_SIZE(pmp_addr));
@@ -537,21 +538,20 @@ void z_riscv_pmp_init(void)
537538
#ifdef CONFIG_MULTITHREADING
538539
/*
539540
* Set the stack guard for this CPU's IRQ stack by making the bottom
540-
* addresses inaccessible. This will never change so we do it here
541-
* and lock it too.
541+
* addresses inaccessible. This will never change so we do it here.
542542
*/
543-
set_pmp_entry(&index, PMP_NONE | PMP_L,
543+
set_pmp_entry(&index, PMP_NONE | COND_CODE_1(CONFIG_PMP_NO_LOCK_GLOBAL, (0x0), (PMP_L)),
544544
(uintptr_t)z_interrupt_stacks[_current_cpu->id],
545545
Z_RISCV_STACK_GUARD_SIZE,
546546
pmp_addr, pmp_cfg, ARRAY_SIZE(pmp_addr));
547547
#else
548548
/* Without multithreading setup stack guards for IRQ and main stacks */
549-
set_pmp_entry(&index, PMP_NONE | PMP_L,
549+
set_pmp_entry(&index, PMP_NONE | COND_CODE_1(CONFIG_PMP_NO_LOCK_GLOBAL, (0x0), (PMP_L)),
550550
(uintptr_t)z_interrupt_stacks,
551551
Z_RISCV_STACK_GUARD_SIZE,
552552
pmp_addr, pmp_cfg, ARRAY_SIZE(pmp_addr));
553553

554-
set_pmp_entry(&index, PMP_NONE | PMP_L,
554+
set_pmp_entry(&index, PMP_NONE | COND_CODE_1(CONFIG_PMP_NO_LOCK_GLOBAL, (0x0), (PMP_L)),
555555
(uintptr_t)z_main_stack,
556556
Z_RISCV_STACK_GUARD_SIZE,
557557
pmp_addr, pmp_cfg, ARRAY_SIZE(pmp_addr));
@@ -569,7 +569,9 @@ void z_riscv_pmp_init(void)
569569
* the kernel mode memory attribute permission is fully operational.
570570
*/
571571
attr_cnt = set_pmp_mem_attr(&index, pmp_addr, pmp_cfg, ARRAY_SIZE(pmp_addr));
572+
#endif /* CONFIG_MEM_ATTR */
572573

574+
#if defined(CONFIG_MEM_ATTR) || defined(CONFIG_PMP_NO_LOCK_GLOBAL)
573575
/*
574576
* This early, we want to protect unlock PMP entries as soon as
575577
* possible. But we need a temporary default "catch all" PMP entry for

boards/adafruit/feather_rfm95_rp2040/adafruit_feather_rfm95_rp2040.dts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
gpio-map-mask = <0xffffffff 0xffffffc0>;
6666
gpio-map-pass-thru = <0 0x3f>;
6767
gpio-map = <0 0 &gpio0 3 0>, /* SCL */
68-
<1 0 &gpio0 2 0>; /* SDA */
68+
<1 0 &gpio0 2 0>; /* SDA */
6969
};
7070
};
7171

@@ -125,11 +125,11 @@ zephyr_i2c: &i2c1 {
125125
compatible = "semtech,sx1276";
126126
reset-gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
127127
dio-gpios = <&gpio0 21 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>, /* SX1276 DIO0 */
128-
<&gpio0 22 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>, /* SX1276 DIO1 */
129-
<&gpio0 23 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>, /* SX1276 DIO2 */
130-
<&gpio0 19 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>, /* SX1276 DIO3 */
131-
<&gpio0 20 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>, /* SX1276 DIO4 */
132-
<&gpio0 18 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>; /* SX1276 DIO5 */
128+
<&gpio0 22 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>, /* SX1276 DIO1 */
129+
<&gpio0 23 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>, /* SX1276 DIO2 */
130+
<&gpio0 19 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>, /* SX1276 DIO3 */
131+
<&gpio0 20 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>, /* SX1276 DIO4 */
132+
<&gpio0 18 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>; /* SX1276 DIO5 */
133133
spi-max-frequency = <10000000>;
134134
power-amplifier-output = "pa-boost";
135135
};
@@ -198,8 +198,8 @@ zephyr_i2c: &i2c1 {
198198
gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
199199
chain-length = <1>;
200200
color-mapping = <LED_COLOR_ID_GREEN
201-
LED_COLOR_ID_RED
202-
LED_COLOR_ID_BLUE>;
201+
LED_COLOR_ID_RED
202+
LED_COLOR_ID_BLUE>;
203203
reset-delay = <280>;
204204
frequency = <800000>;
205205
};

boards/adafruit/feather_rfm95_rp2040/feather_connector.dtsi

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,31 @@
1111
gpio-map-mask = <0xffffffff 0xffffffc0>;
1212
gpio-map-pass-thru = <0 0x3f>;
1313
gpio-map = <0 0 &gpio0 26 0>, /* A0 */
14-
<1 0 &gpio0 27 0>, /* A1 */
15-
<2 0 &gpio0 28 0>, /* A2 */
16-
<3 0 &gpio0 29 0>, /* A3 */
17-
<4 0 &gpio0 24 0>, /* D24 */
18-
<5 0 &gpio0 25 0>, /* D25 */
19-
<6 0 &gpio0 14 0>, /* SCK */
20-
<7 0 &gpio0 15 0>, /* MOSI */
21-
<8 0 &gpio0 8 0>, /* MISO */
22-
<9 0 &gpio0 1 0>, /* RX */
23-
<10 0 &gpio0 0 0>, /* TX */
24-
/* GND */
25-
<12 0 &gpio0 2 0>, /* SDA */
26-
<13 0 &gpio0 3 0>, /* SCL */
27-
<14 0 &gpio0 5 0>, /* D5 */
28-
<15 0 &gpio0 6 0>, /* D6 */
29-
<16 0 &gpio0 9 0>, /* D9 */
30-
<17 0 &gpio0 10 0>, /* D10 */
31-
<18 0 &gpio0 11 0>, /* D11 */
32-
<19 0 &gpio0 12 0>, /* D12 */
33-
<20 0 &gpio0 13 0>; /* D13 */
14+
<1 0 &gpio0 27 0>, /* A1 */
15+
<2 0 &gpio0 28 0>, /* A2 */
16+
<3 0 &gpio0 29 0>, /* A3 */
17+
<4 0 &gpio0 24 0>, /* D24 */
18+
<5 0 &gpio0 25 0>, /* D25 */
19+
<6 0 &gpio0 14 0>, /* SCK */
20+
<7 0 &gpio0 15 0>, /* MOSI */
21+
<8 0 &gpio0 8 0>, /* MISO */
22+
<9 0 &gpio0 1 0>, /* RX */
23+
<10 0 &gpio0 0 0>, /* TX */
24+
/* GND */
25+
<12 0 &gpio0 2 0>, /* SDA */
26+
<13 0 &gpio0 3 0>, /* SCL */
27+
<14 0 &gpio0 5 0>, /* D5 */
28+
<15 0 &gpio0 6 0>, /* D6 */
29+
<16 0 &gpio0 9 0>, /* D9 */
30+
<17 0 &gpio0 10 0>, /* D10 */
31+
<18 0 &gpio0 11 0>, /* D11 */
32+
<19 0 &gpio0 12 0>, /* D12 */
33+
<20 0 &gpio0 13 0>; /* D13 */
3434
};
3535
};
3636

3737
feather_serial: &uart0 {};
38+
3839
feather_i2c: &i2c1 {};
40+
3941
feather_spi: &spi1 {};

boards/adafruit/metro_rp2040/adafruit_metro_rp2040.dts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
gpio-map-mask = <0xffffffff 0xffffffc0>;
5555
gpio-map-pass-thru = <0 0x3f>;
5656
gpio-map = <0 0 &gpio0 17 0>, /* SCL */
57-
<1 0 &gpio0 16 0>; /* SDA */
57+
<1 0 &gpio0 16 0>; /* SDA */
5858
};
5959
};
6060

@@ -186,8 +186,8 @@ zephyr_i2c: &i2c0 {
186186
gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
187187
chain-length = <1>;
188188
color-mapping = <LED_COLOR_ID_GREEN
189-
LED_COLOR_ID_RED
190-
LED_COLOR_ID_BLUE>;
189+
LED_COLOR_ID_RED
190+
LED_COLOR_ID_BLUE>;
191191
reset-delay = <280>;
192192
frequency = <800000>;
193193
};

0 commit comments

Comments
 (0)