diff mbox series

[05/10] smbios: Set BIOS release version

Message ID 20210106212153.5.I1af655eac7c24ccf4537bcc1f61bee9e629bf008@changeid
State Superseded
Delegated to: Bin Meng
Headers show
Series smbios: Enhancements for more flexibility | expand

Commit Message

Simon Glass Jan. 7, 2021, 4:21 a.m. UTC
We may as well include the U-Boot release information in the type-0 table
since it is designed for that purpose.

U-Boot uses release versions based on the year and month. The year cannot
fit in a byte, so drop the century.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 lib/smbios.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Heinrich Schuchardt Jan. 9, 2021, 7:27 p.m. UTC | #1
On 1/7/21 5:21 AM, Simon Glass wrote:
> We may as well include the U-Boot release information in the type-0 table
> since it is designed for that purpose.
>
> U-Boot uses release versions based on the year and month. The year cannot
> fit in a byte, so drop the century.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>   lib/smbios.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/smbios.c b/lib/smbios.c
> index b1171f544a8..8e9c002dec2 100644
> --- a/lib/smbios.c
> +++ b/lib/smbios.c
> @@ -143,8 +143,8 @@ static int smbios_write_type0(ulong *current, int handle, ofnode node)
>   #endif
>   	t->bios_characteristics_ext2 = BIOS_CHARACTERISTICS_EXT2_TARGET;
>
> -	t->bios_major_release = 0xff;
> -	t->bios_minor_release = 0xff;
> +	t->bios_major_release = U_BOOT_VERSION_NUM % 100;

As seen in the commit message this needs explanation. Please add a
comment for future developers:

/* bios_major_release has only one byte, drop century */

Best regards

Heinrich

> +	t->bios_minor_release = U_BOOT_VERSION_NUM_PATCH;
>   	t->ec_major_release = 0xff;
>   	t->ec_minor_release = 0xff;
>
>
diff mbox series

Patch

diff --git a/lib/smbios.c b/lib/smbios.c
index b1171f544a8..8e9c002dec2 100644
--- a/lib/smbios.c
+++ b/lib/smbios.c
@@ -143,8 +143,8 @@  static int smbios_write_type0(ulong *current, int handle, ofnode node)
 #endif
 	t->bios_characteristics_ext2 = BIOS_CHARACTERISTICS_EXT2_TARGET;
 
-	t->bios_major_release = 0xff;
-	t->bios_minor_release = 0xff;
+	t->bios_major_release = U_BOOT_VERSION_NUM % 100;
+	t->bios_minor_release = U_BOOT_VERSION_NUM_PATCH;
 	t->ec_major_release = 0xff;
 	t->ec_minor_release = 0xff;