From patchwork Tue Aug 10 13:45:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1515416 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=X9EreMUy; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GkZ3R5j04z9sPf for ; Tue, 10 Aug 2021 23:45:55 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2F90882C55; Tue, 10 Aug 2021 15:45:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.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=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="X9EreMUy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CC4B182959; Tue, 10 Aug 2021 15:45:19 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 50C8380C68 for ; Tue, 10 Aug 2021 15:45:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-wm1-x32a.google.com with SMTP id q11-20020a7bce8b0000b02902e6880d0accso2034918wmj.0 for ; Tue, 10 Aug 2021 06:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3Ew88R6mroHGsAO++9fvC5wBYY0hnRws0NPy4xuVQ4M=; b=X9EreMUyIOWgTlL7oxyGCoGn3vtwJ1/SYWbJEEJMHrELSEX3nCzWTmw2orLuwCGXhp +QvU8any+U6eA7E1A9hv+RForvfvYHcWgOFH5vjOVQBZHC5TdbvwJzg5sDjPiOr2xJhE v8PgNuDI8F5ujRHYffBAG7XkDwsbsz74F6kwRYTNHeMdzUmGZzTfcUZiX9GlNx4Ch+Yp 91xHqkxx5kY4+3iO8V1OH5U3d4NRSDWYLZh67ulhqRrwMz+H+JnIHUJpW9KTKQE0w6+v 4zcdEVqleb7mN9oJpUEoml4arjGOMv3uOTtvNE0a6/soeMPiAnORQn81Fxhf3qgrDbBs 1m7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=3Ew88R6mroHGsAO++9fvC5wBYY0hnRws0NPy4xuVQ4M=; b=TaSYKn0tsgHxIW6vQyBtDGjxNljq2om/6dpb3UyKUX2EMkJWigFOWE28s5tIVbysu/ zU9DxcPPda6yW7LbjQUdWuqTIuLXO24dHhSaAZX9Gj/uMeUF4FSo+fNuJeOAzxnemQQb YC/1J5AQH5IImZgBrRKuu08vnwH0JcCOIl0rZ32L0Zgtmk8KvjBG+SrGslKrvF/3/QiS PC94W3JLU/BILfoq5cZD0Nq0MmmC60wgpdoyyd+wKdFWSHo2ejiTYuOoFcKh86ykzb59 k5rmAaAC21pl7DB9QV5hjkp+FV2NQzKQOxzgn92MRKDAxdcShPGkjR45kIElGRVvhxex JUIA== X-Gm-Message-State: AOAM532pqV5Dbj7UxajFMHQf0dcXPT+93iUO0ctGdarQdLlFcYfDw7I4 W2wcaKOub7GoAdFVWR33L26iXTUphqgyGYof X-Google-Smtp-Source: ABdhPJyb7aZPrjRhQhNCIm9ncaxqSkm5ga4gWI256DuscXIF/nrjB+JIFORy26FyrijMubTBqN5Uwg== X-Received: by 2002:a05:600c:5c2:: with SMTP id p2mr4840279wmd.188.1628603114566; Tue, 10 Aug 2021 06:45:14 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::648]) by smtp.gmail.com with ESMTPSA id e10sm5824247wrt.82.2021.08.10.06.45.14 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Aug 2021 06:45:14 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: T Karthik Reddy , Ashok Reddy Soma , Michal Simek , Simon Glass Subject: [PATCH 3/4] xilinx: common: Add function to print SoC info Date: Tue, 10 Aug 2021 15:45:04 +0200 Message-Id: <9be74ad8c12a542def8598c972445a030fbb438a.1628603101.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean From: T Karthik Reddy Add print_cpuinfo() to print SoC info like family & revision. This function depends on CONFIG_DISPLAY_CPUINFO config. Signed-off-by: T Karthik Reddy Reviewed-by: Ashok Reddy Soma Signed-off-by: Michal Simek --- board/xilinx/common/board.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index 92b61d83ca47..90c87bab5cff 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -18,6 +18,7 @@ #include #include #include +#include #include "fru.h" @@ -440,3 +441,28 @@ int __maybe_unused board_fit_config_name_match(const char *name) return -1; } + +#if defined(CONFIG_DISPLAY_CPUINFO) && !defined(CONFIG_ARCH_ZYNQ) +int print_cpuinfo(void) +{ + struct udevice *soc; + char name[SOC_MAX_STR_SIZE]; + int ret; + + ret = soc_get(&soc); + if (ret) { + printf("CPU: UNKNOWN\n"); + return 0; + } + + ret = soc_get_family(soc, name, SOC_MAX_STR_SIZE); + if (ret) + printf("CPU: %s\n", name); + + ret = soc_get_revision(soc, name, SOC_MAX_STR_SIZE); + if (ret) + printf("Silicon: %s\n", name); + + return 0; +} +#endif