-
Notifications
You must be signed in to change notification settings - Fork 2k
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
efm32: add support for riotboot #11940
Conversation
@cladmi might want to take a look at the |
Otherwise I confirm this is working on the Pearl Gecko board. Nice! |
ca6f640
to
08ecaa6
Compare
I think that's alright. The bootloader cpu_init() just has to initialize what's needed in order to successfully execute the bootloader's kernel_init and jump to the actual image. |
bootloaders/riotboot/Makefile
Outdated
@@ -8,7 +8,7 @@ BOARD ?= samr21-xpro | |||
FEATURES_REQUIRED += riotboot | |||
|
|||
# Disable unused modules | |||
CFLAGS += -DNDEBUG -DLOG_LEVEL=LOG_NONE | |||
CFLAGS += -DNDEBUG -DLOG_LEVEL=LOG_NONE -DBOOTLOADER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(bikeshadding) maybe call the define "RIOTBOOT"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep the term BOOTLOADER
or use RIOT_BOOTLOADER
instead of RIOTBOOT
. riotboot
is associated with a module that any application can use so I think we should try and keep it [edit:semantically] separate from stuff only the bootloader needs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't care. I think that RIOT_BOOTLOADER
reduces chances on a conflicting define.
I was planning to split this commit from this PR, so I'll change it over there!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, "RIOT_BOOTLOADER" is just an arbitrary but new name of RIOT's bootloader, "riotboot". Why a new name?
"BOOTLOADER" is quite general, but in this case, we only mean riotboot. Why imply that this means any more than riotboot?
For referencing whether the support code is available, "MODULE_RIOTBOOT" can already be used.
How can people not be of the opinion that "RIOTBOOT" is the right name for this define? 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't care. I think that
RIOT_BOOTLOADER
reduces chances on a conflicting define.
I do a little. Please keep BOOTLOADER over RIOT_BOOTLOADER if RIOTBOOT doesn't resonate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can people not be of the opinion that "RIOTBOOT" is the right name for this define? wink
I would think something that isn't RIOTBOOT
is better since this isn't necessarily a riotboot boot-loader issue, but for any bootloader, e.g: for a case where e.g. mcuboot
or similar would be supported, I imagine this initialization would need to be skipped. But that could be changed if and when the need arises.
Well, "RIOT_BOOTLOADER" is just an arbitrary but new name of RIOT's bootloader, "riotboot". Why a new name?
Ok, you are right.
I created #12297 to address the |
08ecaa6
to
dcd6ac5
Compare
dcd6ac5
to
73dee9e
Compare
I've update this PR now that #12297 got merged. I've also disabled most parts of Due to #12311, this doesn't work on the |
73dee9e
to
0336eff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very straightforward.
Only adds definition for bootloader size and skips certain board init parts if RIOT is used as a bootloader.
Another rebase is in order. |
0336eff
to
08bc67c
Compare
Rebased. |
Contribution description
This PR adds support for
riotboot
for EFM32 and all boards.RFC
There is still one part that needs discussion (and should move to a different PR). 8ea2d1d exposes a global define that can be used to skip certain parts of the bootloader, when building the bootloader.I need that for several reasons:reducing the size of the bootloader (EFM32cpu_init()
does a lot more)skipping parts incpu_init()
that are not relevant during bootconfiguring clock sourcesexample: I could have an updated firmware that uses another source/configuratione.g. chip applying errataexample: there can be new (conflicting) EFM32 errataconfiguring DC-DC parametersexample: I decide to update DC-DC parameters to make my board more efficient or stableperipheral initializationMy goal is to boot as quick as possible to the actual firmware on the defaults, and then do proper initialization.I don't know if there is a better way to detect if I'm building the firmware, and I am happy to adapt if there is a way.Resolved by #12297.
Testing procedure
cd tests/riotboot && BOARD=ikea-tradfri make test
should work (or other EFM32 board, e.g. SLTB001a).Issues/PRs references
#8902 (comment)