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.tms570.Core');
70 * Core.resetFunc = '&myfunc';
71 * @p
72 */
73
74 @ModuleStartup
75 @Template ("./Core.xdt")
76
77 module Core inherits ti.sysbios.interfaces.ICore
78 {
79 /*! Reset function type definition. */
80 typedef Void (*ResetFuncPtr)(void);
81
82 /*!
83 * Error raised if Core.id does not match the contents
84 * of MPIDR [7:0] register.
85 */
86 config Error.Id E_mismatchedIds = {
87 msg: "E_mismatchedIds: Core_Id: %d does not match hardware core Id: %d"
88 };
89
90 override config UInt numCores;
91
92 /*!
93 * R5 Core ID, default is Core 0
94 *
95 * Used for making static decisions based on Core ID
96 */
97 config UInt id = 0;
98
99 /*!
100 * ======== resetFunc ========
101 * Reset Function Pointer
102 */
103 metaonly config ResetFuncPtr resetFunc = null;
104
105 @Macro
106 override UInt hwiDisable();
107
108 @Macro
109 override UInt hwiEnable();
110
111 @Macro
112 override Void hwiRestore(UInt key);
113
114 internal:
115
116 117 118 119 120 121
122 metaonly config Bool overrideHwiResetFunc = false;
123
124 125 126 127
128 Void startCore1();
129
130 131 132
133 Void resetC();
134 }