From acb86babdf1232028af56a6dfe4622fd5e9b400a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=BBygowski?= Date: Fri, 19 Jun 2020 14:38:36 +0200 Subject: [PATCH] mb/protectli/vault_kbl/mainboard.c: bring back the beep This commit is cherry-picked from: https://github.com/Dasharo/coreboot.git Branch: protectli_vault_kbl/release Original commit hash: b2b0a2bafbbe9be640f0fd0d02d85c81c90b796b Then it was modified after code review, to: * make it configurable * remove code duplication Signed-off-by: Purdea Andrei Change-Id: I1350df3407aaa9b1fdaf9383972fac3a708bea96 Reviewed-on: https://review.coreboot.org/c/coreboot/+/88221 Reviewed-by: Alicja Michalska Tested-by: build bot (Jenkins) --- src/mainboard/protectli/vault_kbl/Kconfig | 8 ++++++++ src/mainboard/protectli/vault_kbl/mainboard.c | 14 ++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/mainboard/protectli/vault_kbl/mainboard.c diff --git a/src/mainboard/protectli/vault_kbl/Kconfig b/src/mainboard/protectli/vault_kbl/Kconfig index 10f8c400b7..e905be9bdc 100644 --- a/src/mainboard/protectli/vault_kbl/Kconfig +++ b/src/mainboard/protectli/vault_kbl/Kconfig @@ -47,4 +47,12 @@ config CBFS_SIZE config USE_PM_ACPI_TIMER default n +config BEEP_ON_BOOT + bool "Beep on successful boot" + default y + help + Make the platform beep using the PC speaker in final coreboot phase. + May serve as a useful indicator in headless mode that platform is + properly booting. + endif diff --git a/src/mainboard/protectli/vault_kbl/mainboard.c b/src/mainboard/protectli/vault_kbl/mainboard.c new file mode 100644 index 0000000000..f99c716c80 --- /dev/null +++ b/src/mainboard/protectli/vault_kbl/mainboard.c @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include +#include + +static void mainboard_final(void *unused) +{ + if (CONFIG(BEEP_ON_BOOT)) + beep(1500, 100); +} + +struct chip_operations mainboard_ops = { + .final = mainboard_final, +};