Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 1 | /* |
Manish V Badarkhe | ef507e4 | 2020-06-05 08:41:42 +0100 | [diff] [blame] | 2 | * Copyright (c) 2018-2020, Arm Limited. All rights reserved. |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef __FWU_NVM_H__ |
| 8 | #define __FWU_NVM_H__ |
| 9 | |
| 10 | #include <nvm.h> |
| 11 | #include <platform_def.h> |
| 12 | |
| 13 | #define FIP_IMAGE_UPDATE_DONE_FLAG (0xDEADBEEF) |
Manish V Badarkhe | ef507e4 | 2020-06-05 08:41:42 +0100 | [diff] [blame] | 14 | |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 15 | #define FWU_TFTF_TESTCASE_BUFFER_OFFSET \ |
| 16 | (TFTF_NVM_OFFSET + TFTF_STATE_OFFSET(testcase_buffer)) |
| 17 | |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 18 | /* Writes the buffer to the flash at offset with length equal to |
| 19 | * size |
| 20 | * Returns: STATUS_FAIL, STATUS_SUCCESS, STATUS_OUT_OF_RESOURCES |
| 21 | */ |
| 22 | STATUS fwu_nvm_write(unsigned long long offset, const void *buffer, size_t size); |
| 23 | |
| 24 | /* Reads the flash into buffer at offset with length equal to |
| 25 | * size |
| 26 | * Returns: STATUS_FAIL, STATUS_SUCCESS, STATUS_OUT_OF_RESOURCES |
| 27 | */ |
| 28 | STATUS fwu_nvm_read(unsigned long long offset, void *buffer, size_t size); |
| 29 | |
| 30 | /* |
| 31 | * This function is used to replace the original fip.bin |
| 32 | * by the backup fip.bin passed through fip_addr argument. |
| 33 | */ |
| 34 | STATUS fwu_update_fip(unsigned long fip_addr); |
| 35 | |
| 36 | #endif /* __FWU_NVM_H__ */ |