Skip to contentSkip to conversation

configs/zynqmp_kria_kr260_defconfig: new defconfig

PATCH In review Neal Frager via buildroot 1 participant 5 messages May 31, 2023 – Jun 12, 2023 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configs/zynqmp_kria_kr260_defconfig: new defconfig

This patch adds support for Xilinx Kria KR260 starter kit.

KR260 features can be found here:
https://www.xilinx.com/products/som/kria/kr260-robotics-starter-kit.html

While the Kria SOM is based on a ZynqMP SoC, there are some key boot config differences from the other ZynqMP evaluation boards.

1. There are no boot switches on Kria SOMs. The boot mode is thus hard configured for QSPI flash. A pre-programmed boot.bin comes with every Starter Kit. U-Boot can then find the Linux kernel and file system on the SD card.

Optional instructions for updating the boot.bin in the QSPI flash can be found in the readme.txt file and the link below.

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/1641152513/Kria+K26+SOM

2. Kria SOMs use UART1 for the console instead of UART0. For this reason, Kria Starter Kits will use a separate extlinux.conf file from other ZynqMP evaluation boards.

3. The KR260 has a USB to SD card bridge, so the Linux kernel and file system are found on /dev/sda1 and /dev/sda2.

---
 DEVELOPERS                                    |   3 +-
 board/zynqmp/kria/kr260/kr260.sh              |  12 +
 ...inctrl-zynqmp-add-tri-state-controls.patch |  90 ++++
 board/zynqmp/kria/kr260/pm_cfg_obj.c          | 496 ++++++++++++++++++
 board/zynqmp/kria/readme.txt                  |  29 +-
 configs/zynqmp_kria_kr260_defconfig           |  42 ++
 6 files changed, 665 insertions(+), 7 deletions(-)
 create mode 100755 board/zynqmp/kria/kr260/kr260.sh
 create mode 100644 board/zynqmp/kria/kr260/patches/uboot/v1-0001-drivers-pinctrl-zynqmp-add-tri-state-controls.patch
 create mode 100644 board/zynqmp/kria/kr260/pm_cfg_obj.c
 create mode 100644 configs/zynqmp_kria_kr260_defconfig
DEVELOPERS +2 -1
index e76717e845..26bcf93b0a 100644
@@ -2152,9 +2152,10 @@ F:	board/zynqmp/
 F:	board/zynqmp/kria/
 F:	configs/versal_vck190_defconfig
 F:	configs/zynq_zc706_defconfig
+F:	configs/zynqmp_kria_kr260_defconfig
+F:	configs/zynqmp_kria_kv260_defconfig
 F:	configs/zynqmp_zcu102_defconfig
 F:	configs/zynqmp_zcu106_defconfig
-F:	configs/zynqmp_kria_kv260_defconfig
 F:	package/bootgen/
 F:	package/versal-firmware/
 
board/zynqmp/kria/kr260/kr260.sh new file +12 -0
new file mode 100755
index 0000000000..df8b0ccde5
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# This is a temporary work around for generating kr260 u-boot.itb.
+# The problem is there is no way to currently configure u-boot to apply
+# the carrier board dtb overlay during build, so all kr260 carrier board
+# drivers are missing.
+# This will be removed when u-boot can build the kr260 u-boot.itb natively.
+
+UBOOT_DIR=$4
+
+fdtoverlay -o ${UBOOT_DIR}/fit-dtb.blob -i ${UBOOT_DIR}/arch/arm/dts/zynqmp-smk-k26-revA.dtb ${UBOOT_DIR}/arch/arm/dts/zynqmp-sck-kr-g-revB.dtbo
+${UBOOT_DIR}/tools/mkimage -E -f ${UBOOT_DIR}/u-boot.its -B 0x8 ${BINARIES_DIR}/u-boot.itb
board/zynqmp/kria/kr260/patches/uboot/v1-0001-drivers-pinctrl-zynqmp-add-tri-state-controls.patch new file +90 -0

90 lines not on this page · raw message

board/zynqmp/kria/kr260/pm_cfg_obj.c new file +496 -0

496 lines not on this page · raw message

board/zynqmp/kria/readme.txt +23 -6
index bea1430482..dc6915f081 100644
@@ -3,14 +3,17 @@ Xilinx Kria SOM Starter Kits - ZynqMP SoC
 **************************************************
 
 This document describes the Buildroot support for the Kria 
-KV260 starter kit by Xilinx, based on Kria SOM including the 
+KV260 and KR260 starter kits by Xilinx, based on Kria SOM including the 
 Zynq UltraScale+ MPSoC (aka ZynqMP).  It has been tested with 
-the KV260 production board.
+the KV260 and KR260 production boards.
 
-Evaluation board features can be found here with the link below.
+Evaluation board features can be found here with the links below.
 
 KV260:
-https://www.xilinx.com/products/boards-and-kits/kv260.html
+https://www.xilinx.com/products/som/kria/kv260-vision-starter-kit.html
+
+KR260:
+https://www.xilinx.com/products/som/kria/kr260-robotics-starter-kit.html
 
 How to build it
 ===============
@@ -65,7 +68,7 @@ in that the boot.bin and u-boot.itb files need to be flashed
 into the QSPI boot flash such that U-Boot can then load all
 of the remaining images from the SD card.
 
-In addition, the KV260 Starter Kit QSPI comes pre-flashed with
+In addition, the KV260 and KR260 Starter Kits QSPI comes pre-flashed with
 a utility designed to make updating the QSPI flash memory
 easier.
 
@@ -76,8 +79,9 @@ https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/1641152513/Kria+K26+SOM#Bo
 
 Additionally, it is possible to use u-boot for updating the
 QSPI with new boot.bin and u-boot.itb images with the u-boot
-commands below:
+commands below.
 
+KV260 Flashing Instructions:
 Flashing u-boot.itb:
     $ sf probe
     $ fatload mmc 1 0x1000000 u-boot.itb
@@ -90,5 +94,18 @@ Flashing boot.bin:
     $ sf erase 0x200000 +$filesize
     $ sf write 0x1000000 0x200000 $filesize
 
+KR260 Flashing Instructions:
+Flashing u-boot.itb:
+    $ sf probe
+    $ fatload usb 0 0x1000000 u-boot.itb
+    $ sf erase 0xf80000 +$filesize
+    $ sf write 0x1000000 0xf80000 $filesize
+
+Flashing boot.bin:
+    $ sf probe
+    $ fatload usb 0 0x1000000 boot.bin
+    $ sf erase 0x200000 +$filesize
+    $ sf write 0x1000000 0x200000 $filesize
+
 It is possible to boot the Buildroot generated SD card image without
 updating the QSPI boot.bin image, so this is an optional step.
configs/zynqmp_kria_kr260_defconfig new file +42 -0

42 lines not on this page · raw message

Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author Reviewed-by Luca Ceresoli Tested-by Luca Ceresoli on v1 1/1
#1 lore raw

Hi Neal,

Quoted 18 lines · On Wed, 31 May 2023 12:16:02 +0100 Neal Frager <[email protected]> wrote:

This patch adds support for Xilinx Kria KR260 starter kit.

KR260 features can be found here:
https://www.xilinx.com/products/som/kria/kr260-robotics-starter-kit.html

While the Kria SOM is based on a ZynqMP SoC, there are some key boot config differences from the other ZynqMP evaluation boards.

1. There are no boot switches on Kria SOMs. The boot mode is thus hard configured for QSPI flash. A pre-programmed boot.bin comes with every Starter Kit. U-Boot can then find the Linux kernel and file system on the SD card.

Optional instructions for updating the boot.bin in the QSPI flash can be found in the readme.txt file and the link below.

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/1641152513/Kria+K26+SOM

Quoted 8 lines

2. Kria SOMs use UART1 for the console instead of UART0. For this reason, Kria Starter Kits will use a separate extlinux.conf file from other ZynqMP evaluation boards.

3. The KR260 has a USB to SD card bridge, so the Linux kernel and file system are found on /dev/sda1 and /dev/sda2.

Signature · 7 lines
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Hi everyone,

Quoted 24 lines

This patch adds support for Xilinx Kria KR260 starter kit.

KR260 features can be found here:
https://www.xilinx.com/products/som/kria/kr260-robotics-starter-kit.ht
ml

While the Kria SOM is based on a ZynqMP SoC, there are some key boot config differences from the other ZynqMP evaluation boards.

