Mediatek AIoT i500 support

Bug #1962289 reported by ethan.hsieh
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flash-kernel (Ubuntu)
Fix Released
Medium
Loïc Minier
Focal
Fix Released
Medium
Loïc Minier

Bug Description

[Impact]
Add Mediatek AIoT i500 support

[Where problems could occur]
The fix contains
1 Add DB entry for Mediatek AIoT i500 board
Just add a new board to db. There will not be any regression.
2 Add "kernel_ver" value for the ITS file which includes dts coming from linux package.
Only Xilinx and Mediatek AIoT board will call mkimage_fit. And, Medaitek AIoT board's dtbs come from linux packages. There will not be any regression.

[Test Case]
Only Mediatek AIoT and Xilinx boards need fitimage.
Install flash-kernel on Mediatek AIoT and Xilinx boards.
Run "sudo flash-kernel" to generate image.fit. The system should be able to boot successfully after reboot.
1. jammy + Xilinx Kria board: Pass
2. focal + Mediatek AIoT i500 board: Pass

[Regression Potential]
Only Mediatek AIoT boards' ITS file includes the information about kernel version. So, there will be no regression on Xilinx boards.

[Other Info]
See LP: #1946212

Revision history for this message
ethan.hsieh (ethan.hsieh) wrote :
Revision history for this message
ethan.hsieh (ethan.hsieh) wrote :
tags: added: oem-priority originate-from-1946212
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "jammy.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Mathew Hodson (mhodson)
Changed in flash-kernel (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Loïc Minier (lool) wrote :

Hi there,

Thanks for the nice debdiffs; reading through these, I see the following changes:
1) a new boot script – fine, albeit flash-kernel seems to collect more and more of them and it would be good to avoid having too many
2) support for using the kernel ABI version in substs – why not, albeit it's a bit surprising this wasn't needed so far, and it looks like this might be breaking an abstraction
3) a new its file as a template for the FIT image; this one seems really wrong to me because it has this long list of dtbos which will likely evolve across kernel versions

IMO the job of flash-kernel is to keep track of the method with which we install kernels/initramfses/other boot assets, but once a method is implemented, it can be used for a long time. Here, the list of dtbos is very long and seems very platform specific, so it's likely to evolve with kernel versions, so it will likely result in having to update flash-kernel for a new kernel, or having to manage versioned dependencies like "at least this version of flash-kernel to get the its that installs this list of dtbos".

I'm not sure what the proper solution is, it could be that the its file should be provided by the kernel rather than flash-kernel, like dtbs, or perhaps we need to scan for dtbo files.

What would be really useful would be to explain how these dtbos are being used, what's the scenario in which they are used in the FIT image?

Thanks!

Revision history for this message
ethan.hsieh (ethan.hsieh) wrote :

@Loïc

I'm working on an image which will support multiple Medaitek AIoT boards. The dtbo files are for some external components like cameras and panels. Mediatek would like to have these dtbo files in the fitimage. These components are optional. When end-users have it, they can enable it by modifying an u-boot variable.

Pi, zynqmp, and other boards' uboot boot scripts are in flash-kernel. So, I thought it's the right place for the u-boot boot script.

I suggested the HWE team to add the ITS file into linux package. They will have an internal discussion for it. If ITS/DTB/DTBO are in the linux packages, there won't be a dependency issue. I'll get back to you when I get the feedback from the HWE team.

Thanks~

Revision history for this message
Loïc Minier (lool) wrote :

@Ethan: sounds good; perhaps one way to think about it could be:
1) the kernel knows which dtbs and dtbos are supported with a particular kernel build
2) flash-kernel has a clear and stable interface to pull the right bits into a FIT image but does not need to keep track of the list in flash-kernel itself

One way to go would be to agree that all *.dtbo in a particular subdirectory of the kernel deb should be included, or even better, having a list of dtbos for a particular board; flash-kernel could keep the FIT image template, but would iterate over the dtbos listed in the kernel-provided file to generate the FIT image.

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

It would be preferable if the changes would be merged in Debian first. Is there a matching Debian bug?

Revision history for this message
ethan.hsieh (ethan.hsieh) wrote :

@Heinrich

My patch for MTK i500 board is based on a patch[1] for fitimage support.
[1] wasn't upstreamed to [2]. So, I didn't send the MP to [2].

---
[1] https://bugs.launchpad.net/ubuntu/+source/flash-kernel/+bug/1931987
[2] https://salsa.debian.org/installer-team/flash-kernel

Revision history for this message
Loïc Minier (lool) wrote :

I've re-reviewed this, updated README to match the new behavior and tweaked changelog slightly, and I've uploaded this to jammy - failing to add the LP: #1962289 in changelog; it's currently in the UNAPPROVED queue https://launchpad.net/ubuntu/jammy/+queue?queue_state=1&queue_text=

I agree this should go with Debian along with a bazillion changes we have in Ubuntu, but such "API" like changes would indeed ideally be prioritized in our upstreaming efforts.

Changed in flash-kernel (Ubuntu):
assignee: nobody → Loïc Minier (lool)
status: New → Fix Committed
Revision history for this message
Loïc Minier (lool) wrote :

flash-kernel (3.104ubuntu8) jammy; urgency=medium

  * mkimage_fit: subst KERNEL_VERSION in ITS file with actual kernel
    version.
  * Add DB entry, bootscript and ITS templates for Mediatek AIoT i500 board.

Date: Sun, 03 Apr 2022 19:33:03 +0200
Changed-By: Ethan Hsieh <email address hidden>
Maintainer: Ubuntu Developers <email address hidden>
Signed-By: Loïc Minier <email address hidden>
https://launchpad.net/ubuntu/+source/flash-kernel/3.104ubuntu8

==

 OK: flash-kernel_3.104ubuntu8.tar.xz
 OK: flash-kernel_3.104ubuntu8.dsc
     -> Component: main Section: utils

Changed in flash-kernel (Ubuntu):
status: Fix Committed → Fix Released
description: updated
description: updated
Loïc Minier (lool)
Changed in flash-kernel (Ubuntu Focal):
assignee: nobody → Loïc Minier (lool)
Revision history for this message
Loïc Minier (lool) wrote :

Upload is pending review in focal Unapproved queue:
https://launchpad.net/ubuntu/focal/+queue?queue_state=1&queue_text=

Mathew Hodson (mhodson)
Changed in flash-kernel (Ubuntu Focal):
importance: Undecided → Medium
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello ethan.hsieh, or anyone else affected,

Accepted flash-kernel into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/flash-kernel/3.103ubuntu1~20.04.4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in flash-kernel (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
ethan.hsieh (ethan.hsieh) wrote :

Tried flash-kernel (3.103ubuntu1~20.04.4) on my Mediatek AIoT i500 board. The system can boot without any problem with new fitmage generated by flash-kernel (3.103ubuntu1~20.04.4)

$ apt-cache policy flash-kernel | grep Installed
  Installed: 3.103ubuntu1~20.04.4

tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package flash-kernel - 3.103ubuntu1~20.04.4

---------------
flash-kernel (3.103ubuntu1~20.04.4) focal; urgency=medium

  * Backport changes from 3.104ubuntu8 (LP: #1962289).
    * mkimage_fit: subst KERNEL_VERSION in ITS file with actual kernel
      version.
    * Add DB entry, bootscript and ITS templates for Mediatek AIoT i500 board.

 -- Ethan Hsieh <email address hidden> Wed, 13 Apr 2022 12:46:47 +0200

Changed in flash-kernel (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for flash-kernel has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.