From patchwork Mon Sep 15 10:46:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 26 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757933245; bh=DsN6cAKUGk92kyleLZBcRGRrZ60v4ySkB0tcfMxN+8Y=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=giRfnbP0xGBy61WyPIEmKkqDK4doGKumsKL0eiMa2IQcpqXd8svskn5UXAvc/4Up4 UrhNsd49R1tAZKlYUQakMc/8IqIl3YsEC11zs2AY/zu0VvurFchlaHafYqq4JEBKm/ AsZ0CmG9CQRlD7+SzWuQl+QbpfG+qdh3whl/RjjJeaGV5HP5lNIxNtU9MiD2GlHHjB GnXGNeQBhFb3+vwabx0g388f9tYVRIFy09+IOh2cU9AickK7gbvuKfaSuYjDo8mCqA oazeXaCQomsguPWPlbHRHzP5wJteS/jhPBuH2F8Dy20RGiJVHp6IRWBNpAD/PX+oHo nRmXvyLR0+zjQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 19D355F92B for ; Mon, 15 Sep 2025 04:47:25 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id tVn_C5AOcc1H for ; Mon, 15 Sep 2025 04:47:25 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757933245; bh=DsN6cAKUGk92kyleLZBcRGRrZ60v4ySkB0tcfMxN+8Y=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=giRfnbP0xGBy61WyPIEmKkqDK4doGKumsKL0eiMa2IQcpqXd8svskn5UXAvc/4Up4 UrhNsd49R1tAZKlYUQakMc/8IqIl3YsEC11zs2AY/zu0VvurFchlaHafYqq4JEBKm/ AsZ0CmG9CQRlD7+SzWuQl+QbpfG+qdh3whl/RjjJeaGV5HP5lNIxNtU9MiD2GlHHjB GnXGNeQBhFb3+vwabx0g388f9tYVRIFy09+IOh2cU9AickK7gbvuKfaSuYjDo8mCqA oazeXaCQomsguPWPlbHRHzP5wJteS/jhPBuH2F8Dy20RGiJVHp6IRWBNpAD/PX+oHo nRmXvyLR0+zjQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 074B667B34 for ; Mon, 15 Sep 2025 04:47:25 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757933239; bh=XgaUKVjJSurVWbEFasXstO4RnqBsc6hLlBmiprtnvwM=; h=From:To:Cc:Subject:Date:From; b=qmGP87DPBs27Z7iaeGkuY3+6D3hghX38CCtlpyvho2ZfSeEzAF0XzNFEFAcR/3K/L EZ1drG+I1lFhSRqBocwGQ2B2f8F66z8bPS2VUsTmCt9u3DUprX26kjJ9MxriiNJIDb rS++BaJjk3wkSMoDSobRNDxg3C1lMMREg8w4If8JnixZCEh3vPAPMKKs27v5BPqM8W AiekD804oZjsi57FD6++HPpHy0xxKAlzWI3Rm55TmMTsSsMWb5cCZ/DeACLS+I674W YhCtVOI+PtrcbYkon+PYJXZLSIxpQio+E72LrPiyGB7vqLyQ6sMB/pliQGmrGt3z0B Tp9TMYZKjQ5Jg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BBC2D67B4F; Mon, 15 Sep 2025 04:47:19 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id AH_1BI6YOW_s; Mon, 15 Sep 2025 04:47:19 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757933235; bh=S+WrsmSPy46+dWCCExC2w1jgkDOdguwabfeaNDVsJWw=; h=From:To:Cc:Subject:Date:From; b=GtFqRkTBlGgD7mqGekDBUvM1JsHC2Dl/k3B5HZNDrY7G0niIJhfuNzVZQV4NvKlzW YOuDBcwd47zlkeL6I1ldPFuTXeqsf9apoxj7D/NmXs36y5kyDDNWnaRZTvZcXzujq1 C+r1qRhJRMYgGflPXkJ/d4/WrkLA0ltDnOxXwlT57+hICpwMHlSUEC+FAtwY1Fwqj9 TNfiuapvXZkMsLdwUL9yxiy2dP4wfhiPZhS0eJMj/kryPi39tSECy5kRTQZPlEGeCX agFonukuxIKBI0RYGUQRdhKAQb+ecDtRRPez3yKd4DF2JVy2PT+j/7/inPOj06yvkz RsG3CjQouCXag== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 107F967A99; Mon, 15 Sep 2025 04:47:15 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 15 Sep 2025 04:46:41 -0600 Message-ID: <20250915104705.937780-1-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Message-ID-Hash: QL7RFOLFHFLSO3XXK7OBICEZ3GSJPOMS X-Message-ID-Hash: QL7RFOLFHFLSO3XXK7OBICEZ3GSJPOMS X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 00/17] mouse: Provide some support for using a mouse List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass This series resurects some old code that was never submitted, related to using Nuklear with U-Boot. It includes: - a very simple mouse uclass - sandbox mouse driver - USB mouse driver, useful on x86 - EFI mouse driver, useful when running as an EFI app - script updates to use the above with build-qemu and build-efi It also includes a few small patches for sandbox, tests and membuf Not everything is fully working at present: - Mouse works on x86 QEMU (after 'usb start') but not ARM - Mouse works on real hardware with EFI, but not with build-efi script - Mouse times out with 'usb start', even though it does actually work More work will be needed to tidy up these remaining issues. Simon Glass (17): membuf: Add a function to set up a static membuf sandbox: Add a way to set the window title test: Add newlines at the end of the img functions input: Add mouse support sandbox: sdl: Add support for mouse input input: sandbox: Provide a mouse driver input: Add a command to show mouse input sandbox: Enable the mouse sandbox: Provide a test for the mouse uclass usb: Add a USB mouse driver mouse: Provide a way to read clicks efi: Add the simple-pointer protocol efi: Provide a mouse driver for EFI efi: arm: x86: Enable the mouse script: Support mouse with build-efi/qemu scripts x86: emulation: Enable USB support qemu: Enable the mouse MAINTAINERS | 7 + arch/arm/dts/efi-arm_app.dts | 5 + arch/sandbox/cpu/sdl.c | 46 +++- arch/sandbox/cpu/start.c | 9 + arch/sandbox/dts/sandbox.dtsi | 4 + arch/sandbox/dts/test.dts | 4 + arch/sandbox/include/asm/sdl.h | 9 + arch/sandbox/include/asm/state.h | 2 + arch/sandbox/include/asm/test.h | 17 ++ arch/x86/dts/efi-x86_app.dts | 4 + cmd/Kconfig | 9 + cmd/Makefile | 1 + cmd/mouse.c | 69 ++++++ configs/qemu-x86_64_defconfig | 3 + configs/qemu-x86_defconfig | 3 + configs/tools-only_defconfig | 2 +- drivers/input/Kconfig | 29 +++ drivers/input/Makefile | 7 + drivers/input/efi_mouse.c | 221 +++++++++++++++++++ drivers/input/mouse-uclass.c | 72 +++++++ drivers/input/sandbox_mouse.c | 84 ++++++++ drivers/input/usb_mouse.c | 353 +++++++++++++++++++++++++++++++ include/dm/uclass-id.h | 1 + include/efi.h | 1 + include/efi_api.h | 29 +++ include/membuf.h | 17 +- include/mouse.h | 105 +++++++++ include/usb.h | 1 + lib/efi/device_path.c | 1 + lib/membuf.c | 8 + scripts/build-efi | 3 + scripts/build-qemu | 6 +- test/dm/Makefile | 1 + test/dm/mouse.c | 217 +++++++++++++++++++ test/lib/membuf.c | 19 ++ test/py/img/android.py | 2 +- test/py/img/armbian.py | 2 +- test/py/img/cedit.py | 2 +- test/py/img/chromeos.py | 2 +- test/py/img/common.py | 2 +- test/py/img/efi.py | 2 +- test/py/img/fedora.py | 2 +- test/py/img/localboot.py | 2 +- test/py/img/ubuntu.py | 2 +- 44 files changed, 1374 insertions(+), 13 deletions(-) create mode 100644 cmd/mouse.c create mode 100644 drivers/input/efi_mouse.c create mode 100644 drivers/input/mouse-uclass.c create mode 100644 drivers/input/sandbox_mouse.c create mode 100644 drivers/input/usb_mouse.c create mode 100644 include/mouse.h create mode 100644 test/dm/mouse.c