Skip to content

Commit c6de46c

Browse files
Andy Rossnashif
authored andcommitted
soc/intel_adsp: Simplify boot ROM protocol
There was an attempt in the old code to express this as a formal protocol with a proper field definitions, etc... But in fact no such protocol really exists. This scheme is only used in one place to send one specific message to code fixed in ROM on legacy devices that only knows how to recognize this specific value. And 2.5 and later hardware are moving away from it anyway. Just express it directly, and explain in comments. Signed-off-by: Andy Ross <[email protected]>
1 parent a7af0ac commit c6de46c

File tree

1 file changed

+15
-24
lines changed

1 file changed

+15
-24
lines changed

soc/xtensa/intel_adsp/common/soc_mp.c

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,14 @@ extern void z_sched_ipi(void);
3333
extern void z_smp_start_cpu(int id);
3434
extern void z_reinit_idle_thread(int i);
3535

36-
/* ROM wake version parsed by ROM during core wake up. */
37-
#define IDC_ROM_WAKE_VERSION 0x2
38-
39-
/* IDC message type. */
40-
#define IDC_TYPE_SHIFT 24
41-
#define IDC_TYPE_MASK 0x7f
42-
#define IDC_TYPE(x) (((x) & IDC_TYPE_MASK) << IDC_TYPE_SHIFT)
43-
44-
/* IDC message header. */
45-
#define IDC_HEADER_MASK 0xffffff
46-
#define IDC_HEADER(x) ((x) & IDC_HEADER_MASK)
47-
48-
/* IDC message extension. */
49-
#define IDC_EXTENSION_MASK 0x3fffffff
50-
#define IDC_EXTENSION(x) ((x) & IDC_EXTENSION_MASK)
51-
52-
/* IDC power up message. */
53-
#define IDC_MSG_POWER_UP \
54-
(IDC_TYPE(0x1) | IDC_HEADER(IDC_ROM_WAKE_VERSION))
55-
56-
#define IDC_MSG_POWER_UP_EXT(x) IDC_EXTENSION((x) >> 2)
36+
/* IDC power up message to the ROM firmware. This isn't documented
37+
* anywhere, it's basically just a magic number (except the high bit,
38+
* which signals the hardware)
39+
*/
40+
#define IDC_MSG_POWER_UP \
41+
(BIT(31) | /* Latch interrupt in ITC write */ \
42+
(0x1 << 24) | /* "ROM control version" = 1 */ \
43+
(0x2 << 0)) /* "Core wake version" = 2 */
5744

5845
struct cpustart_rec {
5946
uint32_t cpu;
@@ -322,11 +309,15 @@ void arch_start_cpu(int cpu_num, k_thread_stack_t *stack, int sz,
322309
CAVS_SHIM.clkctl |= BIT(16 + cpu_num);
323310
}
324311

325-
/* Send power up message to the other core */
326-
uint32_t ietc = IDC_MSG_POWER_UP_EXT((long) z_soc_mp_asm_entry);
312+
/* Send power-up message to the other core. Start address
313+
* gets passed via the IETC scratch register (only 30 bits
314+
* available, so it's sent shifted). The write to ITC
315+
* triggers the interrupt, so that comes last.
316+
*/
317+
uint32_t ietc = ((long) z_soc_mp_asm_entry) >> 2;
327318

328319
IDC[curr_cpu].core[cpu_num].ietc = ietc;
329-
IDC[curr_cpu].core[cpu_num].itc = IDC_MSG_POWER_UP | IPC_IDCITC_BUSY;
320+
IDC[curr_cpu].core[cpu_num].itc = IDC_MSG_POWER_UP;
330321

331322
#ifndef CONFIG_SOC_SERIES_INTEL_CAVS_V25
332323
/* Early DSPs have a ROM that actually receives the startup

0 commit comments

Comments
 (0)