1 /*
2 * Copyright (c) 2013-2020 Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Licensed under the Apache License, Version 2.0 (the License); you may
7 * not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19
20 #include "Driver_Storage.h"
21
22 #define ARM_STORAGE_DRV_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(1, 0) /* driver version */
23
24 /* Driver Version */
25 static const ARM_DRIVER_VERSION DriverVersion = {
26 ARM_STORAGE_API_VERSION,
27 ARM_STORAGE_DRV_VERSION
28 };
29
30 /* Driver Capabilities */
31 static const ARM_STORAGE_CAPABILITIES DriverCapabilities = {
32 0, /* Asynchronous Mode */
33 0, /* Supports EraseAll operation */
34 0 /* Reserved */
35 };
36
37
38 //
39 // Functions
40 //
41
ARM_Storage_GetVersion(void)42 static ARM_DRIVER_VERSION ARM_Storage_GetVersion (void) {
43 return DriverVersion;
44 }
45
ARM_Storage_GetCapabilities(void)46 static ARM_STORAGE_CAPABILITIES ARM_Storage_GetCapabilities (void) {
47 return DriverCapabilities;
48 }
49
ARM_Storage_Initialize(ARM_Storage_Callback_t callback)50 static int32_t ARM_Storage_Initialize (ARM_Storage_Callback_t callback) {
51 }
52
ARM_Storage_Uninitialize(void)53 static int32_t ARM_Storage_Uninitialize (void) {
54 }
55
ARM_Storage_PowerControl(ARM_POWER_STATE state)56 static int32_t ARM_Storage_PowerControl (ARM_POWER_STATE state)
57 {
58 switch (state)
59 {
60 case ARM_POWER_OFF:
61 break;
62
63 case ARM_POWER_LOW:
64 break;
65
66 case ARM_POWER_FULL:
67 break;
68 }
69 return ARM_DRIVER_OK;
70 }
71
ARM_Storage_ReadData(uint64_t addr,void * data,uint32_t size)72 static int32_t ARM_Storage_ReadData (uint64_t addr, void *data, uint32_t size) {
73 }
74
ARM_Storage_ProgramData(uint64_t addr,const void * data,uint32_t size)75 static int32_t ARM_Storage_ProgramData (uint64_t addr, const void *data, uint32_t size) {
76 }
77
ARM_Storage_Erase(uint64_t addr,uint32_t size)78 static int32_t ARM_Storage_Erase (uint64_t addr, uint32_t size) {
79 }
80
ARM_Storage_EraseAll(void)81 static int32_t ARM_Storage_EraseAll (void) {
82 }
83
ARM_Storage_GetStatus(void)84 static ARM_STORAGE_STATUS ARM_Storage_GetStatus (void) {
85 }
86
ARM_Storage_GetInfo(ARM_STORAGE_INFO * info)87 static int32_t ARM_Storage_GetInfo (ARM_STORAGE_INFO *info) {
88 }
89
ARM_Storage_ResolveAddress(uint64_t addr)90 static uint32_t ARM_Storage_ResolveAddress(uint64_t addr) {
91 }
92
ARM_Storage_GetNextBlock(const ARM_STORAGE_BLOCK * prev_block,ARM_STORAGE_BLOCK * next_block)93 static int32_t ARM_Storage_GetNextBlock(const ARM_STORAGE_BLOCK* prev_block, ARM_STORAGE_BLOCK *next_block) {
94 }
95
ARM_Storage_GetBlock(uint64_t addr,ARM_STORAGE_BLOCK * block)96 static int32_t ARM_Storage_GetBlock(uint64_t addr, ARM_STORAGE_BLOCK *block) {
97 }
98
99 // End Storage Interface
100
101 extern \
102 ARM_DRIVER_STORAGE Driver_Storage0;
103 ARM_DRIVER_STORAGE Driver_Storage0 = {
104 ARM_Storage_GetVersion,
105 ARM_Storage_GetCapabilities,
106 ARM_Storage_Initialize,
107 ARM_Storage_Uninitialize,
108 ARM_Storage_PowerControl,
109 ARM_Storage_ReadData,
110 ARM_Storage_ProgramData,
111 ARM_Storage_Erase,
112 ARM_Storage_EraseAll,
113 ARM_Storage_GetStatus,
114 ARM_Storage_GetInfo,
115 ARM_Storage_ResolveAddress,
116 ARM_Storage_GetNextBlock,
117 ARM_Storage_GetBlock
118 };
119