ODROID-M1

This is for ARMv8 based devices

ODROID-M1

Postby jernst » Fri Apr 15, 2022 12:03 am

The new ODROID-M1 looks like a sweet device.

It has everything, it seems, from real-time clock to M.2 and SATA ports, lots of RAM, GPIO, Ethernet, HDMI, audio, MIPI, nice enclosure, Ubuntu, Android etc etc

Just no Arch Linux ARM. So far :-) I'm going to spend a bit of time on it, anybody want to help?
jernst
 
Posts: 75
Joined: Tue Aug 20, 2013 4:22 pm
Location: Silicon Valley

Re: ODROID-M1

Postby CounterPillow » Fri Apr 22, 2022 7:19 pm

Hi,

the RK3568's mainline support is fairly OK, i.e. it boots, with 5.18 it will have USB 3, SATA and PCIe 2.1 working thanks to the PHY being accepted, and there's currently an RFC patch set on the mailing list to get the PCIe 3 controller working. Video output also is in its 11th iteration on the mailing list. So, as far as kernel goes, basing it on the mainline package is the obvious way to go. I did this for example for my RK3566, and the two chips are very similar. A pull request of mine enables some config options in the stock ALARM kernel for the RK3566 Quartz64, from two of which the RK3568 ODROID M1 should also stand to benefit.

As for the device tree, there's a basic DTS that has been submitted to the linux-rockchip mailing list. Tenkawa from the #linux-rockchip IRC channel on Libera has reportedly gotten their ODROID M1 to boot with mainline.

So the way I'd recommend you move towards getting Arch Linux ARM to boot is as follows:
1. build or take the downstream vendor u-boot from somewhere, install it onto your medium
2. partition the medium, copy the generic Arch Linux ARM root file system tarball onto it
3. make a kernel package based on 5.18-rc and apply some patches (vop2, pcie, your own DTS improvements)
4. Set up qemu-user-static for aarch64 user mode emulation, arch-chroot into the mounted medium's root partition, then install the kernel package

That is more or less the way I did it for my Quartz64.

From there you can look into using PINE64's port of mainline u-boot for the RK3566.
CounterPillow
 
Posts: 23
Joined: Mon May 24, 2021 2:59 pm

Re: ODROID-M1

Postby gonlinux » Sun Jun 19, 2022 10:21 pm

Hi, I try to install archlinuxarm on a nvme ssd for this device.

I don't really understand why u-boot has to be installed on the medium @CounterPillow
AFAIK m1 is shipped with petitboot and a version of u-boot inside following https://wiki.odroid.com/odroid-m1/software/boot_sequence.
What the advantage of doing this ?

Is it possible to install u-boot on nvme ?

I've installed archlinuxarm generic on the nvme.
I took linux-next and compiled the default version aarch64 of the kernel.
Made a boot.scr matching the system.

When I boot, it is detected by petitboot.
But then I have a blackscreen when I run the kernel/system.

I suppose I'm missing some steps to make it works.
Which patches / kernel config are required to boot a mainline kernel ?

Thanks for the help.
gonlinux
 
Posts: 2
Joined: Sun Jun 19, 2022 10:05 pm

Re: ODROID-M1

Postby trap000d » Fri Jun 24, 2022 4:44 am

Mainline Linux kernel isn't ready yet. HDMI, USB3 and nvme still not supported AFAIK.

I've managed to boot Arch on m1 with stock Ubuntu 4.19 kernel - see here:
https://forum.odroid.com/viewtopic.php?p=350517#p350517

As for 5.18 branch. Version with Odroid patches is maintained at https://github.com/tobetter/linux

Here I've created PKGBUILD for 5.18.1: https://github.com/trap000d/aur/tree/ma ... -odroid-m1
Kernel builds OK, yet I had no opportunity to boot it as 4.19 works for me OK. May be next weekend I'll have some time to play with it...

BTW it's already outdated
https://github.com/tobetter/linux/commits/odroid-5.18.y
- the most recent version is 5.18.5: https://github.com/tobetter/linux/commi ... 081b24b34e
trap000d
 
Posts: 11
Joined: Tue Aug 18, 2020 10:24 am

Re: ODROID-M1

Postby gonlinux » Sat Jun 25, 2022 5:00 pm

Thanks for your answer @trap000d,

I'm gonna test an archlinuxarm installation with the latest tobetter kernel.

$this->bbcode_second_pass_quote('trap000d', 'M')ainline Linux kernel isn't ready yet. HDMI, USB3 and nvme still not supported AFAIK.
BTW it's already outdated
https://github.com/tobetter/linux/commits/odroid-5.18.y
- the most recent version is 5.18.5: https://github.com/tobetter/linux/commi ... 081b24b34e


The branch odroid-5.18.y seems up to date, the commit that you linked is merged in this branch since june 21.
gonlinux
 
Posts: 2
Joined: Sun Jun 19, 2022 10:05 pm

Re: ODROID-M1

Postby trap000d » Sun Jun 26, 2022 11:07 pm

Hi @gonlinux,

Yep, I meant my PKGBUILD is (was) outdated - tobetter' repo indeed, is up to date with mainline.

