[PATCH v2 01/11] binman: elf: Check for ELF_TOOLS availability and remove extra semicolon

2023-07-06 Thread lukas . funke-oss
From: Lukas Funke Check if elf tools are available when running DecodeElf(). Also remove superfuous semicolon at line ending. Signed-off-by: Lukas Funke Reviewed-by: Simon Glass --- (no changes since v1) tools/binman/elf.py | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) d

[PATCH v2 02/11] binman: Don't decompress data while signing

2023-07-06 Thread lukas . funke-oss
From: Lukas Funke While signing a fit compressed data (i.e. 'blob-ext') is decompressed, but never compressed again. When compressed data was wrapped in a section, decompression leads to an error because the outer section had the original compressed size but the inner entry has the uncompressed s

[PATCH v2 05/11] binman: ftest: Add test for u_boot_spl_pubkey_dtb

2023-07-06 Thread lukas . funke-oss
From: Lukas Funke Add test for u_boot_spl_pubkey_dtb. The test adds a public key to the dtb and checks if the required nodes will be added to the images dtb. Signed-off-by: Lukas Funke Reviewed-by: Simon Glass --- Changes in v2: - Changed u_boot_spl_pubkey_dtb to u-boot-spl-pubkey-dtb tool

[PATCH v2 03/11] binman: blob_dtb: Add fake_size argument to ObtainContents()

2023-07-06 Thread lukas . funke-oss
From: Lukas Funke The method 'connect_contents_to_file()' calls ObtainsContents() with 'fake_size' argument. Without providing the argument in the blob_dtb we are not able to call this method without error. Signed-off-by: Lukas Funke Reviewed-by: Simon Glass --- (no changes since v1) tools/

[PATCH v2 00/11] Sign Xilinx ZynqMP SPL/FSBL boot images using binman

2023-07-06 Thread lukas . funke-oss
From: Lukas Funke This series adds two etypes to create a verified boot chain for Xilinx ZynqMP devices. The first etype 'xilinx_fsbl_auth' is used to create a bootable, signed image for ZynqMP boards using the Xilinx Bootgen tool. The second etype 'u_boot_spl_pubkey_dtb' is used to add a '/sign

[PATCH v2 04/11] binman: doc: Add documentation for fdt_add_pubkey bintool

2023-07-06 Thread lukas . funke-oss
From: Lukas Funke Add documentation for btool which calls 'fdt_add_pubkey' Signed-off-by: Lukas Funke Reviewed-by: Simon Glass --- (no changes since v1) tools/binman/bintools.rst | 10 ++ 1 file changed, 10 insertions(+) diff --git a/tools/binman/bintools.rst b/tools/binman/bintool

[PATCH v2 06/11] binman: btool: Add fdt_add_pubkey as btool

2023-07-06 Thread lukas . funke-oss
From: Lukas Funke Add btool which calls 'fdt_add_pubkey' Signed-off-by: Lukas Funke Reviewed-by: Simon Glass --- (no changes since v1) tools/binman/btool/fdt_add_pubkey.py | 67 1 file changed, 67 insertions(+) create mode 100644 tools/binman/btool/fdt_add_pubk

[PATCH v2 08/11] binman: doc: Add documentation for Xilinx Bootgen bintool

2023-07-06 Thread lukas . funke-oss
From: Lukas Funke Add documentation for the 'bootgen' bintool Signed-off-by: Lukas Funke Reviewed-by: Simon Glass --- (no changes since v1) tools/binman/bintools.rst | 12 1 file changed, 12 insertions(+) diff --git a/tools/binman/bintools.rst b/tools/binman/bintools.rst index

[PATCH v2 10/11] binman: ftest: Add test for xilinx_fsbl_auth etype

2023-07-06 Thread lukas . funke-oss
From: Lukas Funke Add test for the 'xilinx_fsbl_auth' etype Signed-off-by: Lukas Funke --- Changes in v2: - Fixed typo in dts name tools/binman/ftest.py | 8 tools/binman/test/280_xilinx_fsbl_auth.dts | 23 ++ 2 files changed, 31 insertions

[PATCH v2 07/11] binman: etype: Add u_boot_spl_pubkey_dtb etype

2023-07-06 Thread lukas . funke-oss
From: Lukas Funke This adds a new etype 'u_boot_spl_pubkey_dtb'. The etype adds the public key from a certificate to the dtb. This creates a '/signature' node which is turn contains the fields which make up the public key. Usually this is done by 'mkimage -K'. However, 'binman sign' does not add

[PATCH v2 11/11] binman: etype: Add xilinx_fsbl_auth etype

2023-07-06 Thread lukas . funke-oss
From: Lukas Funke This adds a new etype 'xilinx_fsbl_auth'. Using this etype it is possible to created an authenticated SPL (FSBL in Xilinx terms) for ZynqMP boards. The etype uses Xilinx Bootgen tools in order to transform the SPL into a bootable image and sign the image with a given primary an

[PATCH v2 09/11] binman: btool: Add Xilinx Bootgen btool

2023-07-06 Thread lukas . funke-oss
From: Lukas Funke Add the Xilinx Bootgen as bintool. Xilinx Bootgen is used to create bootable SPL (FSBL in Xilinx terms) images for Zynq/ZynqMP devices. The btool creates a signed version of the SPL. Additionally to signing the key source for the decryption engine can be passend to the boot imag

[PATCH v3 01/11] binman: elf: Check for ELF_TOOLS availability and remove extra semicolon

