| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <ec/acpi/ec.h> |
| 4 | #include <arch/io.h> |
| 5 | #include "mec1653.h" |
| 6 | #include "uart.h" |
| 7 | |
| 8 | void bootblock_ec_init(void) |
| 9 | { |
| 10 | // Tell EC via BIOS Debug Port 1 that the world isn't on fire |
| 11 | |
| 12 | // Let the EC know that BIOS code is running |
| 13 | outb(0x11, 0x86); |
| 14 | outb(0x6e, 0x86); |
| 15 | |
| 16 | // Enable accesses to EC1 interface |
| 17 | ec_set_ports(EC_SC, EC_DATA); |
| 18 | ec_clear_out_queue(); |
| 19 | ec_write(ec_read(0), 0x20); |
| 20 | |
| 21 | // Reset LEDs to power on state |
| 22 | // (Without this warm reboot leaves LEDs off) |
| 23 | ec_write(0x0c, 0x80); |
| 24 | ec_write(0x0c, 0x07); |
| 25 | ec_write(0x0c, 0x8a); |
| 26 | |
| 27 | // Setup debug UART |
| 28 | if (CONFIG(MEC1653_ENABLE_UART)) |
| 29 | mec1653_configure_uart(); |
| 30 | } |