Skip to content

Commit efc5da6

Browse files
committed
docs: Add metadata docs to the top level Readme.md
Also, enable metadata by default in the recovery config.txt files now that this feature has been supported for several APT releases. Previously, this was not enabled by default because it might cause an old verison of the rpiboot host to output a file-not-found error.
1 parent f518422 commit efc5da6

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

Readme.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,33 @@ Be careful not to overwrite `bootcode.bin` or `bootcode4.bin` with the executabl
188188
* Add `uart_2ndstage=1` to the `config.txt` file in `msd/` or `recovery/` directories to enable UART debug output.
189189
* Add `recovery_metadata=1` to the `config.txt` file in `recovery/` or `recovery5/` directory to enable metadata JSON output.
190190

191+
## Reading device metadata from OTP via rpiboot
192+
The `rpiboot` "recovery" modules provide a facility to read the device OTP information. This can be run either as a provisioning step or as a standalone operation.
193+
194+
To enable this make sure that `recovery_metadata=1` is set in the recovery `config.txt` file and pass the `-j metadata` flag to `rpiboot`.
195+
196+
See [board revision](https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#new-style-revision-codes-in-use) documentation to decode the `BOARD_ATTR` field.
197+
198+
Example command to extract the OTP metadata from a Compute Module 4:
199+
```bash
200+
cd recovery
201+
mkdir -p metadata
202+
sudo rpiboot -j metadata -d .
203+
```
204+
205+
Example metadata file contents written to `metadata/SERIAL_NUMBER.json`
206+
```json
207+
{
208+
"MAC_ADDR" : "d8:3a:dd:05:ee:78",
209+
"CUSTOMER_KEY_HASH" : "8251a63a2edee9d8f710d63e9da5d639064929ce15a2238986a189ac6fcd3cee",
210+
"BOOT_ROM" : "0000c8b0",
211+
"BOARD_ATTR" : "00000000",
212+
"USER_BOARDREV" : "c03141",
213+
"JTAG_LOCKED" : "0",
214+
"ADVANCED_BOOT" : "0000e8e8"
215+
}
216+
```
217+
191218
<a name="secure-boot"></a>
192219
## Secure Boot
193220
This repository contains the low-level tools and firmware images for enabling secure-boot/verified boot on Compute Module 4 and Compute Module 5.

recovery/config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
# Uncomment to instruct recovery.bin to send metadata including OTP fields
88
# Specify -j dirname on the command line to specify the directory where
99
# metadata should be stored (JSON format)
10-
#recovery_metadata=1
10+
recovery_metadata=1

recovery5/config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ uart_2ndstage=1
77
# Uncomment to instruct recovery.bin to send metadata including OTP fields
88
# Specify -j dirname on the command line to specify the directory where
99
# metadata should be stored (JSON format)
10-
#recovery_metadata=1
10+
recovery_metadata=1

0 commit comments

Comments
 (0)