adi.h 1005 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef __ADI_H__
  2. #define __ADI_H__
  3. #include "swd_probe_app.h"
  4. #define ARM_ID 0x23B
  5. #define ARCH_ID(architect, archid) ((architect) << 21) | (archid)
  6. #define BIT(nr) (1UL << (nr))
  7. #define ARM_CS_C9_DEVARCH_PRESENT BIT(20)
  8. #define ARM_CS_C9_DEVARCH_ARCHITECT_MASK (0xFFE00000)
  9. #define ARM_CS_C9_DEVARCH_ARCHID_MASK (0x0000FFFF)
  10. #define DEVARCH_ID_MASK (ARM_CS_C9_DEVARCH_ARCHITECT_MASK | ARM_CS_C9_DEVARCH_ARCHID_MASK)
  11. typedef struct {
  12. uint16_t designer;
  13. uint16_t part;
  14. uint8_t revision;
  15. uint8_t cmod;
  16. uint8_t revand;
  17. uint8_t size;
  18. } pidr_data_t;
  19. typedef enum { CIDR_CLASS_ROMTABLE = 0x01, CIDR_CLASS_CORESIGHT = 0x09 } cidr_classes_t;
  20. uint32_t adi_romtable_entry_count(AppFSM* const ctx, uint32_t base);
  21. uint32_t adi_romtable_get(AppFSM* const ctx, uint32_t base, uint32_t pos);
  22. bool adi_is_romtable(AppFSM* const ctx, uint32_t base);
  23. const char* adi_romtable_type(AppFSM* const ctx, uint32_t base);
  24. const char* adi_romtable_full(AppFSM* const ctx, uint32_t base);
  25. #endif