1 /*
2  * Copyright (C) 2015-2020 Alibaba Group Holding Limited
3  */
4 
5 #include "aos/hal/nor.h"
6 
7 
8 /**
9  * Initialises a nor flash interface
10  *
11  * @param[in]  nor  the interface which should be initialised
12  *
13  * @return  0 : on success, EIO : if an error occurred with any step
14  */
hal_nor_init(nor_dev_t * nor)15 int32_t hal_nor_init(nor_dev_t *nor)
16 {
17 	return 0;
18 }
19 
20 /**
21  * Deinitialises a nor flash interface
22  *
23  * @param[in]  nand  the interface which should be initialised
24  *
25  * @return  0 : on success, EIO : if an error occurred with any step
26  */
hal_nor_finalize(nor_dev_t * nor)27 int32_t hal_nor_finalize(nor_dev_t *nor)
28 {
29 	return 0;
30 }
31 
32 /**
33  * Read data from NOR memory
34  *
35  * @param[in]   nor   the interface which should be initialised
36  * @param[out]  data  pointer to the buffer which will store incoming data
37  * @param[in]   addr  nor memory address
38  * @param[in]   len   the number of bytes to read
39  *
40  * @return  0 : on success, EIO : if an error occurred with any step
41  */
hal_nor_read(nor_dev_t * nor,uint32_t * addr,uint8_t * data,uint32_t len)42 int32_t hal_nor_read(nor_dev_t *nor, uint32_t *addr, uint8_t *data, uint32_t len)
43 {
44 	return 0;
45 }
46 
47 
48 /**
49  * Write data to NOR memory
50  *
51  * @param[in]  nor   the interface which should be initialised
52  * @param[in]  data  pointer to source buffer to write
53  * @param[in]  addr  nor memory address
54  * @param[in]  len   the number of bytes to write
55  *
56  * @return  0 : on success, EIO : if an error occurred with any step
57  */
hal_nor_write(nor_dev_t * nor,uint32_t * addr,uint8_t * data,uint32_t len)58 int32_t hal_nor_write(nor_dev_t *nor, uint32_t *addr, uint8_t *data, uint32_t len)
59 {
60 	return 0;
61 }
62 
63 /*
64  * Erase the blocks of the NOR memory
65  *
66  * @param[in]  nor          the interface which should be initialised
67  * @param[in]  addr         nor memory address
68  * @param[in]  block_count  the number of block to erase
69  *
70  * @return  0 : on success, EIO : if an error occurred with any step
71  */
hal_nor_erase_block(nor_dev_t * nor,uint32_t * addr,uint32_t block_count)72 int32_t hal_nor_erase_block(nor_dev_t *nor, uint32_t *addr, uint32_t block_count)
73 {
74 	return 0;
75 }
76 
77 /*
78  * Erase the entire NOR chip
79  *
80  * @param[in]  nor   the interface which should be initialised
81  * @param[in]  addr  nor memory address
82  *
83  * @return  0 : on success, EIO : if an error occurred with any step
84  */
hal_nor_erase_chip(nor_dev_t * nor,uint32_t * addr)85 int32_t hal_nor_erase_chip(nor_dev_t *nor, uint32_t *addr)
86 {
87 	return 0;
88 }
89 
90