summaryrefslogtreecommitdiffstats
path: root/plat/st/common/include/stm32cubeprogrammer.h
blob: 0f5a64d45168199e84d79f06ab1157112c49155f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * Copyright (c) 2021, STMicroelectronics - All Rights Reserved
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#ifndef STM32CUBEPROGRAMMER_H
#define STM32CUBEPROGRAMMER_H

#include <stdint.h>

#include <usb_dfu.h>

/* Phase definition */
#define PHASE_FLASHLAYOUT	0U
#define PHASE_SSBL		3U
#define PHASE_CMD		0xF1U
#define PHASE_RESET		0xFFU

/* Functions provided by plat */
uint8_t usb_dfu_get_phase(uint8_t alt);

int stm32cubeprog_usb_load(struct usb_handle *usb_core_handle,
			   uintptr_t ssbl_base,
			   size_t ssbl_len);

int stm32cubeprog_uart_load(uintptr_t instance, uintptr_t base, size_t len);

#endif /* STM32CUBEPROGRAMMER_H */