by oreggin » Mon Feb 27, 2017 7:34 pm
Hi,
You can boot linux-aarch64 on C2 with a little trick. First of all, hardkernel's u-boot can't boot vanilla Image, so you should convert it to uImage. After that you should reposition the kernel address from 0x11000000 to 0x1080000:
/boot/make_uImage.sh:
$this->bbcode_second_pass_code('', '
#!/bin/sh
address_uImage='0x1080000'
address_uInitrd='0x13000000'
version=`cat ../etc/mkinitcpio.d/linux-aarch64.preset | grep ALL_kver | cut -d= -f2 | sed -e 's/\"//g'`
mkimage -A arm64 -O linux -C none -T kernel -a $address_uImage -e $address_uImage -n "uImage-$version" -d Image uImage
mkimage -A arm64 -O linux -C none -T ramdisk -a $address_uInitrd -e $address_uInitrd -n "uInitrd-$version" -d initramfs-linux.img uInitrd
mkimage -A arm64 -O linux -C none -T ramdisk -a $address_uInitrd -e $address_uInitrd -n "uInitrd-$version-fallback" -d initramfs-linux-fallback.img uInitrd-fallback
')
/boot/boot.ini:
$this->bbcode_second_pass_code('', '
setenv bootargs "console=ttyAML0,115200 root=/dev/mmcblk0p2 rootwait rw fsck.fix=yes net.ifnames=0"
setenv loadaddr "0x1080000"
setenv dtb_loadaddr "0x1000000"
setenv initrd_loadaddr "0x13000000"
load mmc 0:1 ${loadaddr} /uImage
load mmc 0:1 ${dtb_loadaddr} /dtbs/amlogic/meson-gxbb-odroidc2.dtb
load mmc 0:1 ${initrd_loadaddr} /uInitrd
fdt addr ${dtb_loadaddr}
bootm ${loadaddr} ${initrd_loadaddr}:${filesize} ${dtb_loadaddr}
')
This work for me:
$this->bbcode_second_pass_code('', '
[oreggin@odroid-c2 ~]$ uname -a
Linux odroid-c2 4.10.1-1-ARCH #1 SMP Sun Feb 26 18:30:04 MST 2017 aarch64 GNU/Linux
[oreggin@odroid-c2 ~]$ dmesg | head
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.10.1-1-ARCH (builduser@leming) (gcc version 6.3.1 20170109 (GCC) ) #1 SMP Sun Feb 26 18:30:04 MST 2017
[ 0.000000] Boot CPU: AArch64 Processor [410fd034]
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
[ 0.000000] cma: Reserved 512 MiB at 0x0000000040000000
[ 0.000000] On node 0 totalpages: 30432
[ 0.000000] DMA zone: 30 pages used for memmap
[ 0.000000] DMA zone: 0 pages reserved
[ 0.000000] DMA zone: 30432 pages, LIFO batch:1
[oreggin@odroid-c2 ~]$
')
Regards,
oreggin