All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH 04/11] sandbox: Disable I2C emulators in SPL
Date: Thu, 21 Jan 2021 13:57:09 -0700	[thread overview]
Message-ID: <20210121205716.964652-5-sjg@chromium.org> (raw)
In-Reply-To: <20210121205716.964652-1-sjg@chromium.org>

These cannot work with of-platdata since they currently need the
devicetree at runtime. Disable the emulators and the sandbox I2C driver
that needs them. We can enable these later, if needed for testing.

Switch the of_plat_parent test over to use a simple bus instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/sandbox/dts/sandbox.dtsi | 10 +++++++---
 configs/sandbox_spl_defconfig |  1 -
 drivers/i2c/Makefile          |  2 ++
 test/dm/of_platdata.c         |  8 ++++----
 4 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/arch/sandbox/dts/sandbox.dtsi b/arch/sandbox/dts/sandbox.dtsi
index d842f021760..dc933f3bfc7 100644
--- a/arch/sandbox/dts/sandbox.dtsi
+++ b/arch/sandbox/dts/sandbox.dtsi
@@ -260,10 +260,14 @@
 		stringarray = "pre-proper";
 	};
 
-	spl-test7 {
+	test-bus {
+		compatible = "simple-bus";
 		u-boot,dm-spl;
-		compatible = "sandbox,spl-test";
-		stringarray = "spl";
+		spl-test7 {
+			u-boot,dm-spl;
+			compatible = "sandbox,spl-test";
+			stringarray = "spl";
+		};
 	};
 
 	square {
diff --git a/configs/sandbox_spl_defconfig b/configs/sandbox_spl_defconfig
index d193b18f47e..61dae34a6a2 100644
--- a/configs/sandbox_spl_defconfig
+++ b/configs/sandbox_spl_defconfig
@@ -101,7 +101,6 @@ CONFIG_SYSCON=y
 CONFIG_SPL_SYSCON=y
 CONFIG_DEVRES=y
 CONFIG_DEBUG_DEVRES=y
-# CONFIG_SPL_SIMPLE_BUS is not set
 CONFIG_ADC=y
 CONFIG_ADC_SANDBOX=y
 CONFIG_AXI=y
diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index 1aac5c481e2..29aab0f9e30 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -39,7 +39,9 @@ obj-$(CONFIG_SYS_I2C_RCAR_I2C) += rcar_i2c.o
 obj-$(CONFIG_SYS_I2C_RCAR_IIC) += rcar_iic.o
 obj-$(CONFIG_SYS_I2C_ROCKCHIP) += rk_i2c.o
 obj-$(CONFIG_SYS_I2C_S3C24X0) += s3c24x0_i2c.o exynos_hs_i2c.o
+ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_SYS_I2C_SANDBOX) += sandbox_i2c.o i2c-emul-uclass.o
+endif
 obj-$(CONFIG_SYS_I2C_SH) += sh_i2c.o
 obj-$(CONFIG_SYS_I2C_SOFT) += soft_i2c.o
 obj-$(CONFIG_SYS_I2C_STM32F7) += stm32f7_i2c.o
diff --git a/test/dm/of_platdata.c b/test/dm/of_platdata.c
index cfc43a5b038..26c50922c56 100644
--- a/test/dm/of_platdata.c
+++ b/test/dm/of_platdata.c
@@ -210,11 +210,11 @@ DM_TEST(dm_test_of_plat_phandle, UT_TESTF_SCAN_PDATA);
 /* Test that device parents are correctly set up */
 static int dm_test_of_plat_parent(struct unit_test_state *uts)
 {
-	struct udevice *rtc, *i2c;
+	struct udevice *dev, *bus;
 
-	ut_assertok(uclass_first_device_err(UCLASS_RTC, &rtc));
-	ut_assertok(uclass_first_device_err(UCLASS_I2C, &i2c));
-	ut_asserteq_ptr(i2c, dev_get_parent(rtc));
+	ut_assertok(uclass_first_device_err(UCLASS_SIMPLE_BUS, &bus));
+	ut_assertok(device_first_child_err(bus, &dev));
+	ut_asserteq_ptr(bus, dev_get_parent(dev));
 
 	return 0;
 }
-- 
2.30.0.280.ga3ce27912f-goog

  parent reply	other threads:[~2021-01-21 20:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21 20:57 [PATCH 00/11] More minor clean-ups and improvements Simon Glass
2021-01-21 20:57 ` [PATCH 01/11] spl: Tidy up SPL/TPL malloc sizes Simon Glass
2021-01-21 20:57 ` [PATCH 02/11] x86: coral: Support TPM and RTC in SPL Simon Glass
2021-01-21 20:57 ` [PATCH 03/11] i2c: desigware: Add an alias for Intel Apollo Lake Simon Glass
2021-01-26  5:17   ` Heiko Schocher
2021-01-30 21:27   ` Simon Glass
2021-01-21 20:57 ` Simon Glass [this message]
2021-01-26  5:19   ` [PATCH 04/11] sandbox: Disable I2C emulators in SPL Heiko Schocher
2021-01-30 21:27   ` Simon Glass
2021-01-21 20:57 ` [PATCH 05/11] dm: core: Don't inline dev_read...() calls with of-platdata Simon Glass
2021-01-21 20:57 ` [PATCH 06/11] clk: Add debugging for return values Simon Glass
2021-01-21 20:57 ` [PATCH 07/11] clk: x86: Correct the driver name Simon Glass
2021-01-21 20:57 ` [PATCH 08/11] dm: core: Add a comment about pinctrl_select_state() Simon Glass
2021-01-21 20:57 ` [PATCH 09/11] dm: core: Update ofnode_read_fmap_entry() to read hashes Simon Glass
2021-01-21 20:57 ` [PATCH 10/11] Add a symlink for ctype.h Simon Glass
2021-01-21 20:57 ` [PATCH 11/11] binman: Print a debug message when binman selects a node Simon Glass
2021-01-30 21:26 ` Simon Glass
2021-01-30 21:26 ` [PATCH 10/11] Add a symlink for ctype.h Simon Glass
2021-01-30 21:27 ` [PATCH 08/11] dm: core: Add a comment about pinctrl_select_state() Simon Glass
2021-01-30 21:27 ` [PATCH 07/11] clk: x86: Correct the driver name Simon Glass
2021-01-30 21:27 ` [PATCH 06/11] clk: Add debugging for return values Simon Glass
2021-01-30 21:27 ` [PATCH 05/11] dm: core: Don't inline dev_read...() calls with of-platdata Simon Glass
2021-01-30 21:27 ` [PATCH 02/11] x86: coral: Support TPM and RTC in SPL Simon Glass
2021-01-30 21:27 ` [PATCH 01/11] spl: Tidy up SPL/TPL malloc sizes Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210121205716.964652-5-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.