MCPcopy Create free account
hub / github.com/coreboot/coreboot / set_fit_pointer

Function set_fit_pointer

util/cbfstool/fit.c:543–566  ·  view source on GitHub ↗

Set the FIT pointer to a FIT table. */

Source from the content-addressed store, hash-verified

541
542/* Set the FIT pointer to a FIT table. */
543int set_fit_pointer(struct buffer *bootblock,
544 const uint32_t fit_address,
545 fit_offset_converter_t offset_fn,
546 uint32_t topswap_size)
547{
548 struct fit_table *fit;
549 uint32_t *fit_pointer = get_fit_ptr(bootblock, offset_fn, topswap_size);
550
551 fit = rom_buffer_pointer(bootblock, ptr_to_offset(offset_fn, bootblock, fit_address));
552
553 if (fit_address < FIT_TABLE_LOWEST_ADDRESS) {
554 ERROR("FIT must be reside in the top 16MiB.\n");
555 return 1;
556 }
557
558 if (!fit_table_verified(fit)) {
559 ERROR("FIT not found at address.\n");
560 return 1;
561 }
562
563 fit_pointer[0] = fit_address;
564 fit_pointer[1] = 0;
565 return 0;
566}
567
568/*
569 * Return a pointer to the active FIT.

Callers 1

mainFunction · 0.85

Calls 4

get_fit_ptrFunction · 0.85
rom_buffer_pointerFunction · 0.85
ptr_to_offsetFunction · 0.85
fit_table_verifiedFunction · 0.85

Tested by

no test coverage detected