2023-07-18 Thread lukas . funke-oss
From: Lukas Funke Check if elf tools are available when running DecodeElf(). Also remove superfuous semicolon at line ending. Signed-off-by: Lukas Funke Reviewed-by: Simon Glass --- Changes in v3: - Improved test coverage regarding missing libelf - Align error message tools/binman/elf.py

[PATCH v3 00/11] Sign Xilinx ZynqMP SPL/FSBL boot images using binman

2023-07-18 Thread lukas . funke-oss
From: Lukas Funke This series adds two etypes to create a verified boot chain for Xilinx ZynqMP devices. The first etype 'xilinx-fsbl-auth' is used to create a bootable, signed image for ZynqMP boards using the Xilinx Bootgen tool. The second etype 'u-boot-spl-pubkey-dtb' is used to add a '/sign

[PATCH v3 03/11] binman: blob_dtb: Add fake_size argument to ObtainContents()

2023-07-18 Thread lukas . funke-oss
From: Lukas Funke The method 'connect_contents_to_file()' calls ObtainsContents() with 'fake_size' argument. Without providing the argument in the blob_dtb we are not able to call this method without error. Signed-off-by: Lukas Funke Reviewed-by: Simon Glass --- (no changes since v1) tools/

[PATCH v3 02/11] binman: Don't decompress data while signing

2023-07-18 Thread lukas . funke-oss
From: Lukas Funke While signing a fit compressed data (i.e. 'blob-ext') is decompressed, but never compressed again. When compressed data was wrapped in a section, decompression leads to an error because the outer section had the original compressed size but the inner entry has the uncompressed s

[PATCH v3 05/11] binman: ftest: Add test for u_boot_spl_pubkey_dtb

2023-07-18 Thread lukas . funke-oss
From: Lukas Funke Add test for u_boot_spl_pubkey_dtb. The test adds a public key to the dtb and checks if the required nodes will be added to the images dtb. Signed-off-by: Lukas Funke Reviewed-by: Simon Glass --- Changes in v3: - Add newline before main - Adapted test due to property renami

[PATCH v3 04/11] binman: doc: Add documentation for fdt_add_pubkey bintool

2023-07-18 Thread lukas . funke-oss
From: Lukas Funke Add documentation for btool which calls 'fdt_add_pubkey' Signed-off-by: Lukas Funke Reviewed-by: Simon Glass --- Changes in v3: - Fix rst headline length tools/binman/bintools.rst | 10 ++ 1 file changed, 10 insertions(+) diff --git a/tools/binman/bintools.rst b/

[PATCH v3 06/11] binman: btool: Add fdt_add_pubkey as btool

2023-07-18 Thread lukas . funke-oss
From: Lukas Funke Add btool which calls 'fdt_add_pubkey' Signed-off-by: Lukas Funke Reviewed-by: Simon Glass --- (no changes since v1) tools/binman/btool/fdt_add_pubkey.py | 67 1 file changed, 67 insertions(+) create mode 100644 tools/binman/btool/fdt_add_pubk

[PATCH v3 08/11] binman: doc: Add documentation for Xilinx Bootgen bintool

2023-07-18 Thread lukas . funke-oss
From: Lukas Funke Add documentation for the 'bootgen' bintool Signed-off-by: Lukas Funke Reviewed-by: Simon Glass --- (no changes since v1) tools/binman/bintools.rst | 12 1 file changed, 12 insertions(+) diff --git a/tools/binman/bintools.rst b/tools/binman/bintools.rst index

[PATCH v3 09/11] binman: btool: Add Xilinx Bootgen btool

2023-07-18 Thread lukas . funke-oss
From: Lukas Funke Add the Xilinx Bootgen as bintool. Xilinx Bootgen is used to create bootable SPL (FSBL in Xilinx terms) images for Zynq/ZynqMP devices. The btool creates a signed version of the SPL. Additionally to signing the key source for the decryption engine can be passend to the boot imag

[PATCH v3 10/11] binman: ftest: Add test for xilinx_fsbl_auth etype

2023-07-18 Thread lukas . funke-oss
From: Lukas Funke Add test for the 'xilinx_fsbl_auth' etype Signed-off-by: Lukas Funke --- Changes in v3: - Improved test coverage for xilinx-fsbl-auth etype Changes in v2: - Fixed typo in dts name tools/binman/ftest.py | 61 +++ tools/binman/test/28

[PATCH v3 07/11] binman: etype: Add u-boot-spl-pubkey-dtb etype

2023-07-18 Thread lukas . funke-oss
From: Lukas Funke This adds a new etype 'u-boot-spl-pubkey-dtb'. The etype adds the public key from a certificate to the dtb. This creates a '/signature' node which is turn contains the fields which make up the public key. Usually this is done by 'mkimage -K'. However, 'binman sign' does not add

[PATCH v3 11/11] binman: etype: Add xilinx_fsbl_auth etype

2023-07-18 Thread lukas . funke-oss
From: Lukas Funke This adds a new etype 'xilinx-fsbl-auth'. By using this etype it is possible to created an authenticated SPL (FSBL in Xilinx terms) for ZynqMP boards. The etype uses Xilinx Bootgen tools in order to transform the SPL into a bootable image and sign the image with a given primary

[PATCH] arm64: zynqmp: Corrected pcap_prog register address

