diff --git a/qiboot/include/qi.h b/qiboot/include/qi.h index be25626..8d46ac0 100644 --- a/qiboot/include/qi.h +++ b/qiboot/include/qi.h @@ -101,6 +101,7 @@ struct board_api { int (*is_this_board)(void); void (*early_port_init)(void); void (*port_init)(void); + void (*post_serial_init)(void); /* print device-specific things */ void (*putc)(char); void (*close)(void); u8 (*get_ui_keys)(void); diff --git a/qiboot/src/cpu/s3c2442/gta02.c b/qiboot/src/cpu/s3c2442/gta02.c index 5ad5316..3fd93e0 100644 --- a/qiboot/src/cpu/s3c2442/gta02.c +++ b/qiboot/src/cpu/s3c2442/gta02.c @@ -447,6 +447,15 @@ static void set_ui_indication_gta02(enum ui_indication ui_indication) } +void post_serial_init_gta02(void) +{ + if (battery_condition_reasonable) + puts("Battery condition reasonable\n"); + else + puts("BATTERY CONDITION LOW\n"); +} + + /* * our API for bootloader on this machine */ @@ -460,6 +469,7 @@ const struct board_api board_api_gta02 = { .get_board_variant = get_board_variant_gta02, .is_this_board = is_this_board_gta02, .port_init = port_init_gta02, + .post_serial_init = post_serial_init_gta02, .putc = putc_gta02, .close = close_gta02, .get_ui_keys = get_ui_keys_gta02, diff --git a/qiboot/src/phase2.c b/qiboot/src/phase2.c index de20cd3..1fe96b8 100644 --- a/qiboot/src/phase2.c +++ b/qiboot/src/phase2.c @@ -450,6 +450,11 @@ static void try_this_kernel(void) void bootloader_second_phase(void) { + /* give device a chance to print device-specific things */ + + if (this_board->post_serial_init) + (this_board->post_serial_init)(); + /* we try the possible kernels for this board in order */ for (this_kernel = this_board->kernel_source; this_kernel->name;