Driver_Storage.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. #include "Driver_Storage.h"
  19. #define ARM_STORAGE_DRV_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(1, 0) /* driver version */
  20. /* Driver Version */
  21. static const ARM_DRIVER_VERSION DriverVersion = {
  22. ARM_STORAGE_API_VERSION,
  23. ARM_STORAGE_DRV_VERSION
  24. };
  25. /* Driver Capabilities */
  26. static const ARM_STORAGE_CAPABILITIES DriverCapabilities = {
  27. 0, /* Asynchronous Mode */
  28. 0, /* Supports EraseAll operation */
  29. 0 /* Reserved */
  30. };
  31. //
  32. // Functions
  33. //
  34. static ARM_DRIVER_VERSION ARM_Storage_GetVersion (void) {
  35. return DriverVersion;
  36. }
  37. static ARM_STORAGE_CAPABILITIES ARM_Storage_GetCapabilities (void) {
  38. return DriverCapabilities;
  39. }
  40. static int32_t ARM_Storage_Initialize (ARM_Storage_Callback_t callback) {
  41. }
  42. static int32_t ARM_Storage_Uninitialize (void) {
  43. }
  44. static int32_t ARM_Storage_PowerControl (ARM_POWER_STATE state)
  45. {
  46. switch (state)
  47. {
  48. case ARM_POWER_OFF:
  49. break;
  50. case ARM_POWER_LOW:
  51. break;
  52. case ARM_POWER_FULL:
  53. break;
  54. }
  55. return ARM_DRIVER_OK;
  56. }
  57. static int32_t ARM_Storage_ReadData (uint64_t addr, void *data, uint32_t size) {
  58. }
  59. static int32_t ARM_Storage_ProgramData (uint64_t addr, const void *data, uint32_t size) {
  60. }
  61. static int32_t ARM_Storage_Erase (uint64_t addr, uint32_t size) {
  62. }
  63. static int32_t ARM_Storage_EraseAll (void) {
  64. }
  65. static ARM_STORAGE_STATUS ARM_Storage_GetStatus (void) {
  66. }
  67. static int32_t ARM_Storage_GetInfo (ARM_STORAGE_INFO *info) {
  68. }
  69. static uint32_t ARM_Storage_ResolveAddress(uint64_t addr) {
  70. }
  71. static int32_t ARM_Storage_GetNextBlock(const ARM_STORAGE_BLOCK* prev_block, ARM_STORAGE_BLOCK *next_block) {
  72. }
  73. static int32_t ARM_Storage_GetBlock(uint64_t addr, ARM_STORAGE_BLOCK *block) {
  74. }
  75. // End Storage Interface
  76. extern \
  77. ARM_DRIVER_STORAGE Driver_Storage0;
  78. ARM_DRIVER_STORAGE Driver_Storage0 = {
  79. ARM_Storage_GetVersion,
  80. ARM_Storage_GetCapabilities,
  81. ARM_Storage_Initialize,
  82. ARM_Storage_Uninitialize,
  83. ARM_Storage_PowerControl,
  84. ARM_Storage_ReadData,
  85. ARM_Storage_ProgramData,
  86. ARM_Storage_Erase,
  87. ARM_Storage_EraseAll,
  88. ARM_Storage_GetStatus,
  89. ARM_Storage_GetInfo,
  90. ARM_Storage_ResolveAddress,
  91. ARM_Storage_GetNextBlock,
  92. ARM_Storage_GetBlock
  93. };