Skip to content

soc: rp2350: enable support for building with CONFIG_XIP=n #91200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
28 changes: 0 additions & 28 deletions boards/kws/pico2_spe/pico2_spe.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
zephyr,flash = &flash0;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,code-partition = &code_partition;
};

aliases {
Expand Down Expand Up @@ -59,33 +58,6 @@

&flash0 {
reg = <0x10000000 DT_SIZE_M(4)>;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

/* Reserved memory for an image definition block. The block is much
* smaller than 256 bytes, but in practice the linker places the vector
* table at a much larger alignment offset.
*/
image_def: partition@0 {
label = "image_def";
reg = <0x00000000 0x100>;
read-only;
};

/*
* Usable flash. Starts at 0x100, after the image definition block.
* The partition size is 4MB minus the 0x100 bytes taken by the
* image definition.
*/
code_partition: partition@100 {
label = "code-partition";
reg = <0x100 (DT_SIZE_M(4) - 0x100)>;
read-only;
};
};
};

&uart0 {
Expand Down
28 changes: 0 additions & 28 deletions boards/pimoroni/pico_plus2/pico_plus2.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
zephyr,flash = &flash0;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,code-partition = &code_partition;
};

aliases {
Expand Down Expand Up @@ -92,33 +91,6 @@

&flash0 {
reg = <0x10000000 DT_SIZE_M(16)>;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

/* Reserved memory for an image definition block. The block is much
* smaller than 256 bytes, but in practice the linker places the vector
* table at a much larger alignment offset.
*/
image_def: partition@0 {
label = "image_def";
reg = <0x00000000 0x100>;
read-only;
};

/*
* Usable flash. Starts at 0x100, after the image definition block.
* The partition size is 16MB minus the 0x100 bytes taken by the
* image definition.
*/
code_partition: partition@100 {
label = "code-partition";
reg = <0x100 (DT_SIZE_M(16) - 0x100)>;
read-only;
};
};
};

&uart0 {
Expand Down
28 changes: 0 additions & 28 deletions boards/raspberrypi/rpi_pico2/rpi_pico2.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
zephyr,flash = &flash0;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,code-partition = &code_partition;
};

aliases {
Expand Down Expand Up @@ -61,33 +60,6 @@

&flash0 {
reg = <0x10000000 DT_SIZE_M(4)>;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

/* Reserved memory for an image definition block. The block is much
* smaller than 256 bytes, but in practice the linker places the vector
* table at a much larger alignment offset.
*/
image_def: partition@0 {
label = "image_def";
reg = <0x00000000 0x100>;
read-only;
};

/*
* Usable flash. Starts at 0x100, after the image definition block.
* The partition size is 4MB minus the 0x100 bytes taken by the
* image definition.
*/
code_partition: partition@100 {
label = "code-partition";
reg = <0x100 (DT_SIZE_M(4) - 0x100)>;
read-only;
};
};
};

&uart0 {
Expand Down
24 changes: 0 additions & 24 deletions boards/wiznet/w5500_evb_pico2/w5500_evb_pico2.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
zephyr,flash = &flash0;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,code-partition = &code_partition;
};

pico_header: connector {
Expand Down Expand Up @@ -85,29 +84,6 @@
* the second stage bootloader
*/
reg = <0x10000000 DT_SIZE_M(16)>;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

/* Reserved memory for the second stage bootloader */
second_stage_bootloader: partition@0 {
label = "second_stage_bootloader";
reg = <0x00000000 0x100>;
read-only;
};

/*
* Usable flash. Starts at 0x100, after the bootloader. The partition
* size is 16MB minus the 0x100 bytes taken by the bootloader.
*/
code_partition: partition@100 {
label = "code-partition";
reg = <0x100 (DT_SIZE_M(16) - 0x100)>;
read-only;
};
};
};

&uart0 {
Expand Down
5 changes: 4 additions & 1 deletion soc/raspberrypi/rpi_pico/rp2350/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ zephyr_library_sources(soc.c)

zephyr_include_directories(.)

set(SOC_LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/linker.ld CACHE INTERNAL "")
# Add the image definition block if required
zephyr_linker_sources(ROM_START rom_start.ld)

set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")
3 changes: 1 addition & 2 deletions soc/raspberrypi/rpi_pico/rp2350/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ config SOC_SERIES_RP2350
select HAS_RPI_PICO
select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE
select SOC_RESET_HOOK
select XIP

config SOC_RP2350A_M33
select ARM
Expand All @@ -31,7 +30,7 @@ config SOC_RP2350B_M33

config RP2_REQUIRES_IMAGE_DEFINITION_BLOCK
bool
default y if FLASH_LOAD_OFFSET = 0x100
default y
# Currently the IDF only supports using the Cortex-M33 cores. Enforce
# this at build configuration time.
depends on SOC_SERIES_RP2350 && CPU_CORTEX_M33
Expand Down
29 changes: 0 additions & 29 deletions soc/raspberrypi/rpi_pico/rp2350/linker.ld

This file was deleted.

17 changes: 17 additions & 0 deletions soc/raspberrypi/rpi_pico/rp2350/rom_start.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* rom_start.ld - additional data to append at the ROM start */

/*
* Copyright (c) 2024 Andrew Featherstone
*
* SPDX-License-Identifier: Apache-2.0
*/

#if CONFIG_RP2_REQUIRES_IMAGE_DEFINITION_BLOCK
LONG(0xffffded3) /* PICOBIN_BLOCK_MARKER_START */
LONG(0x10210142) /* IMAGE_DEF Item */
LONG(0x00000203) /* VECTOR_TABLE Item */
LONG(ABSOLUTE(_vector_start)) /* - Address of the vector table in flash */
LONG(0x000003ff) /* Last Item in Block */
LONG(0x00000000) /* End of block loop */
LONG(0xab123579) /* PICOBIN_BLOCK_MARKER_END */
#endif /* CONFIG_RP2_REQUIRES_IMAGE_DEFINITION_BLOCK */