All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ioana Ciornei <ioana.ciornei@nxp.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 1/4] board: fsl: lx2160ardb: add api for obtaining board revision
Date: Mon, 26 Apr 2021 16:01:10 +0300	[thread overview]
Message-ID: <20210426130113.6514-2-ioana.ciornei@nxp.com> (raw)
In-Reply-To: <20210426130113.6514-1-ioana.ciornei@nxp.com>

From: Florin Chiculita <florinlaurentiu.chiculita@nxp.com>

Add new API for obtaining board revision and trigger the i2c node
fixup with this new API.

Signed-off-by: Florin Chiculita <florinlaurentiu.chiculita@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
 board/freescale/lx2160a/lx2160a.c | 13 ++++++++++---
 board/freescale/lx2160a/lx2160a.h |  6 +++++-
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/board/freescale/lx2160a/lx2160a.c b/board/freescale/lx2160a/lx2160a.c
index 8f75b48f956b..9f1a6979258c 100644
--- a/board/freescale/lx2160a/lx2160a.c
+++ b/board/freescale/lx2160a/lx2160a.c
@@ -564,6 +564,15 @@ int config_board_mux(void)
 }
 #endif
 
+#if CONFIG_IS_ENABLED(TARGET_LX2160ARDB)
+u8 get_board_rev(void)
+{
+	u8 board_rev = (QIXIS_READ(arch) & 0xf) - 1 + 'A';
+
+	return board_rev;
+}
+#endif
+
 unsigned long get_board_sys_clk(void)
 {
 #if defined(CONFIG_TARGET_LX2160AQDS) || defined(CONFIG_TARGET_LX2162AQDS)
@@ -847,7 +856,6 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 	u64 mc_memory_base = 0;
 	u64 mc_memory_size = 0;
 	u16 total_memory_banks;
-	u8 board_rev;
 
 	ft_cpu_setup(blob, bd);
 
@@ -903,8 +911,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 	fdt_fixup_icid(blob);
 
 if (IS_ENABLED(CONFIG_TARGET_LX2160ARDB)) {
-	board_rev = (QIXIS_READ(arch) & 0xf) - 1 + 'A';
-	if (board_rev == 'C')
+	if (get_board_rev() >= 'C')
 		fdt_fixup_i2c_thermal_node(blob);
 	}
 
diff --git a/board/freescale/lx2160a/lx2160a.h b/board/freescale/lx2160a/lx2160a.h
index 52b020765dc6..cf56cefb45a3 100644
--- a/board/freescale/lx2160a/lx2160a.h
+++ b/board/freescale/lx2160a/lx2160a.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Copyright 2020 NXP
+ * Copyright 2020-2021 NXP
  */
 
 #ifndef __LX2160_H
@@ -58,4 +58,8 @@
 #endif
 #endif
 
+#if CONFIG_IS_ENABLED(TARGET_LX2160ARDB)
+u8 get_board_rev(void);
+#endif
+
 #endif /* __LX2160_H */
-- 
2.17.1

  reply	other threads:[~2021-04-26 13:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 13:01 [PATCH v2 0/4] board: fsl: lx2160ardb: add networking support for RevC Ioana Ciornei
2021-04-26 13:01 ` Ioana Ciornei [this message]
2021-04-26 13:01 ` [PATCH v2 2/4] board: fsl: lx2160ardb: add support for lx2160ardb revC board Ioana Ciornei
2021-04-26 13:01 ` [PATCH v2 3/4] board: fsl: lx2160ardb: add dts fixup function for RevC Ioana Ciornei
2021-05-07  9:04   ` Priyanka Jain
2021-06-17  6:39   ` Priyanka Jain
2021-04-26 13:01 ` [PATCH v2 4/4] board: fsl: lx2160ardb: add dts fixup " Ioana Ciornei

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=20210426130113.6514-2-ioana.ciornei@nxp.com \
    --to=ioana.ciornei@nxp.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.