summaryrefslogtreecommitdiff
path: root/arch/sandbox
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sandbox')
-rw-r--r--arch/sandbox/dts/test.dts23
-rw-r--r--arch/sandbox/include/asm/scmi_test.h25
2 files changed, 46 insertions, 2 deletions
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 899e75f260c..8c4c2bfddd9 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -497,6 +497,27 @@
reg = <0x16>;
#reset-cells = <1>;
};
+
+ protocol@17 {
+ reg = <0x17>;
+
+ regulators {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ regul0_scmi0: reg@0 {
+ reg = <0>;
+ regulator-name = "sandbox-voltd0";
+ regulator-min-microvolt = <1100000>;
+ regulator-max-microvolt = <3300000>;
+ };
+ regul1_scmi0: reg@1 {
+ reg = <0x1>;
+ regulator-name = "sandbox-voltd1";
+ regulator-min-microvolt = <1800000>;
+ };
+ };
+ };
};
sandbox-scmi-agent@1 {
@@ -1264,6 +1285,8 @@
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>;
};
pinctrl {
diff --git a/arch/sandbox/include/asm/scmi_test.h b/arch/sandbox/include/asm/scmi_test.h
index 3e8b0068fd4..2930e686d72 100644
--- a/arch/sandbox/include/asm/scmi_test.h
+++ b/arch/sandbox/include/asm/scmi_test.h
@@ -24,6 +24,7 @@ struct sandbox_scmi_clk {
/**
* struct sandbox_scmi_reset - Simulated reset controller exposed by SCMI
+ * @id: Identifier of the reset controller used in the SCMI protocol
* @asserted: Reset control state: true if asserted, false if desasserted
*/
struct sandbox_scmi_reset {
@@ -32,12 +33,26 @@ struct sandbox_scmi_reset {
};
/**
+ * struct sandbox_scmi_voltd - Simulated voltage regulator exposed by SCMI
+ * @id: Identifier of the voltage domain used in the SCMI protocol
+ * @enabled: Regulator state: true if on, false if off
+ * @voltage_uv: Regulator current voltage in microvoltd (uV)
+ */
+struct sandbox_scmi_voltd {
+ uint id;
+ bool enabled;
+ int voltage_uv;
+};
+
+/**
* 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
- * @clk: Simulated reset domains
- * @clk_count: Simulated reset domains array size
+ * @reset: Simulated reset domains
+ * @reset_count: Simulated reset domains array size
+ * @voltd: Simulated voltage domains (regulators)
+ * @voltd_count: Simulated voltage domains array size
*/
struct sandbox_scmi_agent {
uint idx;
@@ -45,6 +60,8 @@ struct sandbox_scmi_agent {
size_t clk_count;
struct sandbox_scmi_reset *reset;
size_t reset_count;
+ struct sandbox_scmi_voltd *voltd;
+ size_t voltd_count;
};
/**
@@ -63,12 +80,16 @@ struct sandbox_scmi_service {
* @clk_count: Number of clock devices probed
* @reset: Array the reset controller devices
* @reset_count: Number of reset controller devices probed
+ * @regul: Array regulator devices
+ * @regul_count: Number of regulator devices probed
*/
struct sandbox_scmi_devices {
struct clk *clk;
size_t clk_count;
struct reset_ctl *reset;
size_t reset_count;
+ struct udevice **regul;
+ size_t regul_count;
};
#ifdef CONFIG_SCMI_FIRMWARE