Manjaro ARM for the VIM3

Your vim visibly does not load your Linux 5 kernel but a 4.9 one you do not yet understand where it is hidden , these are the plain brutal facts my friend :crazy_face:

Yeah, seems like it.

I did this just now, which resulted in our 5.2 kernel not booting at all, so I expect there was something left on the eMMC that it booted from.
Our images with 4.9 does still boot, but not the ones we create with 5.2 now. So I guess we are probably missing something in regards to going more mainline.

To start the system from the Sd card (after erasing eMMC), you need to add u-boot to the SD card. You can use u-boot-2019, there is support for VIM1 and VIM2.

He need it for Vim3 :frowning:

Then restore the firmware from Android and use the universal multi-boot. This is the best option to provide all users with a simple and proven way to run any system from external media.

1 Like

Mainline u-boot now has support for the N2. Now is a good time to make a test and see if the same config supports VIM3 :slight_smile:

1 Like

I don’t see the Odroid N2 DTS anywhere in the mainline uboot repo.

https://patchwork.ozlabs.org/cover/1134806/ <= submitted but not merged due to a typo (will need a v2 series with minor changes). I’ve proven an earlier draft back in May and it works fine. You also need to have https://patchwork.ozlabs.org/patch/1134772/ applied first.

2 Likes

Odroid-N2 support Merged now :slight_smile:

2 Likes

Thanks.
Been following along on Patchwork.

Waiting to see some Vim3 stuff there too, both uboot and kernel wise. :slight_smile:

Hello,

I tried it but its doesn’t seem to boot.

I flashed the latest Ubuntu emmc using the usb flasher by amlogic and now it boots Ubuntu directly but with upgrade mode on it cannot recognize the manjaro on usb.
Then I tried testing my Manjaro 5.2 build for Vim1 with dtb path to Vim3 and it going in Bootloop which shows that it is reading from the usb but not able to pass over to the Rootfs which must be for the boot.ini

Already posting this on the original Manjaro Forum Thread but I think the Khadas team should be aware of this.

so you mean you’ve finally received your vim3? so now you could use it to natively build arm imaged for also your vim1

Yes Build arm image for both. :smiley:

I haven’t found any info on this anywhere (even on the uboot patchwork), but are there any efforts to mainlining the vim3 uboot soon?
The vim3 kernel mainline is basically worthless without a uboot to go with it.
At least I haven’t been able to boot a mainline kernel with Vim3 support, when using the uboot from Khadas.

@numbqq might update with some info here.

1 Like

The main kernel works fine with the current u-boot-2015 on VIM3. Including the main kernel can be easily installed in eMMC and used with u-boot-2015.

If the main kernel does not start, then errors have been made either in its build or in the system startup scripts.

This is quite possible, even though I have no idea how to get around it.
The boot script, as far as I can see, defines uInitrd, zImage, dtb.img and env.txt is needed to boot the system.
So I have done my best to make the mainline kernel include the uInitrd and zImage files. My uboot package is responsible for the dtb.img and the env.txt. The dtb.img file is created from the vim3 dtb file, from the 4.9 kernel, but I have tried using the dtb from chewitts kernel (which is my source for the 5.3 kernel right now). The device still only boots to a black screen. Not even uboot output.
So I just suspect that the dtb.img file is wrong.
Keep in mind, that I have nothing on my eMMC now and don’t plan too, so I can’t use the “builtin” uboot.

The device boots fine when I use the 4.9 kernel.

I just started and checked the latest kernel in the NEXT Armbian and everything is fine starts and runs. If I understand your information correctly, you have confusion when building and using the main kernel on VIM3. There are a number of simple steps to run the core correctly.

I am confused, yes. :slight_smile:

The content of my bootscript is this:

echo "Starting S905 autoscript..."

setenv kernel_loadaddr "0x11000000"
setenv dtb_loadaddr "0x1000000"
setenv initrd_loadaddr "0x13000000"
setenv env_loadaddr "0x20000000"

setenv hdmiargs "logo=${display_layer},loaded,${fb_addr},${outputmode} vout=${outputmode},enable hdmimode=${hdmimode}"

if test "X$lcd_exist" = "X1"; then
	setenv panelargs "panel_exist=${lcd_exist} panel_type=${panel_type}";
fi;

setenv devs "mmc usb"
setenv mmc_devplist "1 5"
setenv mmc_devnums "0 1"
setenv usb_devplist "1"
setenv usb_devnums "0 1 2 3"

setenv boot_start booti ${kernel_loadaddr} ${initrd_loadaddr} ${dtb_loadaddr}

if test "$hostname" = "KVIM1"; then
	setenv ml_dtb "/dtb/amlogic/meson-gxl-s905x-khadas-vim.dtb";
else if test "$hostname" = "KVIM2"; then
	setenv ml_dtb "/dtb/amlogic/meson-gxm-khadas-vim2.dtb";
