LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"'; \
LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"'; \
LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; \
- LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_BUILD_DATE 0x%Y%m%d'; \
LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_EPOCH %s'; \
else \
return 42; \
LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
LC_ALL=C date +'#define U_BOOT_TZ "%z"'; \
- LC_ALL=C date +'#define U_BOOT_BUILD_DATE 0x%Y%m%d'; \
LC_ALL=C date +'#define U_BOOT_EPOCH %s'; \
fi)
endef
#include <asm/global_data.h>
#include <dm/acpi.h>
+/*
+ * OEM_REVISION is 32-bit unsigned number. It should be increased only when
+ * changing software version. Therefore it should not depend on build time.
+ * U-Boot calculates it from U-Boot version and represent it in hexadecimal
+ * notation. As U-Boot version is in form year.month set low 8 bits to 0x01
+ * to have valid date. So for U-Boot version 2021.04 OEM_REVISION is set to
+ * value 0x20210401.
+ */
+#define OEM_REVISION ((((U_BOOT_VERSION_NUM / 1000) % 10) << 28) | \
+ (((U_BOOT_VERSION_NUM / 100) % 10) << 24) | \
+ (((U_BOOT_VERSION_NUM / 10) % 10) << 20) | \
+ ((U_BOOT_VERSION_NUM % 10) << 16) | \
+ (((U_BOOT_VERSION_NUM_PATCH / 10) % 10) << 12) | \
+ ((U_BOOT_VERSION_NUM_PATCH % 10) << 8) | \
+ 0x01)
+
int acpi_create_dmar(struct acpi_dmar *dmar, enum dmar_flags flags)
{
struct acpi_table_header *header = &dmar->header;
memcpy(header->signature, signature, 4);
memcpy(header->oem_id, OEM_ID, 6);
memcpy(header->oem_table_id, OEM_TABLE_ID, 8);
- header->oem_revision = U_BOOT_BUILD_DATE;
+ header->oem_revision = OEM_REVISION;
memcpy(header->aslc_id, ASLC_ID, 4);
}
#define BUF_SIZE 4096
+#define OEM_REVISION ((((U_BOOT_VERSION_NUM / 1000) % 10) << 28) | \
+ (((U_BOOT_VERSION_NUM / 100) % 10) << 24) | \
+ (((U_BOOT_VERSION_NUM / 10) % 10) << 20) | \
+ ((U_BOOT_VERSION_NUM % 10) << 16) | \
+ (((U_BOOT_VERSION_NUM_PATCH / 10) % 10) << 12) | \
+ ((U_BOOT_VERSION_NUM_PATCH % 10) << 8) | \
+ 0x01)
+
/**
* struct testacpi_plat - Platform data for the test ACPI device
*
ut_asserteq_mem(OEM_ID, hdr.oem_id, sizeof(hdr.oem_id));
ut_asserteq_mem(OEM_TABLE_ID, hdr.oem_table_id,
sizeof(hdr.oem_table_id));
- ut_asserteq(U_BOOT_BUILD_DATE, hdr.oem_revision);
+ ut_asserteq(OEM_REVISION, hdr.oem_revision);
ut_asserteq_mem(ASLC_ID, hdr.aslc_id, sizeof(hdr.aslc_id));
ut_asserteq(0x44, hdr.aslc_revision);
addr = ALIGN(addr + sizeof(struct acpi_rsdp), 16);
ut_assert_nextline("RSDT %08lx %06zx (v01 U-BOOT U-BOOTBL %x INTL 0)",
addr, sizeof(struct acpi_table_header) +
- 3 * sizeof(u32), U_BOOT_BUILD_DATE);
+ 3 * sizeof(u32), OEM_REVISION);
addr = ALIGN(addr + sizeof(struct acpi_rsdt), 16);
ut_assert_nextline("XSDT %08lx %06zx (v01 U-BOOT U-BOOTBL %x INTL 0)",
addr, sizeof(struct acpi_table_header) +
- 3 * sizeof(u64), U_BOOT_BUILD_DATE);
+ 3 * sizeof(u64), OEM_REVISION);
addr = ALIGN(addr + sizeof(struct acpi_xsdt), 64);
ut_assert_nextline("DMAR %08lx %06zx (v01 U-BOOT U-BOOTBL %x INTL 0)",
- addr, sizeof(struct acpi_dmar), U_BOOT_BUILD_DATE);
+ addr, sizeof(struct acpi_dmar), OEM_REVISION);
addr = ALIGN(addr + sizeof(struct acpi_dmar), 16);
ut_assert_nextline("DMAR %08lx %06zx (v01 U-BOOT U-BOOTBL %x INTL 0)",
- addr, sizeof(struct acpi_dmar), U_BOOT_BUILD_DATE);
+ addr, sizeof(struct acpi_dmar), OEM_REVISION);
addr = ALIGN(addr + sizeof(struct acpi_dmar), 16);
ut_assert_nextline("DMAR %08lx %06zx (v01 U-BOOT U-BOOTBL %x INTL 0)",
- addr, sizeof(struct acpi_dmar), U_BOOT_BUILD_DATE);
+ addr, sizeof(struct acpi_dmar), OEM_REVISION);
ut_assert_console_end();
return 0;