Commit 989a72c3d5348ef2a23cb8250a08b3f4bddc0b71

Authored by Tim Gover
Committed by Phil Elwell
1 parent 8d1a3e60

Add Raspberry Pi Imager - embedded

Readme.md
1 -# USB boot code 1 +# USB device boot code
2 2
3 This is the USB MSD boot code which should work on the Raspberry Pi model A, Compute Module, Compute 3 This is the USB MSD boot code which should work on the Raspberry Pi model A, Compute Module, Compute
4 Module 3, Compute Module 4 and Raspberry Pi Zero. 4 Module 3, Compute Module 4 and Raspberry Pi Zero.
5 5
6 -This version of rpiboot has been modified to work from directories which contain the booting  
7 -firmware. There is a msd/ directory which contains bootcode.bin and start.elf to turn  
8 -the Raspberry Pi device into a USB Mass Storage Device (MSD). If run without arguments  
9 -embedded versions of bootcode.bin and start.elf are used to enable the MSD behaviour. 6 +The default behaviour when run with no arguments is to boot the Raspberry Pi with
  7 +special firmware sot that it emulates USB Mass Storage Device (MSD). The host OS
  8 +will treat this as a normal USB mass storage device and allowing the file-system
  9 +to be accessed. If the storage has not been formatted then (default for Compute Module)
  10 +then the [Raspberry Pi Imager App](https://www.raspberrypi.com/software/) can be
  11 +used to install a new operating system.
10 12
11 -For more information run 'rpiboot -h' 13 +Since `RPIBOOT` is a generic firmware loading interface it is possible to load
  14 +other versions of the firmware by passing the `-d` flag to specify the directory
  15 +where the firmware should be loaded from.
  16 +E.g. The firmware in the [msd](msd/README.md) can be replaced with newer/older versions.
  17 +
  18 +For more information run `rpiboot -h`
12 19
13 ## Building 20 ## Building
14 21
15 -### Ubuntu  
16 -Clone this on your Pi or an Ubuntu linux machine 22 +### Linux / Cygwin / WSL
  23 +Clone this on your Pi or a Linux machine.
  24 +Make sure that the system date is set correctly, otherwise, Git may produce an error.
17 25
18 ``` 26 ```
  27 +sudo apt install git libusb-1.0-0-dev
19 git clone --depth=1 https://github.com/raspberrypi/usbboot 28 git clone --depth=1 https://github.com/raspberrypi/usbboot
20 -cd usbboot  
21 -sudo apt install libusb-1.0-0-dev  
22 make 29 make
23 sudo ./rpiboot 30 sudo ./rpiboot
24 ``` 31 ```
@@ -41,26 +48,27 @@ make @@ -41,26 +48,27 @@ make
41 sudo ./rpiboot 48 sudo ./rpiboot
42 ``` 49 ```
43 50
44 -**Note:** You might see an OS warning message about a new disk that it can't access, click "ignore", this likely means that the storage is empty and has no filesystem. From here I recommend installing an OS using the [Raspberry Pi Imager App](https://www.raspberrypi.org/software/), or using any other means like `dd`. 51 +## Running
45 52
46 -## Running your own (not MSD) build 53 +### Compute Module 3
  54 +Fit the `EMMC-DISABLE` jumper on the Compute Module IO board before powering on the board
  55 +or connecting the USB cable.
47 56
48 -If you would like to boot the Raspberry Pi with a standard build you just need to copy the FAT partition  
49 -files into a subdirectory (it must have at the minimum bootcode.bin and start.elf). If you take a  
50 -standard firmware release then this will at the very least boot the linux kernel which will then stop  
51 -(and possibly crash!) when it looks for a filesystem. To provide a filesystem there are many options,  
52 -you can build an initramfs into the kernel, add an initramfs to the boot directory or provide some  
53 -other interface to the filesystem. 57 +### Compute Module 4
  58 +On Compute Module 4 EMMC-DISABLE / nRPIBOOT (GPIO 40) must be fitted to switch the ROM to usbboot mode.
  59 +Otherwise, the SPI EEPROM bootloader image will be loaded instead.
54 60
55 -```bash  
56 -sudo ./rpiboot -d boot  
57 -``` 61 +## Compute Module 4 extensions
  62 +In addition to the MSD functionality, there are a number of other utilities that can be loaded
  63 +via RPIBOOT on Compute Module 4.
58 64
59 -This will serve the boot directory to the Raspberry Pi Device. 65 +| Directory | Description |
  66 +| ----------| ----------- |
  67 +| [recovery](recovery/README.md) | Updates the bootloader EEPROM on a Compute Module 4 |
  68 +| [secure-boot-recovery](secure-boot-recovery/README.md) | Scripts that extend the `recovery` process to enable secure-boot, sign images etc |
  69 +| [secure-boot-msd](secure-boot-msd/README.md) | Scripts for signing the MSD firmware so that it can be used on a secure-boot device |
  70 +| [secure-boot-example](secure-boot-example/README.md) | Simple Linux initrd with a UART console.
60 71
61 -## Compute Module 4  
62 -On Compute Module 4 EMMC-DISABLE / nRPIBOOT (GPIO 40) must be fitted to switch the ROM to usbboot mode.  
63 -Otherwise, the SPI EEPROM bootloader image will be loaded instead.  
64 72
65 <a name="secure-boot"></a> 73 <a name="secure-boot"></a>
66 ## Secure Boot 74 ## Secure Boot
rpi-imager-embedded/README.md 0 → 100644
  1 +This directory contains the embedded Raspberry Pi Imager application.
  2 +Running RPi Imager on the target device is probably the simplest way
  3 +to install the operating system on a Compute Module 4. However, it
  4 +does not export the CM4 file-system as a mass-storage device.
  5 +
  6 +To download the latest version, run:
  7 +```bash
  8 +wget https://downloads.raspberrypi.com/net_install/boot.img
  9 +```
  10 +
  11 +To run:
  12 +```bash
  13 +cd rpi-imager-embedded
  14 +../rpiboot -d .
  15 +```
  16 +
  17 +Make sure that the HDMI display is connected. Once Linux has started
  18 +you will need to unplug the micro-USB cable (when prompted) and connect
  19 +a keyboard and mouse.
rpi-imager-embedded/boot.img 0 → 100644
No preview for this file type
rpi-imager-embedded/bootcode4.bin 0 → 100644
No preview for this file type
rpi-imager-embedded/config.txt 0 → 100644
  1 +boot_ramdisk=1
  2 +uart_2ndstage=1