5148
Comment:
|
5188
|
Deletions are marked like this. | Additions are marked like this. |
Line 6: | Line 6: |
* Same with u-boot (both with 5.5 and 5.6), after modifying the u-boot package in Debian experimental to add the rpi4 target | * Same with u-boot (both with 5.5 and 5.6), after modifying the u-boot package in Debian testing/unstable/experimental to add the rpi4 target (See DebianBug:958668) |
Status on 2020-03-30
- What works:
- Booting Linux 5.5 from unstable, using raspi-firmware from unstable (directly -- as for RPI3 images)
- Same with Linux 5.6
Same with u-boot (both with 5.5 and 5.6), after modifying the u-boot package in Debian testing/unstable/experimental to add the rpi4 target (See 958668)
The rpi4 branch of image-specs builds an image that works, taking a number of shortcuts
- TODOs:
Kernel: 5.5 has partial support (see table here). 5.6 is better. 5.7 will be even better.
- Modify u-boot package to support booting using it.
- Integrate ability to boot with u-boot in raspi-firmware
- Test that everything works fine:
- Ethernet
- Wifi
- GPIO
- ...
Random notes
Chip is Broadcom BCM2711 https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711/README.md
Other distros
Raspbian
- ships only a armhf image
- 4.19 kernel
Ubuntu
both armhf and arm64 images. See https://ubuntu.com/download/raspberry-pi/
- Boots using u-boot and a custom 5.3.0 kernel. Serial console, HDMI, network all work. Very nice.
- The three important pieces seem to be:
- the linux-firmware-raspi2 source package. Maybe equivalent to Debian's raspi-firmware source package?
- the u-boot-rpi package (different from Debian's)
the kernel (linux-raspi2 source package https://launchpad.net/ubuntu/eoan/+source/linux-raspi2 )
openSUSE
boots using u-boot -> grub -> Linux 5.4.14
Debian
- customizing the images for RPI3 and using the 5.5-rc5 kernel in experimental
- works: initial boot, HDMI
- doen't work; serial console, network, keyboard
Upstream kernel
Upstream mailing list: http://lists.infradead.org/pipermail/linux-rpi-kernel/
Issue to track progress of support: https://github.com/lategoodbye/rpi-zero/issues/43
Many patches already landed in the vanilla kernel, mainly from Nicolas Saenz Julienne. https://github.com/torvalds/linux/search?q=repo%3Atorvalds%2Flinux+Nicolas+Saenz+Julienne&unscoped_q=repo%3Atorvalds%2Flinux+Nicolas+Saenz+Julienne&type=Commits
https://git.kernel.org/pub/scm/linux/kernel/git/nsaenz/linux-rpi.git
Boot methods
There are several ways to boot...
Directly load kernel and initramfs from RPI firmware
(That's what the Debian images currently do)
FIXME this doesn't work for the RPI4. I'm not sure why. Maybe because of one of the cmd line parameters passed to the kernel in that case?
RPI firmware loads u-boot, which loads kernel/initramfs
(That's what the Ubuntu images do, and is promising)
FIXME
# https://a-delacruz.github.io/ubuntu/rpi3-setup-64bit-uboot.html # mkimage -A arm64 -O linux -T script -d boot.txt boot.scr # vmlinuz and initrd must be converted. See https://linux-sunxi.org/Initial_Ramdisk or https://andrei.gherzan.ro/linux/uboot-on-rpi/ # mkimage -A arm64 -T ramdisk -C none -n uInitrd -d initrd.img uInitrd # mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "Linux kernel" -d vmlinuz uImage #setenv bootargs earlyprintk console=ttyS0,115200 console=tty1 root=LABEL=writable rw #fdt addr ${fdt_addr} && fdt get value bootargs /chosen bootargs
RPI firmware loads u-boot, which loads grub using EFI, which loads kernel/initramfs
That's what OpenSUSE does. See https://www.suse.com/media/article/UEFI_on_Top_of_U-Boot.pdf
Network boot
Some info at http://lig-membres.imag.fr/duble/software/raspberry-pi-netboot/
Various technical tips
loop-mounting images
# fdisk -l 2020-02-13-raspbian-buster-lite.img Disk 2020-02-13-raspbian-buster-lite.img: 1,7 GiB, 1849688064 bytes, 3612672 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x738a4d67 Device Boot Start End Sectors Size Id Type 2020-02-13-raspbian-buster-lite.img1 8192 532479 524288 256M c W95 FAT32 (LBA) 2020-02-13-raspbian-buster-lite.img2 532480 3612671 3080192 1,5G 83 Linux # mount -o loop,offset=$((8192*512)) 2020-02-13-raspbian-buster-lite.img mountpoint
serial console
https://www.raspberrypi.org/documentation/usage/gpio/ Red: +5V. Green: Tx. White : Rx. Black: GND. => black on GND, white on TXD (GPIO 14) Green on RXD (GPIO 15) add enable_uart=1 to /boot/config.txt
then screen /dev/ttyUSB0 115200
monitor DHCP traffic using tcpdump
tcpdump -i eth0 -pvn port 67 and port 68
Build a kernel
To disable DEBUG_INFO before build: scripts/config --disable DEBUG_INFO