- Notifications
You must be signed in to change notification settings - Fork 0
samples: rpi_pico: create dedicated boards/rpi_pico/boot_stage2 sample #3
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
samples: rpi_pico: create dedicated boards/rpi_pico/boot_stage2 sample #3
Conversation
Added HAL module for the Raspberry Pi Pico. Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
Added basic support for the RP2040 SoC. Support includes booting and starting the kernel, on one core only. Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com> Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Added a pinctrl driver for the Raspberry Pi Pico series Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
Added a serial driver for the RP2040. Only polling API is supported. Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
Added GPIO support for the RP2040 SoC. Only one core is supported. Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
Added support for Raspberry Pi's Pico board, using the RP2040 SoC. Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
| @yonsch please take a look at this part, and decide what is needed here: |
This is a squash of zephyrproject-rtos#41301 and is not intended for review in this PR. However, this PR is dependent of the work from zephyrproject-rtos#41301. Ignore this commit is this PR. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit removes the multi-image stage2 bootloader from the Zephyr image and instead create a dedicated board specific sample for the stage2 bootloader. It reuses the Zephyr build infrastructure, such as Zephyr modules, toolchain, Kconfig, etc. but not the Zephyr kernel itself. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
f8f9209 to d69d1e7 Compare | Note: this PR just presents the outline, one thing that should be considered is whether the complete kconfig tree should be available in this sample. In principle it doesn't make sense to have the whole tree, but kept cleaning up this part outside. Would like some feedback on the approach seen from your viewpoint first. |
| One comment: this work is basically not board specific and there are at least 3 more boards in the queue waiting to be added** which will need the same cmake files at least. Can the new code be moved under the 'soc' tree instead, where it can be shared nicely? 2 from adafruit, one solderparty; there are many others out there. |
Thanks a lot. |
2e9c80f to a69989e Compare e441781 to c93f206 Compare This patch reworks how fragments are handled in the net_buf infrastructure. In particular, it removes the union around the node and frags members in the main net_buf structure. This is done so that both can be used at the same time, at a cost of 4 bytes per net_buf instance. This implies that the layout of net_buf instances changes whenever being inserted into a queue (fifo or lifo) or a linked list (slist). Until now, this is what happened when enqueueing a net_buf with frags in a queue or linked list: 1.1 Before enqueueing: +--------+ +--------+ +--------+ |#1 node|\ |#2 node|\ |#3 node|\ | | \ | | \ | | \ | frags |------| frags |------| frags |------NULL +--------+ +--------+ +--------+ net_buf #1 has 2 fragments, net_bufs #2 and #3. Both the node and frags pointers (they are the same, since they are unioned) point to the next fragment. 1.2 After enqueueing: +--------+ +--------+ +--------+ +--------+ +--------+ |q/slist |------|#1 node|------|#2 node|------|#3 node|------|q/slist | |node | | *flag | / | *flag | / | | / |node | | | | frags |/ | frags |/ | frags |/ | | +--------+ +--------+ +--------+ +--------+ +--------+ When enqueing a net_buf (in this case #1) that contains fragments, the current net_buf implementation actually enqueues all the fragments (in this case #2 and #3) as actual queue/slist items, since node and frags are one and the same in memory. This makes the enqueuing operation expensive and it makes it impossible to atomically dequeue. The `*flag` notation here means that the `flags` member has been set to `NET_BUF_FRAGS` in order to be able to reconstruct the frags pointers when dequeuing. After this patch, the layout changes considerably: 2.1 Before enqueueing: +--------+ +--------+ +--------+ |#1 node|--NULL |#2 node|--NULL |#3 node|--NULL | | | | | | | frags |-------| frags |-------| frags |------NULL +--------+ +--------+ +--------+ This is very similar to 1.1, except that now node and frags are different pointers, so node is just set to NULL. 2.2 After enqueueing: +--------+ +--------+ +--------+ |q/slist |-------|#1 node|-------|q/slist | |node | | | |node | | | | frags | | | +--------+ +--------+ +--------+ | +--------+ +--------+ | |#2 node|--NULL |#3 node|--NULL | | | | | +------------| frags |-------| frags |------NULL +--------+ +--------+ When enqueuing net_buf #1, now we only enqueue that very item, instead of enqueing the frags as well, since now node and frags are separate pointers. This simplifies the operation and makes it atomic. Resolves zephyrproject-rtos#52718. Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Depends on: zephyrproject-rtos#41301 (has been squashed as first commit, please ignore)
This commit removes the multi-image stage2 bootloader from the Zephyr
image and instead create a dedicated board specific sample for the
stage2 bootloader.
It reuses the Zephyr build infrastructure, such as Zephyr modules,
toolchain, Kconfig, etc. but not the Zephyr kernel itself.
Signed-off-by: Torsten Rasmussen Torsten.Rasmussen@nordicsemi.no
@yonsch feel free to give feedback and cherry-pick / squash as you like into zephyrproject-rtos#34835.
This PR allows to build the stage2 bootloader using standard tools, like
cmake + ninja / makeorwest build, for example: