From 954df3d6bf60c750a4f4aaa0f4297260755a234e Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Tue, 10 Aug 2021 17:10:14 -0700 Subject: [PATCH] include/bcd: move bcd code to commonlib/bsd/include Move bcd2bin() / bin2bcd() functions to commonlib/bsd/include/ Also, the license is changed from GPL to BSD. This is because it is needed from "utils" (see CL in the chain). For reference bin2bcd() & bcd2bin() are very simple functions. There are already BSD implementations, like these ones (just to name a few): https://chromium.googlesource.com/chromiumos/platform/mosys/+/refs/heads/main/include/lib/math.h#67 http://web.mit.edu/freebsd/head/sys/contrib/octeon-sdk/cvmx-cn3010-evb-hs5.c BUG=b:172210863 TEST=make (everything compiled Ok). Change-Id: If2eba82da35838799bcbcf38303de6bd53f7eb72 Signed-off-by: Ricardo Quesada Reviewed-on: https://review.coreboot.org/c/coreboot/+/56904 Reviewed-by: Furquan Shaikh Reviewed-by: Paul Menzel Reviewed-by: Jack Rosenthal Tested-by: build bot (Jenkins) --- src/{include => commonlib/bsd/include/commonlib/bsd}/bcd.h | 2 +- src/drivers/ams/as3722rtc.c | 2 +- src/drivers/elog/elog.c | 2 +- src/drivers/i2c/pcf8523/pcf8523.c | 4 ++-- src/drivers/i2c/rx6110sa/rx6110sa.c | 6 +++--- src/drivers/pc80/rtc/mc146818rtc.c | 6 +++--- src/drivers/ti/tps65913/tps65913rtc.c | 2 +- src/include/cper.h | 4 ++-- src/soc/mediatek/common/include/soc/rtc_common.h | 2 +- src/soc/rockchip/common/rk808.c | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) rename src/{include => commonlib/bsd/include/commonlib/bsd}/bcd.h (85%) diff --git a/src/include/bcd.h b/src/commonlib/bsd/include/commonlib/bsd/bcd.h similarity index 85% rename from src/include/bcd.h rename to src/commonlib/bsd/include/commonlib/bsd/bcd.h index 0b4d9f71eb..6346b5f72f 100644 --- a/src/include/bcd.h +++ b/src/commonlib/bsd/include/commonlib/bsd/bcd.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ +/* SPDX-License-Identifier: BSD-3-Clause */ #ifndef _BCD_H_ #define _BCD_H_ diff --git a/src/drivers/ams/as3722rtc.c b/src/drivers/ams/as3722rtc.c index b3a4469a0b..842ed8b4b4 100644 --- a/src/drivers/ams/as3722rtc.c +++ b/src/drivers/ams/as3722rtc.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#include +#include #include #include #include diff --git a/src/drivers/elog/elog.c b/src/drivers/elog/elog.c index cfeb7ce6d7..48270d2034 100644 --- a/src/drivers/elog/elog.c +++ b/src/drivers/elog/elog.c @@ -1,10 +1,10 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include -#include #include #include #include +#include #include #include #include diff --git a/src/drivers/i2c/pcf8523/pcf8523.c b/src/drivers/i2c/pcf8523/pcf8523.c index 94a6251a11..8d368b29a1 100644 --- a/src/drivers/i2c/pcf8523/pcf8523.c +++ b/src/drivers/i2c/pcf8523/pcf8523.c @@ -1,9 +1,9 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include +#include #include #include -#include -#include #include "chip.h" /* Set RTC date from coreboot build date. */ diff --git a/src/drivers/i2c/rx6110sa/rx6110sa.c b/src/drivers/i2c/rx6110sa/rx6110sa.c index 3cab8fa1c0..d30963cab6 100644 --- a/src/drivers/i2c/rx6110sa/rx6110sa.c +++ b/src/drivers/i2c/rx6110sa/rx6110sa.c @@ -2,13 +2,13 @@ #include #include +#include +#include #include #include #include -#include -#include -#include #include +#include #include "chip.h" #include "rx6110sa.h" diff --git a/src/drivers/pc80/rtc/mc146818rtc.c b/src/drivers/pc80/rtc/mc146818rtc.c index 9153a03fd0..fd659f113b 100644 --- a/src/drivers/pc80/rtc/mc146818rtc.c +++ b/src/drivers/pc80/rtc/mc146818rtc.c @@ -2,15 +2,15 @@ #include #include -#include -#include -#include +#include #include +#include #include #include #include #include #include +#include static void cmos_reset_date(void) { diff --git a/src/drivers/ti/tps65913/tps65913rtc.c b/src/drivers/ti/tps65913/tps65913rtc.c index 1ee0d81462..b2b89ec2fc 100644 --- a/src/drivers/ti/tps65913/tps65913rtc.c +++ b/src/drivers/ti/tps65913/tps65913rtc.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#include +#include #include #include #include diff --git a/src/include/cper.h b/src/include/cper.h index 020ac41c77..576e1d878e 100644 --- a/src/include/cper.h +++ b/src/include/cper.h @@ -3,10 +3,10 @@ #ifndef _CPER_H_ #define _CPER_H_ +#include +#include #include #include -#include -#include /* This file contains some definitions and helpers for implementing structures * in the UEFI specification, Appendix "Common Platform Error Record". This diff --git a/src/soc/mediatek/common/include/soc/rtc_common.h b/src/soc/mediatek/common/include/soc/rtc_common.h index 4a864311d9..d257357c3d 100644 --- a/src/soc/mediatek/common/include/soc/rtc_common.h +++ b/src/soc/mediatek/common/include/soc/rtc_common.h @@ -3,7 +3,7 @@ #ifndef SOC_MEDIATEK_RTC_COMMON_H #define SOC_MEDIATEK_RTC_COMMON_H -#include +#include #include #include #include diff --git a/src/soc/rockchip/common/rk808.c b/src/soc/rockchip/common/rk808.c index 7021b02700..73c2312307 100644 --- a/src/soc/rockchip/common/rk808.c +++ b/src/soc/rockchip/common/rk808.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include -#include +#include #include #include #include