diff --git a/patches/u-boot/0014-cmd-tlv_eeprom-fix-alias-access-to-second-eeprom.patch b/patches/u-boot/0014-cmd-tlv_eeprom-fix-alias-access-to-second-eeprom.patch new file mode 100644 index 0000000..58158e9 --- /dev/null +++ b/patches/u-boot/0014-cmd-tlv_eeprom-fix-alias-access-to-second-eeprom.patch @@ -0,0 +1,32 @@ +From 413ad975194c929a09199e6a67cf3d2b2f0fb337 Mon Sep 17 00:00:00 2001 +From: Josua Mayer +Date: Wed, 20 Nov 2024 13:43:02 +0100 +Subject: [PATCH] cmd: tlv_eeprom: fix alias access to second eeprom + +find function wrongly used ARRAY_SIZE function on a 2d pointer, always +returning 1. Thus second eeprom can not be found. + +Replace with defined constant MAX_TLV_DEVICES. + +Fixes: "cmd: tlv_eeprom: support specifying tlv eeprom in DT alias tlv[0-255]" +Signed-off-by: Josua Mayer +--- + cmd/tlv_eeprom.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmd/tlv_eeprom.c b/cmd/tlv_eeprom.c +index 546ede2dda2..881d7a8e3e6 100644 +--- a/cmd/tlv_eeprom.c ++++ b/cmd/tlv_eeprom.c +@@ -906,7 +906,7 @@ static int find_tlv_devices(struct udevice **tlv_devices_p) + struct udevice *dev; + + /* find by alias */ +- for (int i = 0; i < ARRAY_SIZE(tlv_devices_p); i++) { ++ for (int i = 0; i < MAX_TLV_DEVICES; i++) { + snprintf(alias_name, sizeof(alias_name), "tlv%d", i); + node = ofnode_get_aliases_node(alias_name); + if (!ofnode_valid(node)) +-- +2.43.0 +