From 4a637802fa6fd8c532ce32e6595298e60e84f6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Fri, 13 Sep 2019 11:30:45 +0300 Subject: ec/acpi: Replace __PRE_RAM__ use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iae31569f16168ba00ce272e4777f3a69bcd6ee94 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/35397 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/ec/acpi/ec.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'src/ec') diff --git a/src/ec/acpi/ec.c b/src/ec/acpi/ec.c index 481622cf37..939ff781fa 100644 --- a/src/ec/acpi/ec.c +++ b/src/ec/acpi/ec.c @@ -18,19 +18,11 @@ #include #include #include +#include #include "ec.h" -#ifdef __PRE_RAM__ - -static const int ec_cmd_reg = EC_SC; -static const int ec_data_reg = EC_DATA; - -#else - -static int ec_cmd_reg = EC_SC; -static int ec_data_reg = EC_DATA; - -#endif +static u16 ec_cmd_reg = EC_SC; +static u16 ec_data_reg = EC_DATA; int send_ec_command(u8 command) { @@ -162,16 +154,15 @@ void ec_clr_bit(u8 addr, u8 bit) ec_write(addr, ec_read(addr) & ~(1 << bit)); } -#ifndef __PRE_RAM__ - void ec_set_ports(u16 cmd_reg, u16 data_reg) { + if (!ENV_STAGE_HAS_DATA_SECTION) + return; + ec_cmd_reg = cmd_reg; ec_data_reg = data_reg; } -#endif - struct chip_operations ec_acpi_ops = { CHIP_NAME("ACPI Embedded Controller") }; -- cgit v1.2.3