2023-09-15 Thread lukas . funke-oss
From: Lukas Funke Currently the pcap_prog struct variable is pointing to 0x3004 which is incorrect according to [1]. The variable should point to 0x3000. [1] https://www.xilinx.com/htmldocs/registers/ug1087/ug1087-zynq-ultrascale-registers.html#csu___pcap_prog.html Signed-off-by: Lukas Funke

[PATCH] binman: bintool: Change make target arg type from string to list

2023-10-04 Thread lukas . funke-oss
From: Lukas Funke The argument type of `build_from_git` was changed from string to list in d71e7116997f14097735f04cc7847f0a68dbc485. This commit adapts the argument type of all bintools using this function. Signed-off-by: Lukas Funke --- tools/binman/btool/bootgen.py | 2 +- tools/binman/b

[PATCH v4 0/3] Sign Xilinx ZynqMP SPL/FSBL boot images using binman

2023-08-03 Thread lukas . funke-oss
From: Lukas Funke This series adds one etype to create a verified boot chain for Xilinx ZynqMP devices. The etype 'xilinx-bootgen' is used to create a bootable, signed image for ZynqMP boards using the Xilinx Bootgen tool. The series also contains the corresponding btool for calling 'bootgen'.

[PATCH v4 2/3] binman: ftest: Add test for xilinx-bootgen etype

2023-08-03 Thread lukas . funke-oss
From: Lukas Funke Add test for the 'xilinx-bootgen' etype Signed-off-by: Lukas Funke Reviewed-by: Simon Glass --- Changes in v4: - Add test to check for missing bootgen tool Changes in v3: - Improved test coverage for xilinx-fsbl-auth etype Changes in v2: - Fixed typo in dts name tools/b

[PATCH v4 1/3] binman: btool: Add Xilinx Bootgen btool

2023-08-03 Thread lukas . funke-oss
From: Lukas Funke Add the Xilinx Bootgen as bintool. Xilinx Bootgen is used to create bootable SPL (FSBL in Xilinx terms) images for Zynq/ZynqMP devices. The btool creates a signed version of the SPL. Additionally to signing the key source for the decryption engine can be passend to the boot imag

[PATCH v4 3/3] binman: etype: Add xilinx-bootgen etype

2023-08-03 Thread lukas . funke-oss
From: Lukas Funke This adds a new etype 'xilinx-bootgen'. By using this etype it is possible to created an signed SPL (FSBL in Xilinx terms) for ZynqMP boards. The etype uses Xilinx Bootgen tools in order to transform the SPL into a bootable image and sign the image with a given primary and seco

[PATCH 3/5] test: cmd: setexptr: Add tests for bitmap string format

2023-12-11 Thread lukas . funke-oss
From: Lukas Funke Add test to test the bitmap format specifier Signed-off-by: Lukas Funke --- test/cmd/setexpr.c | 9 + 1 file changed, 9 insertions(+) diff --git a/test/cmd/setexpr.c b/test/cmd/setexpr.c index 312593e1e3..4e1c9e983b 100644 --- a/test/cmd/setexpr.c +++ b/test/cmd/set

[PATCH 0/5] Enable setexpr command to print cpu-list like bitmaps

2023-12-11 Thread lukas . funke-oss
From: Lukas Funke This series enables the 'setexpr' command to print "cpu list"-like bitmaps based on the printk format specifier [1]. One use-case is to pass cpu list [2] based kernel parameter like 'isolcpu', 'nohz_full', irq affinity or RCU related CPU parameter to the kernel via a separate

[PATCH 1/5] sandbox: add generic find_next_zero_bit implementation

2023-12-11 Thread lukas . funke-oss
From: Lukas Funke Add generic 'find_next_zero_bit' implementation in order to enable the use of the 'for_each_set_bitrange' macro. The implementation is currently missing for the sandbox-arch and using the function results in a linker error. There are more efficient implementations in the archit

[PATCH 2/5] linux: bitmap.h: add 'for_each_set_bitrange' iteration macro

2023-12-11 Thread lukas . funke-oss
From: Lukas Funke Add 'for_each_set_bitrange' (from Linux kernel) in order to iterate over each set bitrange of a bitmap. This becomes handy if one wants to generate a cpu list i.e. for isolcpu or nohz_full. Signed-off-by: Lukas Funke --- include/linux/bitmap.h | 7 +++ 1 file changed, 7

[PATCH 5/5] cmd: printf: forward '%p' format string specifier

2023-12-11 Thread lukas . funke-oss
From: Lukas Funke Forward '%p' format specifier to the underlying format logic in order to print pointers, especially bitmaps. Signed-off-by: Lukas Funke --- cmd/printf.c | 29 + 1 file changed, 29 insertions(+) diff --git a/cmd/printf.c b/cmd/printf.c index 0c688

[PATCH 4/5] lib: vsprintf: enable '%*pb[l]' format specifier

2023-12-11 Thread lukas . funke-oss
From: Lukas Funke The commit enables vsprintf() to handle the '%*pb[l]' format specifier in order to print bitmaps and its derivatives such as cpumask and nodemask [1]. This can be used to derive kernel boot parameters from bitmaks such as 'isolcpu' or 'nohz_full' [2]. [1] https://www.kernel.org

[PATCH v2 1/6] sandbox: add generic find_next_zero_bit implementation

2023-12-12 Thread lukas . funke-oss
From: Lukas Funke Add generic 'find_next_zero_bit' implementation in order to enable the use of the 'for_each_set_bitrange' macro. The implementation is currently missing for the sandbox-arch and using the function results in a linker error. There are more efficient implementations in the archit

[PATCH v2 0/6] Enable setexpr command to print cpu-list like bitmaps

2023-12-12 Thread lukas . funke-oss
From: Lukas Funke This series enables the 'setexpr' command to print "cpu list"-like bitmaps based on the printk format specifier [1]. One use-case is to pass cpu list [2] based kernel parameter like 'isolcpu', 'nohz_full', irq affinity or RCU related CPU parameter to the kernel via a separate

[PATCH v2 2/6] linux: bitmap.h: add 'for_each_set_bitrange' iteration macro

2023-12-12 Thread lukas . funke-oss
From: Lukas Funke Add 'for_each_set_bitrange' (from Linux kernel) in order to iterate over each set bitrange of a bitmap. This becomes handy if one wants to generate a cpu list i.e. for isolcpu or nohz_full. Signed-off-by: Lukas Funke --- (no changes since v1) include/linux/bitmap.h | 7

[PATCH v2 3/6] test: cmd: setexptr: Add tests for bitmap string format

2023-12-12 Thread lukas . funke-oss
From: Lukas Funke Add test to test the bitmap format specifier Signed-off-by: Lukas Funke --- (no changes since v1) test/cmd/setexpr.c | 9 + 1 file changed, 9 insertions(+) diff --git a/test/cmd/setexpr.c b/test/cmd/setexpr.c index 312593e1e3..4e1c9e983b 100644 --- a/test/cmd/setex

[PATCH v2 4/6] doc: printf() codes: Add bitmap format specifier

2023-12-12 Thread lukas . funke-oss
From: Lukas Funke Add '%*pb[l]' printf format specifier as descriped in [1]. [1] https://www.kernel.org/doc/Documentation/printk-formats.txt Signed-off-by: Lukas Funke --- (no changes since v1) doc/develop/printf.rst | 6 ++ 1 file changed, 6 insertions(+) diff --git a/doc/develop/prin

[PATCH v2 5/6] lib: vsprintf: enable '%*pb[l]' format specifier

2023-12-12 Thread lukas . funke-oss
From: Lukas Funke The commit enables vsprintf() to handle the '%*pb[l]' format specifier in order to print bitmaps and its derivatives such as cpumask and nodemask [1]. This can be used to derive kernel boot parameters from bitmaks such as 'isolcpu' or 'nohz_full' [2]. [1] https://www.kernel.org

[PATCH v2 6/6] cmd: printf: forward '%p' format string specifier

2023-12-12 Thread lukas . funke-oss
From: Lukas Funke Forward '%p' format specifier to the underlying format logic in order to print pointers, especially bitmaps. Signed-off-by: Lukas Funke --- (no changes since v1) cmd/printf.c | 29 + 1 file changed, 29 insertions(+) diff --git a/cmd/printf.c b/c

[PATCH 0/2] Enable reset_cpu() in SPL for ZynqMP

2024-06-03 Thread lukas . funke-oss
From: Lukas Funke This series enables the CPU reset in the SPL for ZynqMP based platforms. This only works if CONFIG_SYSRESET is disabled. This is usually the case since the the regular sysreset requires bl31 firmware to be loaded in order to hand the sysreset over to PMU firmware. In SPL we can

[PATCH 2/2] xilinx: zynqmp: Enable reset_cpu() in SPL

2024-06-03 Thread lukas . funke-oss
From: Lukas Funke This commit enables SPL to reset the CPU via PMU-firmware. The usual reset mechanism requires bl31 to be loaded which may not be the case in SPL. Signed-off-by: Lukas Funke --- board/xilinx/zynqmp/zynqmp.c | 9 + 1 file changed, 9 insertions(+) diff --git a/board/xi

[PATCH 1/2] arm64: zynqmp: Add 'SPL_ZYNQMP_FIRMWARE' to Kconfig

2024-06-03 Thread lukas . funke-oss
From: Lukas Funke In order to make CONFIG_IS_ENABLED() work with 'ZYNQMP_FIRMWARE' introduce an additional Kconfig 'SPL_ZYNQMP_FIRMWARE' which is selected if and only if ZYNQMP_FIRMWARE is enabled. Driver are adapted such that they build with and without the config being set. Signed-off-by: Luka

[PATCH v2 1/1] xilinx: zynqmp: Enable reset_cpu() in SPL

2024-06-04 Thread lukas . funke-oss
From: Lukas Funke This commit enables SPL to reset the CPU via PMU-firmware. The usual reset mechanism requires bl31 to be loaded which may not be the case in SPL. Signed-off-by: Lukas Funke --- Changes in v2: - Drop 2/2 since reworking ZYNQMP_FIRMWARE dependency is out-of-scope board/xilinx

[PATCH v2 0/1] Enable reset_cpu() in SPL for ZynqMP

2024-06-04 Thread lukas . funke-oss
From: Lukas Funke This series enables the CPU reset in the SPL for ZynqMP based platforms. This only works if CONFIG_SYSRESET is disabled. This is usually the case since the the regular sysreset requires bl31 firmware to be loaded in order to hand the sysreset over to PMU firmware. In SPL we can

[PATCH v3 0/7] Add eFuse access for ZynqMP

