Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 43FD8EB64DA for ; Tue, 18 Jul 2023 13:37:08 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9A2548670A; Tue, 18 Jul 2023 15:36:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=phytec.de 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" (1024-bit key; unprotected) header.d=phytec.de header.i=@phytec.de header.b="Yrmn57hq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B89F3866F8; Tue, 18 Jul 2023 15:36:20 +0200 (CEST) Received: from mickerik.phytec.de (mickerik.phytec.de [91.26.50.163]) (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 75FA786706 for ; Tue, 18 Jul 2023 15:36:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=phytec.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=T.Remmet@phytec.de DKIM-Signature: v=1; a=rsa-sha256; d=phytec.de; s=a4; c=relaxed/simple; q=dns/txt; i=@phytec.de; t=1689687372; x=1692279372; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding: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=U7kWDGDf0WjdfbMUKkp6yfOXb96AGcEctNIHagmhU7o=; b=Yrmn57hqUKMMsrJI/oQ4k9yd2Kble9q+NKKY7hAXHFEwElbGL01GTnjcufkhfs8I RryoNx/bFGp4W//atmIv/HNPvbRRAr5LMEAd2dvJR4gkNTYZR971sA7u/YJl7jPH B3ACeCu+GUuGzBtku0oWjjWUgTMX1fBsywOiN3KCbx0=; X-AuditID: ac14000a-917fe70000007ecb-eb-64b6954ca4f8 Received: from berlix.phytec.de (Unknown_Domain [172.25.0.12]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mickerik.phytec.de (PHYTEC Mail Gateway) with SMTP id 59.FB.32459.C4596B46; Tue, 18 Jul 2023 15:36:12 +0200 (CEST) Received: from llp-tremmet2.fritz.box (172.25.0.11) by Berlix.phytec.de (172.25.0.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Tue, 18 Jul 2023 15:36:30 +0200 From: Teresa Remmet To: Stefano Babic , Fabio Estevam , "NXP i . MX U-Boot Team" CC: , , Yannic Moog , Daniel Schultz , Wadim Egorov Subject: [PATCH 5/6] board: phytec: common: phytec_som_detection: Add helper for PCB revision Date: Tue, 18 Jul 2023 15:35:54 +0200 Message-ID: <20230718133555.6627-6-t.remmet@phytec.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230718133555.6627-1-t.remmet@phytec.de> References: <20230718133555.6627-1-t.remmet@phytec.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.25.0.11] X-ClientProxiedBy: Berlix.phytec.de (172.25.0.12) To Berlix.phytec.de (172.25.0.12) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRmVeSWpSXmKPExsWyRpKBR9dn6rYUg65V4hYPr/pbtJ/ysXi7 t5PdYsrj9ewW3e/UHVg95s06weKxc9Zddo+zd3YwevR3t7B6bHy3gymANYrLJiU1J7MstUjf LoErY+OiRywFq/kqzp0UbGBcz9PFyMkhIWAisbGjkamLkYtDSGAJk8TZ9gPsEM4zRom2hxeY QKrYBDQknq44DWaLCJRJPOz9xAxiMwssZpRY/dsSxBYWiJXYfGI/G4jNIqAqsXfZNVYQm1fA TOLihq+MENvkJfYfPAvWyylgLtH24yhYvRBQzeWF7ewQ9YISJ2c+YYGYLy/RvHU21C4JiYMv XjBD1MtL7Lp0Em7mtHOvmSHsUImtX7YzTWAUmoVk1Cwko2YhGbWAkXkVo1BuZnJ2alFmtl5B RmVJarJeSuomRlDYizBw7WDsm+NxiJGJg/EQowQHs5II7/dVm1KEeFMSK6tSi/Lji0pzUosP MUpzsCiJ897vYUoUEkhPLEnNTk0tSC2CyTJxcEo1MCq/yq0W8r1dKHYig8dM1lJF9UPZf72t dYE1pzcarz/AtaVRiPvKW84z8097TfawW5p5R6d/zfWne1cKFH8+l3Pir+kEzdwPy/xmqeZ8 TjcLO6y0/KEK68ZluVV/fB4ut5sQmhYa3mLrYTNznlbuoUlxfpMPhMkr8mns0v7cbpb2kC9q 6UQuSyWW4oxEQy3mouJEAJS0RP9pAgAA 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 Add helper function to read out the PCB revision of a PHYTEC SoM. Signed-off-by: Teresa Remmet --- board/phytec/common/phytec_som_detection.c | 15 +++++++++++++++ board/phytec/common/phytec_som_detection.h | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/board/phytec/common/phytec_som_detection.c b/board/phytec/common/phytec_som_detection.c index 366bdd4ace4b..55562731270b 100644 --- a/board/phytec/common/phytec_som_detection.c +++ b/board/phytec/common/phytec_som_detection.c @@ -186,3 +186,18 @@ char * __maybe_unused phytec_get_opt(struct phytec_eeprom_data *data) return opt; } + +u8 __maybe_unused phytec_get_rev(struct phytec_eeprom_data *data) +{ + struct phytec_api2_data *api2; + + if (!data) + data = &eeprom_data; + + if (data->api_rev < PHYTEC_API_REV2) + return PHYTEC_EEPROM_INVAL; + + api2 = &data->data.data_api2; + + return api2->pcb_rev; +} diff --git a/board/phytec/common/phytec_som_detection.h b/board/phytec/common/phytec_som_detection.h index 01f7e4652ddb..c68e2302cc42 100644 --- a/board/phytec/common/phytec_som_detection.h +++ b/board/phytec/common/phytec_som_detection.h @@ -68,6 +68,7 @@ int phytec_eeprom_data_init(struct phytec_eeprom_data *data, void __maybe_unused phytec_print_som_info(struct phytec_eeprom_data *data); char * __maybe_unused phytec_get_opt(struct phytec_eeprom_data *data); +u8 __maybe_unused phytec_get_rev(struct phytec_eeprom_data *data); #else @@ -99,6 +100,10 @@ inline char *__maybe_unused phytec_get_opt(struct phytec_eeprom_data *data) return NULL; } +u8 __maybe_unused phytec_get_rev(struct phytec_eeprom_data *data) +{ + return PHYTEC_EEPROM_INVAL; +} #endif /* IS_ENABLED(CONFIG_PHYTEC_SOM_DETECTION) */ #endif /* _PHYTEC_SOM_DETECTION_H */ -- 2.34.1