emmc_def.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright (c) 2015-2017, Renesas Electronics Corporation. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. /**
  7. * @file emmc_def.h
  8. * @brief eMMC boot is expecting this header file
  9. *
  10. */
  11. #ifndef EMMC_DEF_H
  12. #define EMMC_DEF_H
  13. #include "emmc_std.h"
  14. /* ************************ HEADER (INCLUDE) SECTION *********************** */
  15. /* ***************** MACROS, CONSTANTS, COMPILATION FLAGS ****************** */
  16. #define EMMC_POWER_ON (1U)
  17. /* ********************** STRUCTURES, TYPE DEFINITIONS ********************* */
  18. /* ********************** DECLARATION OF EXTERNAL DATA ********************* */
  19. extern st_mmc_base mmc_drv_obj;
  20. /* ************************** FUNCTION PROTOTYPES ************************** */
  21. /** @brief for assembler program
  22. */
  23. uint32_t _rom_emmc_finalize(void);
  24. /** @brief eMMC driver API
  25. */
  26. EMMC_ERROR_CODE rcar_emmc_init(void);
  27. EMMC_ERROR_CODE emmc_terminate(void);
  28. EMMC_ERROR_CODE rcar_emmc_memcard_power(uint8_t mode);
  29. EMMC_ERROR_CODE rcar_emmc_mount(void);
  30. EMMC_ERROR_CODE emmc_set_request_mmc_clock(uint32_t *freq);
  31. EMMC_ERROR_CODE emmc_send_idle_cmd(uint32_t arg);
  32. EMMC_ERROR_CODE emmc_select_partition(EMMC_PARTITION_ID id);
  33. EMMC_ERROR_CODE emmc_read_sector(uint32_t *buff_address_virtual,
  34. uint32_t sector_number, uint32_t count,
  35. uint32_t feature_flags);
  36. EMMC_ERROR_CODE emmc_write_sector(uint32_t *buff_address_virtual,
  37. uint32_t sector_number, uint32_t count,
  38. uint32_t feature_flags);
  39. EMMC_ERROR_CODE emmc_erase_sector(uint32_t *start_address,
  40. uint32_t *end_address);
  41. uint32_t emmc_bit_field(uint8_t *data, uint32_t top, uint32_t bottom);
  42. /** @brief interrupt service
  43. */
  44. uint32_t emmc_interrupt(void);
  45. /** @brief DMA
  46. */
  47. /** @brief send command API
  48. */
  49. EMMC_ERROR_CODE emmc_exec_cmd(uint32_t error_mask, uint32_t *response);
  50. void emmc_make_nontrans_cmd(HAL_MEMCARD_COMMAND cmd, uint32_t arg);
  51. void emmc_make_trans_cmd(HAL_MEMCARD_COMMAND cmd, uint32_t arg,
  52. uint32_t *buff_address_virtual, uint32_t len,
  53. HAL_MEMCARD_OPERATION dir,
  54. HAL_MEMCARD_DATA_TRANSFER_MODE transfer_mode);
  55. EMMC_ERROR_CODE emmc_set_ext_csd(uint32_t arg);
  56. /** @brief for error information
  57. */
  58. void emmc_write_error_info(uint16_t func_no, EMMC_ERROR_CODE error_code);
  59. void emmc_write_error_info_func_no(uint16_t func_no);
  60. /* ********************************* CODE ********************************** */
  61. #endif /* EMMC_DEF_H */
  62. /* ******************************** END ************************************ */