Skip to content

Commit e23ef53

Browse files
sreeramIfxjhedberg
authored andcommitted
dts: arm: Infineon: cyw20289: Fix incorrect bootstrap configuration
This commit fixes CYW20829 that was broken on main after the below commit #95333 The root cause of the issue is that, bootstrap section is located at the end of the RAM. So the start address of the section needs to be calculated based on the size of the section. Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
1 parent 0ab5005 commit e23ef53

File tree

2 files changed

+30
-13
lines changed

2 files changed

+30
-13
lines changed

dts/arm/infineon/cat1b/cyw20829/cyw20829.dtsi

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
*/
77

88
#include <mem.h>
9-
10-
#define BOOTSTRAP_SIZE DT_SIZE_K(16)
11-
#define SRAM0_SIZE (DT_SIZE_K(256) - BOOTSTRAP_SIZE)
9+
#include <zephyr/dt-bindings/misc/ifx_cyw20829.h>
1210

1311
/ {
1412
cpus {
@@ -42,36 +40,36 @@
4240
#size-cells = <1>;
4341

4442
compatible = "mmio-sram";
45-
reg = <0x20000000 SRAM0_SIZE>;
43+
reg = <SRAM0_SAHB_BASE SRAM0_SIZE>;
4644

4745
/* SRAM aliased address path */
4846
sram_sahb: sram_sahb@20000000 {
49-
reg = <0x20000000 SRAM0_SIZE>; /* SAHB address */
47+
reg = <SRAM0_SAHB_BASE SRAM0_SIZE>; /* SAHB address */
5048
};
5149

5250
sram_cbus: sram_cbus@4000000 {
53-
reg = <0x04000000 SRAM0_SIZE>; /* CBUS address */
51+
reg = <SRAM0_CBUS_BASE SRAM0_SIZE>; /* CBUS address */
5452
};
5553
};
5654

5755
/* sram_bootstrap address calculation:
5856
* sram_sahb + sram_size (256k) - bootstrap size
59-
* (e.g. 0x20000000 + 0x40000 - 12K (0x3000) = 0x2003D000)
57+
* (e.g. 0x20000000 + 0x40000 - 16K (0x4000) = 0x2003C000)
6058
*/
61-
sram_bootstrap: memory@2003D000 {
59+
sram_bootstrap: memory@2003c000 {
6260
#address-cells = <1>;
6361
#size-cells = <1>;
6462
compatible = "zephyr,memory-region", "mmio-sram";
6563
zephyr,memory-region = "BOOTSTRAP_RAM";
66-
reg = <0x2003D000 BOOTSTRAP_SIZE>;
64+
reg = <BOOTSTRAP_SAHB_BASE BOOTSTRAP_SIZE>;
6765

6866
/* SRAM aliased address path */
69-
sram_bootstrap_sahb: sram_bootstrap_sahb@2003D000 {
70-
reg = <0x2003D000 BOOTSTRAP_SIZE>; /* SAHB address */
67+
sram_bootstrap_sahb: sram_bootstrap_sahb@2003c000 {
68+
reg = <BOOTSTRAP_SAHB_BASE BOOTSTRAP_SIZE>; /* SAHB address */
7169
};
7270

73-
sram_bootstrap_cbus: sram_bootstrap_cbus@403D000 {
74-
reg = <0x0403D000 BOOTSTRAP_SIZE>; /* CBUS address */
71+
sram_bootstrap_cbus: sram_bootstrap_cbus@403c000 {
72+
reg = <BOOTSTRAP_CBUS_BASE BOOTSTRAP_SIZE>; /* CBUS address */
7573
};
7674
};
7775

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (c) 2025 Infineon Technologies AG,
3+
* or an affiliate of Infineon Technologies AG.
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_MISC_IFX_CYW20829_H_
9+
#define ZEPHYR_INCLUDE_DT_BINDINGS_MISC_IFX_CYW20829_H_
10+
11+
#define SRAM0_SAHB_BASE 0x20000000
12+
#define SRAM0_CBUS_BASE 0x04000000
13+
#define BOOTSTRAP_SIZE DT_SIZE_K(16)
14+
#define BOOTSTRAP_BASE_OFFSET (DT_SIZE_K(256) - BOOTSTRAP_SIZE)
15+
#define BOOTSTRAP_SAHB_BASE (SRAM0_SAHB_BASE + BOOTSTRAP_BASE_OFFSET)
16+
#define BOOTSTRAP_CBUS_BASE (SRAM0_CBUS_BASE + BOOTSTRAP_BASE_OFFSET)
17+
#define SRAM0_SIZE (DT_SIZE_K(256) - BOOTSTRAP_SIZE)
18+
19+
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_MISC_IFX_CYW20829_H_ */

0 commit comments

Comments
 (0)