Driver_Storage.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. * Copyright (c) 2013-2018 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. 1, /* Asynchronous Mode */
  28. 1, /* Supports EraseAll operation */
  29. 0 /* Reserved */
  30. };
  31. //
  32. // Functions
  33. //
  34. ARM_DRIVER_VERSION ARM_Storage_GetVersion (void) {
  35. }
  36. ARM_STORAGE_CAPABILITIES ARM_Storage_GetCapabilities (void) {
  37. }
  38. int32_t ARM_Storage_Initialize (ARM_Storage_Callback_t callback) {
  39. }
  40. int32_t ARM_Storage_Uninitialize (void) {
  41. }
  42. int32_t ARM_Storage_PowerControl (ARM_POWER_STATE state)
  43. {
  44. switch (state)
  45. {
  46. case ARM_POWER_OFF:
  47. break;
  48. case ARM_POWER_LOW:
  49. break;
  50. case ARM_POWER_FULL:
  51. break;
  52. default:
  53. return ARM_DRIVER_ERROR_UNSUPPORTED;
  54. }
  55. }
  56. int32_t ARM_Storage_ReadData (uint64_t addr, void *data, uint32_t size) {
  57. }
  58. int32_t ARM_Storage_ProgramData (uint64_t addr, const void *data, uint32_t size) {
  59. }
  60. int32_t ARM_Storage_Erase (uint64_t addr, uint32_t size) {
  61. }
  62. int32_t ARM_Storage_EraseAll (void) {
  63. }
  64. ARM_STORAGE_STATUS ARM_Storage_GetStatus (void) {
  65. }
  66. int32_t ARM_Storage_GetInfo (ARM_STORAGE_INFO *info) {
  67. }
  68. uint32_t ARM_Storage_ResolveAddress(uint64_t addr) {
  69. }
  70. int32_t ARM_Storage_GetNextBlock(const ARM_STORAGE_BLOCK* prev_block, ARM_STORAGE_BLOCK *next_block) {
  71. }
  72. int32_t ARM_Storage_GetBlock(uint64_t addr, ARM_STORAGE_BLOCK *block) {
  73. }
  74. // End Storage Interface
  75. ARM_DRIVER_STORAGE Driver_STORAGE = {
  76. ARM_Storage_GetVersion,
  77. ARM_Storage_GetCapabilities,
  78. ARM_Storage_Initialize,
  79. ARM_Storage_Uninitialize,
  80. ARM_Storage_PowerControl,
  81. ARM_Storage_ReadData,
  82. ARM_Storage_ProgramData,
  83. ARM_Storage_Erase,
  84. ARM_Storage_EraseAll,
  85. ARM_Storage_GetStatus,
  86. ARM_Storage_GetInfo,
  87. ARM_Storage_ResolveAddress,
  88. ARM_Storage_GetNextBlock,
  89. ARM_Storage_GetBlock
  90. };