lockbox.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Lockbox/Security Masks
  3. */
  4. #ifndef __BFIN_PERIPHERAL_LOCKBOX__
  5. #define __BFIN_PERIPHERAL_LOCKBOX__
  6. #ifndef __ASSEMBLY__
  7. #include "bootrom.h"
  8. /* SESR argument structure. Expected to reside at 0xFF900018. */
  9. typedef struct SESR_args {
  10. unsigned short usFlags; /* security firmware flags */
  11. unsigned short usIRQMask; /* interrupt mask */
  12. unsigned long ulMessageSize; /* message length in bytes */
  13. unsigned long ulSFEntryPoint; /* entry point of secure function */
  14. unsigned long ulMessagePtr; /* pointer to the buffer containing
  15. the digital signature and message */
  16. unsigned long ulReserved1; /* reserved */
  17. unsigned long ulReserved2; /* reserved */
  18. } tSESR_args;
  19. /* Secure Entry Service Routine */
  20. static void (* const sesr)(void) = (void *)_BOOTROM_SESR;
  21. #endif
  22. /* SESR flags argument bitfields */
  23. #define SESR_FLAGS_STAY_AT_NMI 0x0000
  24. #define SESR_FLAGS_DROP_BELOW_NMI 0x0001
  25. #define SESR_FLAGS_NO_SF_DMA 0x0000
  26. #define SESR_FLAGS_DMA_SF_TO_RUN_DEST 0x0002
  27. #define SESR_FLAGS_USE_ADI_PUB_KEY 0x0000
  28. #define SESR_FLAGS_USE_CUST_PUB_KEY 0x0100
  29. /* Bit masks for SECURE_SYSSWT */
  30. #define EMUDABL 0x00000001 /* Emulation Disable */
  31. #define RSTDABL 0x00000002 /* Reset Disable */
  32. #define L1IDABL 0x0000001c /* L1 Instruction Memory Disable */
  33. #define L1DADABL 0x000000e0 /* L1 Data Bank A Memory Disable */
  34. #define L1DBDABL 0x00000700 /* L1 Data Bank B Memory Disable */
  35. #define DMA0OVR 0x00000800 /* DMA0 Memory Access Override */
  36. #define DMA1OVR 0x00001000 /* DMA1 Memory Access Override */
  37. #define EMUOVR 0x00004000 /* Emulation Override */
  38. #define OTPSEN 0x00008000 /* OTP Secrets Enable */
  39. #define L2DABL 0x00070000 /* L2 Memory Disable */
  40. /* Bit masks for SECURE_CONTROL */
  41. #define SECURE0 0x0001 /* SECURE 0 */
  42. #define SECURE1 0x0002 /* SECURE 1 */
  43. #define SECURE2 0x0004 /* SECURE 2 */
  44. #define SECURE3 0x0008 /* SECURE 3 */
  45. /* Bit masks for SECURE_STATUS */
  46. #define SECMODE 0x0003 /* Secured Mode Control State */
  47. #define NMI 0x0004 /* Non Maskable Interrupt */
  48. #define AFVALID 0x0008 /* Authentication Firmware Valid */
  49. #define AFEXIT 0x0010 /* Authentication Firmware Exit */
  50. #define SECSTAT 0x00e0 /* Secure Status */
  51. #endif