1. There are no boot switches on Kria SOMs. The boot mode is thus hard configured for QSPI flash. A pre-programmed boot.bin comes with every Starter Kit. U-Boot can then find the Linux kernel and file system on the SD card.

Optional instructions for updating the boot.bin in the QSPI flash can be found in the readme.txt file and the link below.

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/1641152513/Kria+
K26+SOM

2. Kria SOMs use UART1 for the console instead of UART0. For this reason, Kria Starter Kits will use a separate extlinux.conf file from other ZynqMP evaluation boards.

Quoted 7 lines

3. The KR260 has a USB to SD card bridge, so the Linux kernel and file system are found on /dev/sda1 and /dev/sda2.

Just a gentle reminder regarding this patch.

Best regards,
Neal Frager
AMD
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
In reply to Neal Frager via buildroot

Hi Neal,

board/zynqmp/kria/kr260/patches/uboot/v1-0001-drivers-pinctrl-zynqmp-add-tri-state-controls.patch

Quoted 74 lines · On Wed, 31 May 2023 12:16:02 +0100 Neal Frager <[email protected]> wrote:

This patch adds support for Xilinx Kria KR260 starter kit.

KR260 features can be found here:
https://www.xilinx.com/products/som/kria/kr260-robotics-starter-kit.html

While the Kria SOM is based on a ZynqMP SoC, there are some key boot config differences from the other ZynqMP evaluation boards.

1. There are no boot switches on Kria SOMs. The boot mode is thus hard configured for QSPI flash. A pre-programmed boot.bin comes with every Starter Kit. U-Boot can then find the Linux kernel and file system on the SD card.

Optional instructions for updating the boot.bin in the QSPI flash can be found in the readme.txt file and the link below.

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/1641152513/Kria+K26+SOM

2. Kria SOMs use UART1 for the console instead of UART0. For this reason, Kria Starter Kits will use a separate extlinux.conf file from other ZynqMP evaluation boards.

3. The KR260 has a USB to SD card bridge, so the Linux kernel and file system are found on /dev/sda1 and /dev/sda2.

---
 DEVELOPERS                                    |   3 +-
 board/zynqmp/kria/kr260/kr260.sh              |  12 +
 ...inctrl-zynqmp-add-tri-state-controls.patch |  90 ++++
 board/zynqmp/kria/kr260/pm_cfg_obj.c          | 496 ++++++++++++++++++
 board/zynqmp/kria/readme.txt                  |  29 +-
 configs/zynqmp_kria_kr260_defconfig           |  42 ++
 6 files changed, 665 insertions(+), 7 deletions(-)
 create mode 100755 board/zynqmp/kria/kr260/kr260.sh
 create mode 100644 board/zynqmp/kria/kr260/patches/uboot/v1-0001-drivers-pinctrl-zynqmp-add-tri-state-controls.patch
 create mode 100644 board/zynqmp/kria/kr260/pm_cfg_obj.c
 create mode 100644 configs/zynqmp_kria_kr260_defconfig
DEVELOPERS +2 -1
index e76717e845..26bcf93b0a 100644
@@ -2152,9 +2152,10 @@ F:	board/zynqmp/
 F:	board/zynqmp/kria/
 F:	configs/versal_vck190_defconfig
 F:	configs/zynq_zc706_defconfig
+F:	configs/zynqmp_kria_kr260_defconfig
+F:	configs/zynqmp_kria_kv260_defconfig
 F:	configs/zynqmp_zcu102_defconfig
 F:	configs/zynqmp_zcu106_defconfig
-F:	configs/zynqmp_kria_kv260_defconfig
 F:	package/bootgen/
 F:	package/versal-firmware/
 
board/zynqmp/kria/kr260/kr260.sh new file +12 -0
new file mode 100755
index 0000000000..df8b0ccde5
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# This is a temporary work around for generating kr260 u-boot.itb.
+# The problem is there is no way to currently configure u-boot to apply
+# the carrier board dtb overlay during build, so all kr260 carrier board
+# drivers are missing.
+# This will be removed when u-boot can build the kr260 u-boot.itb natively.
+
+UBOOT_DIR=$4
+
+fdtoverlay -o ${UBOOT_DIR}/fit-dtb.blob -i ${UBOOT_DIR}/arch/arm/dts/zynqmp-smk-k26-revA.dtb ${UBOOT_DIR}/arch/arm/dts/zynqmp-sck-kr-g-revB.dtbo
+${UBOOT_DIR}/tools/mkimage -E -f ${UBOOT_DIR}/u-boot.its -B 0x8 ${BINARIES_DIR}/u-boot.itb
board/zynqmp/kria/kr260/patches/uboot/v1-0001-drivers-pinctrl-zynqmp-add-tri-state-controls.patch +0 -0

