blob: 1824821fad0d4ea846eb0b4b286430ab08696cb7
1 | /* |
2 | * \file storage_if.h |
3 | * \brief interfaces declarations for storage operations |
4 | * |
5 | * \version 1.0.0 |
6 | * \date 2013-7-16 |
7 | * \author Sam.Wu <yihui.wu@amlgic.com> |
8 | * |
9 | * Copyright (c) 2013 Amlogic. All Rights Reserved. |
10 | * |
11 | */ |
12 | #ifndef __STOARGE_IF_H__ |
13 | #define __STOARGE_IF_H__ |
14 | |
15 | |
16 | /*** |
17 | upgrade_read_ops: |
18 | |
19 | partition_name: env / logo / recovery /boot / system /cache /media |
20 | |
21 | ***/ |
22 | int store_read_ops(unsigned char *partition_name,unsigned char * buf, uint64_t off, uint64_t size); |
23 | |
24 | |
25 | /*** |
26 | upgrade_write_ops: |
27 | |
28 | partition_name: env / logo / recovery /boot / system /cache /media |
29 | |
30 | ***/ |
31 | int store_write_ops(unsigned char *partition_name,unsigned char * buf,uint64_t off, uint64_t size); |
32 | |
33 | |
34 | /*** |
35 | upgrade_write_ops: |
36 | |
37 | partition_name: env / logo / recovery /boot / system /cache /media |
38 | |
39 | ***/ |
40 | int store_get_partititon_size(unsigned char *partition_name, uint64_t *size); |
41 | |
42 | |
43 | /*** |
44 | upgrade_erase_ops: |
45 | |
46 | partition_name: boot / data |
47 | |
48 | flag = 0; indicate erase partition ; |
49 | flag = 1; indicate scurb whole nand; |
50 | |
51 | ***/ |
52 | int store_erase_ops(unsigned char *par_name, uint64_t off, uint64_t size, unsigned char flag); |
53 | |
54 | /*** |
55 | bootloader: |
56 | ***/ |
57 | int store_boot_read(unsigned char * buf, uint64_t off, uint64_t size); |
58 | |
59 | int store_boot_write(unsigned char * buf,uint64_t off, uint64_t size); |
60 | |
61 | int store_init(unsigned flag); |
62 | |
63 | int store_exit(void); |
64 | |
65 | //dtb read/write |
66 | //@rwFlag: 0---read, 1---write, 2---iread |
67 | int store_dtb_rw(void* buf, unsigned dtbSz, int rwFlag); |
68 | |
69 | //key read/write |
70 | int store_key_read(uint8_t * buffer, |
71 | uint32_t length, uint32_t *actual_lenth); |
72 | int store_key_write(uint8_t * buffer, |
73 | uint32_t length, uint32_t *actual_lenth); |
74 | |
75 | #endif//ifndef __STOARGE_IF_H__ |
76 | |
77 |