Anyway, yesterday I've tried to boot with "my" 5.18.5 kernel. No luck. Black screen, no SSH, no lights, no system logs. So I assume something goes wrong on early boot stage. It could be e.g. any trivial thing like typo or missing overlay... Unfortunately I have no UART adapter on a hand for getting into serial console. Have just ordered one at AliExpress, however delivery might take a month or two. There is a chance somebody manages to port it to Arch by that time :)
trap000d
 
Posts: 11
Joined: Tue Aug 18, 2020 10:24 am

Re: ODROID-M1

Postby rmsc » Wed Oct 19, 2022 11:07 am

I'm working on supporting the Odroid-m1, and I'm happy to say it's looking good!

The SoC is now supported in linux 6.1 (current mainline). The only thing missing is the device-tree file, which unfortunately didn't make the deadline for inclusion in this kernel release. Not sure if device-tree changes qualify for inclusion in a next rc, but that's another topic.

Starting from a correctly partitioned disk and with the latest ArchLinuxArm root filesystem installed, here are the steps required:

$this->bbcode_list('1')
  • chroot into the installation using qemu-user-static and binfmt
  • install an updated (and patched) linux-aarch64-rc kernel package (more on that later)
  • install the uboot-tools package
  • create the required u-boot script (boot.cmd -> boot.scr) using u-boot's mkimage

  • Now regarding the updated and patched kernel, I've submitted an initial PR updating linux-aarch64-rc to the latest 6.1-rc:
    https://github.com/archlinuxarm/PKGBUILDs/pull/1948

    A subsequent PR adding the missing device-tree files is ready to submit, but depends on the previous one being accepted. It's based on this upstream patch series:
    https://patchew.org/linux/2022093005124 ... rel32.net/

    Not sure how to help the ball roll any further, other than asking people to review and comment the initial PR above, so that I can submit the second one. Any help or comment is deeply appreciated!
    rmsc
     
    Posts: 6
    Joined: Tue Oct 18, 2022 10:50 pm

    Re: ODROID-M1

    Postby rmsc » Wed Oct 19, 2022 11:53 am

    As an update to this topic, I went ahead and submitted the second PR:
    https://github.com/archlinuxarm/PKGBUILDs/pull/1950

    Building the kernel in the device, even with distcc, is ridiculously slow, so I decided to cross-compile the package in my main machine. Please note that this process is non-standard, and therefore unsupported. That said it worked perfectly fine for me :)

    First, clone my fork of the PKGBUILDs repo:
    $this->bbcode_second_pass_code('', '
    $ git clone git@github.com:rmsc/PKGBUILDs-archlinuxarm.git -b odroid-m1 --sparse --depth=1 pkgbuilds-odroid-m1
    ')
    Now move the linux-aarch64-rc package to **outside** of the tree, otherwise all the git apply commands will fail silently and you'll end up with a good-looking kernel that hangs mid-boot :oops:
    $this->bbcode_second_pass_code('', '
    $ mv pkgbuilds-odroid-m1/core/linux-aarch64-rc .
    $ rm pkgbuilds-odroid-m1 -rf
    ')
    Finally make sure you have the aarch64-linux-gnu-gcc package installed, and just cross-compile the kernel:
    $this->bbcode_second_pass_code('', '
    $ cd linux-aarch64-rc
    $ CARCH=aarch64 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- makepkg -cCAf
    ')
    NOTE: The credit for this method of using makepkg for cross-compilation is not mine. It was proposed somewhere in this forum, but I can't find the original post or author.. will update if I do, and in any case kudos to him/her.

    In the end you'll have three packages ready. You should install both the kernel and the headers, but ignore the chromebook one:
    $this->bbcode_second_pass_code('', '
    ls *.pkg.*
    linux-aarch64-rc-6.1.rc1-1-aarch64.pkg.tar.zst
    linux-aarch64-rc-headers-6.1.rc1-1-aarch64.pkg.tar.zst
    linux-aarch64-rc-chromebook-6.1.rc1-1-aarch64.pkg.tar.zst
    ')
    rmsc
     
    Posts: 6
    Joined: Tue Oct 18, 2022 10:50 pm

    Re: ODROID-M1

    Postby Refutationalist » Fri Oct 21, 2022 3:44 pm

    Hello!

    I've compiled your kernel and I've tried a couple uboot configurations, but when I boot I don't seem to get video over HDMI. Is this the expected behavior? It seems to grab an address but doesn't start any services, so it appears to be booting. Waiting for a UART cable to investigate that any further.

    Thanks!
    Refutationalist
     
    Posts: 4
    Joined: Tue May 16, 2017 1:05 am

    Re: ODROID-M1

    Postby rmsc » Fri Oct 21, 2022 5:34 pm

    Sorry, my bad :oops: I wasn't using the HDMI output, and I obviously left some required modules out (namely VOP2..).

    I'll build and test in a minute, and then push to the PR as soon as I get it working.
    rmsc
     
    Posts: 6
    Joined: Tue Oct 18, 2022 10:50 pm

    Next

    Return to ARMv8 Devices

    Who is online

    Users browsing this forum: No registered users and 4 guests