1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
32 33 34
35
36 import xdc.runtime.Error;
37
38 /*!
39 * ======== Core ========
40 * Core Identification Module.
41 *
42 * The Core module is used to define which core within a dual core
43 * "R5" subsystem an application is being built for.
44 *
45 * At runtime, a comparison is made between the configured Core.id
46 * and the value of MPIDR (bits 7:0). If they do not agree, an Error
47 * is raised.
48 *
49 * Core 0's vector table is placed at 0x100 and Core 1's vector table
50 * is placed at 0x20000.
51 *
52 * @a(Bootup sequence)
53 * When each Cortex-R core comes out of reset, it initializes the
54 * stack pointer and calls the reset callback function
55 * (see {@link #resetFunc}) and then continues executing the
56 * bootup sequence.
57 *
58 * On a lockstep device, the bootup sequence involves calling
59 * _c_int00() while on dual-core devices, the bootup sequence
60 * involves setting up IPC between the 2 Cortex-R cores to
61 * synchronize their startup.
62 *
63 * The reset callback function is called very early in the
64 * bootup sequence and can be used to detect the reset source and
65 * take the appropriate action. Here's an example showing how to
66 * register a reset callback function:
67 *
68 * @p(code)
69 * var Core = xdc.useModule('ti.sysbios.family.arm.v7r.keystone3.Core');
70 * Core.resetFunc = '&myfunc';
71 * @p
72 */
73
74 @ModuleStartup
75 @Template ("./Core.xdt")
76
77
78 module Core inherits ti.sysbios.interfaces.ICore
79 {
80 /*! Reset function type definition. */
81 typedef Void (*ResetFuncPtr)(void);
82
83 /*!
84 * Error raised if Core.id does not match the contents
85 * of MPIDR [7:0] register.
86 */
87 config Error.Id E_mismatchedIds = {
88 msg: "E_mismatchedIds: Core_Id: %d does not match hardware core Id: %d"
89 };
90
91 override config UInt numCores;
92
93 /*!
94 * R5 Core ID, default is Core 0
95 *
96 * Used for making static decisions based on Core ID
97 */
98
99 config UInt id = 0;
100
101 /*!
102 * ======== resetFunc ========
103 * Reset Function Pointer
104 */
105
106 metaonly config ResetFuncPtr resetFunc = null;
107
108 @Macro
109 override UInt hwiDisable();
110
111 @Macro
112 override UInt hwiEnable();
113
114 @Macro
115 override Void hwiRestore(UInt key);
116
117 internal:
118
119 120 121 122 123 124
125 metaonly config Bool overrideHwiResetFunc = false;
126
127 128 129 130
131 Void startCore1();
132
133 134 135
136 Void resetC();
137 }