Closed ccrome closed 1 year ago
It does beg the question, are there other places where there should be custom hooks on a per-board basis?
we add an optional API (weak function) to board_api.h e.g board_init_post()
in conjunction with board_teardown_post()
I updated the hooks to be in main now, rather than in the port directory. Now it's easy for any board anywhere to define the functions to do per board custom stuff.
void board_init_post(void) __attribute__ ((weak));
void board_teardown_post(void) __attribute__ ((weak));
bool board_app_valid_post() __attribute__ ((weak));
I think I've got it all. Thanks!
Checklist
Description of Change
Some custom i.MX boards require per board setup. Currently, I don't see a mechanism for a specific board to have a setup call.
As a specific example, For example, on the i.MX RT 1011, if you happen to have the boot LED on
GPIO_AD_02
, you might need to custom configureGPR26
in order for it to work with the GPIO configuration you want to use.Additionally, there are lots of other potential reasons you might want to do some setup in
boards/<board_name>
.This patch adds
#ifdef BOARD_INIT_POST_HOOK
, and if it's defined, thenboard_init_post_hook()
will be called at the end ofboard_init()
.