1 /* 2 * Copyright (c) 2021-2025, STMicroelectronics - All Rights Reserved 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef STM32CUBEPROGRAMMER_H 8 #define STM32CUBEPROGRAMMER_H 9 10 #include <stdint.h> 11 12 #include <usb_dfu.h> 13 14 /* Phase definition */ 15 #define PHASE_FLASHLAYOUT 0U 16 #define PHASE_DDR_FW 2U 17 #define PHASE_SSBL 3U 18 #define PHASE_CMD 0xF1U 19 #define PHASE_RESET 0xFFU 20 21 /* Functions provided by plat */ 22 uint8_t usb_dfu_get_phase(uint8_t alt); 23 24 int stm32cubeprog_usb_load(struct usb_handle *usb_core_handle, 25 uint8_t phase, 26 uintptr_t ssbl_base, 27 size_t ssbl_len); 28 29 int stm32cubeprog_uart_load(uintptr_t instance, uint8_t phase, 30 uintptr_t base, size_t len); 31 32 #endif /* STM32CUBEPROGRAMMER_H */ 33