bcm_kona_smc.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Copyright (C) 2013 Broadcom Corporation
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation version 2.
  7. *
  8. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  9. * kind, whether express or implied; without even the implied warranty
  10. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef BCM_KONA_SMC_H
  14. #define BCM_KONA_SMC_H
  15. #include <linux/types.h>
  16. #define FLAGS (SEC_ROM_ICACHE_ENABLE_MASK | SEC_ROM_DCACHE_ENABLE_MASK | \
  17. SEC_ROM_IRQ_ENABLE_MASK | SEC_ROM_FIQ_ENABLE_MASK)
  18. /*!
  19. * Definitions for IRQ & FIQ Mask for ARM
  20. */
  21. #define FIQ_IRQ_MASK 0xC0
  22. #define FIQ_MASK 0x40
  23. #define IRQ_MASK 0x80
  24. /*!
  25. * Secure Mode FLAGs
  26. */
  27. /* When set, enables ICache within the secure mode */
  28. #define SEC_ROM_ICACHE_ENABLE_MASK 0x00000001
  29. /* When set, enables DCache within the secure mode */
  30. #define SEC_ROM_DCACHE_ENABLE_MASK 0x00000002
  31. /* When set, enables IRQ within the secure mode */
  32. #define SEC_ROM_IRQ_ENABLE_MASK 0x00000004
  33. /* When set, enables FIQ within the secure mode */
  34. #define SEC_ROM_FIQ_ENABLE_MASK 0x00000008
  35. /* When set, enables Unified L2 cache within the secure mode */
  36. #define SEC_ROM_UL2_CACHE_ENABLE_MASK 0x00000010
  37. /* Broadcom Secure Service API Service IDs */
  38. #define SSAPI_DORMANT_ENTRY_SERV 0x01000000
  39. #define SSAPI_PUBLIC_OTP_SERV 0x01000001
  40. #define SSAPI_ENABLE_L2_CACHE 0x01000002
  41. #define SSAPI_DISABLE_L2_CACHE 0x01000003
  42. #define SSAPI_WRITE_SCU_STATUS 0x01000004
  43. #define SSAPI_WRITE_PWR_GATE 0x01000005
  44. /* Broadcom Secure Service API Return Codes */
  45. #define SEC_ROM_RET_OK 0x00000001
  46. #define SEC_ROM_RET_FAIL 0x00000009
  47. #define SSAPI_RET_FROM_INT_SERV 0x4
  48. #define SEC_EXIT_NORMAL 0x1
  49. #define SSAPI_ROW_AES 0x0E000006
  50. #define SSAPI_BRCM_START_VC_CORE 0x0E000008
  51. #ifndef __ASSEMBLY__
  52. extern void bcm_kona_smc_init(void);
  53. extern unsigned bcm_kona_smc(unsigned service_id,
  54. unsigned arg0,
  55. unsigned arg1,
  56. unsigned arg2,
  57. unsigned arg3);
  58. extern int bcm_kona_smc_asm(u32 service_id,
  59. u32 buffer_addr);
  60. #endif /* __ASSEMBLY__ */
  61. #endif /* BCM_KONA_SMC_H */