Julius Werner | dbba2b3 | 2019-05-24 20:31:15 -0700 | [diff] [blame] | 1 | /* |
Govindraj Raja | eee28e7 | 2023-08-01 15:52:40 -0500 | [diff] [blame] | 2 | * Copyright (c) 2019, Arm Limited and Contributors. All rights reserved. |
Julius Werner | dbba2b3 | 2019-05-24 20:31:15 -0700 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
Scott Branden | e5dcf98 | 2020-08-25 13:49:32 -0700 | [diff] [blame] | 6 | #include <inttypes.h> |
| 7 | #include <stdint.h> |
Julius Werner | dbba2b3 | 2019-05-24 20:31:15 -0700 | [diff] [blame] | 8 | |
| 9 | #include <common/debug.h> |
| 10 | #include <lib/coreboot.h> |
| 11 | #include <lib/bl_aux_params/bl_aux_params.h> |
| 12 | |
| 13 | void 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 Branden | e5dcf98 | 2020-08-25 13:49:32 -0700 | [diff] [blame] | 30 | ERROR("Ignoring unknown BL aux parameter: 0x%" PRIx64, |
Julius Werner | dbba2b3 | 2019-05-24 20:31:15 -0700 | [diff] [blame] | 31 | p->type); |
| 32 | break; |
| 33 | } |
| 34 | } |
| 35 | } |