Skip to content

west: hal_rpi_pico: Update Pico-SDK to 2.0.0 #76986

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

Merged
merged 4 commits into from
Oct 8, 2024
Merged
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
8 changes: 4 additions & 4 deletions drivers/flash/flash_rpi_pico.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,19 +171,19 @@
{
rom_connect_internal_flash_fn connect_internal_flash = (rom_connect_internal_flash_fn)
rom_func_lookup_inline(ROM_FUNC_CONNECT_INTERNAL_FLASH);
rom_flash_exit_xip_fn flash_exit_xip = (rom_flash_exit_xip_fn)
rom_flash_exit_xip_fn exit_xip = (rom_flash_exit_xip_fn)
rom_func_lookup_inline(ROM_FUNC_FLASH_EXIT_XIP);
rom_flash_flush_cache_fn flash_flush_cache = (rom_flash_flush_cache_fn)
rom_flash_flush_cache_fn flush_cache = (rom_flash_flush_cache_fn)
rom_func_lookup_inline(ROM_FUNC_FLASH_FLUSH_CACHE);

Check notice on line 178 in drivers/flash/flash_rpi_pico.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/flash/flash_rpi_pico.c:178 - rom_flash_exit_xip_fn exit_xip = (rom_flash_exit_xip_fn) - rom_func_lookup_inline(ROM_FUNC_FLASH_EXIT_XIP); - rom_flash_flush_cache_fn flush_cache = (rom_flash_flush_cache_fn) - rom_func_lookup_inline(ROM_FUNC_FLASH_FLUSH_CACHE); + rom_flash_exit_xip_fn exit_xip = + (rom_flash_exit_xip_fn)rom_func_lookup_inline(ROM_FUNC_FLASH_EXIT_XIP); + rom_flash_flush_cache_fn flush_cache = + (rom_flash_flush_cache_fn)rom_func_lookup_inline(ROM_FUNC_FLASH_FLUSH_CACHE);
flash_init_boot2_copyout();

__compiler_memory_barrier();

connect_internal_flash();
flash_exit_xip();
exit_xip();
flash_write_partial_internal(flash_offs, data, count);
flash_flush_cache();
flush_cache();
flash_enable_xip_via_boot2();
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpio/gpio_rpi_pico.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static const struct gpio_driver_api gpio_rpi_driver_api = {
static void gpio_rpi_isr(const struct device *dev)
{
struct gpio_rpi_data *data = dev->data;
io_irq_ctrl_hw_t *irq_ctrl_base;
io_bank0_irq_ctrl_hw_t *irq_ctrl_base;
const io_rw_32 *status_reg;
uint32_t events;
uint32_t pin;
Expand Down
37 changes: 21 additions & 16 deletions modules/hal_rpi_pico/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if(CONFIG_HAS_RPI_PICO)
set(rp2_common_dir ${ZEPHYR_HAL_RPI_PICO_MODULE_DIR}/src/rp2_common)
set(rp2040_dir ${ZEPHYR_HAL_RPI_PICO_MODULE_DIR}/src/rp2040)
set(common_dir ${ZEPHYR_HAL_RPI_PICO_MODULE_DIR}/src/common)
set(boot_stage_dir ${rp2_common_dir}/boot_stage2)
set(boot_stage_dir ${rp2040_dir}/boot_stage2)

# The Second Stage Bootloader is only linked to the app that resides
# at 0x100. Therefore, only if the app's offset is 0x100, the second
Expand Down Expand Up @@ -46,6 +46,8 @@ if(CONFIG_HAS_RPI_PICO)
zephyr_library_sources(${rp2_bootloader_asm})
endif()

zephyr_compile_definitions(PICO_RP2040)

# Pico sources and headers necessary for every build.
# These contain definitions and implementation used mostly for
# initializing the SoC, and therefore are always required.
Expand All @@ -55,11 +57,12 @@ if(CONFIG_HAS_RPI_PICO)
${rp2_common_dir}/hardware_pll/pll.c
${rp2_common_dir}/hardware_xosc/xosc.c
${rp2_common_dir}/hardware_watchdog/watchdog.c
${rp2_common_dir}/pico_platform/platform.c
${rp2_common_dir}/pico_bootrom/bootrom.c
${rp2040_dir}/pico_platform/platform.c
)

zephyr_include_directories(
${common_dir}/pico_base_headers/include
${rp2_common_dir}/hardware_base/include
${rp2_common_dir}/hardware_clocks/include
${rp2_common_dir}/hardware_watchdog/include
Expand All @@ -69,11 +72,18 @@ if(CONFIG_HAS_RPI_PICO)
${rp2_common_dir}/hardware_sync/include
${rp2_common_dir}/hardware_timer/include
${rp2_common_dir}/hardware_resets/include
${rp2_common_dir}/hardware_boot_lock/include
${rp2_common_dir}/hardware_ticks/include
${rp2_common_dir}/hardware_sync_spin_lock/include
${rp2_common_dir}/pico_bootrom/include
${rp2_common_dir}/pico_platform_compiler/include
${rp2_common_dir}/pico_platform_sections/include
${rp2_common_dir}/pico_platform_panic/include
${common_dir}/boot_picoboot_headers/include
${common_dir}/boot_picobin_headers/include
${rp2040_dir}/hardware_regs/include
${rp2040_dir}/hardware_structs/include
${common_dir}/pico_base/include
${rp2_common_dir}/pico_platform/include
${rp2040_dir}/pico_platform/include
${CMAKE_CURRENT_LIST_DIR}
)

Expand Down Expand Up @@ -108,16 +118,16 @@ if(CONFIG_HAS_RPI_PICO)
zephyr_include_directories_ifdef(CONFIG_PICOSDK_USE_TIMER
${rp2_common_dir}/hardware_timer/include)

zephyr_library_sources_ifdef(CONFIG_PICOSDK_USE_CLAIM
${rp2_common_dir}/hardware_claim/claim.c)
zephyr_include_directories_ifdef(CONFIG_PICOSDK_USE_CLAIM
${rp2_common_dir}/hardware_claim/include)

zephyr_library_sources_ifdef(CONFIG_PICOSDK_USE_RTC
${rp2_common_dir}/hardware_rtc/rtc.c)
zephyr_include_directories_ifdef(CONFIG_PICOSDK_USE_RTC
${rp2_common_dir}/hardware_rtc/include)

zephyr_library_sources_ifdef(CONFIG_PICOSDK_USE_PIO
${rp2_common_dir}/hardware_pio/pio.c)
zephyr_include_directories_ifdef(CONFIG_PICOSDK_USE_PIO
${rp2_common_dir}/hardware_pio/include)

# Some flash driver functions must be executed from the RAM.
# Originally pico-sdk places them in the RW data section, so this
# implementation does the same.
Expand All @@ -130,14 +140,9 @@ if(CONFIG_HAS_RPI_PICO)
COMPILE_FLAGS $<TARGET_PROPERTY:compiler,warning_no_pointer_arithmetic>
)

zephyr_library_sources_ifdef(CONFIG_PICOSDK_USE_PIO
${rp2_common_dir}/hardware_pio/pio.c)
zephyr_include_directories_ifdef(CONFIG_PICOSDK_USE_PIO
${rp2_common_dir}/hardware_pio/include)

zephyr_library_sources_ifdef(CONFIG_PICOSDK_USE_CLAIM
${rp2_common_dir}/hardware_claim/claim.c)
${common_dir}/hardware_claim/claim.c)
zephyr_include_directories_ifdef(CONFIG_PICOSDK_USE_CLAIM
${rp2_common_dir}/hardware_claim/include)
${common_dir}/hardware_claim/include)

