Skip to content

Commit 6fff403

Browse files
committed
Edit vendor-specific toc for better navigation
Signed-off-by: Deb <[email protected]>
1 parent c84d15f commit 6fff403

File tree

17 files changed

+620
-13
lines changed

17 files changed

+620
-13
lines changed

architectures/firmware/index.rst

100644100755
Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,4 @@ Firmware Architecture
88

99
sof-xtos/index
1010
sof-zephyr/index
11-
12-
Vendor Specific Architecture Information
13-
========================================
14-
15-
Architecture details of any vendor specific code and flows. This is architecture
16-
specific to a single vendor that falls outside the scope of the high level
17-
generic SOF architecture.
18-
19-
.. toctree::
20-
:maxdepth: 1
21-
22-
intel/cavs/index
11+
vendor-specific/index

architectures/firmware/intel/cavs/index.rst

100644100755
File mode changed.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.. _vendor-specific:
2+
3+
Vendor-Specific Architecture Information
4+
########################################
5+
6+
Architecture details of any vendor specific code and flows. This is architecture
7+
specific to a single vendor that falls outside the scope of the high level
8+
generic SOF architecture.
9+
10+
.. toctree::
11+
:maxdepth: 1
12+
13+
vend-intel/index
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. _apl-boot-ldr:
2+
3+
Apollo Lake Boot Loader
4+
#######################
5+
6+
* Additional HPSRAM memory initialization.
7+
* L2 cache disabled in ``boot_entry`` (enabled by default by APL ROM).
8+
9+
Example list of sections in the APL boot_ldr::
10+
11+
Idx Name Size VMA LMA File off Algn
12+
0 .boot_entry.text 00000036 b000a000 b000a000 000000d4 2**2
13+
CONTENTS, ALLOC, LOAD, READONLY, CODE
14+
1 .boot_entry.literal 0000000c b000a040 b000a040 0000010c 2**2
15+
CONTENTS, ALLOC, LOAD, READONLY, CODE
16+
2 .text 000007d2 b000a0b0 b000a0b0 00000120 2**4
17+
CONTENTS, ALLOC, LOAD, READONLY, CODE
18+
3 .rodata 00000008 b0002000 b0002000 000008f4 2**2
19+
CONTENTS, ALLOC, LOAD, DATA
20+
... more debug sections ...
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
.. _apl-boot-rom:
2+
3+
Apollo Lake Boot ROM
4+
####################
5+
6+
Progress of the boot process is reflected by the status information updated by
7+
the ROM in an SRAM area called *FW Registers*. It is available to the host
8+
driver through a memory window.
9+
10+
ROM FW Registers
11+
****************
12+
13+
This SRAM area updated by the ROM during the boot process is available via
14+
memory window #0, the limit is set to 4K.
15+
16+
Offset 0x00
17+
FwStatus - Current ROM status
18+
19+
Offset 0x04
20+
ErrorCode - Last ROM error code
21+
22+
Offset 0x08
23+
FwPwrStatus - Current DSP clock status (ToBeVerified on APL/CNL)
24+
25+
FwStatus
26+
========
27+
28+
The FwStatus register contains current FW status, initialized to 0 on the DSP
29+
startup.
30+
31+
The ErrorCode register is updated by ROM when *FwStatus* ``running`` bit is
32+
set to “halted on critical error”, initialized to 0 (`ADSP_SUCCESS`) on the
33+
DSP startup.
34+
35+
Once Base FW is being executed, *ErrorCode* is updated every time some error is
36+
detected while calling internal API components. Some of the error codes might be
37+
helpful for driver writers hence documented in this specification.
38+
39+
.. code-block:: c
40+
41+
union fw_status_reg
42+
{
43+
int32_t full;
44+
struct Bits
45+
{
46+
uint32_t state : 24;
47+
uint32_t wait_state : 4;
48+
uint32_t module : 3;
49+
uint32_t running : 1;
50+
} bits;
51+
};
52+
53+
running
54+
This field is used to report current FW running state.
55+
0 – running,
56+
1 – halted.
57+
When FW reports halted state, ErrorCode register contains error
58+
code.
59+
60+
module
61+
This field is used to report FW module (that indicates boot phase
62+
component/module in this context, not a processing module) that is being
63+
executed.
64+
65+
wait_state
66+
This field is updated to non-zero code of operation when ROM is waiting
67+
for completion of that operation.
68+
69+
state
70+
This field is used to report phase of the FW module that is being executed.
71+
When FW switches to another module (reported by Module field) this value
72+
may get started again from 0, so it is Module context sensitive.
73+
74+
.. uml:: images/apl-rom-flow.pu
75+
:caption: APL ROM Boot Sequence
76+
77+
.. code-block:: c
78+
:caption: APL ROM Wait States
79+
80+
// Waiting for IPC busy bit to be set
81+
#define WAIT_FOR_IPC_BUSY 0x1
82+
// Waiting for IPC done bit to be set
83+
#define WAIT_FOR_IPC_DONE 0x2
84+
// Waiting for L2$ invalidation to be ack'ed
85+
#define WAIT_FOR_CACHE_INVALIDATION 0x3
86+
// Waiting for DMA buffer to be filled
87+
#define WAIT_FOR_DMA_BUFFER_FULL 0x5
88+
89+
.. code-block:: c
90+
:caption: APL ROM Status Codes
91+
92+
#define FSR_ROM_INIT 0x0
93+
#define FSR_ROM_INIT_DONE 0x1
94+
#define FSR_ROM_CSE_MANIFEST_LOADED 0x2
95+
#define FSR_ROM_FW_MANIFEST_LOADED 0x3
96+
#define FSR_ROM_FW_FW_LOADED 0x4
97+
#define FSR_ROM_FW_ENTERED 0x5
98+
#define FSR_ROM_VERIFY_FEATURE_MASK 0x6
99+
#define FSR_ROM_GET_LOAD_OFFSET 0x7
100+
#define FSR_ROM_BASEFW_CSE_IMR_REQUEST 0x10
101+
#define FSR_ROM_BASEFW_CSE_IMR_GRANTED 0x11
102+
#define FSR_ROM_BASEFW_CSE_VALIDATE_IMAGE_REQUEST 0x12
103+
#define FSR_ROM_BASEFW_CSE_IMAGE_VALIDATED 0x13
104+
105+
.. code-block:: c
106+
:caption: APL ROM Error Codes
107+
108+
#define ADSP_UNHANDLED_INTERRUPT 0xBEE00000
109+
110+
// Memory hole/ECC error
111+
// Status bits are provided:
112+
// [0] - L2 SRAM ECC error
113+
// [1] - L2 memory hole error
114+
#define ADSP_MEMORY_HOLE_ECC 0xECC00000
115+
#define ADSP_USER_EXCEPTION 0xBEEF0000
116+
#define ADSP_KERNEL_EXCEPTION 0xCAFE0000
117+
118+
// Other critical error
119+
#define ADSP_FAILURE 6
120+
// FW image does not match the feature mask read from HW register.
121+
#define ADSP_INVALID_FEAT_MASK 20
122+
// Invalid parameter
123+
#define ADSP_INVALID_PARAM 21
124+
// CSE responded with error on an IPC request
125+
#define ADSP_CSE_ERROR 40
126+
// Invalid IPC response sent back by CSE.
127+
#define ADSP_CSE_WRONG_RESPONSE 41
128+
// Size of IMR assigned by CSE is too small to load FW Image.
129+
#define ADSP_IMR_TOO_SMALL 42
130+
// Base FW module not found in FW Image.
131+
#define ADSP_BASE_FW_NOT_FOUND 43
132+
// CSE responded with error on FW image validation request.
133+
#define ADSP_CSE_VALIDATION_FAILED 44
134+
// IPC communication failed with fatal error.
135+
#define ADSP_IPC_FATAL_ERROR 45
136+
// L2 cache command failed.
137+
#define ADSP_L2_CACHE_ERROR 46
138+
// Load offset set in FW Image Manifest is too small.
139+
#define ADSP_LOAD_OFFSET_TOO_SMALL 47
140+
141+
ROM -> FW Transition
142+
====================
143+
144+
Once APL ROM jumps to the entry point of the first module in the main binary,
145+
the memory and caches are in the following state:
146+
147+
* L2$ is turned on, so the FW boot procedure may either execute via L2
148+
cacheable address space or directly via L2 uncacheable alias.
149+
150+
* HPSRAM areas allocated by the ROM listed in the next table.
151+
152+
APL ROM HPSRAM Allocation
153+
=========================
154+
155+
+---------------------+------------+--------------+
156+
| Area | Base Addr | Size |
157+
+=====================+============+==============+
158+
| Code load buffer | 0xBE008000 | 0x8000 (32K) |
159+
+---------------------+------------+--------------+
160+
| BSS (inc. stack) | 0xBE010000 | 0x8000 (32K) |
161+
+---------------------+------------+--------------+
162+
| FW Registers | 0xBE01E000 | 0x800 (2K) |
163+
+---------------------+------------+--------------+
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
participant "State" as st
2+
participant "Error" as err
3+
participant "Host\nDriver" as host
4+
participant "APL\nROM" as rom
5+
participant "CSE" as cse
6+
7+
host -> rom : <<IPC>> RomControl (purge=1, dma_id)
8+
9+
== Initialization ==
10+
rom -> rom : Boot
11+
err <[#red]- rom : ADSP_UNHANDLED_INTERRUPT [anytime unhandled int reported]
12+
err <[#red]- rom : ADSP_MEMORY_HOLE_ECC [anytime memory hole int reported]
13+
err <[#red]- rom : ADSP_USER_EXCEPTION [anytime unhandled user mode exception happens]
14+
err <[#red]- rom : ADSP_KERNEL_EXCEPTION [anytime unhandled kernel mode exception happens]
15+
16+
rom -> rom : L2Cache Initialization
17+
err <[#red]- rom : ADSP_L2_CACHE_ERROR [Failed to init L2$]
18+
19+
rom -> rom : Requesting IMR
20+
st <[#green]- rom : FSR_ROM_BASEFW_CSE_IMR_REQUEST
21+
rom -> cse : <<IPC>> IPC_ADSP2CSE_REQUEST_IMR
22+
rom <- cse : <<IPC>> IPC_CSE2ADSP_REQUEST_IMR_RESPONSE
23+
st <[#green]- rom : FSR_ROM_BASEFW_CSE_IMR_GRANTED
24+
25+
rom -> rom : Initializing Code Load DMA
26+
err <[#red]- rom : ADSP_INVALID_PARAM [dma_id out of range]
27+
28+
st <[#green]- rom : FSR_ROM_INIT_DONE
29+
30+
== Loading Image ==
31+
rom -> rom : Loading Firmware
32+
' First fw image block is loaded and feature mask is verified
33+
st <[#green]- rom : FSR_ROM_VERIFY_FEATURE_MASK
34+
err <[#red]- rom : ADSP_INVALID_FEAT_MASK [mft mask does not match SKUID]
35+
' Load offset is verified
36+
st <[#green]- rom : FSR_ROM_GET_LOAD_OFFSET
37+
err <[#red]- rom : ADSP_LOAD_OFFSET_TOO_SMALL [load offset less then Rsvd space]
38+
err <[#red]- rom : ADSP_IMR_TOO_SMALL [load offset greater than assigned IMR size]
39+
' CSE Manifest if loaded
40+
rom -> rom : Loading CSE Manifest
41+
err <[#red]- rom : ADSP_IMR_TOO_SMALL [CSE manifest > IMR size]
42+
st <[#green]- rom : FSR_ROM_CSE_MANIFEST_LOADED
43+
' FW Manifest is loaded
44+
rom -> rom : Loading ADSP FW Manifest
45+
err <[#red]- rom : ADSP_IMR_TOO_SMALL [ADSP FW manifest > IMR size]
46+
st <[#green]- rom : FSR_ROM_FW_MANIFEST_LOADED
47+
err <[#red]- rom : ADSP_BASE_FW_NOT_FOUND [module entry not found in manifest]
48+
' Loading rest of FW
49+
rom -> rom : Loading FW
50+
st <[#green]- rom : FSR_ROM_FW_FW_LOADED
51+
52+
== Authenticating Image ==
53+
st <[#green]- rom : FSR_ROM_BASEFW_CSE_VALIDATE_IMAGE_REQUEST
54+
rom -> cse : <<IPC>> IPC_CSE2ADSP_START_FW_AUTH
55+
rom <- cse : <<IPC>> IPC_CSE2ADSP_START_FW_AUTH_RESPONSE
56+
err <[#red]- rom : ADSP_CSE_VALIDATION_FAILED [invalid image signature]
57+
st <[#green]- rom : FSR_ROM_BASEFW_CSE_IMAGE_VALIDATED
58+
== Booting FW ==
59+
st <[#green]- rom : FSR_ROM_FW_ENTERED
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.. _cavs-boot-apl:
2+
3+
Apollo Lake Boot Process
4+
########################
5+
6+
.. toctree::
7+
:maxdepth: 1
8+
9+
apl-boot-rom
10+
apl-boot-ldr

0 commit comments

Comments
 (0)