aboutsummaryrefslogtreecommitdiff
path: root/arch/sandbox
diff options
context:
space:
mode:
authorEtienne Carriere <etienne.carriere@linaro.org>2022-02-21 09:22:39 +0100
committerTom Rini <trini@konsulko.com>2022-03-02 17:42:06 -0500
commit41d62e2f275c44fd47bcd6d856608528006b082b (patch)
treeb107036ed760aef9c74c8cfffe236831aec6e875 /arch/sandbox
parent4dea25a00d723425c8e2030a849af77b133dfaa1 (diff)
downloadu-boot-41d62e2f275c44fd47bcd6d856608528006b082b.zip
u-boot-41d62e2f275c44fd47bcd6d856608528006b082b.tar.gz
u-boot-41d62e2f275c44fd47bcd6d856608528006b082b.tar.bz2
sandbox: scmi: test against a single scmi agent
As per DT bindings since Linux kernel v5.14, the device tree can define only 1 SCMI agent node that is named scmi [1]. As a consequence, change implementation of the SCMI driver test through sandbox architecture to reflect that. This change updates sandbox test DT and sandbox SCMI driver accordingly since all these are impacted. Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Diffstat (limited to 'arch/sandbox')
-rw-r--r--arch/sandbox/dts/test.dts37
-rw-r--r--arch/sandbox/include/asm/scmi_test.h12
2 files changed, 17 insertions, 32 deletions
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 48ca3e1..30874b0 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -574,17 +574,21 @@
compatible = "sandbox,firmware";
};
- sandbox-scmi-agent@0 {
+ scmi {
compatible = "sandbox,scmi-agent";
#address-cells = <1>;
#size-cells = <0>;
- clk_scmi0: protocol@14 {
+ protocol@10 {
+ reg = <0x10>;
+ };
+
+ clk_scmi: protocol@14 {
reg = <0x14>;
#clock-cells = <1>;
};
- reset_scmi0: protocol@16 {
+ reset_scmi: protocol@16 {
reg = <0x16>;
#reset-cells = <1>;
};
@@ -596,13 +600,13 @@
#address-cells = <1>;
#size-cells = <0>;
- regul0_scmi0: reg@0 {
+ regul0_scmi: reg@0 {
reg = <0>;
regulator-name = "sandbox-voltd0";
regulator-min-microvolt = <1100000>;
regulator-max-microvolt = <3300000>;
};
- regul1_scmi0: reg@1 {
+ regul1_scmi: reg@1 {
reg = <0x1>;
regulator-name = "sandbox-voltd1";
regulator-min-microvolt = <1800000>;
@@ -610,21 +614,6 @@
};
};
};
-
- sandbox-scmi-agent@1 {
- compatible = "sandbox,scmi-agent";
- #address-cells = <1>;
- #size-cells = <0>;
-
- clk_scmi1: protocol@14 {
- reg = <0x14>;
- #clock-cells = <1>;
- };
-
- protocol@10 {
- reg = <0x10>;
- };
- };
};
pinctrl-gpio {
@@ -1403,10 +1392,10 @@
sandbox_scmi {
compatible = "sandbox,scmi-devices";
- clocks = <&clk_scmi0 7>, <&clk_scmi0 3>, <&clk_scmi1 1>;
- resets = <&reset_scmi0 3>;
- regul0-supply = <&regul0_scmi0>;
- regul1-supply = <&regul1_scmi0>;
+ clocks = <&clk_scmi 7>, <&clk_scmi 3>;
+ resets = <&reset_scmi 3>;
+ regul0-supply = <&regul0_scmi>;
+ regul1-supply = <&regul1_scmi>;
};
pinctrl {
diff --git a/arch/sandbox/include/asm/scmi_test.h b/arch/sandbox/include/asm/scmi_test.h
index 2930e68..054be5f 100644
--- a/arch/sandbox/include/asm/scmi_test.h
+++ b/arch/sandbox/include/asm/scmi_test.h
@@ -46,7 +46,6 @@ struct sandbox_scmi_voltd {
/**
* struct sandbox_scmi_agent - Simulated SCMI service seen by SCMI agent
- * @idx: Identifier for the SCMI agent, its index
* @clk: Simulated clocks
* @clk_count: Simulated clocks array size
* @reset: Simulated reset domains
@@ -55,7 +54,6 @@ struct sandbox_scmi_voltd {
* @voltd_count: Simulated voltage domains array size
*/
struct sandbox_scmi_agent {
- uint idx;
struct sandbox_scmi_clk *clk;
size_t clk_count;
struct sandbox_scmi_reset *reset;
@@ -66,12 +64,10 @@ struct sandbox_scmi_agent {
/**
* struct sandbox_scmi_service - Reference to simutaed SCMI agents/services
- * @agent: Pointer to SCMI sandbox agent pointers array
- * @agent_count: Number of emulated agents exposed in array @agent.
+ * @agent: Pointer to SCMI sandbox agent or NULL if not probed
*/
struct sandbox_scmi_service {
- struct sandbox_scmi_agent **agent;
- size_t agent_count;
+ struct sandbox_scmi_agent *agent;
};
/**
@@ -94,13 +90,13 @@ struct sandbox_scmi_devices {
#ifdef CONFIG_SCMI_FIRMWARE
/**
- * sandbox_scmi_service_context - Get the simulated SCMI services context
+ * sandbox_scmi_service_ctx - Get the simulated SCMI services context
* @return: Reference to backend simulated resources state
*/
struct sandbox_scmi_service *sandbox_scmi_service_ctx(void);
/**
- * sandbox_scmi_devices_get_ref - Get references to devices accessed through SCMI
+ * sandbox_scmi_devices_ctx - Get references to devices accessed through SCMI
* @dev: Reference to the test device used get test resources
* @return: Reference to the devices probed by the SCMI test
*/