Mathew King has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36512 )
Change subject: mb/g/drallion: Override smbios enclosure type for drallion ......................................................................
mb/g/drallion: Override smbios enclosure type for drallion
Drallion can be either a clamshell or convertible depending on the presence of the 360 sensor board. Set the smbios type 3 enclosure type to either CONVERTIBLE or LAPTOP accordingly.
BUG=b:143701965 TEST='dmidecode -t 3' Type = Convertible with sensor board connected Type = Laptop with sensor board disconnected
Change-Id: I766e9a4b22a490bc8252670a06504437e82f72d5 Signed-off-by: Mathew King mathewk@chromium.org --- M src/arch/x86/smbios.c M src/include/smbios.h M src/mainboard/google/drallion/variants/drallion/Makefile.inc A src/mainboard/google/drallion/variants/drallion/smbios.c 4 files changed, 31 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/12/36512/1
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 5edf3c6..261888f 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -492,7 +492,7 @@ return SMBIOS_BOARD_TYPE_UNKNOWN; }
-u8 __weak smbios_mainboard_enclosure_type(void) +smbios_enclosure_type __weak smbios_mainboard_enclosure_type(void) { return CONFIG_SMBIOS_ENCLOSURE_TYPE; } diff --git a/src/include/smbios.h b/src/include/smbios.h index ef1c7de..d230fb2 100644 --- a/src/include/smbios.h +++ b/src/include/smbios.h @@ -65,7 +65,6 @@ const char *smbios_mainboard_asset_tag(void); u8 smbios_mainboard_feature_flags(void); const char *smbios_mainboard_location_in_chassis(void); -u8 smbios_mainboard_enclosure_type(void);
#define BIOS_CHARACTERISTICS_PCI_SUPPORTED (1 << 7) #define BIOS_CHARACTERISTICS_PC_CARD (1 << 8) @@ -319,7 +318,7 @@ u8 eos[2]; } __packed;
-enum { +typedef enum { SMBIOS_ENCLOSURE_OTHER = 0x01, SMBIOS_ENCLOSURE_UNKNOWN = 0x02, SMBIOS_ENCLOSURE_DESKTOP = 0x03, @@ -356,7 +355,7 @@ SMBIOS_ENCLOSURE_EMBEDDED_PC = 0x22, SMBIOS_ENCLOSURE_MINI_PC = 0x23, SMBIOS_ENCLOSURE_STICK_PC = 0x24, -}; +} smbios_enclosure_type;
struct smbios_type3 { u8 type; @@ -798,5 +797,6 @@ struct smbios_type17 *t);
smbios_board_type smbios_mainboard_board_type(void); +smbios_enclosure_type smbios_mainboard_enclosure_type(void);
#endif diff --git a/src/mainboard/google/drallion/variants/drallion/Makefile.inc b/src/mainboard/google/drallion/variants/drallion/Makefile.inc index ccbcb08..7e4edc1 100644 --- a/src/mainboard/google/drallion/variants/drallion/Makefile.inc +++ b/src/mainboard/google/drallion/variants/drallion/Makefile.inc @@ -32,3 +32,5 @@ romstage-y += memory.c
ramstage-y += sku.c + +ramstage-y += smbios.c diff --git a/src/mainboard/google/drallion/variants/drallion/smbios.c b/src/mainboard/google/drallion/variants/drallion/smbios.c new file mode 100644 index 0000000..f6c8491 --- /dev/null +++ b/src/mainboard/google/drallion/variants/drallion/smbios.c @@ -0,0 +1,25 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2019 Google LLC + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the + * GNU General Public License for more details. + */ + +#include <variant/gpio.h> +#include <gpio.h> +#include <smbios.h> + +smbios_enclosure_type smbios_mainboard_enclosure_type(void) +{ + if (gpio_get(SENSOR_DET_360) == 0) + return SMBIOS_ENCLOSURE_CONVERTIBLE; + return SMBIOS_ENCLOSURE_LAPTOP; +} \ No newline at end of file
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36512 )
Change subject: mb/g/drallion: Override smbios enclosure type for drallion ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36512/1/src/mainboard/google/dralli... File src/mainboard/google/drallion/variants/drallion/smbios.c:
https://review.coreboot.org/c/coreboot/+/36512/1/src/mainboard/google/dralli... PS1, Line 25: } adding a line without newline at end of file
Hello EricR Lai, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/36512
to look at the new patch set (#2).
Change subject: mb/g/drallion: Override smbios enclosure type for drallion ......................................................................
mb/g/drallion: Override smbios enclosure type for drallion
Drallion can be either a clamshell or convertible depending on the presence of the 360 sensor board. Set the smbios type 3 enclosure type to either CONVERTIBLE or LAPTOP accordingly.
BUG=b:143701965 TEST='dmidecode -t 3' Type = Convertible with sensor board connected Type = Laptop with sensor board disconnected
Change-Id: I766e9a4b22a490bc8252670a06504437e82f72d5 Signed-off-by: Mathew King mathewk@chromium.org --- M src/arch/x86/smbios.c M src/include/smbios.h M src/mainboard/google/drallion/variants/drallion/Makefile.inc A src/mainboard/google/drallion/variants/drallion/smbios.c 4 files changed, 31 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/12/36512/2
Mathew King has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36512 )
Change subject: mb/g/drallion: Override smbios enclosure type for drallion ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36512/1/src/arch/x86/smbios.c File src/arch/x86/smbios.c:
https://review.coreboot.org/c/coreboot/+/36512/1/src/arch/x86/smbios.c@495 PS1, Line 495: smbios_enclosure_type __weak smbios_mainboard_enclosure_type(void)
I like this change, but maybe split it out into a separate commit? one for the type lockdown, then o […]
Done
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36512 )
Change subject: mb/g/drallion: Override smbios enclosure type for drallion ......................................................................
Patch Set 3: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/36512/3/src/mainboard/google/dralli... File src/mainboard/google/drallion/variants/drallion/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/36512/3/src/mainboard/google/dralli... PS3, Line 35: nit: I'd drop the newline here. the one before is to keep romstage and ramstage separate, but these are both ramstage.
EricR Lai has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36512 )
Change subject: mb/g/drallion: Override smbios enclosure type for drallion ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36512/3/src/mainboard/google/dralli... File src/mainboard/google/drallion/variants/drallion/smbios.c:
https://review.coreboot.org/c/coreboot/+/36512/3/src/mainboard/google/dralli... PS3, Line 22: if (gpio_get(SENSOR_DET_360) == 0) how about return gpio_get(SENSOR_DET_360) :SMBIOS_ENCLOSURE_LAPTOP ?SMBIOS_ENCLOSURE_CONVERTIBLE
EricR Lai has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36512 )
Change subject: mb/g/drallion: Override smbios enclosure type for drallion ......................................................................
Patch Set 3:
Do we have any way can make variable pass from romstage to ramstage? we use getgpio everywhere XD If we can use e.g. IS_ISH init at romstage and pass through ramstage, I think this could be more clear.
Mathew King has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36512 )
Change subject: mb/g/drallion: Override smbios enclosure type for drallion ......................................................................
Patch Set 4:
(2 comments)
https://review.coreboot.org/c/coreboot/+/36512/3/src/mainboard/google/dralli... File src/mainboard/google/drallion/variants/drallion/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/36512/3/src/mainboard/google/dralli... PS3, Line 35:
nit: I'd drop the newline here. […]
Done
https://review.coreboot.org/c/coreboot/+/36512/3/src/mainboard/google/dralli... File src/mainboard/google/drallion/variants/drallion/smbios.c:
https://review.coreboot.org/c/coreboot/+/36512/3/src/mainboard/google/dralli... PS3, Line 22: if (gpio_get(SENSOR_DET_360) == 0)
how about return gpio_get(SENSOR_DET_360) :SMBIOS_ENCLOSURE_LAPTOP ?SMBIOS_ENCLOSURE_CONVERTIBLE
Done
EricR Lai has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36512 )
Change subject: mb/g/drallion: Override smbios enclosure type for drallion ......................................................................
Patch Set 5: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/36512 )
Change subject: mb/g/drallion: Override smbios enclosure type for drallion ......................................................................
mb/g/drallion: Override smbios enclosure type for drallion
Drallion can be either a clamshell or convertible depending on the presence of the 360 sensor board. Set the smbios type 3 enclosure type to either CONVERTIBLE or LAPTOP accordingly.
BUG=b:143701965 TEST='dmidecode -t 3' Type = Convertible with sensor board connected Type = Laptop with sensor board disconnected
Change-Id: I766e9a4b22a490bc8252670a06504437e82f72d5 Signed-off-by: Mathew King mathewk@chromium.org Reviewed-on: https://review.coreboot.org/c/coreboot/+/36512 Reviewed-by: EricR Lai ericr_lai@compal.corp-partner.google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/mainboard/google/drallion/variants/drallion/Makefile.inc A src/mainboard/google/drallion/variants/drallion/smbios.c 2 files changed, 25 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified EricR Lai: Looks good to me, approved
diff --git a/src/mainboard/google/drallion/variants/drallion/Makefile.inc b/src/mainboard/google/drallion/variants/drallion/Makefile.inc index ccbcb08..954c9d5 100644 --- a/src/mainboard/google/drallion/variants/drallion/Makefile.inc +++ b/src/mainboard/google/drallion/variants/drallion/Makefile.inc @@ -32,3 +32,4 @@ romstage-y += memory.c
ramstage-y += sku.c +ramstage-y += smbios.c diff --git a/src/mainboard/google/drallion/variants/drallion/smbios.c b/src/mainboard/google/drallion/variants/drallion/smbios.c new file mode 100644 index 0000000..45bd31d --- /dev/null +++ b/src/mainboard/google/drallion/variants/drallion/smbios.c @@ -0,0 +1,24 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2019 Google LLC + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the + * GNU General Public License for more details. + */ + +#include <smbios.h> +#include <variant/variant.h> + +smbios_enclosure_type smbios_mainboard_enclosure_type(void) +{ + return has_360_sensor_board() ? + SMBIOS_ENCLOSURE_CONVERTIBLE : + SMBIOS_ENCLOSURE_LAPTOP; +}