sec_boot_lib.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef SEC_BOOT_LIB_H
  2. #define SEC_BOOT_LIB_H
  3. /**************************************************************************
  4. * INCLUDE LINUX HEADER
  5. **************************************************************************/
  6. #include "sec_osal_light.h"
  7. /**************************************************************************
  8. * INCLUDE MTK HEADERS
  9. **************************************************************************/
  10. #include "masp_version.h"
  11. #include "sec_typedef.h"
  12. #include "sec_error.h"
  13. #include "sec_nvram.h"
  14. #include "sec_osal.h"
  15. #include "sec_mod.h"
  16. /**************************************************************************
  17. * [S-BOOT]
  18. **************************************************************************/
  19. /* S-BOOT Attribute */
  20. #define ATTR_SBOOT_DISABLE 0x00
  21. #define ATTR_SBOOT_ENABLE 0x11
  22. #define ATTR_SBOOT_ONLY_ENABLE_ON_SCHIP 0x22
  23. /**************************************************************************
  24. * [S-USBDL]
  25. **************************************************************************/
  26. /* S-USBDL Attribute */
  27. #define ATTR_SUSBDL_DISABLE 0x00
  28. #define ATTR_SUSBDL_ENABLE 0x11
  29. #define ATTR_SUSBDL_ONLY_ENABLE_ON_SCHIP 0x22
  30. /**************************************************************************
  31. * EXTERNAL VARIABLE
  32. **************************************************************************/
  33. /*extern AND_ROMINFO_T rom_info;*/
  34. /*extern SECURE_INFO sec_info;*/
  35. /*extern SECCFG_U seccfg;*/
  36. /*extern AND_SECROIMG_T secroimg;*/
  37. extern unsigned int g_rom_info_sbc_attr;
  38. extern unsigned int g_rom_info_sdl_attr;
  39. extern unsigned int g_hw_sbcen;
  40. extern unsigned int g_lock_state;
  41. extern unsigned int g_random_id[NUM_RID];
  42. extern unsigned char g_crypto_seed[NUM_CRYPTO_SEED];
  43. extern unsigned int g_sbc_pubk_hash[NUM_SBC_PUBK_HASH];
  44. extern unsigned int lks;
  45. /**************************************************************************
  46. * EXPORT FUNCTION
  47. **************************************************************************/
  48. extern int masp_boot_init(void);
  49. extern int sec_boot_enabled(void);
  50. extern int sec_usbdl_enabled(void);
  51. extern int sec_modem_auth_enabled(void);
  52. extern int sec_schip_enabled(void);
  53. extern int sec_get_random_id(unsigned int *rid);
  54. /* HACC HW init */
  55. extern unsigned int sec_boot_hacc_init(void);
  56. #endif /* SEC_BOOT_LIB_H */