1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3 * Copyright (c) 2026, Qualcomm Technologies, Inc. and/or its subsidiaries.
4 */
5
6 #ifndef _DSP_BOOT_H_
7 #define _DSP_BOOT_H_
8
9 #include <io.h>
10 #include <string.h>
11 #include <stdint.h>
12 #include <stdlib.h>
13
14 #include "dsp.h"
15 #include "pas.h"
16
17 /*
18 * Compute
19 */
20 #define TURING_QDSP6V68SS_PUB_REG 0x00b00000
21 #define TURING_QDSP6V68SS_CC_REG 0x00b18000
22 #define TURING_QDSP6SS_Q6_CC_REG 0x00b40000
23
24 static const struct dsp_fw_boot_regs compute_fw_boot_regs = {
25 .xo_cbcr = TURING_QDSP6V68SS_CC_REG + 0x54,
26 .sleep_cbcr = TURING_QDSP6V68SS_CC_REG + 0x58,
27 .core_cbcr = TURING_QDSP6SS_Q6_CC_REG + 0x1040,
28 .rst_evb = TURING_QDSP6V68SS_PUB_REG + 0x10,
29 .core_start = TURING_QDSP6V68SS_PUB_REG + 0x400,
30 .boot_cmd = TURING_QDSP6V68SS_PUB_REG + 0x404,
31 .boot_status = TURING_QDSP6V68SS_PUB_REG + 0x408,
32 };
33
34 /*
35 * LPASS
36 */
37 #define LPASS_QDSP6V67SS_PUB_REG 0x00400000
38 #define LPASS_MCC_REG 0x00950000
39
40 static const struct dsp_fw_boot_regs lpass_fw_boot_regs = {
41 .xo_cbcr = LPASS_QDSP6V67SS_PUB_REG + 0x38,
42 .sleep_cbcr = LPASS_QDSP6V67SS_PUB_REG + 0x3c,
43 .core_cbcr = LPASS_QDSP6V67SS_PUB_REG + 0x20,
44 .rst_evb = LPASS_QDSP6V67SS_PUB_REG + 0x10,
45 .core_start = LPASS_QDSP6V67SS_PUB_REG + 0x400,
46 .boot_cmd = LPASS_QDSP6V67SS_PUB_REG + 0x404,
47 .boot_status = LPASS_QDSP6V67SS_PUB_REG + 0x408,
48 .lpass.efuse_evb_sel = LPASS_MCC_REG + 0xb000,
49 };
50
51 /*
52 * WPSS
53 */
54 #define WPSS_QDSP6V67SS_PUB_REG 0x00000000
55
56 static const struct dsp_fw_boot_regs wpss_fw_boot_regs = {
57 .xo_cbcr = WPSS_QDSP6V67SS_PUB_REG + 0x38,
58 .sleep_cbcr = WPSS_QDSP6V67SS_PUB_REG + 0x3c,
59 .core_cbcr = WPSS_QDSP6V67SS_PUB_REG + 0x20,
60 .rst_evb = WPSS_QDSP6V67SS_PUB_REG + 0x10,
61 .core_start = WPSS_QDSP6V67SS_PUB_REG + 0x400,
62 .boot_cmd = WPSS_QDSP6V67SS_PUB_REG + 0x404,
63 .boot_status = WPSS_QDSP6V67SS_PUB_REG + 0x408,
64 };
65
dsp_fw_get_boot_regs(uint32_t id)66 static inline const struct dsp_fw_boot_regs *dsp_fw_get_boot_regs(uint32_t id)
67 {
68 switch (id) {
69 case PAS_ID_WPSS:
70 return &wpss_fw_boot_regs;
71 case PAS_ID_TURING:
72 return &compute_fw_boot_regs;
73 case PAS_ID_QDSP6:
74 return &lpass_fw_boot_regs;
75 default:
76 return NULL;
77 }
78 }
79
80 #endif /* _DSP_BOOT_H_ */
81