blob: 7f357b7c22259f44b942a053ce83022f2c43a58d [file] [log] [blame]
Julius Wernerdbba2b32019-05-24 20:31:15 -07001/*
2 * Copyright (c) 2019, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
Scott Brandene5dcf982020-08-25 13:49:32 -07006#include <inttypes.h>
7#include <stdint.h>
Julius Wernerdbba2b32019-05-24 20:31:15 -07008
9#include <common/debug.h>
10#include <lib/coreboot.h>
11#include <lib/bl_aux_params/bl_aux_params.h>
12
13void bl_aux_params_parse(u_register_t head,
14 bl_aux_param_handler_t handler)
15{
16 struct bl_aux_param_header *p;
17
18 for (p = (void *)head; p; p = (void *)(uintptr_t)p->next) {
19 if (handler && handler(p))
20 continue;
21
22 switch (p->type) {
23#if COREBOOT
24 case BL_AUX_PARAM_COREBOOT_TABLE:
25 coreboot_table_setup((void *)(uintptr_t)
26 ((struct bl_aux_param_uint64 *)p)->value);
27 break;
28#endif
29 default:
Scott Brandene5dcf982020-08-25 13:49:32 -070030 ERROR("Ignoring unknown BL aux parameter: 0x%" PRIx64,
Julius Wernerdbba2b32019-05-24 20:31:15 -070031 p->type);
32 break;
33 }
34 }
35}