diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-09-13 11:30:45 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-09-14 10:57:28 +0000 |
commit | 4a637802fa6fd8c532ce32e6595298e60e84f6d6 (patch) | |
tree | 8cc466d9364f100d2451eeeec04ba0d3b373fa49 /src/ec | |
parent | 505e3f7e852a5f3d9a37b702c9095443e6ad7d44 (diff) |
ec/acpi: Replace __PRE_RAM__ use
Change-Id: Iae31569f16168ba00ce272e4777f3a69bcd6ee94
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35397
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/ec')
-rw-r--r-- | src/ec/acpi/ec.c | 21 |
1 files changed, 6 insertions, 15 deletions
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 <device/device.h> #include <arch/io.h> #include <delay.h> +#include <stdint.h> #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") }; |