hal_hw_map.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _HAL_HW_MAP_H_
  13. #define _HAL_HW_MAP_H_
  14. #include <stdint.h>
  15. #include <stdbool.h>
  16. #include <stddef.h>
  17. #include "hal_config.h"
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. /**
  22. * \brief properties to be set for blue screen dump regions
  23. */
  24. typedef enum
  25. {
  26. HAL_BS_REGION_IGNORE = (1 << 0), ///< the region should be ignored
  27. HAL_BS_REGION_FLASH = (1 << 1), ///< the region is flash
  28. HAL_BS_REGION_ZSP = (1 << 2), ///< the region is in zsp power domain
  29. HAL_BS_REGION_GGE = (1 << 3), ///< the region is in gge power domain
  30. HAL_BS_REGION_LTE = (1 << 4), ///< the region is in zsp power domain
  31. HAL_BS_REGION_WCN = (1 << 5), ///< the region is in wcn power domain
  32. HAL_BS_REGION_RFDIG = (1 << 6), ///< the region is in rfdig power domain
  33. HAL_BS_REGION_END = (1 << 31), ///< the end of regions
  34. } halBsDumpRegionFlags_t;
  35. /**
  36. * \brief address range in [start, end]
  37. *
  38. * The end address is inclusive. For example, a range from 0x100000, with
  39. * size of 0x100000 should be expressed as:
  40. *
  41. * \code{.cpp}
  42. * halAddressRange_t range = {
  43. * .start = 0x100000,
  44. * .end = 0x1fffff,
  45. * };
  46. * \endcode
  47. */
  48. typedef struct
  49. {
  50. uint32_t start; ///< start address, inclusive
  51. uint32_t end; ///< end address, inclusive
  52. } halAddressRange_t;
  53. /**
  54. * \brief blue screen dump region
  55. *
  56. * One or more property bits can be set for each region. At blue screen dump,
  57. * region can be ignored. For example, if the region is in power off power
  58. * domain.
  59. */
  60. typedef struct
  61. {
  62. uint32_t address; ///< start address, inclusive
  63. uint32_t size; ///< size
  64. uint32_t property; ///< properties
  65. } halBsDumpRegion_t;
  66. /**
  67. * \brief whether the specified address are accessible
  68. *
  69. * Typically, this will only be called during process debug commands from
  70. * PC. And it will avoid to access non-accessible addresses.
  71. *
  72. * \param address start address
  73. * \param size range size
  74. * \return
  75. * - true if the whole region is accessible
  76. * - false if some of the region is non-accessible.
  77. */
  78. bool halHwMapValid(uint32_t address, size_t size);
  79. /**
  80. * \brief get regions for blue screen dump
  81. *
  82. * The last region will be marked as \p HAL_BS_REGION_END.
  83. *
  84. * \return blue screen dump regions
  85. */
  86. const halBsDumpRegion_t *halHwBsDumpRegions(void);
  87. #ifdef __cplusplus
  88. }
  89. #endif
  90. #endif