rk3288: Add CBMEM console support and fix RETURN_FROM_VERSTAGE
Since we can now reduce our vboot2 work buffer by 4K, we can use all that hard-earned space for the CBMEM console instead (and 4K are unfortunately barely enough for all the stuff we dump with vboot2). Also add console_init() and exception_init() to the verstage for CONFIG_RETURN_FROM_VERSTAGE, which was overlooked before (our model requires those functions to be called again at the beginning of every stage... even though some consoles like UARTs might not need it, others like the CBMEM console do). In the !RETURN_FROM_VERSTAGE case, this is expected to be done by the platform-specific verstage entry wrapper, and already in place for the only implementation we have for now (tegra124). (Technically, there is still a bug in the case where EARLY_CONSOLE is set but BOOTBLOCK_CONSOLE isn't, since both verstage and romstage would run init_console_ptr() as if they were there first, so the romstage overwrites the verstage's output. I don't think it's worth fixing that now, since EARLY_CONSOLE && !BOOTBLOCK_CONSOLE is a pretty pointless use-case and I think we should probably just get rid of the CONFIG_BOOTBLOCK_CONSOLE option eventually.) BRANCH=None BUG=None TEST=Booted Pinky. Change-Id: Id666cb7a194d32cfe688861ab17c5e908bc7760d Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/232614
This commit is contained in:
parent
64e972f103
commit
85486928ab
4 changed files with 17 additions and 10 deletions
|
|
@ -20,6 +20,7 @@
|
|||
#include <2api.h>
|
||||
#include <2struct.h>
|
||||
#include <antirollback.h>
|
||||
#include <arch/exception.h>
|
||||
#include <console/console.h>
|
||||
#include <console/vtxprintf.h>
|
||||
#include <string.h>
|
||||
|
|
@ -167,11 +168,7 @@ static void save_if_needed(struct vb2_context *ctx)
|
|||
* TODO: Avoid loading a stage twice (once in hash_body & again in load_stage).
|
||||
* when per-stage verification is ready.
|
||||
*/
|
||||
#if CONFIG_RETURN_FROM_VERSTAGE
|
||||
void main(void)
|
||||
#else
|
||||
void verstage_main(void)
|
||||
#endif /* CONFIG_RETURN_FROM_VERSTAGE */
|
||||
{
|
||||
struct vb2_context ctx;
|
||||
struct vboot_region fw_main;
|
||||
|
|
@ -250,3 +247,12 @@ void verstage_main(void)
|
|||
printk(BIOS_INFO, "Slot %c is selected\n", is_slot_a(&ctx) ? 'A' : 'B');
|
||||
vb2_set_selected_region(wd, &fw_main);
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_RETURN_FROM_VERSTAGE)
|
||||
void main(void)
|
||||
{
|
||||
console_init();
|
||||
exception_init();
|
||||
verstage_main();
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue