diff options
author | Florin Chiculita <florinlaurentiu.chiculita@nxp.com> | 2023-05-31 18:02:17 +0300 |
---|---|---|
committer | Peng Fan <peng.fan@nxp.com> | 2023-06-15 17:58:23 +0800 |
commit | ee22330e81ae0022dd79b9b9d575b3eff589084c (patch) | |
tree | b98752012dbec9c9781f4465db1e3ee9eb204794 | |
parent | c6caaafe8d6863d7a258054ffbcce875f1f11c53 (diff) | |
download | u-boot-ee22330e81ae0022dd79b9b9d575b3eff589084c.zip u-boot-ee22330e81ae0022dd79b9b9d575b3eff589084c.tar.gz u-boot-ee22330e81ae0022dd79b9b9d575b3eff589084c.tar.bz2 |
board: fsl: lx2160ardb: add api for obtaining board revision
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>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r-- | board/freescale/lx2160a/lx2160a.c | 15 | ||||
-rw-r--r-- | board/freescale/lx2160a/lx2160a.h | 9 |
2 files changed, 19 insertions, 5 deletions
diff --git a/board/freescale/lx2160a/lx2160a.c b/board/freescale/lx2160a/lx2160a.c index 2a75205..4d406ac8 100644 --- a/board/freescale/lx2160a/lx2160a.c +++ b/board/freescale/lx2160a/lx2160a.c @@ -487,6 +487,15 @@ int config_board_mux(void) } #endif +#if IS_ENABLED(CONFIG_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) @@ -760,9 +769,6 @@ int ft_board_setup(void *blob, struct bd_info *bd) u64 mc_memory_size = 0; u16 total_memory_banks; int err; -#if IS_ENABLED(CONFIG_TARGET_LX2160ARDB) - u8 board_rev; -#endif err = fdt_increase_size(blob, 512); if (err) { @@ -825,8 +831,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); #endif diff --git a/board/freescale/lx2160a/lx2160a.h b/board/freescale/lx2160a/lx2160a.h index 52b0207..13673fc 100644 --- a/board/freescale/lx2160a/lx2160a.h +++ b/board/freescale/lx2160a/lx2160a.h @@ -58,4 +58,13 @@ #endif #endif +#if IS_ENABLED(CONFIG_TARGET_LX2160ARDB) +u8 get_board_rev(void); +#else +static inline u8 get_board_rev(void) +{ + return 0; +} +#endif + #endif /* __LX2160_H */ |