Set the FIT pointer to a FIT table. */
| 541 | |
| 542 | /* Set the FIT pointer to a FIT table. */ |
| 543 | int 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. |
no test coverage detected