From patchwork Tue Apr 8 07:17:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Primoz Fiser X-Patchwork-Id: 879034 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp5338605wrs; Tue, 8 Apr 2025 00:17:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXlf0vVE3Po1g1Y6bTEKa5vmQqAzRsE4krfMddwtpb1XKf4sxZz0kismUipUqFmt2lSm4YceQ==@linaro.org X-Google-Smtp-Source: AGHT+IH/Y6CYBuuO44J57oiP1QLd/0aZk4fIOLIbDPRe/s4/ylmOLnnb50GvjwrvlgpXpsXOF3Bk X-Received: by 2002:a05:6102:41a4:b0:4c1:8ebb:400e with SMTP id ada2fe7eead31-4c8568e3d71mr11842402137.8.1744096636105; Tue, 08 Apr 2025 00:17:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1744096636; cv=none; d=google.com; s=arc-20240605; b=ZTQVB7mUfXHCSLsmx3jv57dQH6GxnzY5bqljArcD2kQmTsk6eyWyRrHwfyeLfygW4c /AtFSMLrWblCb1EDUe0U+8YkJnC6HqmDOrWZki7Z0sp6pnOtgeL1iH0d7Gg+51p1yfo9 zZzYAtkI87cGOfLVqL68gz4JHOO6EKp2Bv+DGPFxXOw8XHjHFkejV+AHFCfqP0R4uBYy VS0bGhkjQ1zZsev0rKQGpN4btAufH1T8TDTwoTmSL+H4BbuAncU8gEUkv5jgsHb2tVxz RWmHnE0gdp5MoZoQD1NsplvLnw2jr5zCI52sUiXZZBo63Z2Pzn7YMMnDMgqrI2f26Lxj vqQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=I2Qf38D8gkTI4IOrOwvWpALByNmzSt6KBXVPrBIhBrs=; fh=6LrkRLFr8NrJ4eqnPE5/aYqssMDjFtB9S19Edf9fI1o=; b=MjOMhjRGpHtBWTQT2P8HfOZgFR80nqFOtW44Cz1rYysre/qKM0WiUEKWOi3PzaVQpV jwIRcMp0LXR79n97CcjvVKZj8wOnump/D3iZ2mhdJRpIFC7l/JG27svZtC8W99iaRo7B 2iyr/O2/JgxENDA/2Ip5bjJ4mZkZEVymAyzif4Sn+hGpCturnTmAgayHh67ZjGhZdXE2 YIgKZmXFQ90nCaAedeVbnd36xonSLB0700B5J5JkxT/9LeIs61o5Sz3KrQTs3/HTCOl6 7JEwkXbc0Ye0rdOvwwExyuXXi3d0IvD9stjgd1n/RwH/+sy993I6DKh/6m1FALERcJTk UFAg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@norik.com header.s=default header.b="Eh+/O9VV"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id ada2fe7eead31-4c9b456ae0bsi366020137.356.2025.04.08.00.17.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Apr 2025 00:17:16 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=fail header.i=@norik.com header.s=default header.b="Eh+/O9VV"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BCC9E83211; Tue, 8 Apr 2025 09:17:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=norik.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=norik.com header.i=@norik.com header.b="Eh+/O9VV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 33C8783339; Tue, 8 Apr 2025 09:17:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from cpanel.siel.si (cpanel.siel.si [46.19.9.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F1BA6831FE for ; Tue, 8 Apr 2025 09:17:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=norik.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=primoz.fiser@norik.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=norik.com; s=default; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject: To:From:Sender:Reply-To:Cc:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=I2Qf38D8gkTI4IOrOwvWpALByNmzSt6KBXVPrBIhBrs=; b=Eh+/O9VVa5Ghd4srF8ziYo9v9/ +VLye3taTv2dpD8eBYkMxe+WqRsZ4DMvUruySxg1ePlQWYWxqG6dd2grCMniLu3qpe3b60NqMPbVH ossq2CCHj9vxa30OMnZQk674yiwCuD79JHlJz0Feo5KGI4+upRTaBg0EkjChE2ZgDxU9VyOC5fLAP fWcjd2p+68P+W6PcmrYG/2nPbE/SO0XE/cvJgsmevOjWtMYL9mWPmvQkWFwBLzt2fMnYCiDiNtp/E yrf/P9SFXe8Xk4ohyKO0twZ3WhFwpFkw2992r2CuEFyHKi7gjqXLYXUFSoaPi7QoYmZ8h616EmT30 ic6YLcrg==; Received: from [89.212.21.243] (port=39300 helo=localhost.localdomain) by cpanel.siel.si with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1u23Cp-00AN1v-1I; Tue, 08 Apr 2025 09:17:10 +0200 From: Primoz Fiser To: Tom Rini , Daniel Schultz , Teresa Remmet , Yannic Moog , Wadim Egorov , Primoz Fiser , u-boot@lists.denx.de, upstream@lists.phytec.de Subject: [PATCH] board: phytec: common: Fix phytec_get_product_name() Date: Tue, 8 Apr 2025 09:17:10 +0200 Message-Id: <20250408071710.3618157-1-primoz.fiser@norik.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel.siel.si X-AntiAbuse: Original Domain - lists.denx.de X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - norik.com X-Get-Message-Sender-Via: cpanel.siel.si: authenticated_id: primoz.fiser@norik.com X-Authenticated-Sender: cpanel.siel.si: primoz.fiser@norik.com X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Currently, phytec_get_product_name() function only takes care of PCM SoM type, however in case of PCL, KSM or KSP SoM type it will return error: phytec_get_product_name: Invalid SOM type Add support for other SoM types as defined in phytec_som_type_str enum (see phytec_som_detection.h) to get rid of the error. While at it, also simplify switch case statements by grouping them together. This makes it more concise and readable. Signed-off-by: Primoz Fiser Reviewed-by: Daniel Schultz --- board/phytec/common/phytec_som_detection.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/board/phytec/common/phytec_som_detection.c b/board/phytec/common/phytec_som_detection.c index 1f2213902edb..4d7c9b9f80f6 100644 --- a/board/phytec/common/phytec_som_detection.c +++ b/board/phytec/common/phytec_som_detection.c @@ -295,17 +295,16 @@ static int phytec_get_product_name(struct phytec_eeprom_data *data, switch (api2->som_type) { case 0: + case 1: + case 2: + case 3: som_type = api2->som_type; break; case 4: - som_type = 0; - break; case 5: som_type = 0; break; case 6: - som_type = 1; - break; case 7: som_type = 1; break;