xref: /openbmc/linux/arch/arm/mach-bcm/bcm_kona_smc.h (revision 089a49b6)
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 
14 #ifndef BCM_KONA_SMC_H
15 #define BCM_KONA_SMC_H
16 
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)
20 
21 /*!
22  * Definitions for IRQ & FIQ Mask for ARM
23  */
24 
25 #define FIQ_IRQ_MASK						0xC0
26 #define FIQ_MASK						0x40
27 #define IRQ_MASK						0x80
28 
29 /*!
30  * Secure Mode FLAGs
31  */
32 
33 /* When set, enables ICache within the secure mode */
34 #define SEC_ROM_ICACHE_ENABLE_MASK                        0x00000001
35 
36 /* When set, enables DCache within the secure mode */
37 #define SEC_ROM_DCACHE_ENABLE_MASK                        0x00000002
38 
39 /* When set, enables IRQ within the secure mode */
40 #define SEC_ROM_IRQ_ENABLE_MASK                           0x00000004
41 
42 /* When set, enables FIQ within the secure mode */
43 #define SEC_ROM_FIQ_ENABLE_MASK                           0x00000008
44 
45 /* When set, enables Unified L2 cache within the secure mode */
46 #define SEC_ROM_UL2_CACHE_ENABLE_MASK                     0x00000010
47 
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
55 
56 /* Broadcom Secure Service API Return Codes */
57 #define SEC_ROM_RET_OK			0x00000001
58 #define SEC_ROM_RET_FAIL		0x00000009
59 
60 #define SSAPI_RET_FROM_INT_SERV		0x4
61 #define SEC_EXIT_NORMAL			0x1
62 
63 #define SSAPI_ROW_AES			0x0E000006
64 #define SSAPI_BRCM_START_VC_CORE	0x0E000008
65 
66 #ifndef	__ASSEMBLY__
67 extern int __init bcm_kona_smc_init(void);
68 
69 extern unsigned bcm_kona_smc(unsigned service_id,
70 			     unsigned arg0,
71 			     unsigned arg1,
72 			     unsigned arg2,
73 			     unsigned arg3);
74 
75 extern int bcm_kona_smc_asm(u32 service_id,
76 			    u32 buffer_addr);
77 
78 #endif	/* __ASSEMBLY__ */
79 
80 #endif /* BCM_KONA_SMC_H */
81