boardid: Minor clean up and standardization

Merge the different coreboot table strapping ID structures into one
because they're really just all the same, and I want to add more. Make
the signature of the board_id() function return a uint32_t because
that's also what goes in the coreboot table. Add a printk to the generic
code handling strapping IDs in ramstage so that not every individual
mainboard implementation needs its own print. (In turn, remove one such
print from fsp1_1 code because it's in the way of my next patch.)

Change-Id: Ib9563edf07b623a586a4dc168fe357564c5e68b5
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/22741
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Julius Werner
2017-12-05 13:39:10 -08:00
parent ec477346bf
commit e2f17f782f
22 changed files with 40 additions and 46 deletions

View File

@ -247,13 +247,16 @@ static inline void lb_vboot_handoff(struct lb_header *header) {}
static void lb_board_id(struct lb_header *header)
{
#if IS_ENABLED(CONFIG_BOARD_ID_AUTO)
struct lb_board_id *bid;
struct lb_strapping_id *rec;
uint32_t bid = board_id();
bid = (struct lb_board_id *)lb_new_record(header);
rec = (struct lb_strapping_id *)lb_new_record(header);
bid->tag = LB_TAG_BOARD_ID;
bid->size = sizeof(*bid);
bid->board_id = board_id();
rec->tag = LB_TAG_BOARD_ID;
rec->size = sizeof(*rec);
rec->id_code = bid;
printk(BIOS_INFO, "Board ID: %d\n", bid);
#endif
}
@ -289,13 +292,16 @@ static void lb_boot_media_params(struct lb_header *header)
static void lb_ram_code(struct lb_header *header)
{
#if IS_ENABLED(CONFIG_RAM_CODE_SUPPORT)
struct lb_ram_code *code;
struct lb_strapping_id *rec;
uint32_t code = ram_code();
code = (struct lb_ram_code *)lb_new_record(header);
rec = (struct lb_strapping_id *)lb_new_record(header);
code->tag = LB_TAG_RAM_CODE;
code->size = sizeof(*code);
code->ram_code = ram_code();
rec->tag = LB_TAG_RAM_CODE;
rec->size = sizeof(*rec);
rec->id_code = code;
printk(BIOS_INFO, "RAM code: %d\n", code);
#endif
}