All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier-oss@weidmueller.com>
To: u-boot@lists.denx.de, Michal Simek <michal.simek@amd.com>
Cc: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Subject: [PATCH 06/10] xilinx: common: Separate display cpu info function
Date: Wed,  8 Jun 2022 18:20:49 +0200	[thread overview]
Message-ID: <20220608162054.25641-7-stefan.herbrechtsmeier-oss@weidmueller.com> (raw)
In-Reply-To: <20220608162054.25641-1-stefan.herbrechtsmeier-oss@weidmueller.com>

From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>

Move the print_cpuinfo function of CONFIG_DISPLAY_CPUINFO into its own
source file to support reuse by other board vendors.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
---

 board/xilinx/common/Makefile   |  3 +++
 board/xilinx/common/board.c    | 29 ----------------------------
 board/xilinx/common/cpu-info.c | 35 ++++++++++++++++++++++++++++++++++
 3 files changed, 38 insertions(+), 29 deletions(-)
 create mode 100644 board/xilinx/common/cpu-info.c

diff --git a/board/xilinx/common/Makefile b/board/xilinx/common/Makefile
index 212028478c..cdc3c96774 100644
--- a/board/xilinx/common/Makefile
+++ b/board/xilinx/common/Makefile
@@ -5,6 +5,9 @@
 #
 
 obj-y	+= board.o
+ifndef CONFIG_ARCH_ZYNQ
+obj-$(CONFIG_DISPLAY_CPUINFO) += cpu-info.o
+endif
 ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_CMD_FRU) += fru.o fru_ops.o
 endif
diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
index 402fa77006..5f2afb9def 100644
--- a/board/xilinx/common/board.c
+++ b/board/xilinx/common/board.c
@@ -485,35 +485,6 @@ 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);
-
-	ret = soc_get_machine(soc, name, SOC_MAX_STR_SIZE);
-	if (ret)
-		printf("Chip:  %s\n", name);
-
-	return 0;
-}
-#endif
-
 #if CONFIG_IS_ENABLED(DTB_RESELECT)
 #define MAX_NAME_LENGTH	50
 
diff --git a/board/xilinx/common/cpu-info.c b/board/xilinx/common/cpu-info.c
new file mode 100644
index 0000000000..4a863d00de
--- /dev/null
+++ b/board/xilinx/common/cpu-info.c
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2014 - 2020 Xilinx, Inc.
+ * Michal Simek <michal.simek@xilinx.com>
+ */
+
+#include <common.h>
+#include <soc.h>
+
+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);
+
+	ret = soc_get_machine(soc, name, SOC_MAX_STR_SIZE);
+	if (ret)
+		printf("Chip:  %s\n", name);
+
+	return 0;
+}
-- 
2.30.2


  parent reply	other threads:[~2022-06-08 16:22 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08 16:20 [PATCH 00/10] xilinx: zynqmp: Support foreign vendor boards Stefan Herbrechtsmeier
2022-06-08 16:20 ` [PATCH 01/10] firmware: firmware-zynqmp: Check if rx channel dev pointer is valid Stefan Herbrechtsmeier
2022-06-08 16:20 ` [PATCH 02/10] firmware: firmware-zynqmp: Probe driver before use Stefan Herbrechtsmeier
2022-06-16 14:22   ` Michal Simek
2022-06-20  6:40     ` Stefan Herbrechtsmeier
2022-06-20  6:51       ` Michal Simek
2022-06-20  9:33         ` Stefan Herbrechtsmeier
2022-06-08 16:20 ` [PATCH 03/10] soc: xilinx: zynqmp: Add machine identification support Stefan Herbrechtsmeier
2022-06-17 10:41   ` Michal Simek
2022-06-20  9:16     ` Stefan Herbrechtsmeier
2022-06-08 16:20 ` [PATCH 04/10] xilinx: zynqmp: Use soc machine function to get silicon idcode name Stefan Herbrechtsmeier
2022-06-17 10:41   ` Michal Simek
2022-06-08 16:20 ` [PATCH 05/10] xilinx: cpuinfo: Print soc machine Stefan Herbrechtsmeier
2022-06-08 16:20 ` Stefan Herbrechtsmeier [this message]
2022-06-08 16:20 ` [PATCH 07/10] xilinx: zynqmp: make spi flash support optional Stefan Herbrechtsmeier
2022-06-08 16:20 ` [PATCH 08/10] tools: zynqmp_psu_init_minimize: Remove low level uart settings Stefan Herbrechtsmeier
2022-06-08 16:20 ` [PATCH 09/10] tools: zynqmp_psu_init_minimize: Add serdes_illcalib forward declaration Stefan Herbrechtsmeier
2022-06-16 15:13   ` Michal Simek
2022-06-20  7:07     ` Stefan Herbrechtsmeier
2022-06-20  7:18       ` Michal Simek
2022-06-20 13:38         ` Stefan Herbrechtsmeier
2022-06-20 13:53           ` Michal Simek
2022-06-08 16:20 ` [PATCH 10/10] xilinx: zynqmp: Support vendor specific board_init Stefan Herbrechtsmeier
2022-06-16 15:12   ` Michal Simek
2022-06-20  6:48     ` Stefan Herbrechtsmeier
2022-06-20  6:53       ` Michal Simek
2022-06-20  9:36         ` Stefan Herbrechtsmeier
2022-06-17 11:06 ` [PATCH 00/10] xilinx: zynqmp: Support foreign vendor boards Michal Simek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220608162054.25641-7-stefan.herbrechtsmeier-oss@weidmueller.com \
    --to=stefan.herbrechtsmeier-oss@weidmueller.com \
    --cc=michal.simek@amd.com \
    --cc=stefan.herbrechtsmeier@weidmueller.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.