2024-06-04 Thread lukas . funke-oss
From: Lukas Funke This series adds a driver to read and write ZynqMP eFuses [1]. The driver can be accessed by the 'fuse read' and 'fuse write' commands Example: => fuse read 0 0xc 3 Reading bank 0: Word 0x000c: 3cb16685 013af244 4000 Note: Accessing eFuses requires eFuse access to b

[PATCH v3 1/7] configs: zynqmp_kria: Enable CMD_FUSE and ZYNQMP_EFUSE

2024-06-04 Thread lukas . funke-oss
From: Lukas Funke Enable CMD_FUSE and ZYNQMP_EFUSE in order to be able to write ZyqnMP eFuses from within the bootloader for Kria SoM. Signed-off-by: Lukas Funke --- (no changes since v1) configs/xilinx_zynqmp_virt_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/xilin

[PATCH v3 2/7] configs: zynqmp_virt: Enable CMD_FUSE and ZYNQMP_EFUSE

2024-06-04 Thread lukas . funke-oss
From: Lukas Funke Enable CMD_FUSE and ZYNQMP_EFUSE in order to be able to write ZyqnMP eFuses from within the bootloader. Signed-off-by: Lukas Funke --- (no changes since v1) configs/xilinx_zynqmp_kria_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/xilinx_zynqmp_kria

[PATCH v3 4/7] soc: xilinx: versal-net: Use zynqmp_pm_get_chipid() to get chip revision

2024-06-04 Thread lukas . funke-oss
From: Lukas Funke Use common zynqmp_pm_get_chipid() function to get the chip revision Signed-off-by: Lukas Funke --- (no changes since v1) drivers/soc/soc_xilinx_versal_net.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/soc/soc_xilinx_versal_net.c

[PATCH v3 3/7] soc: xilinx: versal: Use zynqmp_pm_get_chipid() to get chip revision

2024-06-04 Thread lukas . funke-oss
From: Lukas Funke Use common zynqmp_pm_get_chipid() function to get the chip revision Signed-off-by: Lukas Funke --- (no changes since v1) drivers/soc/soc_xilinx_versal.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/soc/soc_xilinx_versal.c b/drive

[PATCH v3 5/7] soc: xilinx: zynqmp: Use zynqmp_pm_get_chipid() to get chip revision

2024-06-04 Thread lukas . funke-oss
From: Lukas Funke Use common zynqmp_pm_get_chipid() function to get the chip revision Signed-off-by: Lukas Funke --- (no changes since v1) drivers/soc/soc_xilinx_zynqmp.c | 21 + 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/soc/soc_xilinx_zynqmp.

[PATCH v3 6/7] firmware: zynqmp: Add support to access efuses

2024-06-04 Thread lukas . funke-oss
From: Lukas Funke Add functions to access efuses through PMU firmware interface. Signed-off-by: Lukas Funke --- (no changes since v1) drivers/firmware/firmware-zynqmp.c | 31 ++ include/zynqmp_firmware.h | 2 ++ 2 files changed, 33 insertions(+) diff --

[PATCH v3 7/7] drivers: misc: Add driver to access ZynqMP efuses

2024-06-04 Thread lukas . funke-oss
From: Lukas Funke Add driver to access ZynqMP efuses. This is a u-boot port of [1]. Note: Accessing eFuses requires eFuse access to be enabled in the underlying PMU firmware. [1] https://lore.kernel.org/all/20240224114516.86365-8-srinivas.kandaga...@linaro.org/ Signed-off-by: Lukas Funke ---

[PATCH v3 0/1] Enable reset_cpu() in SPL for ZynqMP

2024-06-07 Thread lukas . funke-oss
From: Lukas Funke This series enables the CPU reset in the SPL for ZynqMP based platforms. This only works if CONFIG_SYSRESET is disabled. This is usually the case since the the regular sysreset requires bl31 firmware to be loaded in order to hand the sysreset over to PMU firmware. In SPL we can

[PATCH v3 1/1] xilinx: zynqmp: Enable reset_cpu() in SPL

2024-06-07 Thread lukas . funke-oss
From: Lukas Funke This commit enables SPL to reset the CPU via PMU-firmware. The usual reset mechanism requires bl31 to be loaded which may not be the case in SPL. Signed-off-by: Lukas Funke --- Changes in v3: - Use 'ZYNQMP_PM_RESET_SOFT' directly - Add comment on what happens if CONFIG_ZYNQMP

[PATCH 0/2] Import environment variables from FIT configuration

2024-07-01 Thread lukas . funke-oss
From: Lukas Funke This series enables U-Boot to import environment variables from the selectd FIT configuration. One use-case is that the overall build process enriches the FIT configuration node with dm-verity information which should be injected into the kernel commandline. U-Boot will then re

[PATCH 1/2] env: Add function to import environment variables from FIT conf node

2024-07-01 Thread lukas . funke-oss
From: Lukas Funke Add function which reads properties from FIT conf node prefixed with "env,". Import property name (without 'env,') and it's value as runtime environment variables. Note: this only works with string properties Example: configurations { default = "conf-1";

[PATCH 2/2] test: fit: Add test to check environment extraction from FIT conf node

2024-07-01 Thread lukas . funke-oss
From: Lukas Funke Add test which adds environment variables to the FIT configuration node and checks whether they are exported to the runtime environment. Signed-off-by: Lukas Funke --- configs/sandbox_defconfig | 1 + test/py/tests/test_fit.py | 45 +++ 2

[PATCH 0/1] tpm: fix uninitalized field access

