1 // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 #ifndef _SOC_PID_H_
15 #define _SOC_PID_H_
16 
17 #define PROPID_GEN_BASE 0x3FF1F000
18 //Bits 1..7: 1 if interrupt will be triggering PID change
19 #define PROPID_CONFIG_INTERRUPT_ENABLE	((PROPID_GEN_BASE)+0x000)
20 //Vectors for the various interrupt handlers
21 #define PROPID_CONFIG_INTERRUPT_ADDR_1	((PROPID_GEN_BASE)+0x004)
22 #define PROPID_CONFIG_INTERRUPT_ADDR_2	((PROPID_GEN_BASE)+0x008)
23 #define PROPID_CONFIG_INTERRUPT_ADDR_3	((PROPID_GEN_BASE)+0x00C)
24 #define PROPID_CONFIG_INTERRUPT_ADDR_4	((PROPID_GEN_BASE)+0x010)
25 #define PROPID_CONFIG_INTERRUPT_ADDR_5	((PROPID_GEN_BASE)+0x014)
26 #define PROPID_CONFIG_INTERRUPT_ADDR_6	((PROPID_GEN_BASE)+0x018)
27 #define PROPID_CONFIG_INTERRUPT_ADDR_7	((PROPID_GEN_BASE)+0x01C)
28 
29 //Delay, in CPU cycles, before switching to new PID
30 #define PROPID_CONFIG_PID_DELAY			((PROPID_GEN_BASE)+0x020)
31 #define PROPID_CONFIG_NMI_DELAY			((PROPID_GEN_BASE)+0x024)
32 
33 //Last detected interrupt. Set by hw on int.
34 #define PROPID_TABLE_LEVEL				((PROPID_GEN_BASE)+0x028)
35 //PID/prev int data for each int
36 #define PROPID_FROM_1					((PROPID_GEN_BASE)+0x02C)
37 #define PROPID_FROM_2					((PROPID_GEN_BASE)+0x030)
38 #define PROPID_FROM_3					((PROPID_GEN_BASE)+0x034)
39 #define PROPID_FROM_4					((PROPID_GEN_BASE)+0x038)
40 #define PROPID_FROM_5					((PROPID_GEN_BASE)+0x03C)
41 #define PROPID_FROM_6					((PROPID_GEN_BASE)+0x040)
42 #define PROPID_FROM_7					((PROPID_GEN_BASE)+0x044)
43 #define PROPID_FROM_PID_MASK	0x7
44 #define PROPID_FROM_PID_S		0
45 #define PROPID_FROM_INT_MASK	0xF
46 #define PROPID_FROM_INT_S		3
47 
48 //PID to be set after confirm routine
49 #define PROPID_PID_NEW					((PROPID_GEN_BASE)+0x048)
50 //Write to kick off PID change
51 #define PROPID_PID_CONFIRM				((PROPID_GEN_BASE)+0x04c)
52 //current PID?
53 #define PROPID_PID_REG					((PROPID_GEN_BASE)+0x050)
54 
55 //Write to mask NMI
56 #define PROPID_PID_NMI_MASK_HW_ENABLE	((PROPID_GEN_BASE)+0x054)
57 //Write to unmask NMI
58 #define PROPID_PID_NMI_MASK_HW_DISABLE	((PROPID_GEN_BASE)+0x058)
59 #define PROPID_PID_NMI_MASK_HW_REG		((PROPID_GEN_BASE)+0x05c)
60 
61 //Debug regs
62 #define PROPID_PID						((PROPID_GEN_BASE)+0x060)
63 #define PROPID_NMI_MASK_HW				((PROPID_GEN_BASE)+0x064)
64 
65 #endif /* _SOC_PID_H_ */
66