History

platform/chrome: cros_ec_lpcs: reserve the MEC LPC I/O ports first

Some ChromeOS EC devices (such as the Framework Laptop) only map I/O ports 0x800-0x807. Making the larger reservation required by the non-MEC LPC (the 0xFF ports for the memory map, and the 0xFF ports for the parameter region) is non-viable on these devices. Since we probe the MEC EC first, we can get away with a smaller reservation that covers the MEC EC ports. If we fall back to classic LPC, we can grow the reservation to cover the memory map and the parameter region. cros_ec_lpc_probe also interacted with I/O ports 0x800-0x807 without a reservation. Restructuring the code to request the MEC LPC region first obviates the need to do so.

Dustin L. Howett committed 4 years ago

Commit c9bc1a01 parent 6a5d7782 files · +33 −16Browse files

Showing the changes to include/linux/platform_data (1 of 2 files). Show all

Unified · Split

include/linux/platform_data/cros_ec_commands.h+7−3
@@ -51,10 +51,14 @@ · 50 unmodified lines
5151 /*
5252 * The actual block is 0x800-0x8ff, but some BIOSes think it's 0x880-0x8ff
5353 * and they tell the kernel that so we have to think of it as two parts.
54+ *
55+ * Other BIOSes report only the I/O port region spanned by the Microchip
56+ * MEC series EC; an attempt to address a larger region may fail.
5457 */
55−#define EC_HOST_CMD_REGION0 0x800
56−#define EC_HOST_CMD_REGION1 0x880
57−#define EC_HOST_CMD_REGION_SIZE 0x80
58+#define EC_HOST_CMD_REGION0 0x800
59+#define EC_HOST_CMD_REGION1 0x880
60+#define EC_HOST_CMD_REGION_SIZE 0x80
61+#define EC_HOST_CMD_MEC_REGION_SIZE 0x8
5862
5963 /* EC command register bit functions */
6064 #define EC_LPC_CMDR_DATA BIT(0) /* Data ready for host to read */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t