Michał Żygowski | 3289a39 | 2022-11-09 14:46:08 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <console/console.h> |
| 4 | #include <pc80/i8254.h> |
| 5 | #include <soc/gpio.h> |
| 6 | #include <delay.h> |
| 7 | #include <gpio.h> |
| 8 | |
| 9 | static void beep_and_blink(void) |
| 10 | { |
| 11 | static uint8_t blink = 0; |
| 12 | static uint8_t beep_count = 0; |
| 13 | |
| 14 | gpio_set(GPP_E8, blink); |
| 15 | /* Beep 12 times at most, constant beeps may be annoying */ |
| 16 | if (beep_count < 12) { |
| 17 | beep(800, 300); |
| 18 | mdelay(200); |
| 19 | beep_count++; |
| 20 | } else { |
| 21 | mdelay(500); |
| 22 | } |
| 23 | |
| 24 | blink ^= 1; |
| 25 | } |
| 26 | |
| 27 | void die_notify(void) |
| 28 | { |
| 29 | if (ENV_POSTCAR) |
| 30 | return; |
| 31 | |
| 32 | /* Make SATA LED blink and use PC SPKR */ |
| 33 | gpio_output(GPP_E8, 0); |
| 34 | |
| 35 | while (1) { |
| 36 | beep_and_blink(); |
| 37 | beep_and_blink(); |
| 38 | beep_and_blink(); |
| 39 | beep_and_blink(); |
| 40 | delay(2); |
| 41 | } |
| 42 | } |