bcm27xx: add support for Raspberry Pi Zero 2
authorStijn Tintel <stijn@linux-ipv6.be>
Mon, 1 Nov 2021 21:39:48 +0000 (23:39 +0200)
committerStijn Tintel <stijn@linux-ipv6.be>
Fri, 1 Jul 2022 09:56:56 +0000 (12:56 +0300)
Due to licensing uncertainty, we do not include the firmwares for the
wireless chips used in the Raspberry Pi Zero 2 W. To have working
wireless, follow the instructions below.

For people building their own images:

  mkdir -p files/lib/firmware/brcm
  wget -P files/lib/firmware/brcm/ https://github.com/RPi-Distro/firmware-nonfree/raw/bullseye/debian/config/brcm80211/brcm/brcmfmac43436-sdio.bin
  wget -P files/lib/firmware/brcm/ https://github.com/RPi-Distro/firmware-nonfree/raw/bullseye/debian/config/brcm80211/brcm/brcmfmac43436-sdio.txt
  wget -P files/lib/firmware/brcm/ https://github.com/RPi-Distro/firmware-nonfree/raw/bullseye/debian/config/brcm80211/brcm/brcmfmac43436s-sdio.bin
  wget -P files/lib/firmware/brcm/ https://github.com/RPi-Distro/firmware-nonfree/raw/bullseye/debian/config/brcm80211/brcm/brcmfmac43436s-sdio.txt

Now build the OpenWrt image as usual, and it will include the firmware
files in the correct location.

For people using ext4 images:

Write the ext4 image to the sdcard, then mount the 2nd partition and put
the firmware files from the links above in /lib/firmware/brcm relative
from the mount point where the partition is mounted.

For people using squashfs images:

Write the squashfs image to the sdcard, place it in the Raspberry Pi
Zero 2 W, boot it and wait for the overlay filesystem to be created.
Find the offset of the overlay filesystem in sysfs:

  # cat /sys/devices/virtual/block/loop0/loop/offset
  25755648

Shut down the device, unplug the power and move the SD card to a Linux
computer. Mount the 2nd partition of the sdcard as a loop device with
the offset found earlier.

  sudo mount /dev/sdh2 -o loop,offset=25755648 /mnt/temp

Put the firmware files from the links above in /upper/lib/firmware/brcm
relative to the mount point where the loop device is mounted.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Tested-by: Peter van Dijk <peter@7bits.nl>
target/linux/bcm27xx/base-files/etc/board.d/02_network
target/linux/bcm27xx/base-files/etc/diag.sh
target/linux/bcm27xx/image/Makefile

index b4394f6922f14e15989fb5b0af96a543db7ce226..23bc9afdb98522070eb5b2c247afcbff94ab68a5 100644 (file)
@@ -23,6 +23,7 @@ raspberrypi,model-b-rev2)
        ucidef_set_interface_lan "eth0"
        ;;
 
+raspberrypi,model-zero-2 |\
 raspberrypi,model-zero-w)
        ucidef_set_interface_lan "wlan0"
        ;;
index a22ffd3f2a3a1244b91b27ab38ee5448826eac67..180b31ec95ccf9043b887e0c19e3ee6a8c1fb76d 100644 (file)
@@ -20,6 +20,7 @@ set_state() {
        raspberrypi,3-compute-module |\
        raspberrypi,model-b |\
        raspberrypi,model-zero |\
+       raspberrypi,model-zero-2 |\
        raspberrypi,model-zero-w)
                status_led="led0"
                ;;
index 83d255f32600dade49157f2ff6ad43d03ff69ad0..4cd1052941cc745e7da81087a9ef91989cb26e0e 100644 (file)
@@ -96,13 +96,15 @@ define Device/rpi-2
        bcm2709-rpi-2-b bcm2710-rpi-2-b \
        bcm2710-rpi-3-b bcm2710-rpi-3-b-plus \
        bcm2711-rpi-4-b bcm2711-rpi-400 \
-       bcm2710-rpi-cm3 bcm2711-rpi-cm4
+       bcm2710-rpi-cm3 bcm2711-rpi-cm4 \
+       bcm2710-rpi-zero-2
   SUPPORTED_DEVICES := \
-       rpi-2-b rpi-3-b rpi-3-b-plus rpi-cm \
+       rpi-2-b rpi-3-b rpi-3-b-plus rpi-cm rpi-zero-2 \
        raspberrypi,2-model-b raspberrypi,2-model-b-rev2 \
        raspberrypi,3-model-b raspberrypi,3-model-b-plus \
        raspberrypi,3-compute-module raspberrypi,compute-module-3 \
-       raspberrypi,400 raspberrypi,4-compute-module raspberrypi,4-model-b
+       raspberrypi,400 raspberrypi,4-compute-module raspberrypi,4-model-b \
+       raspberrypi,model-zero-2
   DEVICE_PACKAGES := \
        cypress-firmware-43430-sdio \
        cypress-nvram-43430-sdio-rpi-3b \
@@ -126,12 +128,14 @@ define Device/rpi-3
   DEVICE_DTS := \
        broadcom/bcm2710-rpi-2-b \
        broadcom/bcm2710-rpi-3-b broadcom/bcm2710-rpi-3-b-plus \
-       broadcom/bcm2710-rpi-cm3
+       broadcom/bcm2710-rpi-cm3 \
+       broadcom/bcm2710-rpi-zero-2
   SUPPORTED_DEVICES := \
-       rpi-3-b rpi-3-b-plus \
+       rpi-3-b rpi-3-b-plus rpi-zero-2 \
        raspberrypi,2-model-b-rev2 \
        raspberrypi,3-model-b raspberrypi,3-model-b-plus \
-       raspberrypi,3-compute-module raspberrypi,compute-module-3
+       raspberrypi,3-compute-module raspberrypi,compute-module-3 \
+       raspberrypi,model-zero-2
   DEVICE_PACKAGES := \
        cypress-firmware-43430-sdio \
        cypress-nvram-43430-sdio-rpi-3b \