Jump to content

Odroid M1


Igor
 Share

Recommended Posts

Hi all.

 

Regarding Petitboot that comes pre-installed in the Odroid M1's SPI.  I 100% understand that the current image does not support Petitboot.  I understand it is a work in progress.  Is the intention though, to have the final production image support
Petitboot?

 

My understanding (and am happy to be corrected) is that without petitboot, booting from SATA/NVMe, without any other storage devices attached, isn't possible (u-boot limitation?).

 

I've been stuffing about and I have been able to get the current WIP build copied to NVMe SSD and booting from petitboot (with one outstanding limitation).  At a high level:

  • Copy the "Armbian_22.11.0-trunk_Odroidm1_kinetic_edge_6.1.0-rc1.img.xz" to a USB stick.  Not DD/Etcher/whatever.  Just copied to the USB stick
    • It might be possible to download the image directly within the petitboot shell but the bundled busybox wget command doesn't support https.
  • Boot the M1 into petitboot with the above USB stick plugged in.
  • Extract and DD the image onto the NVMe block device
    • The USB stick will likely already be mounted in /usr/var/petitboot/mnt/dev/sda1/, so...
    • xz -d -c /usr/var/petitboot/mnt/dev/sda1/Armbian_22.11.0-trunk_Odroidm1_kinetic_edge_6.1.0-rc1.img.xz | dd of=/dev/nvme0n1 bs=4k
  • Tamper with the installed image a little before attempting to boot it:
    • mkdir /mnt/nvme0n1p1
    • mount /dev/nvme0n1p1 /mnt/nvme0n1p1
    • rm /mnt/nvme0n1p1/boot/boot.scr (this file existing seems to the petitboot parser segfault)
    • rm /mnt/nvme0n1p1/boot/boot.ini  (for good measure)
    • Create a petitboot kboot.conf file with suitable settings:
      • echo "Armbian=/boot/Image initrd=/boot/uInitrd dtb=/boot/dtb/rockchip/rk3568-odroid-m1.dtb root=/dev/disk/by-label/armbi_root rootwait rootfstype=ext4 consoleblank=0 loglevel=5 splash=verbose earlycon console=ttyS2,1500000"  >/mnt/nvme0n1p1/etc/kboot.conf
    • Reboot
      • echo 1 > /proc/sys/kernel/sysrq
      • echo b > /proc/sysrq-trigger

 

The main limitation with the above, which might be entirely because I'm only a few hours into learning about petitboot, is that using the above method still requires manual intervention at boot time.  The above will add Armbian into the petitboot menu but it won't boot it automatically.  You need to select it with the arrows and hit enter to start it booting.  I'm going to post some questions on the Odroid forum and hopefully get this final quirk resolved.

 

Cheers

Shaun

Link to comment
Share on other sites

When discussing a problem make sure to provide full logs!

12 hours ago, Shaun Maher said:

current image does not support Petitboot.

 

Idea is to get rid of everything that smells on proprietary boot loader and all dirty hacks that are required that this hardware boots up. But when this is not finished and become stable there is little to do.

Link to comment
Share on other sites

a big thumbs up! With the odroidm1 sid-build I managed for the first time to successfully test my use case with lxd and zfs!

Only problem I had:
After installing the zfsutils-linux the kernel module was missing:
 

# /sbin/modprobe zfs
modprobe: FATAL: Module zfs not found in directory /lib/modules/5.19.0-odroid-arm64

I got it working by manually installing/compiling the kernel module:
 

apt install linux-headers-arm64 zfs-dkms


Is this an issue in the debian upstream or in the armbian build?
I am looking forward to a first release!

Link to comment
Share on other sites

I've had great success with the new 6.1-rcX based images. Applying mmind's tree for the DTS only. Good chance we'll be able to merge this board with the rest of rockchip64 around the 6.2 timeframe, with zero patches if that DTS is merged.

 

Keep in mind these images don't use Petitboot "the kexec stuff" itself but does use the u-boot included in SPI (which is part of Petitboot), and require the env to skip petitboot.

 

 

 

 

Link to comment
Share on other sites

On 11/2/2022 at 9:03 AM, Shaun Maher said:

Tamper with the installed image a little before attempting to boot it:

  • mkdir /mnt/nvme0n1p1
  • mount /dev/nvme0n1p1 /mnt/nvme0n1p1
  • rm /mnt/nvme0n1p1/boot/boot.scr (this file existing seems to the petitboot parser segfault)
  • rm /mnt/nvme0n1p1/boot/boot.ini  (for good measure)
  • Create a petitboot kboot.conf file with suitable settings:
    • echo "Armbian=/boot/Image initrd=/boot/uInitrd dtb=/boot/dtb/rockchip/rk3568-odroid-m1.dtb root=/dev/disk/by-label/armbi_root rootwait rootfstype=ext4 consoleblank=0 loglevel=5 splash=verbose earlycon console=ttyS2,1500000"  >/mnt/nvme0n1p1/etc/kboot.conf
  •  

 

 

