Yann Gautier | eb16b47 | 2018-10-15 09:36:32 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef IO_STM32IMAGE_H |
| 8 | #define IO_STM32IMAGE_H |
| 9 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 10 | #include <drivers/io/io_driver.h> |
| 11 | #include <drivers/partition/partition.h> |
Yann Gautier | eb16b47 | 2018-10-15 09:36:32 +0200 | [diff] [blame] | 12 | |
| 13 | #define MAX_LBA_SIZE 512 |
| 14 | #define MAX_PART_NAME_SIZE (EFI_NAMELEN + 1) |
| 15 | #define STM32_PART_NUM (PLAT_PARTITION_MAX_ENTRIES - STM32_TF_A_COPIES) |
| 16 | |
| 17 | struct stm32image_part_info { |
| 18 | char name[MAX_PART_NAME_SIZE]; |
| 19 | uint32_t binary_type; |
| 20 | uintptr_t part_offset; |
| 21 | uint32_t bkp_offset; |
| 22 | }; |
| 23 | |
| 24 | struct stm32image_device_info { |
| 25 | struct stm32image_part_info part_info[STM32_PART_NUM]; |
Lionel Debieve | 496393a | 2019-09-24 17:46:37 +0200 | [diff] [blame] | 26 | unsigned long long device_size; |
Yann Gautier | eb16b47 | 2018-10-15 09:36:32 +0200 | [diff] [blame] | 27 | uint32_t lba_size; |
| 28 | }; |
| 29 | |
| 30 | int register_io_dev_stm32image(const io_dev_connector_t **dev_con); |
| 31 | |
| 32 | #endif /* IO_STM32IMAGE_H */ |