The Khadas VIM (http://khadas.com/vim/) is an arm64 DIY Set-Top-Box based on Amlogic P212 reference board that use S905X SoC.

As Odroid-C2 (based on S905 SoC) is in the mainline U-boot, it should be possible to adapt it for the Khadas VIM (of course a lot of work are needed!). It's also possible to try using the Amlogic code found in the 2015.01 version of U-Boot.

Also, Khadas VIM is supported in the mainline kernel, so when we will have a working U-Boot, installation and boot of openSUSE Tumbleweed with EFI should be possible.

The upgrade version, the VIM2, is based on an Amlogic S912 SoC, which is an upgraded version of the S905X SoC. Both are now supported in mainstream Linux Kernel (4.12 for Khadas VIM and next 4.14 for Khadas VIM2).

For me, the goal of this project is to better understand how U-boot and Amlogic SoCs are working (and also others boards!).

I'm pretty sure that my U-Boot version will not not work at the end of the week, but I hope that my knowledge of it will be improved!

Goal for HackWeek 19: - Refresh my U-Boot knowledge (didn't had enough spare time since the last HackWeek...) - Try to add openSUSE wiki page for AML-S805X-AC (first quick tests shown that TW is not booting, need to check why) - Try to work on ROC-RK3328-CC support (U-Boot and TW) - Help on packaging official BL31 ATF firmware for GXL (GXM supported?)

Goal for HackWeek 18: - Fix the USB U-Boot issue on VIM2 board (EDIT: done upstream) - Add other ARM64 boards: work on ROC-RK3328-CC (EDIT: still lot of issues...)

Update of 14 February 2020: - Patches to add ROC-RK3328-CC support in U-Boot done! Latest TW version doesn't boot correctly, I need to check why - Some tests has been done with AML-S805X-AC board: TW kernel boots but there are some kernel oops/panic on version 5.4. Bug created and I need to test later with kernel 5.5

Update of 13 July 2018: - Khadas VIM is working well with latest U-Boot version (a patch is still needed for USB boot) and latest openSUSE TW. Wikipage as been created for it and also for another SBC with pretty much the same hardware, the Libretech-CC. - My work will now focus on Khadas VIM2 board: U-boot is working with patches from BayLibre (apart USB), I found an issue with MMU initialization in U-Boot and I was able to fix it. Patch has been sent to Neil Armstrong of BayLibre for inclusion in his VIM2 patches.

Update for July 2018: - Board is working with official U-Boot and openSUSE TW. I will try to create add u-boot support for that board for TW and create and wiki page for openSUSE during HackWeek 17.

Update of 24 Octobre 2017: - Minimal U-Boot is booting on VIM board and EFI boot works, as openSUSE TW installation iso boots. I need to add needed modules to be able to install it.

Update of 12 October 2017: - U-Boot support is on a good way for P212 board, see https://patchwork.ozlabs.org/cover/825135/. Thanks to BayLibre guys! So I will use these patches to see if VIM can boot. First I will have a look at the code to better understand U-boot :)

Looking for hackers with the skills:

khadas vim aarch64 arm64 arm u-boot uboot kernel

This project is part of:

Hack Week 16 Hack Week 17 Hack Week 18 Hack Week 19

Activity

  • almost 5 years ago: aplanas liked this project.
  • over 5 years ago: acho liked this project.
  • over 6 years ago: pgonin liked this project.
  • over 6 years ago: dmdiss liked this project.
  • about 7 years ago: michals liked this project.
  • about 7 years ago: a_faerber liked this project.
  • about 7 years ago: mbrugger liked this project.
  • about 7 years ago: ldevulder disliked this project.
  • about 7 years ago: ldevulder liked this project.
  • about 7 years ago: ldevulder added keyword "khadas" to this project.
  • about 7 years ago: ldevulder added keyword "vim" to this project.
  • about 7 years ago: ldevulder added keyword "aarch64" to this project.
  • about 7 years ago: ldevulder added keyword "arm64" to this project.
  • about 7 years ago: ldevulder added keyword "arm" to this project.
  • about 7 years ago: ldevulder added keyword "u-boot" to this project.
  • about 7 years ago: ldevulder added keyword "uboot" to this project.
  • about 7 years ago: ldevulder added keyword "kernel" to this project.
  • about 7 years ago: ldevulder originated this project.

  • Comments

    • a_faerber
      over 5 years ago by a_faerber | Reply

      AFAIK we're still lacking an Open Source toolchain to build a bootable image for VIM (gxl) and VIM2 (gxm?). Maybe you could contribute to extending my meson-tools to allow more people to contribute to and benefit from your efforts?

      Also, you might want to help package and test the new upstream BL31 in arm-trusted-firmware.

      • ldevulder
        almost 5 years ago by ldevulder | Reply

        Thx, I will try to work on BL31 packaging for HackWeek 19.

    • ldevulder
      almost 5 years ago by ldevulder | Reply

      Remi Pommarel also created a toolchain for gxl/gxm called gxlimg.

      As for upstream BL31 I tested it and yes I could try to help packaging it, could be for the next HackWeek 19 :-)

    Similar Projects

    Improve various phones kernel mainline support (Qualcomm, Exynos, MediaTek) by pvorel

    Similar to previous hackweeks ( https://hackweek.opensuse.org/projects/improve-qualcomm-soc-msm8994-slash-msm8992-kernel-mainline-support, https://hackweek.opensuse.org/projects/test-mainline-kernel-on-an-older-qualcomm-soc-msm89xx-explore-mainline-kernel-qualcomm-mainlining) try to improve kernel mainline support of various phones.


    Investigate non-booting Forlinx OKMX8MX-C board (aarch64) by a_faerber

    Description

    In the context of a SUSE customer inquiry last year, a Forlinx OKMX8MX-C arm64 board had been relayed to me from China that a customer was not successful booting SUSE Linux Micro on. Typically this happens when the vendor's bootloader (e.g., U-Boot) is not configured properly (e.g., U-Boot's distro boot) to be compliant with Arm SystemReady Devicetree (formerly IR) band. Unfortunately I could not immediately get it to emit any output, to even diagnose why it wasn't working. There was no public documentation on the vendor's website to even confirm I was checking the right UARTs.

    Earlier this year (2024) I happened to meet the ODM/OEM, Forlinx, at Embedded World 2024 in Nuremberg and again the Monday before Hackweek 24 at Electronica 2024 in Munich. The big puzzle was that the PCB print "OKMX8MX-C" does not match any current Forlinx product, there being OKMX8MM-C and OKMX8MP-C products with the Mini and Plus variants of NXP i.MX 8M family instead. One suggestion from Forlinx staff was to double-check the DIP switches on the board for boot mode selection.

    Goals

    Double-check the board name and investigate further what may be wrong with this board.

    Resources

    none

    Progress

    • The board name is indeed as spelled above, not matching any product on forlinx.net.
    • The DIP switches were set to boot from microSD.
    • Changing the DIP switches to eMMC boot did result in UART1 RS-232 output! (although at times garbled with the cable supplied and USB adapter used)
    • As feared, it did not automatically load our GRUB from USB.
    • Booting our GRUB manually from USB (via eMMC U-Boot commands fatload+bootefi) was unsuccessful, with partially Chinese error messages.
    • This confirmed the initial suspicion, already shared with Forlinx at Embedded World 2024, that the Forlinx System-on-Module's boot firmware was not Arm SystemReady Devicetree compliant and that a firmware update would be necessary to remedy that.
    • The microSD card turned out not to contain a bootable image but to only include Chinese-language board documentation (dated 20220507) and BSP files. They used a diverging name of OKMX8MQ-C.


    Create openSUSE images for Arm/RISC-V boards by avicenzi

    Project Description

    Create openSUSE images (or test generic EFI images) for Arm and/or RISC-V boards that are not yet supported.

    Goal for this Hackweek

    Create bootable images of Tumbleweed for SBCs that currently have no images available or are untested.

    Consider generic EFI images where possible, as some boards can hold a bootloader.

    Document in the openSUSE Wiki how to flash and use the image for a given board.

    Boards that I have around and there are no images:

    • Rock 3B
    • Nano PC T3 Plus
    • Lichee RV D1
    • StartFive VisionFive (has some image needs testing)

    Hack Week 22

    Hack Week 21

    Resources


    Investigate non-booting Forlinx OKMX8MX-C board (aarch64) by a_faerber

    Description

    In the context of a SUSE customer inquiry last year, a Forlinx OKMX8MX-C arm64 board had been relayed to me from China that a customer was not successful booting SUSE Linux Micro on. Typically this happens when the vendor's bootloader (e.g., U-Boot) is not configured properly (e.g., U-Boot's distro boot) to be compliant with Arm SystemReady Devicetree (formerly IR) band. Unfortunately I could not immediately get it to emit any output, to even diagnose why it wasn't working. There was no public documentation on the vendor's website to even confirm I was checking the right UARTs.

    Earlier this year (2024) I happened to meet the ODM/OEM, Forlinx, at Embedded World 2024 in Nuremberg and again the Monday before Hackweek 24 at Electronica 2024 in Munich. The big puzzle was that the PCB print "OKMX8MX-C" does not match any current Forlinx product, there being OKMX8MM-C and OKMX8MP-C products with the Mini and Plus variants of NXP i.MX 8M family instead. One suggestion from Forlinx staff was to double-check the DIP switches on the board for boot mode selection.

    Goals

    Double-check the board name and investigate further what may be wrong with this board.

    Resources

    none

    Progress

    • The board name is indeed as spelled above, not matching any product on forlinx.net.
    • The DIP switches were set to boot from microSD.
    • Changing the DIP switches to eMMC boot did result in UART1 RS-232 output! (although at times garbled with the cable supplied and USB adapter used)
    • As feared, it did not automatically load our GRUB from USB.
    • Booting our GRUB manually from USB (via eMMC U-Boot commands fatload+bootefi) was unsuccessful, with partially Chinese error messages.
    • This confirmed the initial suspicion, already shared with Forlinx at Embedded World 2024, that the Forlinx System-on-Module's boot firmware was not Arm SystemReady Devicetree compliant and that a firmware update would be necessary to remedy that.
    • The microSD card turned out not to contain a bootable image but to only include Chinese-language board documentation (dated 20220507) and BSP files. They used a diverging name of OKMX8MQ-C.


    Officially Become a Kernel Hacker! by m.crivellari

    Description

    My studies as well my spare time are dedicated to the Linux Kernel. Currently I'm focusing on interrupts on x86_64, but my interests are not restricted to one specific topic, for now.

    I also "played" a little bit with kernel modules (ie lantern, a toy packet analyzer) and I've added a new syscall in order read from a task A, the memory of a task B.

    Maybe this will be a good chance to...

    Goals

    • create my first kernel patch

    Resources

    Achivements


    early stage kdump support by mbrugger

    Project Description

    When we experience a early boot crash, we are not able to analyze the kernel dump, as user-space wasn't able to load the crash system. The idea is to make the crash system compiled into the host kernel (think of initramfs) so that we can create a kernel dump really early in the boot process.

    Goal for the Hackweeks

    1. Investigate if this is possible and the implications it would have (done in HW21)
    2. Hack up a PoC (done in HW22 and HW23)
    3. Prepare RFC series (giving it's only one week, we are entering wishful thinking territory here).

    update HW23

    • I was able to include the crash kernel into the kernel Image.
    • I'll need to find a way to load that from init/main.c:start_kernel() probably after kcsan_init()
    • I workaround for a smoke test was to hack kexec_file_load() systemcall which has two problems:
      1. My initramfs in the porduction kernel does not have a new enough kexec version, that's not a blocker but where the week ended
      2. As the crash kernel is part of init.data it will be already stale once I can call kexec_file_load() from user-space.

    The solution is probably to rewrite the POC so that the invocation can be done from init.text (that's my theory) but I'm not sure if I can reuse the kexec infrastructure in the kernel from there, which I rely on heavily.

    update HW24

    • Day1
      • rebased on v6.12 with no problems others then me breaking the config
      • setting up a new compilation and qemu/virtme env
      • getting desperate as nothing works that used to work
    • Day 2
      • getting to call the invocation of loading the early kernel from __init after kcsan_init()
    • Day 3

      • fix problem of memdup not being able to alloc so much memory... use 64K page sizes for now
      • code refactoring
      • I'm now able to load the crash kernel
      • When using virtme I can boot into the crash kernel, also it doesn't boot completely (major milestone!), crash in elfcorehdr_read_notes()
    • Day 4

      • crash systems crashes (no pun intended) in copy_old_mempage() link; will need to understand elfcorehdr...
      • call path vmcore_init() -> parse_crash_elf_headers() -> elfcorehdr_read() -> read_from_oldmem() -> copy_oldmem_page() -> copy_to_iter()
    • Day 5

      • hacking arch/arm64/kernel/crash_dump.c:copy_old_mempage() to see if crash system really starts. It does.
      • fun fact: retested with more reserved memory and with UEFI FW, host kernel crashes in init but directly starts the crash kernel, so it works (somehow) \o/
    • TODOs

      • fix elfcorehdr so that we actually can make use of all this...
      • test where in the boot __init() chain we can/should call kexec_early_dump()


    Modernize ocfs2 by goldwynr

    Ocfs2 has gone into a stage of neglect and disrepair. Modernize the code to generate enough interest.

    Goals: * Change the mount sequence to use fscontext * Move from using bufferhead to bio/folios * Use iomap * Run it through xfstests


    Model checking the BPF verifier by shunghsiyu

    Project Description

    BPF verifier plays a crucial role in securing the system (though less so now that unprivileged BPF is disabled by default in both upstream and SLES), and bugs in the verifier has lead to privilege escalation vulnerabilities in the past (e.g. CVE-2021-3490).

    One way to check whether the verifer has bugs to use model checking (a formal verification technique), in other words, build a abstract model of how the verifier operates, and then see if certain condition can occur (e.g. incorrect calculation during value tracking of registers) by giving both the model and condition to a solver.

    For the solver I will be using the Z3 SMT solver to do the checking since it provide a Python binding that's relatively easy to use.

    Goal for this Hackweek

    Learn how to use the Z3 Python binding (i.e. Z3Py) to build a model of (part of) the BPF verifier, probably the part that's related to value tracking using tristate numbers (aka tnum), and then check that the algorithm work as intended.

    Resources


    Linux on Cavium CN23XX cards by tsbogend

    Before Cavium switched to ARM64 CPUs they developed quite powerful MIPS based SOCs. The current upstream Linux kernel already supports some Octeon SOCs, but not the latest versions. Goal of this Hack Week project is to use the latest Cavium SDK to update the Linux kernel code to let it running on CN23XX network cards.