Yeah, you can convince Petitboot to `kexec` into Armbian's kernel. Probably can be done on other Petitboot boards too. By then, vendor's uboot, and vendor's kernel is already loaded, `kexec`'ing then into an Armbian mainline kernel. "It works" until it doesn't...

Link to comment
Share on other sites

46 minutes ago, rpardini said:

Good chance we'll be able to merge this board with the rest of rockchip64 around the 6.2 timeframe, with zero patches if that DTS is merged.

I doubt it, if mainline development continues at the same rate as before, the next WIP patches for the pending drivers will certainly be available at this time.

Link to comment
Share on other sites

8 hours ago, usual user said:

Odroid-M1 support has just landed  so will be available with 6.2.0-rc1 out-of-the-box. RGA support can be wired on top (v4l2-compliance.log), but the DMA deficiency for 32-bit addresses needs to be addressed for devices with more than 4GB of RAM.

 

Excellent news @usual user. I've bumped Armbian to 6.1 plus the DTS patches. 

My own image at https://github.com/rpardini/armbian-release/releases/download/20221213a/Armbian_20221213a-rpardini_Odroidm1_kinetic_edge_6.1.0.img.xz

Igor has community images too, including desktops... https://github.com/armbian/community/releases (might be some 6.1-rcX still, should be updated the next few days).

 

Any news about ATF and u-boot?

Link to comment
Share on other sites

17 hours ago, rpardini said:

Any news about ATF and u-boot?

TF-A is progressing slowly, but there seem to be still open questions.
The DT rebase of u-boot has taken place. It still takes a rebase to be up to date, but this is only a small thing, because the basic structure conversion has already taken place.

But I haven't seen any movement in uboot WIP trees that I'm aware of. IMHO they are waiting to see how the TF-A development turns out in the end to develop u-boot accordingly further. I will report when I get news.
But the most important thing is that for the kernel only the rkvdec2 support is missing, and for the userspace only the FFmpeg v4l2-request support is missing to be usable out-of-the-box with pure mainline support for standard applications. It is thus available for all distributions without special effort for the Odroid-M1. They only have to maintain the distribution-specific modifications that they apply for other devices anyway.
I'm currently playing with jernej's FFmpeg patches for v4l2-request support and VP8 acceleration seems to work. H.264 fails with this error:

[h264_v4l2m2m @ 0xaaaabfc5ae10] Could not find a valid device
[h264_v4l2m2m @ 0xaaaabfc5ae10] can't configure decoder

But I don't know if the 5.1.2 paches basically work or how I can inspect the FFmpeg framework appropriately. With the gstreamer framework, however, everything works as expected.

Link to comment
Share on other sites

1 hour ago, Kiendeleo said:

is there a way to install only the necessary files to an eMMC drive and the rest to an NVME to work around this limitation?

Sure, with distro-boot only a suitable firmware in the firmware area and three files in a partition accessible from the firmware is required.
Because I still have Petitboot in SPI flash, I used @rpardini's initial image as boot trampoline, because Petitboot requires a very special partition layout. Then the kernel binary, the DTB and extlinux.conf copied into the partition, and my operating system is entirely run by the NVME. It should be noted that the kernel binary must be uncompressed, as the legacy firmware does not even support compressed kernel binaries.
I use a microSD card as boot trampoline, because the firmware only reads it, and I only mount it from the operating system read-write if I want to update the kernel binary or the DTB. But an eMMC works the same way. The only annoying thing about this method is the need to copy the kernel binary and DTB over, but this is a simple workaround until mainline firmware is available.

Link to comment
Share on other sites

2 hours ago, Kiendeleo said:

In the meantime, is there a way to install only the necessary files to an eMMC drive and the rest to an NVME to work around this limitation?

 

I used `armbian-install` (nee `nand-sata-install`) for this with success.

It can use a small boot partition (/boot) on the eMMC to jumpstart kernel, but mount root in NVMe.

Take care to not overwrite SPI/MTD accidentally.

 

Link to comment
Share on other sites

20 hours ago, rpardini said:

I used `armbian-install` (nee `nand-sata-install`) for this with success.

The first time I ran this command, I was only presented with "Boot from SD" and "Boot from SPI" as options. The only drives attached to the board were an eMMC and an NVME Drive. I chose the "Boot From SD" and selected my NVME drive as the target in the next step, which seems to work. After completing the conversion and rebooting, if I run the `sudo armbian-install` command, I am given options for the eMMC. It is working correctly. Is this a bug? Also, is there a manpage somewhere for the `armbian-install` command?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...