buildroot/board/raspberrypi
Gaël PORTAY 250a3544bf board/raspberrypi: reword console comment
The Raspberry Pi with Bluetooth connectivity up to 4 (i.e. Zero W, Zero
2 W, 3, 4 and Compute Module 4) use the miniuart-bt overlay to restore
UART0 for the serial console (like the Raspberry Pi and Raspberry Pi 2
that have no Bluetooth); the Bluetooth uses the mini-UART instead[1][2].

This rewords the comment instead of enumerating every hardwares that can
be extended in the future.

[1]: https://www.raspberrypi.com/documentation/computers/configuration.html#uarts-and-device-tree
[2]: https://github.com/raspberrypi/linux/blob/rpi-6.6.y/arch/arm/boot/dts/overlays/miniuart-bt-overlay.dts#L4-L6

Signed-off-by: Gaël PORTAY <gael.portay@rtone.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-08-08 18:43:13 +02:00
..
patches configs/raspberrypi*: bump kernel version to 17f135b (6.6.28) 2024-07-12 16:42:14 +02:00
cmdline_5.txt configs: add raspberrypi 5 defconfig 2024-06-06 16:18:09 +02:00
cmdline.txt package/rpi-firmware: add option to use custom cmdline.txt 2022-10-31 13:12:59 +01:00
config_0w.txt board/raspberrypi: reword console comment 2024-08-08 18:43:13 +02:00
config_3_64bit.txt board/raspberrypi: reword console comment 2024-08-08 18:43:13 +02:00
config_3_qt5we.txt board/raspberrypi: reword console comment 2024-08-08 18:43:13 +02:00
config_3.txt board/raspberrypi: reword console comment 2024-08-08 18:43:13 +02:00
config_4_64bit.txt board/raspberrypi: reword console comment 2024-08-08 18:43:13 +02:00
config_4.txt board/raspberrypi: reword console comment 2024-08-08 18:43:13 +02:00
config_5.txt configs: add raspberrypi 5 defconfig 2024-06-06 16:18:09 +02:00
config_cm4io_64bit.txt board/raspberrypi: reword console comment 2024-08-08 18:43:13 +02:00
config_cm4io.txt board/raspberrypi: reword console comment 2024-08-08 18:43:13 +02:00
config_default.txt package/rpi-firmware: rework boot/config file handling 2021-10-17 22:11:41 +02:00
config_zero2w.txt board/raspberrypi: reword console comment 2024-08-08 18:43:13 +02:00
genimage.cfg.in board/raspberrypi/post-image.sh: generate genimage config from template if not present 2023-09-29 09:11:49 +02:00
linux-4k-page-size.fragment configs: add raspberrypi 5 defconfig 2024-06-06 16:18:09 +02:00
post-build.sh Revert "board/raspberrypi: handle dtb overlays for all variants" 2023-12-03 18:12:25 +01:00
post-image.sh board/raspberrypi/post-image.sh: generate genimage config from template if not present 2023-09-29 09:11:49 +02:00
readme.txt configs/raspberrypi5: install BCM2712D0 device-tree blob 2024-07-17 23:17:11 +02:00

Raspberry Pi

Intro
=====

These instructions apply to all models of the Raspberry Pi:
  - the original models A and B,
  - the "enhanced" models A+ and B+,
  - the model B2 (aka Raspberry Pi 2)
  - the model B3 (aka Raspberry Pi 3).
  - the model B4 (aka Raspberry Pi 4).
  - the model CM4 (aka Raspberry Pi Compute Module 4 and IO Board).
  - the model B5 (aka Raspberry Pi 5).

How to build it
===============

Configure Buildroot
-------------------

There are several Raspberry Pi defconfig files in Buildroot, one for
each major variant, which you should base your work on:

For models A, B, A+ or B+:

  $ make raspberrypi_defconfig

For model Zero (model A+ in smaller form factor):

  $ make raspberrypi0_defconfig

or for model Zero W (model Zero with wireless LAN and Bluetooth):

  $ make raspberrypi0w_defconfig

For model Zero 2 W (model B3 in smaller form factor):

  $ make raspberrypizero2w_defconfig

For model 2 B:

  $ make raspberrypi2_defconfig

For model 3 B and B+:

  $ make raspberrypi3_defconfig