endif()
9 changes: 6 additions & 3 deletions modules/hal_rpi_pico/bootloader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ enable_language(ASM)
set(rp2_common_dir ${ZEPHYR_HAL_RPI_PICO_MODULE_DIR}/src/rp2_common)
set(rp2040_dir ${ZEPHYR_HAL_RPI_PICO_MODULE_DIR}/src/rp2040)
set(common_dir ${ZEPHYR_HAL_RPI_PICO_MODULE_DIR}/src/common)
set(boot_stage_dir ${rp2_common_dir}/boot_stage2)
set(boot_stage_dir ${rp2040_dir}/boot_stage2)

add_executable(boot_stage2)

Expand All @@ -34,9 +34,12 @@ target_sources(boot_stage2 PRIVATE ${boot_stage_dir}/${flash_type_file})
target_include_directories(boot_stage2 PUBLIC
..
${boot_stage_dir}/asminclude
${rp2_common_dir}/pico_platform/include
${rp2040_dir}/pico_platform/include
${rp2040_dir}/hardware_regs/include
${common_dir}/pico_base/include
${common_dir}/pico_base_headers/include
${rp2_common_dir}/pico_platform_compiler/include
${rp2_common_dir}/pico_platform_sections/include
${rp2_common_dir}/pico_platform_panic/include
${ZEPHYR_BASE}/include
)

Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ manifest:
- hal
- name: hal_rpi_pico
path: modules/hal/rpi_pico
revision: fba7162cc7bee06d0149622bbcaac4e41062d368
revision: 79ee0f9e058a6327fc943d2f2a19cf3ade107cec
groups:
- hal
- name: hal_silabs
Expand Down
Loading