coreboot/src/ec
Subrata Banik e6a89935e9 ec/google/chromeec: Override Lid State for Factory Netboot
This patch modifies the get_lid_switch() function to allow faking the
lid switch state when the GBB_FLAG_DISABLE_LID_SHUTDOWN Kconfig option
is enabled.

When GBB_FLAG_DISABLE_LID_SHUTDOWN is enabled, the function will
always return 1 (lid open), bypassing the actual lid switch state
retrieval from the Embedded Controller (EC).

This functionality is specifically designed to facilitate factory
processes, such as netboot image downloads, where devices need to
remain operational regardless of the lid's closed state. This prevents
intended shutdowns triggered by a closed lid during manufacturing and
testing.

By setting GBB_FLAG_DISABLE_LID_SHUTDOWN, we override the actual
lid status with a simulated LID status is open, which is a
prerequisite for display initialization.

w/o this patch:

```
[ALERT]  Graphics hand-off block not found
...
[INFO ]              NAME |       PORT | POLARITY |     VALUE
[INFO ]               lid |  undefined |     high |       low
```

w/ this patch:

```
[INFO ]              NAME |       PORT | POLARITY |     VALUE
[INFO ]               lid |  undefined |     high |      high
...
[INFO ]  framebuffer_info: bytes_per_line: 7680, bits_per_pixel: 32
[INFO ]    x_res x y_res: 1920 x 1200, size: 9216000 at 0xd0000000
```

BUG=b:333982806
TEST=Verified lid switch behavior with and without
`GBB_FLAG_DISABLE_LID_SHUTDOWN` enabled.

Change-Id: I89d506ab50b421b93be13b0e5e36a7ef1247e2b9
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/86807
Reviewed-by: Jayvik Desai <jayvik@google.com>
Reviewed-by: Caveh Jalali <caveh@chromium.org>
Reviewed-by: Ren Kuo <ren.kuo@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-03-13 19:23:00 +00:00
..
51nb/npce985la0dx include/device/device.h: Remove CHIP_NAME() macro 2024-01-31 09:51:58 +00:00
acpi ec/acpi/ec.c: Promote timeout messages to errors 2025-01-22 20:20:44 +00:00
apple/acpi tree: Replace ShiftLeft(a,b) with ASL 2.0 syntax 2022-12-23 08:30:39 +00:00
clevo/it5570e tree: Use <stdio.h> for snprintf 2024-05-29 10:33:54 +00:00
compal/ene932 ec, lib, security, sb: Add SPDX license headers to Kconfig files 2024-02-18 02:00:21 +00:00
dasharo/ec ec/dasharo/ec: Gate options behind EC_DASHARO_EC 2025-03-10 15:22:37 +00:00
dell/mec5035 ec/dell/mec5035: Replace defines with enums 2024-08-26 22:32:30 +00:00
google ec/google/chromeec: Override Lid State for Factory Netboot 2025-03-13 19:23:00 +00:00
hp/kbc1126 ec/hp/kbc1126/acpi: Drop unnecessary _STA methods 2024-03-16 15:20:04 +00:00
intel ec: Rename Makefiles from .inc to .mk 2024-01-24 08:35:25 +00:00
kontron ec, lib, security, sb: Add SPDX license headers to Kconfig files 2024-02-18 02:00:21 +00:00
lenovo tree: Use <stdio.h> for snprintf 2024-05-29 10:33:54 +00:00
purism tree: Remove unused <stddef.h> 2024-05-29 02:51:20 +00:00
quanta ec, lib, security, sb: Add SPDX license headers to Kconfig files 2024-02-18 02:00:21 +00:00
roda/it8518 include/device/device.h: Remove CHIP_NAME() macro 2024-01-31 09:51:58 +00:00
smsc/mec1308 ec, lib, security, sb: Add SPDX license headers to Kconfig files 2024-02-18 02:00:21 +00:00
starlabs/merlin {ec,mb}/starlabs: Consolidate EC-related CFR options in ec directory 2025-02-11 09:22:58 +00:00
system76/ec ec/system76/ec: Remove RPM calculation 2024-07-26 23:03:33 +00:00
ec.h treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00