blob: a856ffbbca38471b54f886e3b24bb1868bf0d225 [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
28typedef enum {
29 DEVICE_MTD = 0,
30 DEVICE_ZFTL = 1,
31 DEVICE_MTD_BLOCK,
32 DEVICE_UNKNOWN,
33} device_type_t;
34
35/*******************************************************************************
36 * Global variable declarations *
37 ******************************************************************************/
38
39
40/*******************************************************************************
41 * Global function declarations *
42 ******************************************************************************/
43
44/**
45 * @brief
46 * @note
47 */
48
49int mtd_find(const char *i_parti_name, char *o_mtd_path, device_type_t device_type, unsigned int o_mtd_path_len);
50int get_partition_update_info(int target, const char *partition_name, device_data_t *device_data);
51int mtd_erase_partition(int target, const char*partition_name);
52int is_partition_exist(int target, char * partition_name);
53
54/**
55 * @brief
56 * @note
57 */
58
59int write_mtd_partition_data(partition_mtd_info_t *mtd_info, int offset, int len, unsigned char *write_data);
60int read_mtd_partition_data(partition_mtd_info_t *mtd_info, int offset, int len, char * read_data);
61
62
63int get_partition_mtd_info(const char *partition_name, int partition_type, partition_mtd_info_t *mtd_info);
64
65
66/*******************************************************************************
67 * Inline function implementations *
68 ******************************************************************************/
69
70
71
72
73#endif // _UPI_MTD_H
74