mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] test: arm: qemu-sabrelite: Use qemu specific device tree
Date: Tue,  1 Oct 2024 10:52:08 +0200	[thread overview]
Message-ID: <20241001085208.522095-1-s.hauer@pengutronix.de> (raw)

The sabrelite board has some GPIOs registered as buttons. These GPIOs
are not properly emulated in QEMU and read as low. The buttons are
active low as well, so in barebox we detect all buttons as pressed. One
of these buttons is registered as KEY_POWER. Depending on the
initialization order it can happen that barebox tries to power down the
board during startup. Avoid this pitfall by passing a device tree to
QEMU which has the gpio-keys driver disabled.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/dts/Makefile                           | 2 +-
 arch/arm/dts/imx6q-sabrelite-qemu.dts           | 5 +++++
 test/arm/qemu-sabrelite@multi_v7_defconfig.yaml | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/imx6q-sabrelite-qemu.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 68585e1e4b..3b3236b416 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -127,7 +127,7 @@ lwl-$(CONFIG_MACH_RPI2) += bcm2836-rpi-2.dtb.o
 lwl-$(CONFIG_MACH_RPI3) += bcm2837-rpi-3.dtb.o
 lwl-$(CONFIG_MACH_RPI_CM3) += bcm2837-rpi-cm3.dtb.o
 lwl-$(CONFIG_MACH_RPI4) += bcm2711-rpi-4.dtb.o bcm2711-rpi-400.dtb.o bcm2711-rpi-cm4-io.dtb.o bcm2711-rpi-cm4s-io.dtb.o
-lwl-$(CONFIG_MACH_SABRELITE) += imx6q-sabrelite.dtb.o imx6dl-sabrelite.dtb.o
+lwl-$(CONFIG_MACH_SABRELITE) += imx6q-sabrelite.dtb.o imx6dl-sabrelite.dtb.o imx6q-sabrelite-qemu.dtb.o
 lwl-$(CONFIG_MACH_SABRESD) += imx6q-sabresd.dtb.o imx6qp-sabresd.dtb.o imx6dl-sabresd.dtb.o
 lwl-$(CONFIG_MACH_FREESCALE_IMX6SX_SABRESDB) += imx6sx-sdb.dtb.o
 lwl-$(CONFIG_MACH_SOCFPGA_ALTERA_SOCDK) += socfpga_cyclone5_socdk.dtb.o
diff --git a/arch/arm/dts/imx6q-sabrelite-qemu.dts b/arch/arm/dts/imx6q-sabrelite-qemu.dts
new file mode 100644
index 0000000000..a16a882543
--- /dev/null
+++ b/arch/arm/dts/imx6q-sabrelite-qemu.dts
@@ -0,0 +1,5 @@
+#include "imx6q-sabrelite.dts"
+
+&{/gpio-keys} {
+	status = "disabled";
+};
diff --git a/test/arm/qemu-sabrelite@multi_v7_defconfig.yaml b/test/arm/qemu-sabrelite@multi_v7_defconfig.yaml
index 77b7f9e589..8dc137ee44 100644
--- a/test/arm/qemu-sabrelite@multi_v7_defconfig.yaml
+++ b/test/arm/qemu-sabrelite@multi_v7_defconfig.yaml
@@ -15,6 +15,6 @@ targets:
       BareboxTestStrategy: {}
 images:
   barebox-dt-2nd.img: !template "$LG_BUILDDIR/images/barebox-dt-2nd.img"
-  imx6q-sabreliste.dtb: !template "$LG_BUILDDIR/arch/arm/dts/imx6q-sabrelite.dtb"
+  imx6q-sabreliste.dtb: !template "$LG_BUILDDIR/arch/arm/dts/imx6q-sabrelite-qemu.dtb"
 imports:
   -  ../strategy.py
-- 
2.39.5




             reply	other threads:[~2024-10-01  8:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-01  8:52 Sascha Hauer [this message]
2024-10-01 10:35 ` Sascha Hauer

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=20241001085208.522095-1-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox