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.
Showing the changes to include/linux/platform_data (1 of 2 files). Show all
Unified · Split
| @@ -51,10 +51,14 @@ · 50 unmodified lines | ||
| 51 | 51 | /* |
| 52 | 52 | * The actual block is 0x800-0x8ff, but some BIOSes think it's 0x880-0x8ff |
| 53 | 53 | * 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. | |
| 54 | 57 | */ |
| 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 | |
| 58 | 62 | |
| 59 | 63 | /* EC command register bit functions */ |
| 60 | 64 | #define EC_LPC_CMDR_DATA BIT(0) /* Data ready for host to read */ |