aboutsummaryrefslogtreecommitdiff
path: root/arch/sandbox
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sandbox')
-rw-r--r--arch/sandbox/cpu/spl.c1
-rw-r--r--arch/sandbox/cpu/start.c8
-rw-r--r--arch/sandbox/cpu/state.c3
-rw-r--r--arch/sandbox/dts/sandbox.dtsi3
-rw-r--r--arch/sandbox/dts/test.dts40
-rw-r--r--arch/sandbox/include/asm/scmi_test.h13
-rw-r--r--arch/sandbox/include/asm/test.h5
7 files changed, 34 insertions, 39 deletions
diff --git a/arch/sandbox/cpu/spl.c b/arch/sandbox/cpu/spl.c
index 650bdb0..3f107b8 100644
--- a/arch/sandbox/cpu/spl.c
+++ b/arch/sandbox/cpu/spl.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <dm.h>
#include <hang.h>
+#include <handoff.h>
#include <init.h>
#include <log.h>
#include <os.h>
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 13b0731..0f5a873 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -4,14 +4,14 @@
*/
#include <common.h>
+#include <cli.h>
#include <command.h>
-#include <dm/root.h>
#include <efi_loader.h>
#include <errno.h>
+#include <event.h>
#include <init.h>
#include <log.h>
#include <os.h>
-#include <cli.h>
#include <sort.h>
#include <asm/getopt.h>
#include <asm/global_data.h>
@@ -19,6 +19,7 @@
#include <asm/malloc.h>
#include <asm/sections.h>
#include <asm/state.h>
+#include <dm/root.h>
#include <linux/ctype.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -119,10 +120,11 @@ int sandbox_early_getopt_check(void)
os_exit(0);
}
-int misc_init_f(void)
+static int sandbox_misc_init_f(void *ctx, struct event *event)
{
return sandbox_early_getopt_check();
}
+EVENT_SPY(EVT_MISC_INIT_F, sandbox_misc_init_f);
static int sandbox_cmdline_cb_help(struct sandbox_state *state, const char *arg)
{
diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c
index ce904b1..e0d0112 100644
--- a/arch/sandbox/cpu/state.c
+++ b/arch/sandbox/cpu/state.c
@@ -421,7 +421,8 @@ int state_uninit(void)
{
int err;
- log_info("Writing sandbox state\n");
+ if (state->write_ram_buf || state->write_state)
+ log_info("Writing sandbox state\n");
state = &main_state;
/* Finish the bloblist, so that it is correct before writing memory */
diff --git a/arch/sandbox/dts/sandbox.dtsi b/arch/sandbox/dts/sandbox.dtsi
index 66b813f..826db26 100644
--- a/arch/sandbox/dts/sandbox.dtsi
+++ b/arch/sandbox/dts/sandbox.dtsi
@@ -7,6 +7,9 @@
#define USB_CLASS_HUB 9
/ {
+ binman {
+ };
+
chosen {
stdout-path = "/serial";
};
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 48ca3e1..05c1cd5 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -61,6 +61,9 @@
osd0 = "/osd";
};
+ binman {
+ };
+
config {
testing-bool;
testing-int = <123>;
@@ -574,17 +577,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 +603,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 +617,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 +1395,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 2>, <&clk_scmi 0>;
+ 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..c72ec1e 100644
--- a/arch/sandbox/include/asm/scmi_test.h
+++ b/arch/sandbox/include/asm/scmi_test.h
@@ -17,7 +17,6 @@ struct sandbox_scmi_service;
* @rate: Clock rate in Hertz
*/
struct sandbox_scmi_clk {
- uint id;
bool enabled;
ulong rate;
};
@@ -46,7 +45,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 +53,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 +63,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 +89,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
*/
diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h
index 0d83f4d..015e96d 100644
--- a/arch/sandbox/include/asm/test.h
+++ b/arch/sandbox/include/asm/test.h
@@ -9,6 +9,7 @@
#define __ASM_TEST_H
#include <video.h>
+#include <pci_ids.h>
/* The sandbox driver always permits an I2C device with this address */
#define SANDBOX_I2C_TEST_ADDR 0x59
@@ -17,8 +18,8 @@
#define SANDBOX_PCI_SWAP_CASE_EMUL_ID 0x5678
#define SANDBOX_PCI_PMC_EMUL_ID 0x5677
#define SANDBOX_PCI_P2SB_EMUL_ID 0x5676
-#define SANDBOX_PCI_CLASS_CODE PCI_CLASS_CODE_COMM
-#define SANDBOX_PCI_CLASS_SUB_CODE PCI_CLASS_SUB_CODE_COMM_SERIAL
+#define SANDBOX_PCI_CLASS_CODE (PCI_CLASS_COMMUNICATION_SERIAL >> 8)
+#define SANDBOX_PCI_CLASS_SUB_CODE (PCI_CLASS_COMMUNICATION_SERIAL & 0xff)
#define PCI_CAP_ID_PM_OFFSET 0x50
#define PCI_CAP_ID_EXP_OFFSET 0x60