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