[Tinkerphones] LetuxOS: PinePhone support

H. Nikolaus Schaller hns at goldelico.com
Mon Feb 3 22:08:00 CET 2020


Hi Xavi,

> Am 03.02.2020 um 21:37 schrieb Xavi Drudis Ferran <xdrudis at tinet.cat>:
> 
> El Mon, Feb 03, 2020 at 07:24:22PM +0100, H. Nikolaus Schaller deia:
>> Hi,
>> finally, after bootstrapping my aarch64-linux-gnu (arm64) cross-toolchain
>> and fixing minor issues I am able to compile our kernel tree for
>> arm64 :)
>> 
>> Using a pinephone_defconfig from
>> 
>> 	https://gitlab.com/pine64-org/linux/blob/58a9a99b775d71c5b78f19da1a251788561d28cc/arch/arm64/configs/pinephone_defconfig
>> 
>> and letux-5.5.1 I got an 248 MB vmimage.
>> 
>> Next I have to find out which image compression is needed for the
>> U-Boot and how to place it on the SD card and then try to boot.
>> 
> 
> I don't know about Allwinner, but what I remember about Pine Rockpro64
> is that arm64 kernels can't decompress themselves. So uboot does that
> after loading and before booting.
> 
> You can cp Image.gz to the card and in bootcmd decompress it with the uboot command:
> 
> unzip $compressedKernImgAdr $uncompressedKernImgAdr
> 
> My notes are somethign like
> 
> export CROSS_COMPILE=aarch64-linux-gnu- ; export ARCH=arm64
> make clean
> make ${something}_defconfig
> 
> make -j 12 BL31=bl31.elf  u-boot-dtb.bin spl/u-boot-spl.bin u-boot.itb
> ./tools/mkimage -n rk3399 -T rksd -d tpl/u-boot-tpl-dtb.bin out #this will be different for allwinner, I guess
> 
> 
> cp u-boot-rockchip/uEnv.txt /media/.../boot/
> cp linux-5.2.11/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtb /media/.../boot/rk3399-rockpro64.dtb
> cp linux-5.2.11/arch/arm64/boot/Image.gz /media/.../boot/Image.gz
> 
> in uEnv.txt:
> 
> KERNCOMPADDR=0x13000000
> KERNUNCADDR=0x10000000
> DEVTREEADDR=0x14000000
> bootargs=...
> bootcmd=ext4load mmc 1:1 $KERNCOMPADDR Image.gz; unzip $KERNCOMPADDR $KERNUNCADDR; ext4load mmc 1:1 $DEVTREEADDR rk3399-rockpro64.dtb; booti $KERNUNCADDR - $DEVTREEADDR

It looks like the Ubuntu Touch image (and U-Boot) for the PinePhone
exactly does this.

I can find on the SD card
/boot/boot-pinephone.scr
/boot/boot-pinephone.txt
/boot/Image.gz
and
/boot/dtb/allwinner/sun50i-a64-pinephone.dtb

And boot-pinephone.txt indeed does:

part uuid ${devtype} ${devnum}:${distro_bootpart} uuid
setenv bootargs console=${console} console=tty0 root=PARTUUID=${uuid} rw rootwait
setenv kernel_addr_z 0x44080000

if load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_z} /boot/Image.gz; then
  unzip ${kernel_addr_z} ${kernel_addr_r}
  if load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} /boot/dtb/allwinner/sun50i-a64-pinephone.dtb; then
    if load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} /boot/initrd.img; then
      booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
    else
      booti ${kernel_addr_r} - ${fdt_addr_r};
    fi;
  fi;
fi

So your descriptions help a lot and I better know which files I can
simply copy and how to prepare the newly built files...

BR and thanks,
Nikolaus



More information about the Community mailing list