diff options
author | Scott Branden <scott.branden@broadcom.com> | 2016-07-08 12:09:23 -0700 |
---|---|---|
committer | Sheetal Tigadoli <sheetal.tigadoli@broadcom.com> | 2020-04-01 12:36:02 +0530 |
commit | 5c38088881ffd10f9a2dc1cc2af7300295eb6f04 (patch) | |
tree | 9b7da6ddbdce68732fa27c169b93d762dd8e7bca /drivers/io/io_fip.c | |
parent | 0edfd3772a6d0e0dd68f5e650eb93c441e05e685 (diff) | |
download | platform_external_arm-trusted-firmware-5c38088881ffd10f9a2dc1cc2af7300295eb6f04.tar.gz platform_external_arm-trusted-firmware-5c38088881ffd10f9a2dc1cc2af7300295eb6f04.tar.bz2 platform_external_arm-trusted-firmware-5c38088881ffd10f9a2dc1cc2af7300295eb6f04.zip |
drivers: Add support to retrieve plat_toc_flags
Add support to retrieve plat_toc_flags value from FIP header flags.
plat_toc_flags is for platform specific use. It is stored in
FIP header by fiptool using --plat-toc-flags option.
Change-Id: Ibadd91b4f28e6503f4426e4efd404bbe512ad124
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Sheetal Tigadoli <sheetal.tigadoli@broadcom.com>
Diffstat (limited to 'drivers/io/io_fip.c')
-rw-r--r-- | drivers/io/io_fip.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/drivers/io/io_fip.c b/drivers/io/io_fip.c index 5d49fffaa..02f85d603 100644 --- a/drivers/io/io_fip.c +++ b/drivers/io/io_fip.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2019, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2014-2020, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -46,6 +46,7 @@ typedef struct { */ typedef struct { uintptr_t dev_spec; + uint16_t plat_toc_flag; } fip_dev_state_t; static const uuid_t uuid_null; @@ -220,6 +221,11 @@ static int fip_dev_init(io_dev_info_t *dev_info, const uintptr_t init_params) uintptr_t backend_handle; fip_toc_header_t header; size_t bytes_read; + fip_dev_state_t *state; + + assert(dev_info != NULL); + + state = (fip_dev_state_t *)dev_info->info; /* Obtain a reference to the image by querying the platform layer */ result = plat_get_image_source(image_id, &backend_dev_handle, @@ -248,6 +254,11 @@ static int fip_dev_init(io_dev_info_t *dev_info, const uintptr_t init_params) result = -ENOENT; } else { VERBOSE("FIP header looks OK.\n"); + /* + * Store 16-bit Platform ToC flags field which occupies + * bits [32-47] in fip header. + */ + state->plat_toc_flag = (header.flags >> 32) & 0xffff; } } @@ -453,3 +464,17 @@ int register_io_dev_fip(const io_dev_connector_t **dev_con) return result; } + +/* Function to retrieve plat_toc_flags, previously saved in FIP dev */ +int fip_dev_get_plat_toc_flag(io_dev_info_t *dev_info, uint16_t *plat_toc_flag) +{ + fip_dev_state_t *state; + + assert(dev_info != NULL); + + state = (fip_dev_state_t *)dev_info->info; + + *plat_toc_flag = state->plat_toc_flag; + + return 0; +} |