[{"id":3688656,"web_url":"http://patchwork.ozlabs.org/comment/3688656/","msgid":"<CAFLszTg7DHsiQHmLo19kDjLGNoKWqAzHOn559ANwS8T5mFM3-Q@mail.gmail.com>","list_archive_url":null,"date":"2026-05-08T17:58:57","subject":"Re: [PATCH 3/6] sysinfo: tq_eeprom: new driver","submitter":{"id":6170,"url":"http://patchwork.ozlabs.org/api/people/6170/","name":"Simon Glass","email":"sjg@chromium.org"},"content":"Hi Nora,\n\nOn 2026-05-08T08:48:28, Feilke, Alexander\n<Alexander.Feilke@ew.tq-group.com> wrote:\n> sysinfo: tq_eeprom: new driver\n>\n> Introduce a sysinfo driver that can be instantiated from the device,\n> which will provide information from the EEPROM found on all TQ-Systems\n> SoMs.\n>\n> Signed-off-by: Nora Schiffer <nora.schiffer@ew.tq-group.com>\n> Signed-off-by: Max Merchel <Max.Merchel@ew.tq-group.com>\n> Signed-off-by: Alexander Feilke <alexander.feilke@ew.tq-group.com>\n>\n> drivers/sysinfo/Kconfig     |   8 ++\n>  drivers/sysinfo/Makefile    |   1 +\n>  drivers/sysinfo/tq_eeprom.c | 223 ++++++++++++++++++++++++++++++++++++++++++++\n>  include/sysinfo/tq_eeprom.h |  24 +++++\n>  4 files changed, 256 insertions(+)\n\n> diff --git a/drivers/sysinfo/tq_eeprom.c b/drivers/sysinfo/tq_eeprom.c\n> @@ -0,0 +1,223 @@\n> +#include <display_options.h>\n> +#include <dm.h>\n> +#include <i2c_eeprom.h>\n> +#include <log.h>\n> +#include <net.h>\n> +#include <dm/device_compat.h>\n> +#include <linux/ctype.h>\n> +#include <linux/sizes.h>\n> +#include <sysinfo/tq_eeprom.h>\n\nCan you drop display_options.h and linux/sizes.h ?\n\n> diff --git a/drivers/sysinfo/tq_eeprom.c b/drivers/sysinfo/tq_eeprom.c\n> @@ -0,0 +1,223 @@\n> +static int tq_eeprom_serial_len_old(const struct tq_eeprom_data *data)\n> +{\n> +     int i;\n> +\n> +     for (i = 0; i < sizeof(data->serial); i++) {\n> +             if (!isdigit(data->serial[i]))\n> +                     break;\n> +     }\n> +\n> +     return i;\n> +}\n> +\n> +static int tq_eeprom_serial_len_new(const struct tq_eeprom_data *data)\n> +{\n> +     int i;\n> +\n> +     for (i = 0; i < sizeof(data->serial); i++) {\n> +             if (!(isdigit(data->serial[i]) || isupper(data->serial[i])))\n> +                     break;\n> +     }\n> +\n> +     return i;\n> +}\n\nPlease fold these into a single helper taking a 'bool allow_upper' (or similar).\n\n> diff --git a/drivers/sysinfo/tq_eeprom.c b/drivers/sysinfo/tq_eeprom.c\n> @@ -0,0 +1,223 @@\n> +static int tq_eeprom_dump(const struct sysinfo_tq_eeprom_priv *priv)\n> +{\n> +     printf(\"TQ EEPROM:\\n\");\n> +     printf(\"  ID:  %s\\n\", priv->id[0] ? priv->id : '<invalid>');\n> +     printf(\"  SN:  %s\\n\", priv->serial[0] ? priv->serial : '<invalid>');\n> +     printf(\"  MAC: \");\n> +     if (is_valid_ethaddr(priv->mac))\n> +             printf('%pM\\n', priv->mac);\n> +     else\n> +             printf('<invalid>\\n');\n> +\n> +     return 0;\n> +}\n\nAlways returns 0 and the caller ignores it, so please make this void.\n\n> diff --git a/drivers/sysinfo/tq_eeprom.c b/drivers/sysinfo/tq_eeprom.c\n> @@ -0,0 +1,223 @@\n> +     for (i = 0; i < sizeof(data->id); i++) {\n> +             if (!(isprint(data->id[i]) && isascii(data->id[i])))\n> +                     break;\n> +     }\n\nisprint() already implies the ASCII printable range - you can drop the\nisascii() check.\n\nRegards,\nSimon","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256\n header.s=google header.b=b5sqpMiL;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org\n header.b=\"b5sqpMiL\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org","phobos.denx.de;\n spf=pass smtp.mailfrom=sjg@chromium.org"],"Received":["from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4gBxhT5SvTz1yKd\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 09 May 2026 03:59:21 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id A839084DC5;\n\tFri,  8 May 2026 19:59:19 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 34D8384DCE; Fri,  8 May 2026 19:59:18 +0200 (CEST)","from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com\n [IPv6:2607:f8b0:4864:20::52e])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 0AFDA84DC4\n for <u-boot@lists.denx.de>; Fri,  8 May 2026 19:59:16 +0200 (CEST)","by mail-pg1-x52e.google.com with SMTP id\n 41be03b00d2f7-b6ce6d1d3dcso941490a12.3\n for <u-boot@lists.denx.de>; Fri, 08 May 2026 10:59:15 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; t=1778263154; cv=none;\n d=google.com; s=arc-20240605;\n b=GWrlVzgb7WGDfSrlS8fFPjeig6Ym2/ZOgnnEsRPPrYX50QiQsvoQ9X3tBw1y4Q4TXL\n i3CXfvbleZUeoGstJjNGiRXVyz8Vwja9SWC+7y4H+2jeM5LSFz3cn1teCS1oiGcq5e8c\n g53O7ToKm1eW7kR+jbNhdRP26OVaYOb2kCnx9gwWfbRXRAFC1sSHYU5qfNZPeXYPEAX0\n +TVcIwb+DWznMBoTxCTZA/D3BQsnJ66NEM3ReGsRHLwkQJsCDn7awRT6OR4p3tDC/tv+\n /zfa3mha7nY+nj58azp7SDyqqsjkoR6c6Rg9W2czKTK03QWZ7Kh4aKKlFgEvoPtErT88\n zTKg==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=AkyEyuBQuEe42OGk9Eak9OdZ6Ls27l2A/3rdiNbid5c=;\n fh=UGsLeeC1AcZOX8WWJFDoNj3PJmg8a9DA4NYbCTpcfgo=;\n b=CA+CfGI7nGByVw5dZFuQ7FeZ5s+R72oBt2cXPcfB/P8EdGBdirrq5UP1H4e6d93FaQ\n R41cnWoIGXdW/NtQvnS3vlSP9oxjw0i/cX4b2bxMVn2uAnfEWLJl+6SF4m45jZ/20hVf\n QVplgM4p/gtk7RLraHqxHTTwSZLVgZ58eyzuO+EpjozNYDaUW4e79yTiRRIG1eyy0HfE\n KJZ3iC0UmdfOfr4UPJ54S+dM9XbOfmFmTJPLKrTviUwYLdtFIcebetrXOpcw87VLF8PO\n pMUDPqH5lsxBFC2u9xkSAWU3/ibeLkjWCmj4w0xEgo5yK9aovHF0CCw/Wz2jrSCrpdGB\n lICw==; darn=lists.denx.de","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=chromium.org; s=google; t=1778263154; x=1778867954; darn=lists.denx.de;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=AkyEyuBQuEe42OGk9Eak9OdZ6Ls27l2A/3rdiNbid5c=;\n b=b5sqpMiLp+aFbbcNS5OII96XKbhApjkjVvRlTwkzOJjlW+OZfAJyIC7DQBEHJeE4e/\n 9XRVnTkjD2GdueGAZr/9YJdwiCoxkxnD1dnFlRaDm1K+NCqBqp/lsl8ngOd2Del58GUo\n 6BRyIxROAxkg41izcqP0v8UwzjbXA28qFR/Ak=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1778263154; x=1778867954;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=AkyEyuBQuEe42OGk9Eak9OdZ6Ls27l2A/3rdiNbid5c=;\n b=FqePQP5Nix2ec93n6Q0NFPr8I3cjCX7U9xbS5K2jyov9ODU+KQzOE62JOzRwf+YwyR\n QahYhX1It3Xm2OOAPGiIoH0sSUe4g3yGFNtBsfrooErwisOLxxBdpaUZ/cMZcZ0lcE4B\n BU3lXM7v6JcOAAfWWfeif9h1Go/CwSatwGI3sYusFCimC9PJmeZUwMX9+ql7vaqlgZlv\n akNPDxBMC4VzVMINelHfpKLAiDfNPdpQpkeVm6jk/WCgZKtNVHBrMm5r1b9cuCHwaM1k\n CKPo7xR7hXGAOugEouMVaN3uYrsJUnr7HH38X9bhjYQ/8xzHy1XQxAfybChJK2QzFWKD\n Kt/g==","X-Forwarded-Encrypted":"i=1;\n AFNElJ+LmS9rB+zWO7cfbWptN7J5hGjofen1/EnqBSvYyrK1OEiQ+5D5pjfJLINZLQmqysijf0D7YCw=@lists.denx.de","X-Gm-Message-State":"AOJu0YxdpiZGcj2XXc5B50YfnybtlGjVzL9YFmdEJtFWU/K/7DWflaw2\n 6PPS65OfkljV+pO5deim6am4z2YUVJa84ED/DVIAg8hV/8M++ncvEdd5xUcMhMURJK+dMD9ADap\n io/EnEVmcqVjeLHfva/kKPEeWLJUyJBdpFMQ+YEtN","X-Gm-Gg":"AeBDies8JwFfF7OidyDiLyxZWpZACI0cODPg/nyQOBS16Vr+Hk+UvrRSqXQveJoqBW3\n T8Jla27axXQkv09vaiuPx5N22Zp44gF0H4dZi+zI7YWh+b1AoeMW6gs+cKadWen16Qq31jti8mW\n PAWQIYYSrnKCNWqdfCmwH4KirtQ7mhb+Yw95hMEct3dkSTrkgQTGK3hhNKIBdN1seXAkI/1rtPD\n 7kebuANGBccqh9g1PdS6kIU6jACJ66/X+H9jfeTk3TxHbUzravCjMm9EjfewLai/BB9aWhyEBJL\n dIQM7A==","X-Received":"by 2002:a05:6a20:a11c:b0:3a2:f402:50df with SMTP id\n adf61e73a8af0-3aa5a9e9051mr16098170637.44.1778263154421; Fri, 08 May 2026\n 10:59:14 -0700 (PDT)","MIME-Version":"1.0","References":"<20260508084834.45637-1-Alexander.Feilke@ew.tq-group.com>\n <20260508084834.45637-4-Alexander.Feilke@ew.tq-group.com>","In-Reply-To":"<20260508084834.45637-4-Alexander.Feilke@ew.tq-group.com>","From":"Simon Glass <sjg@chromium.org>","Date":"Fri, 8 May 2026 11:58:57 -0600","X-Gm-Features":"AVHnY4LVKZnz1R3XVxrHJUosXCqwu9NQxug7XR0NN4cv5U9orjqK-jPg18aiAA8","Message-ID":"\n <CAFLszTg7DHsiQHmLo19kDjLGNoKWqAzHOn559ANwS8T5mFM3-Q@mail.gmail.com>","Subject":"Re: [PATCH 3/6] sysinfo: tq_eeprom: new driver","To":"Alexander.Feilke@ew.tq-group.com","Cc":"\"NXP i.MX U-Boot Team\" <uboot-imx@nxp.com>, u-boot@ew.tq-group.com,\n u-boot@lists.denx.de, Nora Schiffer <nora.schiffer@ew.tq-group.com>,\n Stefano Babic <sbabic@nabladev.com>,\n Fabio Estevam <festevam@gmail.com>, Tom Rini <trini@konsulko.com>,\n Max Merchel <Max.Merchel@ew.tq-group.com>","Content-Type":"text/plain; charset=\"UTF-8\"","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"}}]