Hello all,
The PoE HAT control on the stock kernel is done via the device tree overlay. Per viewtopic.php?f=23&t=14544 loading overlays on aarch64 must be done from uboot.
I followed the instruction by Darell tan and cooked up the following boot script.
$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} rw rootwait smsc95xx.macaddr="${usbethaddr}"
if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /Image; then
if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /dtbs/${fdtfile}; then
fdt addr ${fdt_addr_r}
fdt resize
setexpr fdtovaddr ${fdt_addr_r} + F000
load ${devtype} ${devnum}:${bootpart} ${fdtovaddr} /overlays/upstream-pi4.dtbo && fdt apply ${fdtovaddr}
load ${devtype} ${devnum}:${bootpart} ${fdtovaddr} /overlays/rpi-poe.dtbo && fdt apply ${fdtovaddr}
load ${devtype} ${devnum}:${bootpart} ${fdtovaddr} /overlays/disable-bt.dtbo && fdt apply ${fdtovaddr}
if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /initramfs-linux.img; then
booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
else
booti ${kernel_addr_r} - ${fdt_addr_r};
fi;
fi;
fi
# vim:set ts=2 sw=2 et:
')
The overlay files come from linux-raspberrypi4.
However, I got the following error from uboot.
$this->bbcode_second_pass_code('', '
U-Boot 2020.07-2 (Aug 09 2020 - 02:00:40 +0000) Arch Linux ARM
DRAM: 7.9 GiB
RPI 4 Model B (0xd03114)
MMC: emmc2@7e340000: 0, mmcnr@7e300000: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Net: eth0: genet@7d580000
starting USB...
No working controllers 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
1142 bytes read in 12 ms (92.8 KiB/s)
## Executing script at 02c00000
30601728 bytes read in 1300 ms (22.4 MiB/s)
32503 bytes read in 27 ms (1.1 MiB/s)
2778 bytes read in 19 ms (142.6 KiB/s)
failed on fdt_overlay_apply(): FDT_ERR_NOTFOUND
2937 bytes read in 19 ms (150.4 KiB/s)
failed on fdt_overlay_apply(): FDT_ERR_BADMAGIC
base fdt does did not have a /__symbols__ node
make sure you've compiled with -@
1073 bytes read in 19 ms (54.7 KiB/s)
failed on fdt_overlay_apply(): FDT_ERR_BADMAGIC
base fdt does did not have a /__symbols__ node
make sure you've compiled with -@
7040360 bytes read in 311 ms (21.6 MiB/s)
ERROR: Did not find a cmdline Flattened Device Tree
Starting kernel ...
')
Obviously the overlay file from armv7 does not work on aarch64. Have anyone worked on the overlay on aarch64? Where can I find the files necessary to compile the overlay files for mainline kernel?