[SRU] Add support for AMD-Xilinx Kria KD240

Bug #2037407 reported by Talha Can Havadar
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flash-kernel (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned
Lunar
Won't Fix
Undecided
Unassigned
Mantic
Fix Released
Undecided
Unassigned
Noble
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

Add AMD-Xilinx Kria KD240 board support

[Where problems could occur]

The patch adds support for the AMD-Xilinx Kria KD240, but affects the boot script used by:

* ZCU 102, 104, 106, 111
* Kria KR revisions A, B, 1
* Kria KV revisions A, B, Z, 1

[Test Case]

* Enable proposed updates (https://wiki.ubuntu.com/Testing/EnableProposed)
* Update flash-kernel to the version in -proposed: sudo apt install -t jammy-proposed flash-kernel
* Run flash-kernel (if the upgrade didn't already): sudo flash-kernel
* Reboot: sudo reboot
* Ensure system boots successfully

[Regression Potential]

As the patch touches the u-boot script used by several boards (listed above), booting should be re-tested against the potentially affected boards under the proposed package.

Revision history for this message
Talha Can Havadar (tchavadar) wrote :
tags: added: patch
Revision history for this message
Talha Can Havadar (tchavadar) wrote :

debdiff to the devel

Revision history for this message
Talha Can Havadar (tchavadar) wrote :
Revision history for this message
Andreas Hasenack (ahasenack) wrote (last edit ):

Sorry, I have no idea how this package works, so I can't review the code changes properly, only the syntax of the patch.

This should be reviewed by someone familiar with u-boot, so I'm subscribing Dave Jones to this bug, as he has uploaded this package before.

devel_0.debdiff:
- d/changelog needs to be updated for noble (3.107ubuntu3, and noble release name) Maybe the whole patch could be rebased, as there is an offset in db/all.db
- there is no indication from where these changes are coming from. I know this is a native package, but if there is some upstream repository with PRs and comments about these changes, could they be linked somewhere perhaps? But this is just me asking as someone who is not familiar at all with this package.
- the d/changelog diff is also making changes elsewhere in the file, not just adding an entry on top. That is usually not desirable:
@@ -614,7 +620,7 @@

   * Add riscv64 support (LP: #1966219)
   * Add the following boards to db/all.db
- - SiFive HiFive Unmatched A00
+ - SiFive HiFive Unmatched A00
     - BeagleV Starlight Beta

  -- Heinrich Schuchardt <email address hidden> Tue, 08 Mar 2022 10:05:15 +0100

The other debdiffs also have that stray changelog change.

We will also need a mantic diff, now that noble is open for development already.

You should update the [test case] with what you said in the [regression potential] section, about testing other affected boards.

Revision history for this message
Dave Jones (waveform) wrote :

I've had a look at the devel patch and there's a few things I'm a bit concerned about:

In the new all.db entry the "Machine:" entries both include * wildcards. The all.db database is organized to be in strictly alphabetical order and that means that entries with * wildcards (or really, any accepted wildcard) should never be the first Machine: entry because their sorting order is ambiguous. I realize we've already got several such entries, but I'd really like to see all of these revised to be more like the Pi entries with wildcards, e.g.:

Machine: Raspberry Pi 3 Model B
Machine: Raspberry Pi 3 Model B Rev 1.2
Machine: Raspberry Pi 3 Model B Rev *

Here the first entry has no wildcards and hence can be used to enforce the sort order without ambiguity. They also serve to document the strings that the wildcard is expected to match. In the proposed patch, I'm not sure what sort of strings the "ZynqMP *K24*" and "ZynqMP *KD240*" are going to match.

Secondly, in the revised u-boot script, the support list of Kria boards at the top appears unchanged, but I'd assume "sck-kd-g" should appear in there somewhere?

Continuing with the revised u-boot script, $k24_starter is set to "SMK-K24-" if it's not already in the environment. I'm not entirely clear on what this variable is meant to represent and why the environment's providing it? It would be nice to see this (and, ideally, $card1_name) documented as the "variables expected to be in the environment".

Finally, the patch adds the following test:

  if setexpr model gsub .*$k24_starter.* $model

This doesn't make sense unless $model is also set in the environment. It stands in contrast to the tests immediately following it that rely on $model_test, which is retrieved from the device-tree prior to the tests. Are we sure this is correct?

Leaving as "Incomplete" and unsubscribing ubuntu-sponsors pending correct and clarification of the above.

Revision history for this message
Talha Can Havadar (tchavadar) wrote (last edit ):

Thank you for your time and comments Dave and Andreas, since the flash-kernel has dependency to the kernel and the current kernel for Xilinx boards (which is accessible by public) does not include the dtb files required for KD240 yet. So in anyway we needed to hold this update to be released on flash-kernel until we have the new version of kernel released with correct dtb files.

Meanwhile, I will be working on to resolve the issues you guys mentioned already.

As Dave mentioned, I have updated the mechanism to check the type of the board and added a comment in the header of the bootscript to explain the purpose of `card1_name` variable.

I have updated the all.db entry for Kria family like below;
```
Machine: ZynqMP SMK-K26 Rev1/B/A
Machine: ZynqMP *K26*
Machine: ZynqMP *K24*
Machine: ZynqMP *KD240*
Kernel-Flavors: xilinx-zynqmp
Method: generic
Boot-Script-Path: /boot/firmware/boot.scr.uimg
U-Boot-Script-Name: bootscr.zynqmp
Boot-FIT-Path: /boot/firmware/image.fit
Boot-ITS-File-Name: image-kria.its
Required-Packages: u-boot-tools
```

Is this what you would expect in `Machine` field Dave?

I will prepare a debdiff for noble. After your feed back I will update the other debdiffs as well.

Revision history for this message
Talha Can Havadar (tchavadar) wrote :

Hello Dave,

I have addressed the issues you mentioned in noble_1.debdiff do you think it is ok to continue? If so I will apply the same changes to devel, mantic, lunar and jammy as well.

Revision history for this message
Talha Can Havadar (tchavadar) wrote :

Update the changelog

Revision history for this message
Talha Can Havadar (tchavadar) wrote :

Update the version and changelog entry, and include fallback dtb fix for KR260 as well

Revision history for this message
Talha Can Havadar (tchavadar) wrote :

Apply changes in noble_3.debdiff to jammy

Revision history for this message
Dave Jones (waveform) wrote :

Ah, this looks much better. Thanks very much for addressing those concerns (the u-boot script in particular!); I'm happy to sponsor this at this point.

Revision history for this message
Dave Jones (waveform) wrote :

Okay, noble is sponsored; I tweaked the changelog date to appease lintian (the latest noble upload had a later date than that in the noble_3.debdiff, but that's a trivial change). Once that's migrated we should tackle mantic, lunar (assuming it's still in service at that point), and then jammy.

I see we've got a jammy debdiff (which looks good to go), any chance you could put together a mantic and lunar debdiff?

Revision history for this message
Talha Can Havadar (tchavadar) wrote :

Thank you very much Dave. Yes I have prepared the debdiffs for mantic and lunar as well and will attach them here.

Revision history for this message
Talha Can Havadar (tchavadar) wrote :

Apply the same changes in noble_3.debdiff to lunar

Revision history for this message
Talha Can Havadar (tchavadar) wrote :

Apply the same changes in noble_3.debdiff to mantic

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package flash-kernel - 3.107ubuntu4

---------------
flash-kernel (3.107ubuntu4) noble; urgency=medium

  * Add support for Xilinx Kria KD240 (LP: #2037407)
    - Fix minor issues in bootscr.zynqmp

 -- Talha Can Havadar <email address hidden> Fri, 08 Dec 2023 14:17:40 +0000

Changed in flash-kernel (Ubuntu Noble):
status: New → Fix Released
Revision history for this message
Talha Can Havadar (tchavadar) wrote :

Hi @Dave, is it possible to give priority to jammy SRU when you start working on SRU since it is a prerequisite for our image builds?

Revision history for this message
Steve Langasek (vorlon) wrote : Proposed package upload rejected

An upload of flash-kernel to lunar-proposed has been rejected from the upload queue for the following reason: "lunar EOL in 9 days; no more SRUs.".

Changed in flash-kernel (Ubuntu Lunar):
status: New → Won't Fix
Revision history for this message
Talha Can Havadar (tchavadar) wrote :

Thank you for the information Steve

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Talha, or anyone else affected,

Accepted flash-kernel into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/flash-kernel/3.104ubuntu18 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-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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 Jammy):
status: New → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

I accepted the jammy SRU, but for this to go out into -updates we also need the mantic SRU uploaded (right now it's missing from the queues).

Also, this adds AMD-Xilinx Kria KD240, but I'd request the same test case to be run on all the previous Kria platforms we support, to ensure there's no regression in existing hardware.

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Talha, or anyone else affected,

Accepted flash-kernel into mantic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/flash-kernel/3.107ubuntu2.1 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-mantic to verification-done-mantic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-mantic. 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 Mantic):
status: New → Fix Committed
tags: added: verification-needed-mantic
Revision history for this message
Talha Can Havadar (tchavadar) wrote (last edit ):
Download full text (3.9 KiB)

Test results:

On KV260 Rev1 I have,

flash-kernel (3.107ubuntu2.1) in mantic-proposed is successfully installed and was able to reboot with out an issue.
```
flash-kernel:
  Installed: 3.107ubuntu2.1
  Candidate: 3.107ubuntu2.1
  Version table:
 *** 3.107ubuntu2.1 100
        100 http://ports.ubuntu.com/ubuntu-ports mantic-proposed/main arm64 Packages
        100 /var/lib/dpkg/status
     3.104ubuntu17xlnx2 500
        500 http://oem.archive.canonical.com/updates jammy-limerick/public arm64 Packages
     3.104ubuntu17 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 Packages
     3.104ubuntu9 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 Packages
ubuntu@kria:~$ cat /proc/device-tree/model
ZynqMP SMK-K26 Rev1/B/A
```

flash-kernel(3.104ubuntu18) in jammy-proposed is successfully installed and was able to reboot without an issue.
```
ubuntu@kria:~$ sudo apt policy flash-kernel
flash-kernel:
  Installed: 3.104ubuntu18
  Candidate: 3.104ubuntu18
  Version table:
 *** 3.104ubuntu18 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy-proposed/main arm64 Packages
        100 /var/lib/dpkg/status
     3.104ubuntu17xlnx2 500
        500 http://oem.archive.canonical.com/updates jammy-limerick/public arm64 Packages
     3.104ubuntu17 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 Packages
     3.104ubuntu9 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 Packages
ubuntu@kria:~$ cat /proc/device-tree/model
ZynqMP SMK-K26 Rev1/B/A
```

On KD240,

flash-kernel (3.107ubuntu2.1) in mantic-proposed is successfully installed and was able to reboot with out an issue.
```
Last login: Mon Jan 22 15:43:04 UTC 2024 from 192.168.88.95 on pts/0
ubuntu@kria:~$ sudo apt policy flash-kernel
[sudo] password for ubuntu:
flash-kernel:
  Installed: 3.107ubuntu2.1
  Candidate: 3.107ubuntu2.1
  Version table:
 *** 3.107ubuntu2.1 100
        100 http://ports.ubuntu.com/ubuntu-ports mantic-proposed/main arm64 Packages
        100 /var/lib/dpkg/status
     3.104ubuntu17xlnx2 500
        500 http://oem.archive.canonical.com/updates jammy-limerick/public arm64 Packages
     3.104ubuntu17 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 Packages
     3.104ubuntu9 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 Packages
ubuntu@kria:~$ cat /proc/device-tree/model
ZynqMP KD240 revA/B/1
```

flash-kernel(3.104ubuntu18) in jammy-proposed is successfully installed and was able to reboot without an issue.
```
ubuntu@kria:~$ sudo apt policy flash-kernel
[sudo] password for ubuntu:
flash-kernel:
  Installed: 3.104ubuntu18
  Candidate: 3.104ubuntu18
  Version table:
 *** 3.104ubuntu18 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy-proposed/main arm64 Packages
        100 /var/lib/dpkg/status
     3.104ubuntu17xlnx2 500
        500 http://oem.archive.canonical.com/updates jammy-limerick/public arm64 Packages
     3.104ubuntu17 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 Packages
     3.104ubuntu9 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 Packages
ubuntu@kri...

Read more...

tags: added: verification-done-jammy verification-done-mantic
removed: verification-needed verification-needed-jammy verification-needed-mantic
tags: added: verification-needed verification-needed-jammy verification-needed-mantic
removed: verification-done-jammy verification-done-mantic
Revision history for this message
Vincent Liao (liaou3) wrote :
Download full text (4.4 KiB)

All passed.
Below are the test results for ZCU 102, 104, 106 below.

ZCU 102 (202008-28157)

1. jammy-propsed

ubuntu@zynqmp:~$ apt policy flash-kernel
flash-kernel:
  Installed: 3.104ubuntu18
  Candidate: 3.104ubuntu18
  Version table:
 *** 3.104ubuntu18 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy-proposed/main arm64 Packages
        100 /var/lib/dpkg/status
     3.104ubuntu17xlnx2 500
        500 http://oem.archive.canonical.com/updates jammy-limerick/public arm64 Packages
     3.104ubuntu17 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 Packages
     3.104ubuntu9 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 Packages
ubuntu@zynqmp:~$ cat /proc/device-tree/model
ZynqMP ZCU102 Rev1.0

2. mantic-proposed
ubuntu@zynqmp:~$ apt policy flash-kernel
flash-kernel:
  Installed: 3.107ubuntu2.1
  Candidate: 3.107ubuntu2.1
  Version table:
 *** 3.107ubuntu2.1 100
        100 http://ports.ubuntu.com/ubuntu-ports mantic-proposed/main arm64 Packages
        100 /var/lib/dpkg/status
     3.104ubuntu18 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy-proposed/main arm64 Packages
     3.104ubuntu17xlnx2 500
        500 http://oem.archive.canonical.com/updates jammy-limerick/public arm64 Packages
     3.104ubuntu17 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 Packages
     3.104ubuntu9 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 Packages
ubuntu@zynqmp:~$ cat /proc/device-tree/model
ZynqMP ZCU102 Rev1.0

ZCU 104 (202008-28114)

1. jammy-proposed

ubuntu@zynqmp:~$ apt policy flash-kernel
flash-kernel:
  Installed: 3.104ubuntu18
  Candidate: 3.104ubuntu18
  Version table:
 *** 3.104ubuntu18 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy-proposed/main arm64 Packages
        100 /var/lib/dpkg/status
     3.104ubuntu17xlnx2 500
        500 http://oem.archive.canonical.com/updates jammy-limerick/public arm64 Packages
     3.104ubuntu17 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 Packages
     3.104ubuntu9 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 Packages
ubuntu@zynqmp:~$ cat /proc/device-tree/model
ZynqMP ZCU104 RevC

2. mantic-proposed

ubuntu@zynqmp:~$ apt policy flash-kernel
flash-kernel:
  Installed: 3.107ubuntu2.1
  Candidate: 3.107ubuntu2.1
  Version table:
 *** 3.107ubuntu2.1 100
        100 http://ports.ubuntu.com/ubuntu-ports mantic-proposed/main arm64 Packages
        100 /var/lib/dpkg/status
     3.104ubuntu18 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy-proposed/main arm64 Packages
     3.104ubuntu17xlnx2 500
        500 http://oem.archive.canonical.com/updates jammy-limerick/public arm64 Packages
     3.104ubuntu17 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 Packages
     3.104ubuntu9 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 Packages
ubuntu@zynqmp:~$ cat /proc/device-tree/model
ZynqMP ZCU104 RevC

ZCU 106 (202210-30688)

1. jammy-proposed

ubuntu@zynqmp:~$ apt policy flash-kernel
flash-kernel:
  Installed: 3.104ubuntu18
  Candidate: 3.104ubuntu18
  Version t...

Read more...

Revision history for this message
Talha Can Havadar (tchavadar) wrote :

Thank you @Vincent for sharing the results for ZCU boards.

As you may notice the results for ZCU 111 is not listed above, because we dont have ZCU 111 available to us. But when you look at the bootscr.zynqmp file it uses the same flow as ZCU 102. And all the tests for ZCU 102 is passed so I will mark the bug as verification done.

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

This bug was fixed in the package flash-kernel - 3.107ubuntu2.1

---------------
flash-kernel (3.107ubuntu2.1) mantic; urgency=medium

  [ Talha Can Havadar ]
  * Add support for Xilinx Kria KD240 (LP: #2037407)
    - Fix minor issues in bootscr.zynqmp

 -- Talha Can Havadar <email address hidden> Mon, 15 Jan 2024 10:38:38 +0000

Changed in flash-kernel (Ubuntu Mantic):
status: Fix Committed → Fix Released
Revision history for this message
Timo Aaltonen (tjaalton) 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.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package flash-kernel - 3.104ubuntu18

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

  * Add support for Xilinx Kria KD240 (LP: #2037407)
    - Fix minor issues in bootscr.zynqmp

 -- Talha Can Havadar <email address hidden> Mon, 15 Jan 2024 10:44:12 +0000

Changed in flash-kernel (Ubuntu Jammy):
status: Fix Committed → Fix Released
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.