blob: 95d2b4a807f0b30821c2395b95df986b66ea18fa [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/**
2* @file upi_mtd.h
3* @brief °æ±¾·ÖÇøÅäÖÃÐÅÏ¢
4*
5* Copyright (C) 2017 Sanechips Technology Co., Ltd.
6* @author
7*
8*/
9
10#ifndef _UPI_MTD_H
11#define _UPI_MTD_H
12
13/*******************************************************************************
14 * Include header files *
15 ******************************************************************************/
16
17#include "upi_img_interface.h"
18#include "upi_update.h"
19/*******************************************************************************
20 * Macro definitions *
21 ******************************************************************************/
22
23
24/*******************************************************************************
25 * Type definitions *
26 ******************************************************************************/
27
lh758261d2023-07-13 05:52:04 -070028typedef enum
29{
30 DEVICE_MTD = 0,
31 DEVICE_ZFTL = 1,
32 DEVICE_MTD_BLOCK,
33 DEVICE_UNKNOWN,
lh9ed821d2023-04-07 01:36:19 -070034} device_type_t;
35
36/*******************************************************************************
37 * Global variable declarations *
38 ******************************************************************************/
39
40
41/*******************************************************************************
42 * Global function declarations *
43 ******************************************************************************/
44
45/**
46 * @brief
47 * @note
48 */
49
50int mtd_find(const char *i_parti_name, char *o_mtd_path, device_type_t device_type, unsigned int o_mtd_path_len);
51int get_partition_update_info(int target, const char *partition_name, device_data_t *device_data);
52int mtd_erase_partition(int target, const char*partition_name);
53int is_partition_exist(int target, char * partition_name);
54
55/**
56 * @brief
57 * @note
58 */
59
60int write_mtd_partition_data(partition_mtd_info_t *mtd_info, int offset, int len, unsigned char *write_data);
61int read_mtd_partition_data(partition_mtd_info_t *mtd_info, int offset, int len, char * read_data);
62
63
64int get_partition_mtd_info(const char *partition_name, int partition_type, partition_mtd_info_t *mtd_info);
65
66
67/*******************************************************************************
68 * Inline function implementations *
69 ******************************************************************************/
70
71
72
73
74#endif // _UPI_MTD_H
75