
On Wed, 9 Sep 2020 at 10:44, Etienne Carriere etienne.carriere@linaro.org wrote:
Add tests for SCMI clocks. A test device driver sandbox-scmi_devices.c is used to get clock resources, allowing further clock manipulation.
Change sandbox-smci_agent to emulate 3 clocks exposed through 2 agents. Add DM test scmi_clocks to test these 3 clocks. Update DM test sandbox_scmi_agent with load/remove test sequences factorized by {load|remove}_sandbox_scmi_test_devices() helper functions.
Signed-off-by: Etienne Carriere etienne.carriere@linaro.org Cc: Simon Glass sjg@chromium.org Cc: Peng Fan peng.fan@nxp.com Cc: Sudeep Holla sudeep.holla@arm.com
Changes in v4:
- Move SCMI test devices instances from BSS to test device private data and update test/dm/scmi.c accordingly.
- Update sandbox_scmi_devices_ctx() helper to add device reference arg.
- Fix spelling issues in inline comments.
- Rename local variables rc to ret for consistency.
Changes in v3:
- New commit in the series, addresses review comments on test support. ut_dm_scmi_clocks test SCMI are found and behave as expected for the implemented clk uclass methods.
arch/sandbox/dts/test.dts | 15 ++ arch/sandbox/include/asm/scmi_test.h | 39 +++++ configs/sandbox_defconfig | 1 + drivers/firmware/scmi/Makefile | 2 +- drivers/firmware/scmi/sandbox-scmi_agent.c | 169 ++++++++++++++++++- drivers/firmware/scmi/sandbox-scmi_devices.c | 75 ++++++++ test/dm/scmi.c | 141 +++++++++++++++- 7 files changed, 431 insertions(+), 11 deletions(-) create mode 100644 drivers/firmware/scmi/sandbox-scmi_devices.c
Reviewed-by: Simon Glass sjg@chromium.org