1c1db9d73STony Lindgren /* 2c1db9d73STony Lindgren * omap-secure.h: OMAP Secure infrastructure header. 3c1db9d73STony Lindgren * 4c1db9d73STony Lindgren * Copyright (C) 2011 Texas Instruments, Inc. 5c1db9d73STony Lindgren * Santosh Shilimkar <santosh.shilimkar@ti.com> 6c1db9d73STony Lindgren * 7c1db9d73STony Lindgren * This program is free software; you can redistribute it and/or modify 8c1db9d73STony Lindgren * it under the terms of the GNU General Public License version 2 as 9c1db9d73STony Lindgren * published by the Free Software Foundation. 10c1db9d73STony Lindgren */ 11c1db9d73STony Lindgren #ifndef OMAP_ARCH_OMAP_SECURE_H 12c1db9d73STony Lindgren #define OMAP_ARCH_OMAP_SECURE_H 13c1db9d73STony Lindgren 14c1db9d73STony Lindgren /* Monitor error code */ 15c1db9d73STony Lindgren #define API_HAL_RET_VALUE_NS2S_CONVERSION_ERROR 0xFFFFFFFE 16c1db9d73STony Lindgren #define API_HAL_RET_VALUE_SERVICE_UNKNWON 0xFFFFFFFF 17c1db9d73STony Lindgren 18c1db9d73STony Lindgren /* HAL API error codes */ 19c1db9d73STony Lindgren #define API_HAL_RET_VALUE_OK 0x00 20c1db9d73STony Lindgren #define API_HAL_RET_VALUE_FAIL 0x01 21c1db9d73STony Lindgren 22c1db9d73STony Lindgren /* Secure HAL API flags */ 23c1db9d73STony Lindgren #define FLAG_START_CRITICAL 0x4 24c1db9d73STony Lindgren #define FLAG_IRQFIQ_MASK 0x3 25c1db9d73STony Lindgren #define FLAG_IRQ_ENABLE 0x2 26c1db9d73STony Lindgren #define FLAG_FIQ_ENABLE 0x1 27c1db9d73STony Lindgren #define NO_FLAG 0x0 28c1db9d73STony Lindgren 29c1db9d73STony Lindgren /* Maximum Secure memory storage size */ 30c1db9d73STony Lindgren #define OMAP_SECURE_RAM_STORAGE (88 * SZ_1K) 31c1db9d73STony Lindgren 32c1db9d73STony Lindgren /* Secure low power HAL API index */ 33c1db9d73STony Lindgren #define OMAP4_HAL_SAVESECURERAM_INDEX 0x1a 34c1db9d73STony Lindgren #define OMAP4_HAL_SAVEHW_INDEX 0x1b 35c1db9d73STony Lindgren #define OMAP4_HAL_SAVEALL_INDEX 0x1c 36c1db9d73STony Lindgren #define OMAP4_HAL_SAVEGIC_INDEX 0x1d 37c1db9d73STony Lindgren 38c1db9d73STony Lindgren /* Secure Monitor mode APIs */ 39c1db9d73STony Lindgren #define OMAP4_MON_SCU_PWR_INDEX 0x108 40c1db9d73STony Lindgren #define OMAP4_MON_L2X0_DBG_CTRL_INDEX 0x100 41c1db9d73STony Lindgren #define OMAP4_MON_L2X0_CTRL_INDEX 0x102 42c1db9d73STony Lindgren #define OMAP4_MON_L2X0_AUXCTRL_INDEX 0x109 43c1db9d73STony Lindgren #define OMAP4_MON_L2X0_PREFETCH_INDEX 0x113 44c1db9d73STony Lindgren 45c1db9d73STony Lindgren /* Secure PPA(Primary Protected Application) APIs */ 46c1db9d73STony Lindgren #define OMAP4_PPA_L2_POR_INDEX 0x23 47c1db9d73STony Lindgren #define OMAP4_PPA_CPU_ACTRL_SMP_INDEX 0x25 48c1db9d73STony Lindgren 49c1db9d73STony Lindgren #ifndef __ASSEMBLER__ 50c1db9d73STony Lindgren 51c1db9d73STony Lindgren extern u32 omap_secure_dispatcher(u32 idx, u32 flag, u32 nargs, 52c1db9d73STony Lindgren u32 arg1, u32 arg2, u32 arg3, u32 arg4); 53c1db9d73STony Lindgren extern u32 omap_smc2(u32 id, u32 falg, u32 pargs); 54*a33f1788SPali Rohár extern u32 omap_smc3(u32 id, u32 process, u32 flag, u32 pargs); 55c1db9d73STony Lindgren extern phys_addr_t omap_secure_ram_mempool_base(void); 56f7a9b8a1SLokesh Vutla extern int omap_secure_ram_reserve_memblock(void); 57c1db9d73STony Lindgren 58f7a9b8a1SLokesh Vutla #ifdef CONFIG_OMAP4_ERRATA_I688 59f7a9b8a1SLokesh Vutla extern int omap_barrier_reserve_memblock(void); 60f7a9b8a1SLokesh Vutla #else 61f7a9b8a1SLokesh Vutla static inline void omap_barrier_reserve_memblock(void) 62f7a9b8a1SLokesh Vutla { } 63f7a9b8a1SLokesh Vutla #endif 64c1db9d73STony Lindgren #endif /* __ASSEMBLER__ */ 65c1db9d73STony Lindgren #endif /* OMAP_ARCH_OMAP_SECURE_H */ 66