aarch64 u-boot for raspberry pi 4 with 8GB RAM

This forum is for topics dealing with problems with software specifically in the AArch64 repo.

aarch64 u-boot for raspberry pi 4 with 8GB RAM

Postby jpnadas » Sun May 07, 2023 7:03 am

Hi,

I have installed archarm aarch64 in my CM4, and the default instructions in the guide did not work.

I instead had to change the u-boot configuration, and I didn't have to change the device in fstab. I picked up the instructions from this guide: https://blog.huenet.net/how-to-install-64-bit-arch-on-a-raspberry-pi-4/. It seems to suggest the issue is only for 8GB ones, but I don't have other versions to test here.

The u-boot configuration which worked for me is:
$this->bbcode_second_pass_code('', '
# After modifying, run ./mkscr

# Set root partition to the second partition of boot device
part uuid ${devtype} ${devnum}:2 uuid

setenv bootargs console=ttyS1,115200 console=tty0 root=PARTUUID=${uuid} audit=0 rw rootwait smsc95xx.macaddr="${usbethaddr}"

fatload ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /Image;
fatload ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /initramfs-linux.img;
booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr};
')

I was wondering what's the path to follow for adding the other u-boot config to the main image. Alternatively, if the instructions are not suitable for all versions, how to patch the official instructions.

Thanks a lot.
jpnadas
 
Posts: 1
Joined: Sun May 07, 2023 6:54 am

Re: aarch64 u-boot for raspberry pi 4 with 8GB RAM

Postby stepfr » Fri Jul 14, 2023 10:49 pm

I can confirm the issue is still here also on Raspberry Pi 4 Model B Rev 1.5 4GB
The issue is old and since we are still on this version :
uboot-raspberrypi-2021.04-1 is up to date
Many of us will have this issue.
First topics about this bug as a reminder :
[url]https://archlinuxarm.org/forum/viewtopic.php?f=67&t=15422[/url] the solution is given there :
[url]https://archlinuxarm.org/forum/viewtopic.php?f=67&t=15422&start=10#p67207[/url] and following posts.

As a summary, as a temporary fix, you have to modify the /boot/boot.txt to replace ${fdt_addr_r} by ${fdt_addr} on the lines beginig by "booti" (2 lines) and then rebuild the boot.scr using the script ./mkscr (also in /boot). This script needs uboot-tools to be installed (and it's not true for a fresh install). No need to modify /etc/fstab (as said by jpnadas).

It's seems to be linked to a uboot bug (that may be corrected "soon"):

[url]https://forums.raspberrypi.com//viewtopic.php?f=98&t=314845[/url]
[url]https://marc.info/?l=u-boot&m=167967087204332&w=2[/url]

As it's my first Rpi using archlinux (i have some olimex), i had to add some more steps, tu use mkscr.

Using another linux with SD card in a reader (usb port) i had to prepare a chroot (to make pacman works (to install uboot-tools)
1/ Mount / (ext4) on /xxx/root
2/ Mount /boot (vfat) on /xxx/root/boot
3/ Mount other mandatory filesystems :
mount --bind /dev /xxx/root/dev
mount -t sysfs sys /xxx/root/sys/
mount -t proc /proc /xxx/root/proc
mount --bind /etc/resolv.conf /xxx/root/etc/resolv.conf
chroot /xxx/root

you have to initialise pacman while root in the chroot
pacman-key --init
pacman-key --populate archlinuxarm
Install uboot-tools :
Pacman -S uboot-tools

then modify the /boot/boot.txt of the chrooted archlinux as explained previously
then use the ./mkscr command (while in /boot) to generate a new boot.scr

At last exist the chroot, umount all filesystems related to the archlinux SD card.
use the SD card in the RPi4 and ... AARCH64 using RPi4b is working !

Hope this post will help other users until uboot mainteners will fix this problem.
stepfr
 
Posts: 3
Joined: Tue Jan 10, 2023 2:41 am

Re: aarch64 u-boot for raspberry pi 4 with 8GB RAM

Postby nocreativity » Sun Aug 27, 2023 4:25 pm

Thanx to stepfr for summing up the way to fix archlinux installations on current (rev 1.5) raspberry pi 4! (Unfortunately, I hadn't seen his post until I had it figured out myself, based on almost the same posts mentioned by stepfr.)

Two comments:
(1) I can confirm that it works the way stepfr has described it.
(2) If you have another Linux machine you don't have to do the "chroot" part: If you have the SD card mounted on another linux machine (doesn't have to be a raspi), to update the boot.scr file, you
(2a) install uboot-tools,
(2b) change ([code]cd[/code]) to the "boot" directory (base directory of first SD card partition) and
(2c) execute [code]mkimage -A arm -T script -O linux -d boot.txt boot.scr[/code]. Thereafter you umount the SD card, put it in the raspberry pi and booting works! You continue performing the pacman-key commands. No need to install uboot-tools.
nocreativity
 
Posts: 1
Joined: Sun Aug 27, 2023 3:48 pm


Return to ARMv8

Who is online

Users browsing this forum: No registered users and 32 guests