or for model 3 B and B+ (64 bit):

  $ make raspberrypi3_64_defconfig

For model 4 B:

  $ make raspberrypi4_defconfig

or for model 4 B (64 bit):

  $ make raspberrypi4_64_defconfig

For model CM4 (on IO Board):

  $ make raspberrypicm4io_defconfig

or for CM4 (on IO Board - 64 bit):

  $ make raspberrypicm4io_64_defconfig

For model 5 B:

  $ make raspberrypi5_defconfig

Build the rootfs
----------------

Note: you will need to have access to the network, since Buildroot will
download the packages' sources.

You may now build your rootfs with:

  $ make

(This may take a while, consider getting yourself a coffee ;-) )

Result of the build
-------------------

After building, you should obtain this tree:

    output/images/
    +-- bcm2708-rpi-b-rev1.dtb      [1]
    +-- bcm2708-rpi-b.dtb           [1]
    +-- bcm2708-rpi-b-plus.dtb      [1]
    +-- bcm2708-rpi-cm.dtb          [1]
    +-- bcm2708-rpi-zero.dtb        [1]
    +-- bcm2708-rpi-zero-w.dtb      [1]
    +-- bcm2710-rpi-zero-2-w.dtb    [1]
    +-- bcm2709-rpi-2-b.dtb         [1]
    +-- bcm2710-rpi-2-b.dtb         [1]
    +-- bcm2710-rpi-3-b.dtb         [1]
    +-- bcm2710-rpi-3-b-plus.dtb    [1]
    +-- bcm2710-rpi-cm3.dtb         [1]
    +-- bcm2711-rpi-4-b.dtb         [1]
    +-- bcm2711-rpi-400.dtb         [1]
    +-- bcm2711-rpi-cm4.dtb         [1]
    +-- bcm2711-rpi-cm4s.dtb        [1]
    +-- bcm2712-rpi-5-b.dtb         [1]
    +-- bcm2712d0-rpi-5-b.dtb       [1]
    +-- boot.vfat
    +-- rootfs.ext4
    +-- rpi-firmware/
    |   +-- bootcode.bin
    |   +-- cmdline.txt
    |   +-- config.txt
    |   +-- fixup.dat               [1]
    |   +-- fixup4.dat              [1]
    |   +-- start.elf               [1]
    |   +-- start4.elf              [1]
    |   `-- overlays/               [2]
    +-- sdcard.img
    +-- Image                       [1]
    `-- zImage                      [1]

[1] Not all of them will be present, depending on the RaspberryPi
    model you are using.

[2] Only for the Raspberry Pi 3/4 Models (overlay miniuart-bt is needed
    to enable the RPi3 serial console otherwise occupied by the bluetooth
    chip). Alternative would be to disable the serial console in cmdline.txt
    and /etc/inittab.

How to write the SD card
========================

Once the build process is finished you will have an image called "sdcard.img"
in the output/images/ directory.

Copy the bootable "sdcard.img" onto an SD card with "dd":

  $ sudo dd if=output/images/sdcard.img of=/dev/sdX

Insert the SDcard into your Raspberry Pi, and power it up. Your new system
should come up now and start two consoles: one on the serial port on
the P1 header, one on the HDMI output where you can login using a USB
keyboard.

How to write to CM4 eMMC memory
===============================

For CM4 modules without eMMC memory see above for booting from SD card,
for CM4 modules with eMMC memory proceed as following:

- fit jumper on IO Board header J2 to disable eMMC boot
- connect IO Board micro USB port (J11 USB slave) to your host linux system
- power up CM4/IO Board (lsusb command should show a '0a5c:2711 Broadcom Corp.
  BCM2711 Boot' device)
- run 'sudo ./host/bin/rpiboot', output should look like the following:
    Waiting for BCM2835/6/7/2711...
    Loading embedded: bootcode4.bin
    Sending bootcode.bin
    Successful read 4 bytes
    Waiting for BCM2835/6/7/2711...
    Loading embedded: bootcode4.bin
    Second stage boot server
    Loading embedded: start4.elf
    File read: start4.elf
    Second stage boot server done

- a USB mass storage device should show up (the CM4 eMMC memory), proceed
  as described above to copy sdcard.img to it
- power down CM4/IO Board
- remove jumper on IO Board header J2 to re-enable eMMC boot
- power up CM4/IO Board