2024-07-15 Thread lukas . funke-oss
From: Lukas Funke tpm_tis_wait_init() is using the 'chip->timeout_b' field which is initialized in tpm_tis_init(). However, the init-function is called *after* tpm_tis_wait_init() introducing an uninitalized field access. This series/commit fixes the issue. Lukas Funke (1): tpm: call tpm_t

[PATCH 1/1] tpm: call tpm_tis_wait_init() after tpm_tis_init()

2024-07-15 Thread lukas . funke-oss
From: Lukas Funke tpm_tis_wait_init() is using the 'chip->timeout_b' field which is initialized in tpm_tis_init(). However, the init-function is called *after* tpm_tis_wait_init() introducing an uninitalized field access. This commit switches both routines. Signed-off-by: Lukas Funke --- dri

[PATCH v2 1/1] tpm: call tpm_tis_wait_init() after tpm_tis_init()

2024-07-24 Thread lukas . funke-oss
From: Lukas Funke tpm_tis_wait_init() is using the 'chip->timeout_b' field which is initialized in tpm_tis_init(). However, the init-function is called *after* tpm_tis_wait_init() introducing an uninitalized field access. This commit switches both routines. Signed-off-by: Lukas Funke Acked-by:

[PATCH v2 0/1] tpm: fix uninitalized field access

2024-07-24 Thread lukas . funke-oss
From: Lukas Funke tpm_tis_wait_init() is using the 'chip->timeout_b' field which is initialized in tpm_tis_init(). However, the init-function is called *after* tpm_tis_wait_init() introducing an uninitalized field access. This series/commit fixes the issue. Changes in v2: - Call tpm_tis_wait_

[PATCH v3 01/11] sandbox: add generic find_next_zero_bit implementation

2024-01-10 Thread lukas . funke-oss
From: Lukas Funke Add generic 'find_next_zero_bit()' implementation in order to enable the use of the 'for_each_set_bitrange' macro. The implementation is currently missing for the sandbox-arch and using the function results in a linker error. The implementation is copied from the 'arm' implement

[PATCH v3 00/11] Enable setexpr command to print cpu-list like bitmaps

2024-01-10 Thread lukas . funke-oss
From: Lukas Funke This series enables the 'setexpr' command to print "cpu list"-like bitmaps based on the printk format specifier [1]. One use-case is to pass cpu list [2] based kernel parameter like 'isolcpu', 'nohz_full', irq affinity or RCU related CPU parameter to the kernel via a separate

[PATCH v3 05/11] cmd: printf: Correctly handle field width

2024-01-10 Thread lukas . funke-oss
From: Lukas Funke Correctly parse the field width from the format specifier. Before this commit the field_width was simply ignored. Signed-off-by: Lukas Funke --- (no changes since v1) cmd/printf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/printf.c b/cmd/printf.

[PATCH v3 02/11] linux: bitmap.h: add 'for_each_set_bitrange' iteration macro

2024-01-10 Thread lukas . funke-oss
From: Lukas Funke Add 'for_each_set_bitrange' (from Linux kernel) in order to iterate over each set bitrange of a bitmap. This becomes handy if one wants to generate a cpu list i.e. for isolcpu or nohz_full. Signed-off-by: Lukas Funke Reviewed-by: Simon Glass --- (no changes since v1) inclu

[PATCH v3 03/11] test: cmd: setexpr: Add tests for bitmap string format

2024-01-10 Thread lukas . funke-oss
From: Lukas Funke Add tests to test the bitmap format specifier. Test different bit widths and access to memory by pointer. Signed-off-by: Lukas Funke --- (no changes since v1) test/cmd/setexpr.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/test/cmd/setexpr.c b

[PATCH v3 06/11] lib: Add hextobarray() function

2024-01-10 Thread lukas . funke-oss
From: Lukas Funke Add a 'hextobarray()' function which converts a hex string to it's memory representation. This can be used to represent large integer numbers or bitmasks which do not fit in a regular unsigned long value. Signed-off-by: Lukas Funke --- (no changes since v1) include/vsprintf

[PATCH v3 04/11] doc: printf() codes: Add bitmap format specifier

2024-01-10 Thread lukas . funke-oss
From: Lukas Funke Add '%pbl' printf format specifier as descriped in [1]. [1] https://www.kernel.org/doc/Documentation/printk-formats.txt Signed-off-by: Lukas Funke --- Changes in v3: - Remove '%bp' from documentation - Give an example output in the documentation doc/develop/printf.rst | 4

[PATCH v3 09/11] setexpr: Promote 'setexpr_get_arg()' to a public function

2024-01-10 Thread lukas . funke-oss
From: Lukas Funke Promote 'setexpr_get_arg()' to a public function in order to use it from the setexpr command and in the printf-internals. Signed-off-by: Lukas Funke --- (no changes since v1) cmd/setexpr.c | 15 +-- include/command.h | 27 +++ 2 files

[PATCH v3 08/11] setexpr: rename 'get_arg()' to 'setexpr_get_arg()'

2024-01-10 Thread lukas . funke-oss
From: Lukas Funke Prefix the get_arg() function with 'setexpr_' in order to prepare the removal of the static specifier. The prefix shall denote the origin of the function. Signed-off-by: Lukas Funke --- (no changes since v1) cmd/setexpr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 delet

[PATCH v3 07/11] lib: vsprintf: enable '%pbl' format specifier

