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