I know we have a similar script for the KV260 carrier, but I wonder whether U-Boot would be able to load the base dtb and then apply the overlay at runtime before loading Linux.

Another question is of course: is there any effort ongoing to fix this upstream?

board/zynqmp/kria/kr260/patches/uboot/v1-0001-drivers-pinctrl-zynqmp-add-tri-state-controls.patch line 8

Quoted 13 lines

new file mode 100644
index 0000000000..422a5d091c

board/zynqmp/kria/kr260/patches/uboot/v1-0001-drivers-pinctrl-zynqmp-add-tri-state-controls.patch new file +8 -0
@@ -0,0 +1,90 @@
+From 560b2e0b6de66c4c9f4b261308263dd091c6002a Mon Sep 17 00:00:00 2001
+From: Neal Frager <[email protected]>
+Date: Tue, 28 Mar 2023 14:42:59 +0100
+Subject: [PATCH v1 1/1] drivers: pinctrl-zynqmp: add tri-state controls
+
+This patch enables u-boot pinctrl of the tri-state registers.  As it does not
+check pmufw version, it assumes version 2 of the pmufw pinctrl driver which
+comes only in pmufw 2023.1 or newer.

Why is this needed? Since you are using a vendor U-Boot, it feels strange that you need further patches on top.

Is this patch being upstreamed?

As a general rule, every commit message should always explain _why_ the patch is needed. Explaining _what_ the patch changes is often evident from the diff and thus useless in the commit message.

Otherwise looks good.

Luca

Signature · 7 lines
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

Hi Luca,

Quoted 89 lines

Hi Neal,

This patch adds support for Xilinx Kria KR260 starter kit.

KR260 features can be found here:
https://www.xilinx.com/products/som/kria/kr260-robotics-starter-kit.ht
ml

While the Kria SOM is based on a ZynqMP SoC, there are some key boot config differences from the other ZynqMP evaluation boards.

1. There are no boot switches on Kria SOMs. The boot mode is thus hard configured for QSPI flash. A pre-programmed boot.bin comes with every Starter Kit. U-Boot can then find the Linux kernel and file system on the SD card.

Optional instructions for updating the boot.bin in the QSPI flash can be found in the readme.txt file and the link below.

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/1641152513/Kria+
K26+SOM

2. Kria SOMs use UART1 for the console instead of UART0. For this reason, Kria Starter Kits will use a separate extlinux.conf file from other ZynqMP evaluation boards.

3. The KR260 has a USB to SD card bridge, so the Linux kernel and file system are found on /dev/sda1 and /dev/sda2.

---
 DEVELOPERS                                    |   3 +-
 board/zynqmp/kria/kr260/kr260.sh              |  12 +
 ...inctrl-zynqmp-add-tri-state-controls.patch |  90 ++++
 board/zynqmp/kria/kr260/pm_cfg_obj.c          | 496 ++++++++++++++++++
 board/zynqmp/kria/readme.txt                  |  29 +-
 configs/zynqmp_kria_kr260_defconfig           |  42 ++
 6 files changed, 665 insertions(+), 7 deletions(-)  create mode 

100755 board/zynqmp/kria/kr260/kr260.sh create mode 100644 board/zynqmp/kria/kr260/patches/uboot/v1-0001-drivers-pinctrl-zynqmp-a dd-tri-state-controls.patch create mode 100644 board/zynqmp/kria/kr260/pm_cfg_obj.c

 create mode 100644 configs/zynqmp_kria_kr260_defconfig
DEVELOPERS +2 -1
index e76717e845..26bcf93b0a 100644
@@ -2152,9 +2152,10 @@ F:	board/zynqmp/
 F:	board/zynqmp/kria/
 F:	configs/versal_vck190_defconfig
 F:	configs/zynq_zc706_defconfig
+F:	configs/zynqmp_kria_kr260_defconfig
+F:	configs/zynqmp_kria_kv260_defconfig
 F:	configs/zynqmp_zcu102_defconfig
 F:	configs/zynqmp_zcu106_defconfig
-F:	configs/zynqmp_kria_kv260_defconfig
 F:	package/bootgen/
 F:	package/versal-firmware/
 
board/zynqmp/kria/kr260/kr260.sh new file +15 -0
new file mode 100755
index 0000000000..df8b0ccde5
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# This is a temporary work around for generating kr260 u-boot.itb.
+# The problem is there is no way to currently configure u-boot to 
+apply # the carrier board dtb overlay during build, so all kr260 
+carrier board # drivers are missing.
+# This will be removed when u-boot can build the kr260 u-boot.itb natively.
+
+UBOOT_DIR=$4
+
+fdtoverlay -o ${UBOOT_DIR}/fit-dtb.blob -i 
+${UBOOT_DIR}/arch/arm/dts/zynqmp-smk-k26-revA.dtb 
+${UBOOT_DIR}/arch/arm/dts/zynqmp-sck-kr-g-revB.dtbo
+${UBOOT_DIR}/tools/mkimage -E -f ${UBOOT_DIR}/u-boot.its -B 0x8 
+${BINARIES_DIR}/u-boot.itb
(quoted diff) +0 -0

a/board/zynqmp/kria/kr260/patches/uboot/v1-0001-drivers-pinctrl-zynqmp -add-tri-state-controls.patch b/board/zynqmp/kria/kr260/patches/uboot/v1-0001-drivers-pinctrl-zynqmp -add-tri-state-controls.patch

Quoted 3 lines

I know we have a similar script for the KV260 carrier, but I wonder whether U-Boot would be able to load the base dtb and then apply the overlay at runtime before loading Linux.

Another question is of course: is there any effort ongoing to fix this upstream?

Applying the overlay at runtime could be a solution, but we would need a way to get the overlay file to u-boot, in this case. Without the overlay, we do not have the sd card interface, so it would need to be written to the qspi.

Perhaps Michal Simek can speak about our plans to fix this upstream, so the post-build fixup of the u-boot.itb is no longer necessary.

Quoted 17 lines

new file mode 100644
index 0000000000..422a5d091c

board/zynqmp/kria/kr260/patches/uboot/v1-0001-drivers-pinctrl-zy new file +11 -0
+++ nqmp-add-tri-state-controls.patch
@@ -0,0 +1,90 @@
+From 560b2e0b6de66c4c9f4b261308263dd091c6002a Mon Sep 17 00:00:00 
+2001
+From: Neal Frager <[email protected]>
+Date: Tue, 28 Mar 2023 14:42:59 +0100
+Subject: [PATCH v1 1/1] drivers: pinctrl-zynqmp: add tri-state 
+controls
+
+This patch enables u-boot pinctrl of the tri-state registers.  As it 
+does not check pmufw version, it assumes version 2 of the pmufw 
+pinctrl driver which comes only in pmufw 2023.1 or newer.
Quoted 1 line

Why is this needed? Since you are using a vendor U-Boot, it feels strange that you need further patches on top.

The u-boot 2023.1 release is missing control of the tri-state registers via the pinctrl driver.
Without this patch, the usb bridge to the sd card interface will not be configured properly, so we have no sd card for booting Linux.

Quoted 1 line

Is this patch being upstreamed?

Our software team is working on it. The pinctrl driver works with the pmufw underneath.
Before 2023.1, the pmufw was missing the proper support for the tri-state registers, so the patch I am adding got reverted as you can see below:
https://github.com/Xilinx/u-boot-xlnx/commit/ab8bc7989b3ede27e5bc7666a0a2a4f6fed4b1dd

I expect by 2023.2, this will be fixed, so my patch can be removed from buildroot, but perhaps Michal can comment?

Quoted 1 line

As a general rule, every commit message should always explain _why_ the patch is needed. Explaining _what_ the patch changes is often evident from the diff and thus useless in the commit message.

Good point. I could update the commit message.

Quoted 1 line

Otherwise looks good.

Thanks!

Neal Frager
AMD
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot