mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] test: arm: qemu-sabrelite: Use qemu specific device tree
@ 2024-10-01  8:52 Sascha Hauer
  2024-10-01 10:35 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2024-10-01  8:52 UTC (permalink / raw)
  To: Barebox List

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] test: arm: qemu-sabrelite: Use qemu specific device tree
  2024-10-01  8:52 [PATCH] test: arm: qemu-sabrelite: Use qemu specific device tree Sascha Hauer
@ 2024-10-01 10:35 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-10-01 10:35 UTC (permalink / raw)
  To: Barebox List, Sascha Hauer


On Tue, 01 Oct 2024 10:52:08 +0200, Sascha Hauer wrote:
> 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.
> 
> [...]

Applied, thanks!

[1/1] test: arm: qemu-sabrelite: Use qemu specific device tree
      https://git.pengutronix.de/cgit/barebox/commit/?id=38dbe309f536 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-01 10:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-01  8:52 [PATCH] test: arm: qemu-sabrelite: Use qemu specific device tree Sascha Hauer
2024-10-01 10:35 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox