[SRU] Add support for the NXP S32G274A-RDB2 board in Jammy

Bug #2004495 reported by Isaac True
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flash-kernel (Ubuntu)
Fix Released
Medium
Loïc Minier
Jammy
New
Undecided
Isaac True

Bug Description

[ Impact ]

Flash-kernel only supports boards maintained in the db/all.db database.

We want to be able to support the 'NXP S32G274A-RDB2' in Jammy.

The database entries are copied from the Lunar version for the package.

[ Test Plan ]

As the database entries are the same as in Lunar they already received some testing.

Check that no entry is deleted in the database.

On a NXP S32G274A-RDB2 board, run flash-kernel to verify that a new fit image has been created and deployed to /boot/firmware

[ Where problems could occur ]

We could by mistake delete entries for other boards in the database.

We could create a database file that flash-kernel cannot parse.

This could lead to errors in booting other systems.

Both causes are not probable as we copy the entries from Lunar where testing already has occurred.

[ Other Info ]

Original description

I've created a debdiff which adds support for the NXP S32G274A-RDB2 reference board for the S32G2 SoC. The added fit image template (its/arm64/image-nxp-s32.its) can also be used for other boards in the S32 family, which may be added in the future.

This is a development board for NXP's automotive platform with a specific and custom BSP (https://github.com/nxp-auto-linux/). The device tree and support for the board is not (yet) in the mainline kernel, and the board is not supported by upstream U-Boot. In order to achieve the best compatibility with the custom U-Boot implementation required to boot this board, this patch instructs flash-kernel to only generate the fit image and place it in /boot/firmware/fitImage, without generating a boot script.

Tags: patch
Revision history for this message
Isaac True (itrue) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "flash-kernel_3.106ubuntu9_add-nxps32g274a-rdb2.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
Revision history for this message
Loïc Minier (lool) wrote :

Hi Isaac,

Thanks for the nice debdiff!

I understand you have a compatible Ubuntu-esque kernel for an S32 platform, as I don't have access to the hardware myself, could you confirm you have tested the patch on the target hardware and its exact name?

Changed in flash-kernel (Ubuntu):
assignee: nobody → Loïc Minier (lool)
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Isaac True (itrue) wrote :

Hi Loïc,

Yes I've tested the version in the debdiff (3.106ubuntu9) on the target device (NXP S32G274A-RDB2 reference board aka S32G-VNP-RDB2: https://www.nxp.com/design/designs/s32g2-vehicle-networking-reference-design:S32G-VNP-RDB2) running 22.04.

Here's the output of the test:

ubuntu@ubuntu:~$ sudo flash-kernel $(uname -r)
Using DTB: s32g274a-rdb2.dtb
Installing /lib/firmware/5.15.0-59.65-bsp35.0-ppa14-nxp-s32/device-tree/freescale/s32g274a-rdb2.dtb into /boot/dtbs/5.15.0-59.65-bsp35.0-ppa14-nxp-s32/./s32g274a-rdb2.dtb
Taking backup of s32g274a-rdb2.dtb.
Installing new s32g274a-rdb2.dtb.
Installing /lib/firmware/5.15.0-59.65-bsp35.0-ppa14-nxp-s32/device-tree/freescale/s32g274a-rdb2.dtb into /boot/dtbs/5.15.0-59.65-bsp35.0-ppa14-nxp-s32/./s32g274a-rdb2.dtb
Taking backup of s32g274a-rdb2.dtb.
Installing new s32g274a-rdb2.dtb.
flash-kernel: installing version 5.15.0-59.65-bsp35.0-ppa14-nxp-s32
Generating u-boot image... done.
Taking backup of fitImage.
Installing new fitImage.

ubuntu@ubuntu:~$ sudo dumpimage -l /boot/firmware/fitImage
FIT description: Ubuntu kernel, ramdisk and FDT blobs for the NXP S32 family
Created: Thu Feb 2 14:52:24 2023
 Image 0 (kernel-1)
  Description: Ubuntu kernel
  Created: Thu Feb 2 14:52:24 2023
  Type: Kernel Image
  Compression: uncompressed
  Data Size: 46402048 Bytes = 45314.50 KiB = 44.25 MiB
  Architecture: AArch64
  OS: Linux
  Load Address: 0x80000000
  Entry Point: 0x80000000
  Hash algo: sha256
  Hash value: 96221c7b0ffdc2f429206ab7d27c3128b2d663462719990aabe94e1023b249de
 Image 1 (ramdisk-1)
  Description: Ubuntu ramdisk
  Created: Thu Feb 2 14:52:24 2023
  Type: RAMDisk Image
  Compression: uncompressed
  Data Size: 28992936 Bytes = 28313.41 KiB = 27.65 MiB
  Architecture: AArch64
  OS: Linux
  Load Address: 0x90000000
  Entry Point: unavailable
  Hash algo: sha256
  Hash value: 8d9415d0f6dac9bc5e24a6c3f44577331c8458e40929499df883a46a27367a35
 Image 2 (fdt-1)
  Description: NXP S32
  Created: Thu Feb 2 14:52:24 2023
  Type: Flat Device Tree
  Compression: uncompressed
  Data Size: 45491 Bytes = 44.42 KiB = 0.04 MiB
  Architecture: AArch64
  Load Address: 0x83000000
  Hash algo: sha256
  Hash value: 5501381d695ef799be36d9144cb35f8e2eb65842c77b5206ff471d09f800142c
 Default Configuration: 'nxp-s32'
 Configuration 0 (nxp-s32)
  Description: NXP S32
  Kernel: kernel-1
  Init Ramdisk: ramdisk-1
  FDT: fdt-1

The board successfully boots using the new fitImage file.

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

This bug was fixed in the package flash-kernel - 3.106ubuntu10

---------------
flash-kernel (3.106ubuntu10) lunar; urgency=medium

  * Add support for the NXP S32G274A-RDB2 (LP: #2004495)
    - Add entry in db/all.db using the generic U-Boot method, the kernel
      provided s33g274a-rdb2 device tree to generate a FIT image under
      boot/firmware/fitImage.
    - Add its/arm64/image-nxp-s32.its FIT image template applicable for all
      S32x boards.

 -- Isaac True <email address hidden> Wed, 01 Feb 2023 15:30:35 +0000

Changed in flash-kernel (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Loïc Minier (lool) wrote :

Isaac tells me he needs this change in jammy as well; @Isaac: I'll let you morph this bug title/description per SRU process, ping me or someone else when ready to sponsor :)

Changed in flash-kernel (Ubuntu Jammy):
assignee: nobody → Isaac True (itrue)
Revision history for this message
Isaac True (itrue) wrote :

I've attached the .debdiff for the current development version in Jammy (flash-kernel-3.104ubuntu16)

summary: - Add support for the NXP S32G274A-RDB2 board
+ [SRU] Add support for the NXP S32G274A-RDB2 board in Jammy
description: updated
Revision history for this message
Isaac True (itrue) wrote :

Test results on 22.04 using flash-kernel-3.104ubuntu16ppa1 from the .debdiff in #7 and a custom kernel and device tree:

ubuntu@ubuntu:~$ apt info flash-kernel | grep ^Version

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Version: 3.104ubuntu16ppa1

ubuntu@ubuntu:~$ sudo flash-kernel
Using DTB: s32g274a-rdb2.dtb
Installing /lib/firmware/5.15.0-1007-s32/device-tree/freescale/s32g274a-rdb2.dtb into /boot/dtbs/5.15.0-1007-s32/./s32g274a-rdb2.dtb
Taking backup of s32g274a-rdb2.dtb.
Installing new s32g274a-rdb2.dtb.
flash-kernel: installing version 5.15.0-1007-s32
Generating u-boot image... done.
Taking backup of fitImage.
Installing new fitImage.

ubuntu@ubuntu:~$ sudo dumpimage -l /boot/firmware/fitImage
FIT description: Ubuntu kernel, ramdisk and FDT blobs for the NXP S32 family
Created: Tue Mar 14 07:59:54 2023
 Image 0 (kernel-1)
  Description: Ubuntu kernel
  Created: Tue Mar 14 07:59:54 2023
  Type: Kernel Image
  Compression: uncompressed
  Data Size: 37957640 Bytes = 37068.01 KiB = 36.20 MiB
  Architecture: AArch64
  OS: Linux
  Load Address: 0x80000000
  Entry Point: 0x80000000
  Hash algo: sha256
  Hash value: c822873731442460371cf6201d37c914fd54c6be9b3fdf5ffb075ee236941b74
 Image 1 (ramdisk-1)
  Description: Ubuntu ramdisk
  Created: Tue Mar 14 07:59:54 2023
  Type: RAMDisk Image
  Compression: uncompressed
  Data Size: 33251316 Bytes = 32471.99 KiB = 31.71 MiB
  Architecture: AArch64
  OS: Linux
  Load Address: 0x90000000
  Entry Point: unavailable
  Hash algo: sha256
  Hash value: 3125b5e38589dd16ed92dd025cd477c796108c5ccea2c4c6bba298ef787b9aee
 Image 2 (fdt-1)
  Description: NXP S32
  Created: Tue Mar 14 07:59:54 2023
  Type: Flat Device Tree
  Compression: uncompressed
  Data Size: 45615 Bytes = 44.55 KiB = 0.04 MiB
  Architecture: AArch64
  Load Address: 0x83000000
  Hash algo: sha256
  Hash value: df2b932e0a4882fc35bc492aa0570c69171faa2a1f046b9236d6fb584456b7d6
 Default Configuration: 'nxp-s32'
 Configuration 0 (nxp-s32)
  Description: NXP S32
  Kernel: kernel-1
  Init Ramdisk: ramdisk-1
  FDT: fdt-1

---

After a reboot the system boots back up using the new fit image without any issues.

Revision history for this message
Robie Basak (racb) wrote :

Missing from the bug description is an explanation of *user* impact. What's the user story that currently doesn't succeed, that you intend to fix with this SRU?

> On a NXP S32G274A-RDB2 board, run flash-kernel to verify that a new fit image has been created and deployed to /boot/firmware

This is not sufficient as a Test Plan. Please expand this to include the full exercise of the hardware enablement you are proposing. The details would depend on the user story which needs describing first.

Revision history for this message
Benjamin Drung (bdrung) wrote (last edit ):

I unsubscribed ~ubuntu-sponsors. Please resubscribe ~ubuntu-sponsors once you addressed Robie's comment.

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.