@@ -233,6 +233,146 @@ impl EcRequest<()> for EcRequestConsoleRead {
233233 }
234234}
235235
236+ /// Supported features
237+ #[ derive( Debug , FromPrimitive ) ]
238+ pub enum EcFeatureCode {
239+ /// This image contains a limited set of features. Another image
240+ /// in RW partition may support more features.
241+ Limited = 0 ,
242+ /// Commands for probing/reading/writing/erasing the flash in the
243+ /// EC are present.
244+ Flash = 1 ,
245+ /// Can control the fan speed directly.
246+ PwmFan = 2 ,
247+ /// Can control the intensity of the keyboard backlight.
248+ PwmKeyboardBacklight = 3 ,
249+ /// Support Google lightbar, introduced on Pixel.
250+ Lightbar = 4 ,
251+ /// Control of LEDs
252+ Led = 5 ,
253+ /// Exposes an interface to control gyro and sensors.
254+ /// The host goes through the EC to access these sensors.
255+ /// In addition, the EC may provide composite sensors, like lid angle.
256+ MotionSense = 6 ,
257+ /// The keyboard is controlled by the EC
258+ Keyboard = 7 ,
259+ /// The AP can use part of the EC flash as persistent storage.
260+ PersistentStorage = 8 ,
261+ /// The EC monitors BIOS port 80h, and can return POST codes.
262+ Port80 = 9 ,
263+ /// Thermal management: include TMP specific commands.
264+ /// Higher level than direct fan control.
265+ Thermal = 10 ,
266+ /// Can switch the screen backlight on/off
267+ BacklightSwitch = 11 ,
268+ /// Can switch the wifi module on/off
269+ WifiSwitch = 12 ,
270+ /// Monitor host events, through for example SMI or SCI
271+ HostEvents = 13 ,
272+ /// The EC exposes GPIO commands to control/monitor connected devices.
273+ Gpio = 14 ,
274+ /// The EC can send i2c messages to downstream devices.
275+ I2c = 15 ,
276+ /// Command to control charger are included
277+ Charger = 16 ,
278+ /// Simple battery support.
279+ Battery = 17 ,
280+ /// Support Smart battery protocol
281+ /// (Common Smart Battery System Interface Specification)
282+ SmartBattery = 18 ,
283+ /// EC can detect when the host hangs.
284+ HangDetect = 19 ,
285+ /// Report power information, for pit only
286+ Pmu = 20 ,
287+ /// Another Cros EC device is present downstream of this one
288+ SubMcu = 21 ,
289+ /// Support USB Power delivery (PD) commands
290+ UsbPd = 22 ,
291+ /// Control USB multiplexer, for audio through USB port for instance.
292+ UsbMux = 23 ,
293+ /// Motion Sensor code has an internal software FIFO
294+ MotionSenseFifo = 24 ,
295+ /// Support temporary secure vstore
296+ SecureVstore = 25 ,
297+ /// EC decides on USB-C SS mux state, muxes configured by host
298+ UsbcSsMuxVirtual = 26 ,
299+ /// EC has RTC feature that can be controlled by host commands
300+ Rtc = 27 ,
301+ /// The MCU exposes a Fingerprint sensor
302+ Fingerprint = 28 ,
303+ /// The MCU exposes a Touchpad
304+ Touchpad = 29 ,
305+ /// The MCU has RWSIG task enabled
306+ RwSig = 30 ,
307+ /// EC has device events support
308+ DeviceEvent = 31 ,
309+ /// EC supports the unified wake masks for LPC/eSPI systems
310+ UnifiedWakeMasks = 32 ,
311+ /// EC supports 64-bit host events
312+ HostEvent64 = 33 ,
313+ /// EC runs code in RAM (not in place, a.k.a. XIP)
314+ ExecInRam = 34 ,
315+ /// EC supports CEC commands
316+ Cec = 35 ,
317+ /// EC supports tight sensor timestamping.
318+ MotionSenseTightTimesStamps = 36 ,
319+ ///
320+ /// EC supports tablet mode detection aligned to Chrome and allows
321+ /// setting of threshold by host command using
322+ /// MOTIONSENSE_CMD_TABLET_MODE_LID_ANGLE.
323+ RefinedTabletModeHysteresis = 37 ,
324+ /// Early Firmware Selection ver.2. Enabled by CONFIG_VBOOT_EFS2.
325+ /// Note this is a RO feature. So, a query (EC_CMD_GET_FEATURES) should
326+ /// be sent to RO to be precise.
327+ Efs2 = 38 ,
328+ /// The MCU is a System Companion Processor (SCP).
329+ Scp = 39 ,
330+ /// The MCU is an Integrated Sensor Hub
331+ Ish = 40 ,
332+ /// New TCPMv2 TYPEC_ prefaced commands supported
333+ TypecCmd = 41 ,
334+ /// The EC will wait for direction from the AP to enter Type-C alternate
335+ /// modes or USB4.
336+ TypecRequireApModeEntry = 42 ,
337+ /// The EC will wait for an acknowledge from the AP after setting the
338+ /// mux.
339+ TypeCMuxRequireApAck = 43 ,
340+ /// The EC supports entering and residing in S4.
341+ S4Residency = 44 ,
342+ /// The EC supports the AP directing mux sets for the board.
343+ TypeCApMuxSet = 45 ,
344+ /// The EC supports the AP composing VDMs for us to send.
345+ TypeCApVdmSend = 46 ,
346+ /// The EC supports system safe mode panic recovery.
347+ SystemSafeMode = 47 ,
348+ /// The EC will reboot on runtime assertion failures.
349+ AssertReboots = 48 ,
350+ /// The EC image is built with tokenized logging enabled.
351+ TokenizedLogging = 49 ,
352+ /// The EC supports triggering an STB dump.
353+ AmdStbDump = 50 ,
354+ /// The EC supports memory dump commands.
355+ MemoryDump = 51 ,
356+ /// The EC supports DP2.1 capability
357+ Dp21 = 52 ,
358+ /// The MCU is System Companion Processor Core 1
359+ ScpC1 = 53 ,
360+ /// The EC supports UCSI PPM.
361+ UcsiPpm = 54 ,
362+ }
363+
364+ pub struct EcRequestGetFeatures { }
365+
366+ pub struct EcResponseGetFeatures {
367+ pub flags : [ u32 ; 2 ] ,
368+ }
369+
370+ impl EcRequest < EcResponseGetFeatures > for EcRequestGetFeatures {
371+ fn command_id ( ) -> EcCommands {
372+ EcCommands :: GetFeatures
373+ }
374+ }
375+
236376#[ repr( u8 ) ]
237377pub enum RebootEcCmd {
238378 /// Cancel a pending reboot
0 commit comments