1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-25 15:59:21 +02:00

qi-add-post-serial-init-api.patch

It can be useful to have a device API that can print device-specific things
after serial is initialized.

Signed-off-by: Andy Green <andy@openmoko.com>
This commit is contained in:
Andy Green 2009-02-03 18:06:36 +00:00 committed by Andy Green
parent 53279b5983
commit dd2344a9c7
3 changed files with 16 additions and 0 deletions

View File

@ -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);

View File

@ -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,

View File

@ -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;