mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
compulab: refactor board revision handling
Move board revision handling code to a common location for further reuse. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Reviewed-by: Tom Rini <trini@ti.com>
This commit is contained in:
parent
52d848695c
commit
a937fd1682
5 changed files with 54 additions and 25 deletions
25
board/compulab/common/common.c
Normal file
25
board/compulab/common/common.c
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* (C) Copyright 2014 CompuLab, Ltd. <www.compulab.co.il>
|
||||
*
|
||||
* Authors: Igor Grinberg <grinberg@compulab.co.il>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/bootm.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "eeprom.h"
|
||||
|
||||
void cl_print_pcb_info(void)
|
||||
{
|
||||
u32 board_rev = get_board_rev();
|
||||
u32 rev_major = board_rev / 100;
|
||||
u32 rev_minor = board_rev - (rev_major * 100);
|
||||
|
||||
if ((rev_minor / 10) * 10 == rev_minor)
|
||||
rev_minor = rev_minor / 10;
|
||||
|
||||
printf("PCB: %u.%u\n", rev_major, rev_minor);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue