Zero 2 W support

Ask questions about Arch Linux ARM. Please search before making a new topic.

Re: Zero 2 W support

Postby ionspin » Sun Nov 21, 2021 9:47 pm

$this->bbcode_second_pass_quote('dingausmwald', '@')ionspin

Just to be clear, i used the rpi-aarch64-latest image. Not the aarch64-latest. But i guess you did too.



Yes, that is correct, md5sum 226c986716ac2a0d95b426f5ed3352a4 to be precise.

$this->bbcode_second_pass_quote('graysky', 'K')evin refreshed the images a few days ago. If I understand this thread correctly, it should just work.

http://il.us.mirror.archlinuxarm.org/os ... est.tar.gz
or
http://il.us.mirror.archlinuxarm.org/os ... est.tar.gz

First try 64-bit since I thought that is what I understand works. I do not have the hardware so I cannot.


The rpi-aarch64-latest you linked is the one I was testing with. As far as the ArchLinuxARM-rpi-4-latest, that one worked out of the box, but unfortunately I need a 64-bit system.

I have naively patched uboot to include Zero 2, and now I am stuck at this point
$this->bbcode_second_pass_code('', '
U-Boot 2021.04-1 (Nov 21 2021 - 21:23:36 +0000) Arch Linux ARM

DRAM: 448 MiB
RPI Zero 2 (0x902120)
MMC: mmc@7e202000: 0, mmcnr@7e300000: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In: serial
Out: vidconsole
Err: vidconsole
Net: No ethernet found.
starting USB...
Bus usb@7e980000: USB DWC2
scanning bus usb@7e980000 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
708 bytes read in 2 ms (345.7 KiB/s)
## Executing script at 02c00000
39852544 bytes read in 1648 ms (23.1 MiB/s)
28481 bytes read in 7 ms (3.9 MiB/s)
7231011 bytes read in 301 ms (22.9 MiB/s)
Moving Image from 0x80000 to 0x200000, end=28e0000
## Flattened Device Tree blob at 02e00000
Booting using the fdt blob at 0x2e00000
Using Device Tree in place at 0000000002e00000, end 0000000002e09f40

Starting kernel ...
')

The patch for the uboot was this
$this->bbcode_second_pass_code('', '
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 55afaa54d9..431984870a 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -157,6 +157,11 @@ static const struct rpi_model rpi_models_new_scheme[] = {
DTB_DIR "bcm2711-rpi-4-b.dtb",
true,
},
+ [0x12] = {
+ "Zero 2",
+ DTB_DIR "bcm2710-rpi-zero-2.dtb",
+ true,
+ },
[0x13] = {
"400",
DTB_DIR "bcm2711-rpi-400.dtb",
')

and the accompanying PKGBUILD for uboot-raspberrypi is then this:
$this->bbcode_second_pass_code('', '
# U-Boot: Raspberry Pi
# Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>

buildarch=12

pkgname=uboot-raspberrypi
pkgver=2021.04
pkgrel=1
pkgdesc="U-Boot for Raspberry Pi"
arch=('armv7h' 'aarch64')
url='http://www.denx.de/wiki/U-Boot/WebHome'
license=('GPL')
backup=('boot/boot.txt' 'boot/boot.scr' 'boot/config.txt')
makedepends=('bc' 'dtc' 'git')
conflicts_armv7h=('linux-raspberrypi')
_commit=12bc6e3677348adaffd155e7a04761e2661d4bff
source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver/rc/-rc}.tar.bz2"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2710-rpi-3-b.dtb"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2710-rpi-3-b-plus.dtb"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2710-rpi-cm3.dtb"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2711-rpi-4-b.dtb"
"https://github.com/raspberrypi/firmware/raw/${_commit}/boot/bcm2710-rpi-zero-2.dtb"

'0001-rpi-increase-space-for-kernel.patch'
'0002-add-rpi-zero-2.patch'
'boot.txt.v2'
'boot.txt.v3'
'mkscr')
md5sums=('1299c23ee4fde7e73a1b9f8f80fd28e0'
'8ec878fae64a80af5cd8b1b35e8c1f04'
'2adcbe600344faccba7c02a48c69d13b'
'1c1b6783d95c9d2da868e3326845e758'
'6d2e63f432358b23f98fd86c956ae0de'
'34d9a7450c0ace160a8d5ad7c31552d5'
'728c4a0a542db702b8d88ffe1994660c'
'f8b4442a2d606930fe21f4e0aede757a'
'69e883f0b8d1686b32bdf79684623f06'
'be8abe44b86d63428d7ac3acc64ee3bf'
'021623a04afd29ac3f368977140cfbfd')

prepare() {
cd u-boot-${pkgver/rc/-rc}

patch -p1 -i ../0001-rpi-increase-space-for-kernel.patch
patch -p1 -i ../0002-add-rpi-zero-2.patch
}

build() {
cd u-boot-${pkgver/rc/-rc}

unset CFLAGS
unset CXXFLAGS
unset CPPFLAGS

make distclean
[[ $CARCH == "armv7h" ]] && make rpi_2_config
[[ $CARCH == "aarch64" ]] && make rpi_arm64_config
echo 'CONFIG_IDENT_STRING=" Arch Linux ARM"' >> .config
make EXTRAVERSION=-${pkgrel}
}

package() {
cd u-boot-${pkgver/rc/-rc}

mkdir -p "${pkgdir}"/boot

if [[ $CARCH == "armv7h" ]]; then
cp u-boot.bin ${pkgdir}/boot/kernel7.img
cp ../boot.txt.v2 ../boot.txt
elif [[ $CARCH == "aarch64" ]]; then
cp u-boot.bin ${pkgdir}/boot/kernel8.img
cp ../*.dtb ${pkgdir}/boot
cp ../boot.txt.v3 ../boot.txt
echo "enable_uart=1" > ${pkgdir}/boot/config.txt
fi

tools/mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d ../boot.txt "${pkgdir}"/boot/boot.scr
cp ../{boot.txt,mkscr} "${pkgdir}"/boot
}
')

I also had to add the bcm2710-rpi-zero-2.dtb to the /boot/dtbs/broadcom/ and didn't have time to figure out how to get that into the PKBUILD just yet, I've never written one before and it's getting late here :)

I'm receiving a mini-HDMI connector tomorrow so I might be able to see if something different happens when I install linux-raspberrypi4 kernel on aarch64 because I was unable to get UART to work with it.

Thanks for the help in any case!
ionspin
 
Posts: 4
Joined: Sun Nov 21, 2021 7:05 pm

Re: Zero 2 W support

Postby ionspin » Mon Nov 22, 2021 2:51 pm

A quick update, I'll try to test more in detail later. Mini-HDMI arrived, so I could test a bit more as my UART connection was flaky.

With patched U-Boot from previous post and linux-aarch64-5.15.1-1 would boot, but usb (no keyboard/usb ethernet) didn't seem to work.
After linux-raspberrypi4-5.10.79-2 (no U-Boot now) Zero 2 booted without problems and usb seems to work. I don't know if a combination of what I did and copying the DTB had additional effect on this so I'll retest with a fresh install later.

@dingausmwald
I think copying the bcm2710-rpi-zero-2.dtb to /boot AND /dtbs/broadcom/bcm283x-rpi-other.dtb would be equivalent to the naive U-Boot patch i posted and let you boot.
ionspin
 
Posts: 4
Joined: Sun Nov 21, 2021 7:05 pm

Re: Zero 2 W support

Postby ionspin » Mon Nov 22, 2021 4:45 pm

Latest update, and the solution I'll use for now:
- Clean SD card
- Installed ArchLinuxARM-rpi-aarch64-latest.tar.gz
- Chroot from another RPI
- Installed linux-raspberrypi4
$this->bbcode_second_pass_code('', '[root@alarm /]# pacman -S linux-raspberrypi4
resolving dependencies...
looking for conflicting packages...
:: linux-raspberrypi4 and linux-aarch64 are in conflict (linux). Remove linux-aarch64? [y/N] y
:: linux-raspberrypi4 and uboot-raspberrypi are in conflict. Remove uboot-raspberrypi? [y/N] y

Packages (3) linux-aarch64-5.15.1-1 [removal] uboot-raspberrypi-2021.04-1 [removal] linux-raspberrypi4-5.10.79-2

Total Installed Size: 47.66 MiB
Net Upgrade Size: -71.77 MiB

:: Proceed with installation? [Y/n] y')
Booted the Zero 2 W without any problems, working usb
ionspin
 
Posts: 4
Joined: Sun Nov 21, 2021 7:05 pm

Re: Zero 2 W support

Postby WebReflection » Tue Nov 23, 2021 2:23 pm

I can confirm using the Raspberry Pi 4 installation info for Aarch64, booting from a Pi 4, or even Pi 3, swapping to linux-raspberrypi4 works on Pi Zero 2 W, Pi 3, and Pi 4 out of the box.

At this point, I wonder if the Raspberry Pi 4 page shouldn't just be Raspberry Pi 64bit and if the linux-raspberrypi4 also shouldn't be renamed ... this stuff works like a charm in all recent Pis, including GPU HW acceleration, and the dance to have this working with the bare aarch64 dist consistently across all 3 platforms is kinda undesired, plus that dist doesn't bring HW acceleration to Pi 4, but it does to the Pi 3, yet it can't see wlan0 on Pi Zero 2, so basically it's a one dist fits nothing but Pi 3, although is suggested for the 4 too.

Thoughts? And btw, thanks for the info/hint on how to make it work there!
WebReflection
 
Posts: 99
Joined: Tue Apr 02, 2013 6:49 pm

Re: Zero 2 W support

Postby graysky » Tue Nov 23, 2021 2:57 pm

The rename of the kernel packages is being discussed.

EDIT
And now it is done: viewtopic.php?f=3&t=15691
graysky
Developer
 
Posts: 1728
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: Zero 2 W support

Postby WebReflection » Sun Dec 05, 2021 11:33 am

the "done" link doesn't exist, plus it's not clear if ArchLinuxARM-rpi-aarch64-latest.tar.gz already have the correct etc/fstab or if it uses already the linux-rpi kernel, desired, instead of the generic aarch64.

If that's the case, all notes around renaming the /etc/fstab for Pi 64 (any of them) can be dropped.
WebReflection
 
Posts: 99
Joined: Tue Apr 02, 2013 6:49 pm

Re: Zero 2 W support

Postby graysky » Sun Dec 05, 2021 11:38 am

$this->bbcode_second_pass_quote('WebReflection', 't')he "done" link doesn't exist, plus it's not clear if ArchLinuxARM-rpi-aarch64-latest.tar.gz already have the correct etc/fstab or if it uses already the linux-rpi kernel, desired, instead of the generic aarch64.

If that's the case, all notes around renaming the /etc/fstab for Pi 64 (any of them) can be dropped.


Fixed link. The 64-bit image will boot the mainline kernel (linux-aarch64), you need to install linux-rpi once booted and upon doing so will have the fstab automatically corrected.
graysky
Developer
 
Posts: 1728
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000
Top

Re: Zero 2 W support

Postby WebReflection » Sun Dec 05, 2021 5:20 pm

that's nice, thanks for the update!
WebReflection
 
Posts: 99
Joined: Tue Apr 02, 2013 6:49 pm

Re: Zero 2 W support

Postby graysky » Sun Dec 05, 2021 5:24 pm

See the brief instruction at the end of this post which suggest a few other packages to pull down on the kernel swap.
graysky
Developer
 
Posts: 1728
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: Zero 2 W support

Postby WebReflection » Mon Dec 06, 2021 9:43 am

Done, thanks! I've got last question though ... the 32bit version of the Pi4 (maybe others too, haven't checked yet) uses (or used to use) the linux-raspberrypi4 (or linux-rpi) by default ... and I wonder why we cannot have the same with the aarch64 version specific for the pi, so that the SD card is already flushed with the most compatible / ad-hoc kernel, otherwise we need to do the fancy dance across multiple version of the Pi to be lucky enough it boots and we can install the dedicated kernel.

I know that in an ideal world the aarch64 mainline kernel should "just work" and be the one to use, but I am also pragmatic and see that's not going to happen any time soon, if ever.

In few words, is it planned to have http://os.archlinuxarm.org/os/ArchLinux ... est.tar.gz snipping same as http://os.archlinuxarm.org/os/ArchLinux ... est.tar.gz does, meaning with the linux-rpi specific kernel, instead of the mainstream one?

Thanks!
WebReflection
 
Posts: 99
Joined: Tue Apr 02, 2013 6:49 pm

PreviousNext

Return to User Questions

Who is online

Users browsing this forum: No registered users and 9 guests