2024-01-10 Thread lukas . funke-oss
From: Lukas Funke The commit enables vsprintf() to handle the '%pbl' format specifier in order to print bitmaps and its derivatives such as cpumask and nodemask [1]. This can be used to derive kernel boot parameters from bitmaks such as 'isolcpu' or 'nohz_full' [2]. [1] https://www.kernel.org/do

[PATCH v3 10/11] setexptr: Extend setexpr_get_arg() to handle pointer to memory

2024-01-10 Thread lukas . funke-oss
From: Lukas Funke Extend setexpr_get_arg() function in order to handle bitmaps with length greater than 8 byte. If the bitmap is provided as hex string the string is parsed into a bitmap. Signed-off-by: Lukas Funke --- (no changes since v1) cmd/setexpr.c | 29 ++--- 1

[PATCH v3 11/11] cmd: printf: forward '%p' format string specifier

2024-01-10 Thread lukas . funke-oss
From: Lukas Funke Forward '%p' format specifier to the underlying format logic in order to print pointers, especially bitmaps. Signed-off-by: Lukas Funke --- Changes in v3: - Dereference pointer argument (i.e. *value) in the 'setexpr name fmt value' case. This is currently only supported

[PATCH 1/3] firmware: zynqmp: Add support to access efuses

2024-05-14 Thread lukas . funke-oss
From: Lukas Funke Add functions to access efuses through PMU firmware interface. Signed-off-by: Lukas Funke --- drivers/firmware/firmware-zynqmp.c | 31 ++ include/zynqmp_firmware.h | 2 ++ 2 files changed, 33 insertions(+) diff --git a/drivers/firmware/

[PATCH 2/3] amd64: zynqmp: Add command to program efuses

2024-05-14 Thread lukas . funke-oss
From: Lukas Funke Add subcommands to read/write eFuses using u-boot. The subcommands through the 'zynqmp' command. Example: => zynqmp efuse_read 0xc 0xc : 85 36 b1 3c 34 f2 3b 01 00 00 00 40 .f. --- board/xilinx/zynqmp/cmds.c | 101 + 1

[PATCH 0/3] Add eFuse access for ZynqMP

2024-05-14 Thread lukas . funke-oss
From: Lukas Funke This series adds a driver to read and write ZynqMP eFuses [1]. The driver can be accessed by the 'efuse_read' and 'efuse_write' subcommands of the 'zynqmp' command. Example: => zynqmp efuse_read 0xc 0xc : 85 66 b1 32 43 f2 4a 02 00 00 00 40 .f.https://doc

[PATCH 3/3] drivers: misc: Add driver to access ZynqMP efuses

2024-05-14 Thread lukas . funke-oss
From: Lukas Funke Add driver to access ZynqMP efuses. This is a u-boot port of [1]. [1] https://lore.kernel.org/all/20240224114516.86365-8-srinivas.kandaga...@linaro.org/ Signed-off-by: Lukas Funke --- drivers/misc/Kconfig| 8 ++ drivers/misc/Makefile | 1 + drivers/misc/z

[PATCH v2 0/2] Add eFuse access for ZynqMP

2024-05-15 Thread lukas . funke-oss
From: Lukas Funke This series adds a driver to read and write ZynqMP eFuses [1]. The driver can be accessed by the 'fuse read' and 'fuse write' commands Example: => fuse read 0 0xc 3 Reading bank 0: Word 0x000c: 3cb16685 013af244 4000 Note: Accessing eFuses requires eFuse access to b

[PATCH v2 1/2] firmware: zynqmp: Add support to access efuses

2024-05-15 Thread lukas . funke-oss
From: Lukas Funke Add functions to access efuses through PMU firmware interface. Signed-off-by: Lukas Funke --- (no changes since v1) drivers/firmware/firmware-zynqmp.c | 31 ++ include/zynqmp_firmware.h | 2 ++ 2 files changed, 33 insertions(+) diff --

[PATCH v2 2/2] drivers: misc: Add driver to access ZynqMP efuses

2024-05-15 Thread lukas . funke-oss
From: Lukas Funke Add driver to access ZynqMP efuses. This is a u-boot port of [1]. [1] https://lore.kernel.org/all/20240224114516.86365-8-srinivas.kandaga...@linaro.org/ Signed-off-by: Lukas Funke --- Changes in v2: - Drop vendor specific fuse cmd, use existing fuse cmd - Minor code refacto

[PATCH v1 1/3] arch: riscv: Rename spl_soc_init() to spl_dram_init()

2024-04-22 Thread lukas . funke-oss
From: Lukas Funke Rename spl_soc_init() to spl_dram_init() because the generic function name does not reflect what the function is actually doing. In addition spl_dram_init() is commonly used for dram initialization and should be called from board_init_f(). Signed-off-by: Lukas Funke --- arch

[PATCH v1 3/3] board: starfive: Call spl_dram_init() for DRAM initialization

2024-04-22 Thread lukas . funke-oss
From: Lukas Funke Call spl_dram_init() since this is commonly used for dram initialization in u-boot. Signed-off-by: Lukas Funke --- board/starfive/visionfive2/spl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/starfive/visionfive2/spl.c b/board/starfive/visio

[PATCH v1 2/3] board: sifive: Call spl_dram_init() for DRAM initialization

2024-04-22 Thread lukas . funke-oss
From: Lukas Funke Call spl_dram_init() since this is commonly used for dram initialization in u-boot. Signed-off-by: Lukas Funke --- board/sifive/unleashed/spl.c | 4 ++-- board/sifive/unmatched/spl.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/board/sifive/unleas

