diff options
author | Angel Pons <th3fanbus@gmail.com> | 2023-03-21 16:13:36 +0100 |
---|---|---|
committer | Lean Sheng Tan <sheng.tan@9elements.com> | 2023-03-24 16:36:42 +0000 |
commit | 964079f77cced3aedc468a888b6b6f32cfbec7c9 (patch) | |
tree | a582aa14ad438130326129ec0495a35a7086c8dd /src/mainboard/prodrive/atlas/ec.h | |
parent | 3ba1621dab403625cb0852d5dad6285e0ab6744d (diff) |
mb/prodrive/atlas: Add support to read from EC EMI
Implement initial support for EMI (Embedded Memory Interface), which
Microchip describes as "a standard run-time mechanism for the system
host to communicate with the Embedded Controller (EC) and other logical
components". EMI allows the host to access regions of EC memory without
requiring any assistance from the EC.
For now, Atlas only uses EMI 0. This change enables EMI 0, subsequent
commits will read data from it.
Change-Id: Ia899ae71e97f9fc259397dfb5fb84ca06545f5d8
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73936
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Diffstat (limited to 'src/mainboard/prodrive/atlas/ec.h')
-rw-r--r-- | src/mainboard/prodrive/atlas/ec.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mainboard/prodrive/atlas/ec.h b/src/mainboard/prodrive/atlas/ec.h new file mode 100644 index 0000000000..bad9904340 --- /dev/null +++ b/src/mainboard/prodrive/atlas/ec.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef MICROCHIP_MEC152X_EC_H +#define MICROCHIP_MEC152X_EC_H + +/* + * Used references: MEC152x datasheet (Microchip document DS00003427C) + */ + +#include <types.h> + +/* TABLE 3-1: BASE ADDRESS */ +#define LDN_ESPI_IO_COMPONENT 0xd + +/* TABLE 9-6: ESPI I/O BASE ADDRESS REGISTER DEFAULT VALUES */ +#define EMI_0_IOBASE_INDEX 0x68 +#define EMI_1_IOBASE_INDEX 0x6c + +void ec_espi_io_program_iobase(const u16 port, const u8 iobase_index, const u16 base); + +void ec_emi_read(u8 *dest, const u16 base, const u8 region, const u16 offset, const u16 length); + +#endif /* MICROCHIP_MEC152X_EC_H */ |