Attention is currently required from: Hung-Te Lin, Julius Werner. Ricardo Quesada has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/56904 )
Change subject: include/bcd: move bcd code to commonlib/bsd/include ......................................................................
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. And there are already BSD implementations of them, like this one: https://chromium.googlesource.com/chromiumos/platform/mosys/+/refs/heads/mai...
BUG=b:172210863 TEST=make (everything compiled Ok).
Change-Id: If2eba82da35838799bcbcf38303de6bd53f7eb72 Signed-off-by: Ricardo Quesada ricardoq@google.com --- R src/commonlib/bsd/include/commonlib/bsd/bcd.h M src/drivers/ams/as3722rtc.c M src/drivers/elog/elog.c M src/drivers/i2c/pcf8523/pcf8523.c M src/drivers/i2c/rx6110sa/rx6110sa.c M src/drivers/pc80/rtc/mc146818rtc.c M src/drivers/ti/tps65913/tps65913rtc.c M src/include/cper.h M src/soc/mediatek/common/include/soc/rtc_common.h M src/soc/rockchip/common/rk808.c 10 files changed, 15 insertions(+), 15 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/04/56904/1
diff --git a/src/include/bcd.h b/src/commonlib/bsd/include/commonlib/bsd/bcd.h similarity index 100% rename from src/include/bcd.h rename to src/commonlib/bsd/include/commonlib/bsd/bcd.h diff --git a/src/drivers/ams/as3722rtc.c b/src/drivers/ams/as3722rtc.c index b3a4469..842ed8b 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 <bcd.h> +#include <commonlib/bsd/bcd.h> #include <device/i2c_simple.h> #include <rtc.h> #include <stdint.h> diff --git a/src/drivers/elog/elog.c b/src/drivers/elog/elog.c index cfeb7ce..48270d2 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 <acpi/acpi.h> -#include <bcd.h> #include <boot_device.h> #include <bootstate.h> #include <cbmem.h> +#include <commonlib/bsd/bcd.h> #include <commonlib/bsd/elog.h> #include <commonlib/region.h> #include <console/console.h> diff --git a/src/drivers/i2c/pcf8523/pcf8523.c b/src/drivers/i2c/pcf8523/pcf8523.c index 94a6251..8d368b2 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 <commonlib/bsd/bcd.h> +#include <console/console.h> #include <device/smbus.h> #include <version.h> -#include <console/console.h> -#include <bcd.h> #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 3cab8fa..d30963c 100644 --- a/src/drivers/i2c/rx6110sa/rx6110sa.c +++ b/src/drivers/i2c/rx6110sa/rx6110sa.c @@ -2,13 +2,13 @@
#include <acpi/acpi_device.h> #include <acpi/acpigen.h> +#include <commonlib/bsd/bcd.h> +#include <console/console.h> #include <device/device.h> #include <device/i2c.h> #include <device/i2c_bus.h> -#include <version.h> -#include <console/console.h> -#include <bcd.h> #include <timer.h> +#include <version.h> #include "chip.h" #include "rx6110sa.h"
diff --git a/src/drivers/pc80/rtc/mc146818rtc.c b/src/drivers/pc80/rtc/mc146818rtc.c index 9153a03..fd659f1 100644 --- a/src/drivers/pc80/rtc/mc146818rtc.c +++ b/src/drivers/pc80/rtc/mc146818rtc.c @@ -2,15 +2,15 @@
#include <acpi/acpi.h> #include <arch/io.h> -#include <bcd.h> -#include <fallback.h> -#include <version.h> +#include <commonlib/bsd/bcd.h> #include <console/console.h> +#include <fallback.h> #include <pc80/mc146818rtc.h> #include <rtc.h> #include <security/vboot/vbnv.h> #include <security/vboot/vbnv_layout.h> #include <types.h> +#include <version.h>
static void cmos_reset_date(void) { diff --git a/src/drivers/ti/tps65913/tps65913rtc.c b/src/drivers/ti/tps65913/tps65913rtc.c index 1ee0d81..b2b89ec 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 <bcd.h> +#include <commonlib/bsd/bcd.h> #include <console/console.h> #include <device/i2c_simple.h> #include <rtc.h> diff --git a/src/include/cper.h b/src/include/cper.h index 020ac41..576e1d8 100644 --- a/src/include/cper.h +++ b/src/include/cper.h @@ -3,10 +3,10 @@ #ifndef _CPER_H_ #define _CPER_H_
+#include <commonlib/bsd/bcd.h> +#include <rtc.h> #include <types.h> #include <uuid.h> -#include <bcd.h> -#include <rtc.h>
/* 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 4a86431..d257357c 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 <bcd.h> +#include <commonlib/bsd/bcd.h> #include <console/console.h> #include <rtc.h> #include <stdbool.h> diff --git a/src/soc/rockchip/common/rk808.c b/src/soc/rockchip/common/rk808.c index 7021b02..73c2312 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 <assert.h> -#include <bcd.h> +#include <commonlib/bsd/bcd.h> #include <console/console.h> #include <delay.h> #include <device/i2c_simple.h>