Merge tag 'gpio-for-v3.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
[linux-2.6.git] / arch / arm / mach-bcm / bcm_kona_smc.h
blob3bedbed1c21bd3b66b79a06cd27e0dbd7fd15e6a
1 /*
2 * Copyright (C) 2013 Broadcom Corporation
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.
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.
14 #ifndef BCM_KONA_SMC_H
15 #define BCM_KONA_SMC_H
17 #include <linux/types.h>
18 #define FLAGS (SEC_ROM_ICACHE_ENABLE_MASK | SEC_ROM_DCACHE_ENABLE_MASK | \
19 SEC_ROM_IRQ_ENABLE_MASK | SEC_ROM_FIQ_ENABLE_MASK)
21 /*!
22 * Definitions for IRQ & FIQ Mask for ARM
25 #define FIQ_IRQ_MASK 0xC0
26 #define FIQ_MASK 0x40
27 #define IRQ_MASK 0x80
29 /*!
30 * Secure Mode FLAGs
33 /* When set, enables ICache within the secure mode */
34 #define SEC_ROM_ICACHE_ENABLE_MASK 0x00000001
36 /* When set, enables DCache within the secure mode */
37 #define SEC_ROM_DCACHE_ENABLE_MASK 0x00000002
39 /* When set, enables IRQ within the secure mode */
40 #define SEC_ROM_IRQ_ENABLE_MASK 0x00000004
42 /* When set, enables FIQ within the secure mode */
43 #define SEC_ROM_FIQ_ENABLE_MASK 0x00000008
45 /* When set, enables Unified L2 cache within the secure mode */
46 #define SEC_ROM_UL2_CACHE_ENABLE_MASK 0x00000010
48 /* Broadcom Secure Service API Service IDs */
49 #define SSAPI_DORMANT_ENTRY_SERV 0x01000000
50 #define SSAPI_PUBLIC_OTP_SERV 0x01000001
51 #define SSAPI_ENABLE_L2_CACHE 0x01000002
52 #define SSAPI_DISABLE_L2_CACHE 0x01000003
53 #define SSAPI_WRITE_SCU_STATUS 0x01000004
54 #define SSAPI_WRITE_PWR_GATE 0x01000005
56 /* Broadcom Secure Service API Return Codes */
57 #define SEC_ROM_RET_OK 0x00000001
58 #define SEC_ROM_RET_FAIL 0x00000009
60 #define SSAPI_RET_FROM_INT_SERV 0x4
61 #define SEC_EXIT_NORMAL 0x1
63 #define SSAPI_ROW_AES 0x0E000006
64 #define SSAPI_BRCM_START_VC_CORE 0x0E000008
66 #ifndef __ASSEMBLY__
67 extern void bcm_kona_smc_init(void);
69 extern unsigned bcm_kona_smc(unsigned service_id,
70 unsigned arg0,
71 unsigned arg1,
72 unsigned arg2,
73 unsigned arg3);
75 extern int bcm_kona_smc_asm(u32 service_id,
76 u32 buffer_addr);
78 #endif /* __ASSEMBLY__ */
80 #endif /* BCM_KONA_SMC_H */