Attention is currently required from: Furquan Shaikh, Maulik V Vaghela, Tim Wawrzynczak, Subrata Banik, Patrick Rudolph. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/57804 )
Change subject: soc/intel/common/../cse: Create APIs for CSE device state transition ......................................................................
Patch Set 3:
(2 comments)
File src/soc/intel/common/block/cse/cse.c:
https://review.coreboot.org/c/coreboot/+/57804/comment/e4d1a141_c16f6e41 PS3, Line 923: static bool is_cse_idle(void) I just saw the follow-up patch. I'd make this function public (non-static), retype its return value to `enum cse_device_state` and rename it to something like `get_cse_device_state()`.
https://review.coreboot.org/c/coreboot/+/57804/comment/5b6016d2_aaa78fe1 PS3, Line 946: set_cse_to_prior_state
What's this `prior state`? Why not name this function `ensure_cse_idle`?
Ok, I just saw CB:57805 and the intended usage of this function. It should obtain the current state from `is_cse_idle()`, and take the prior state as a parameter.
Or one could make a single `bool set_cse_device_state(enum cse_device_state requested_state);` function that provides the functionality of `ensure_cse_active()` and `set_cse_to_prior_state()`. The function would check if the current state differs from the requested state, and put the CSE in the requested state if necessary, returning success/failure.
Together with `get_cse_device_state()`, the resulting API is flexible and straightforward to use.