Skip to content

Commit

Permalink
B1 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kilograham committed Sep 13, 2021
1 parent c09c7f0 commit ad55537
Show file tree
Hide file tree
Showing 25 changed files with 4,689 additions and 474 deletions.
25 changes: 23 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ include(pico_sdk/pico_sdk_init.cmake)

project(pico_bootrom)

set(PICO_BARE_METAL 1)
if (NOT INCLUDE_TESTS)
set(PICO_BARE_METAL 1)
else()
# SDK versions conflict with code to be tested
set(SKIP_PICO_BIT_OPS 1)
endif()

# Add pico targets to the build
pico_sdk_init()
Expand All @@ -32,13 +37,15 @@ set(GENERATED_H ${CMAKE_CURRENT_BINARY_DIR}/generated.h)
# order matches original makefile
add_executable(bootrom
bootrom/bootrom_rt0.S
bootrom/bit_functions.S
bootrom/bootrom_main.c
bootrom/bootrom_misc.S
bootrom/program_flash_generic.c
bootrom/usb_boot_device.c
bootrom/virtual_disk.c
bootrom/async_task.c
bootrom/mufplib.S
bootrom/mufplib-double.S
usb_device_tiny/runtime.c
usb_device_tiny/usb_device.c
usb_device_tiny/usb_msc.c
Expand Down Expand Up @@ -104,13 +111,23 @@ target_compile_definitions(bootrom PRIVATE
BOOTROM_ONLY_SIZE_HACKS
USE_16BIT_ROM_FUNCS
USE_BOOTROM_GPIO

# for
USE_HW_DIV
)

USE_POPCOUNT32
USE_CLZ32
USE_CTZ32
USE_REVERSE32
)

target_link_options(bootrom PRIVATE "LINKER:--script=${CMAKE_CURRENT_LIST_DIR}/bootrom/bootrom.ld")
set_target_properties(bootrom PROPERTIES LINK_DEPENDS ${CMAKE_CURRENT_LIST_DIR}/bootrom/bootrom.ld)
target_link_libraries(bootrom PRIVATE
hardware_resets
hardware_regs
hardware_structs
pico_platform
hardware_sync
boot_uf2_headers
boot_picoboot_headers
Expand All @@ -128,4 +145,8 @@ pico_add_map_output(bootrom)
pico_add_hex_output(bootrom)
pico_add_h32_output(bootrom)

if (INCLUDE_TESTS)
add_subdirectory(test)
endif()


3 changes: 2 additions & 1 deletion LICENSE.TXT
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
NOTE: this license applies to the contents of this repository, EXCLUDING the contents of the files bootrom/mufplib.S which is licensed separately:
NOTE: this license applies to the contents of this repository, EXCLUDING the contents of the files bootrom/mufplib.S
and bootrom/mufplib-double.S, which are licensed separately:

Copyright 2020 (c) 2020 Raspberry Pi (Trading) Ltd.

Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
This is the B0 version of the RP2040 bootrom.
This is the B1 version of the RP2040 bootrom.

The version on the chip was built in _Release_ mode using an _arm-cortex_m0-eabi_ version of
[crosstool-NG](https://crosstool-ng.github.io/crostool-NG) with GCC version 7.2.0.
The version on the chip was built in _Debug_ mode using GCC 9.3.1 (GNU Arm Embedded Toolchain 9-2020-q2-update).

Note the GIT revision info (included in the bootrom) on chip does not match the GIT revision of this
branch. Additionally, certain `DMB` instructions are encoded as `DMB SY` vs `DMB ISH` when building
Expand Down
4 changes: 2 additions & 2 deletions bootrom/async_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ void __attribute__((noreturn)) async_task_worker() {
execute_task(&virtual_disk_queue, &_worker_task);
}
#ifdef USE_PICOBOOT
else if (dequeue_task(&rpiboot_queue, &_worker_task)) {
execute_task(&rpiboot_queue, &_worker_task);
else if (dequeue_task(&picoboot_queue, &_worker_task)) {
execute_task(&picoboot_queue, &_worker_task);
}
#endif
else {
Expand Down
4 changes: 2 additions & 2 deletions bootrom/async_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct async_task {
uint32_t erase_size;
uint8_t *data;
uint32_t data_length;
uint32_t rpiboot_user_token;
uint32_t picoboot_user_token;
uint8_t type;
uint8_t exclusive_param;
// an identifier for the logical source of the task
Expand Down Expand Up @@ -79,7 +79,7 @@ void __attribute__((noreturn)) async_task_worker();
void reset_task(struct async_task *task);

extern struct async_task_queue virtual_disk_queue;
extern struct async_task_queue rpiboot_queue;
extern struct async_task_queue picoboot_queue;

static inline void async_disable_queue(struct async_task_queue *queue, bool disable) {
queue->disable = disable;
Expand Down
Loading

0 comments on commit ad55537

Please sign in to comment.