fi;fi;

## First, boot from mmc
## Second, boot from USB storage
for dev in ${devs}; do
	if test "X${dev}" = "Xmmc"; then
		setenv devplist ${mmc_devplist};
		setenv devnums ${mmc_devnums};
	else if test "X${dev}" = "Xusb"; then
		setenv devplist ${usb_devplist};
		setenv devnums ${usb_devnums};
	fi;fi;
	for dev_num in ${devnums}; do
		for distro_bootpart in ${devplist}; do
			echo "Scanning ${dev} ${dev_num}:${distro_bootpart}...";
			if test "X${distro_bootpart}" = "X5"; then
				setenv load_method "ext4load";
				setenv mark_prefix "boot/";
			else
				setenv load_method "fatload";
				setenv mark_prefix "";
			fi;
			if ${load_method} ${dev} ${dev_num}:${distro_bootpart} ${initrd_loadaddr} uInitrd; then
				if ${load_method} ${dev} ${dev_num}:${distro_bootpart} ${kernel_loadaddr} zImage; then
					if ${load_method} ${dev} ${dev_num}:${distro_bootpart} ${dtb_loadaddr} dtb.img || ${load_method} ${dev} ${dev_num}:${distro_bootpart} ${dtb_loadaddr} ${ml_dtb}; then
						if ${load_method} ${dev} ${dev_num}:${distro_bootpart} ${env_loadaddr} /boot/env.txt || ${load_method} ${dev} ${dev_num}:${distro_bootpart} ${env_loadaddr} env.txt; then
							echo "Import env.txt"; env import -t ${env_loadaddr} ${filesize};
						fi;
						if test "X${rootdev}" = "X"; then
							echo "rootdev is missing! use default: root=LABEL=ROOTFS!";
							setenv rootdev "LABEL=ROOTFS";
						fi;
						if test "X${custom_ethmac}" != "X"; then
							echo "Found custom ethmac: ${custom_ethmac}, overwrite eth_mac!";
							setenv eth_mac ${custom_ethmac};
						fi;
						if test "X${eth_mac}" = "X"; then
							echo "Set default mac address to ethaddr: ${ethaddr}!";
							setenv eth_mac ${ethaddr};
							setenv save_ethmac "yes";
						fi;
						if test -e ${dev} ${dev_num}:${distro_bootpart} ${mark_prefix}.next; then
							echo "Booting mainline kernel...";
							setenv condev "console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0";
						else
							echo "Booting legacy kernel...";
							setenv condev "console=ttyS0,115200n8 console=tty0 no_console_suspend consoleblank=0";
						fi;
						if test "X${hwver}" = "XVIM2.V14"; then
							fdt addr ${dtb_loadaddr};
							fdt resize 65536;
							fdt set /fan hwver "VIM2.V14";
							fdt set /i2c@c11087c0/khadas-mcu hwver "VIM2.V14";
							fdt set /soc/cbus@c1100000/i2c@87c0/khadas-mcu hwver "VIM2.V14";
						else if test "X${hwver}" = "XVIM3.V11"; then
							fdt addr ${dtb_loadaddr};
							fdt resize 65536;
							fdt set /soc/aobus@ff800000/i2c@5000/khadas-mcu hwver "VIM3.V11";
							kbi init;
							kbi portmode r;
							if test ${port_mode} = 0; then
								fdt set /usb3phy@ffe09080 portnum <1>;
								fdt set /pcieA@fc000000 status disabled;
							else
								fdt set /usb3phy@ffe09080 portnum <0>;
								fdt set /pcieA@fc000000 status okay;
							fi;
						fi;fi;
						setenv bootargs "root=${rootdev} rootflags=data=writeback rw ${condev} ${hdmiargs} ${panelargs} fsck.repair=yes net.ifnames=0 ddr_size=${ddr_size} wol_enable=${wol_enable}  jtag=disable mac=${eth_mac} androidboot.mac=${eth_mac} save_ethmac=${save_ethmac} fan=${fan_mode} hwver=${hwver} coherent_pool=${dma_size} reboot_mode=${reboot_mode}";
						run boot_start;
					fi;
				fi;
			fi;
		done;
	done;
done

# Rebuilt
# mkimage -A arm64 -O linux -T script -C none -a 0 -e 0 -n "S905 autoscript" -d /boot/s905_autoscript.cmd /boot/s905_autoscript
# mkimage -A arm64 -O linux -T script -C none -a 0 -e 0 -n "S905 autoscript" -d /boot/s905_autoscript.cmd /boot/boot.scr

The kernel binary itself is /boot/zImage. That creates an /boot/initramfs-linux.img, that gets made into a /boot/uInitrd, when the kernel gets installed.

So I am not sure what I am missing.

By the way, the main core already has DTB for VIM3. wifi and audio via HDMI are not working yet (I use BT for audio output and test video works fine with audio via BT). :slight_smile:

1 Like