bl_aux_params.c 770 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2019, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <inttypes.h>
  7. #include <stdint.h>
  8. #include <common/debug.h>
  9. #include <lib/coreboot.h>
  10. #include <lib/bl_aux_params/bl_aux_params.h>
  11. void bl_aux_params_parse(u_register_t head,
  12. bl_aux_param_handler_t handler)
  13. {
  14. struct bl_aux_param_header *p;
  15. for (p = (void *)head; p; p = (void *)(uintptr_t)p->next) {
  16. if (handler && handler(p))
  17. continue;
  18. switch (p->type) {
  19. #if COREBOOT
  20. case BL_AUX_PARAM_COREBOOT_TABLE:
  21. coreboot_table_setup((void *)(uintptr_t)
  22. ((struct bl_aux_param_uint64 *)p)->value);
  23. break;
  24. #endif
  25. default:
  26. ERROR("Ignoring unknown BL aux parameter: 0x%" PRIx64,
  27. p->type);
  28. break;
  29. }
  30. }
  31. }