[PATCH v1 0/3] riscv: Rename spl_soc_init() to spl_dram_init()

2024-04-22 Thread lukas . funke-oss
From: Lukas Funke This patch series renames spl_soc_init() to spl_dram_init() since the purpose of the function is to initialization the DRAM on sifive/starfive boards. spl_dram_init() is a commonly used function for this purpose. Lukas Funke (3): arch: riscv: Rename spl_soc_init() to spl_dr

[PATCH v2 0/3] riscv: Rename spl_soc_init() to spl_dram_init()

2024-04-23 Thread lukas . funke-oss
From: Lukas Funke This patch series renames spl_soc_init() to spl_dram_init() since the purpose of the function is to initialization the DRAM on sifive/starfive boards. spl_dram_init() is a commonly used function for this purpose. Changes in v2: - capitalized acronym DRAM Lukas Funke (3): a

[PATCH v2 2/3] board: sifive: Call spl_dram_init() for DRAM initialization

2024-04-23 Thread lukas . funke-oss
From: Lukas Funke Call spl_dram_init() since this is commonly used for DRAM initialization in u-boot. Signed-off-by: Lukas Funke --- (no changes since v1) board/sifive/unleashed/spl.c | 4 ++-- board/sifive/unmatched/spl.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --gi

[PATCH v2 1/3] arch: riscv: Rename spl_soc_init() to spl_dram_init()

2024-04-23 Thread lukas . funke-oss
From: Lukas Funke Rename spl_soc_init() to spl_dram_init() because the generic function name does not reflect what the function is actually doing. In addition spl_dram_init() is commonly used for dram initialization and should be called from board_init_f(). Signed-off-by: Lukas Funke --- (no c

[PATCH v2 3/3] board: starfive: Call spl_dram_init() for DRAM initialization

2024-04-23 Thread lukas . funke-oss
From: Lukas Funke Call spl_dram_init() since this is commonly used for dram initialization in u-boot. Signed-off-by: Lukas Funke --- Changes in v2: - capitalized acronym DRAM board/starfive/visionfive2/spl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/starf

[PATCH v3 0/2] riscv: Rename spl_soc_init() to spl_dram_init()

2024-04-24 Thread lukas . funke-oss
From: Lukas Funke This patch series renames spl_soc_init() to spl_dram_init() since the purpose of the function is to initialization the DRAM on sifive/starfive boards. spl_dram_init() is a commonly used function for this purpose. Changes in v3: - Reorganize patches such that each patch can be

[PATCH v3 1/2] board: sifive: Rename spl_soc_init() to spl_dram_init()

2024-04-24 Thread lukas . funke-oss
From: Lukas Funke Rename spl_soc_init() to spl_dram_init() because the generic function name does not reflect what the function actually does. Also spl_dram_init() is commonly used for dram initialization and should be called from board_init_f(). Signed-off-by: Lukas Funke --- (no changes sinc

[PATCH v3 2/2] board: starfive: Rename spl_soc_init() to spl_dram_init()

2024-04-24 Thread lukas . funke-oss
From: Lukas Funke Rename spl_soc_init() to spl_dram_init() because the generic function name does not reflect what the function actually does. Also spl_dram_init() is commonly used for dram initialization and should be called from board_init_f(). Signed-off-by: Lukas Funke --- Changes in v3:

[RFC PATCH v1 0/1] mmc: zynq_sdhci: Only evaluate card-stable signal if card was detected

2024-04-24 Thread lukas . funke-oss
From: Lukas Funke On ZynqMp there seems to be a dependency between the card-stable bit and the card-detect bit. The card-stable bit is set *if and only if* the card-detect bit was set before, indicating that the signal was stable and reliable during card insertion. If the card-detect bit is *no

[RFC PATCH v1 1/1] mmc: zynq_sdhci: Only evaluate card-stable signal if card was detected

2024-04-24 Thread lukas . funke-oss
From: Lukas Funke On ZynqMp there seems to be a dependency between the card-stable bit and the card-detect bit. The card-stable bit is set *if and only if* the card-detect bit was set before, indicating that the signal was stable and reliable during card insertion. If the card-detect bit is *not

[PATCH] arm64: zynqmp: Add label to pmu fwnode

2024-02-27 Thread lukas . funke-oss
From: Lukas Funke Some zynqmp SoCs (the cg series) only have two cpus. Thus, for some cases the cpu-affinity has to adapted, because cpu3 and cpu4 are missing. By adding a label to the pmu fwnode the cpu affinity can be adapted in a device specific dt. Signed-off-by: Lukas Funke --- arch/arm/d

[PATCH v2] arm64: zynqmp: Add label to pmu fwnode

2024-03-07 Thread lukas . funke-oss
From: Lukas Funke ZynqMP CG series devices only have two cpus. In this case the interrupt-affinity property has to adapted, because cpu3 and cpu4 are missing. By adding a label to the pmu fwnode the interrupt-affinity can be adapted in a device specific DT. Signed-off-by: Lukas Funke --- arch/

[PATCH 0/2] Introduce spl_arch_init() for architecture specific initialization

2024-03-20 Thread lukas . funke-oss
From: Lukas Funke Currently some architectures use spl_board_init() for their architecture specific initialization. This prohibits board developers from adding board init code using said function. This series introduces a new function in order to separate arch init code from board init code.

  1   2   >