chromeec: Add commands to check PD image type

Coreboot needs to be able to reboot the PD controller into RO
image in recovery mode early in the boot process in order to
avoid a lengthy recovery mode boot if it is only done at vboot
software sync time.

In order to do this a new device index field is added to the
command structure which must be initaalized to zero for all EC

This early init and image check code is only used in romstage so
include it in the __PRE_RAM__ block.

TEST=build and boot on samus EVT in recovery mode and see that
the PD is rebooted to RO mode early in the boot.

Change-Id: Iee60aae4d49b83b4a377b71e41e8109858a90223
Signed-off-by: Stefan Reinauer <>
Original-Commit-Id: b36cf37d9b5a7053ecbd15c748eac84836d413e1
Original-Change-Id: Iebc48709b527d3571618da775c849e1c3fcd6384
Original-Signed-off-by: Duncan Laurie <>
Original-Reviewed-by: Aaron Durbin <>
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <>
2 files changed