Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2175709/?format=api
{ "id": 2175709, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2175709/?format=api", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/1.0/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null }, "msgid": "<20251218185252.957388-4-visitorckw@gmail.com>", "date": "2025-12-18T18:52:52", "name": "[3/3] board: Add QEMU m68k virt board support", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "40ec575d64bcada419f91392c4d0dd8b5c6a0c8c", "submitter": { "id": 87364, "url": "http://patchwork.ozlabs.org/api/1.0/people/87364/?format=api", "name": "Kuan-Wei Chiu", "email": "visitorckw@gmail.com" }, "delegate": { "id": 3651, "url": "http://patchwork.ozlabs.org/api/1.0/users/3651/?format=api", "username": "trini", "first_name": "Tom", "last_name": "Rini", "email": "trini@ti.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20251218185252.957388-4-visitorckw@gmail.com/mbox/", "series": [ { "id": 485900, "url": "http://patchwork.ozlabs.org/api/1.0/series/485900/?format=api", "date": "2025-12-18T18:52:49", "name": "m68k: Add support for QEMU virt machine", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/485900/mbox/" } ], "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2175709/checks/", "tags": {}, "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20230601 header.b=EU90k2Ee;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de", "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.b=\"EU90k2Ee\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "phobos.denx.de;\n spf=pass smtp.mailfrom=visitorckw@gmail.com" ], "Received": [ "from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4dXKs0710Xz1xty\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 19 Dec 2025 06:06:28 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 166DD83734;\n\tThu, 18 Dec 2025 20:05:58 +0100 (CET)", "by phobos.denx.de (Postfix, from userid 109)\n id A1FFA800AB; Thu, 18 Dec 2025 19:53:35 +0100 (CET)", "from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com\n [IPv6:2607:f8b0:4864:20::102e])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 480CA8003E\n for <u-boot@lists.denx.de>; Thu, 18 Dec 2025 19:53:33 +0100 (CET)", "by mail-pj1-x102e.google.com with SMTP id\n 98e67ed59e1d1-34be2be4b7cso681045a91.3\n for <u-boot@lists.denx.de>; Thu, 18 Dec 2025 10:53:33 -0800 (PST)", "from visitorckw-work01.c.googlers.com.com\n (25.118.81.34.bc.googleusercontent.com. [34.81.118.25])\n by smtp.gmail.com with ESMTPSA id\n 98e67ed59e1d1-34e70d65653sm3136275a91.5.2025.12.18.10.53.29\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 18 Dec 2025 10:53:31 -0800 (PST)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20230601; t=1766084012; x=1766688812; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=nLtlbXtUwx7TwQOkOrSQlwTN8yGlnIs4PVkEFEMKuMg=;\n b=EU90k2EeWo6OYAWl9J98QykBLumRZ7/x96KuZH5wmOrQd9qqOYYIpWwOywMbTHXyc2\n Axk6wkFaRx4tHZ7RfUsoBODl447FEknmpKZ3kdhTj3bh0IuVpHo1tJ+nYBbCG1VX5+hv\n SYrMZfYtZ80Q8/K0uBo3m22WtDcMHNEayOmAjcgXQRlJBHAiazf2BKMScpNANV3wj+mD\n nNcV1OrGCx3yMknIYtD7XTAQ0UcN64rvvLKvuIHMtO/Ddl3YIxOA5Ll9OHjTCd/g3gsU\n aIV/UNoHOo937w9tiQS4Z2HaWqxUU9BsqePfDL9zZMkGBIAWI/2xt4JkEyvJPZcHceKa\n BCmQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1766084012; x=1766688812;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=nLtlbXtUwx7TwQOkOrSQlwTN8yGlnIs4PVkEFEMKuMg=;\n b=LZNdjxUKX1D1PISzsjnDwSTLJ3gaYM23kebLzj4x158Is81zpwrzSB+awL+nLmZPMb\n 6FaLgq4Igfk3NxJS7Rg60Cvam3ZDgpL1vJm+uKfKuiFOfkXTdfw/tQdhPr/7tCFw8ben\n jIaBM2GQKjzwEh26wMjar4ZbHFgTlbqD/eKXEeu44/2PFCHlpTkd2fZ1VztOTbi4ZZO4\n 5hrqAZwkanfcjcRsZb0xWAO2NDBRE1VbldQvu3bjOrO2uCfqKLSLJLkRxkgBvMBYzeZk\n IuvNdxhlFNPBTG85ASkAfzMFWOX2FsucGuz3CqNF8SZCLkwaya+M77o95xCJCj+ytroL\n xPZg==", "X-Forwarded-Encrypted": "i=1;\n AJvYcCVw09Df3+hoLHXZYCaCp49M3h5J4ievOzvkcDSh0xCNTqchGLwltwafUyz7elDBWGQRdbBuzO4=@lists.denx.de", "X-Gm-Message-State": "AOJu0YwSk1YwKMj7318ra7XRIJ6e9GFITMst/crwLFz0TzKp1ryptA18\n JlZu8KoTatHuYaHQd8c/d1g5f+dpLCC+h3s8jYAFTuQP40Y+XJhZqePb", "X-Gm-Gg": "AY/fxX5rt4mC2AMwZeX14rhXO4wlYPmDHOZJYsliLYJxR54O9MfTDLent3Rbx4qKIdR\n AeAGjBDjldT2mfrP+MYcbgWsVUCouFc7saU2Dsq3mJ/Wn0tRQKYIUqjo9q5FEXEaheHjahiwC6Q\n XH7zeM7ad2bH39x7FHwnHJ/RgzEDRGNfTeTlKBibmpDF9HIkZmpcG/QzUpFZBWs5Hp0Gj0DHre3\n V43Bj44dm1JBINg9G3ZeufxVOw/trnF8IzyMe+JjjDJZADoyDBd3aC0TfWHRTBVQIhQ8hEEmF1l\n KrtwH+fAleBdJwNrIkiBSGcZNvERfDwsyKjvBIkqsSFfyuJCry7Hk1EJ0ws9FQRWI8S64frzUFh\n 7wZETxWsLOce52TCnh21T65buCKSahg7HHF06WdAFnhY7F+Z31aYfOYgU4lKbIj5bI1yF2yukWL\n 0new36CSckajqyem8MgJpShrsVYoDnmG6kUk3lQMQ4lPpSaqR6xJZX0gpryAhnrNtNTDuGtPmm1\n VRNSCdl+dUoPUWRBTM2yQ==", "X-Google-Smtp-Source": "\n AGHT+IHonXkpuObOZf1WcyiU49TdnKxvZrW/1jpuDzlmJovPu7sCaoisN+rDY6hEYvJRuhIb0bGdVg==", "X-Received": "by 2002:a17:90b:37c3:b0:340:be4d:a718 with SMTP id\n 98e67ed59e1d1-34e92113213mr314922a91.7.1766084011571;\n Thu, 18 Dec 2025 10:53:31 -0800 (PST)", "From": "Kuan-Wei Chiu <visitorckw@gmail.com>", "To": "alison.wang@nxp.com,\n\tangelo@kernel-space.org", "Cc": "trini@konsulko.com, jserv@ccns.ncku.edu.tw, eleanor15x@gmail.com,\n u-boot@lists.denx.de, Kuan-Wei Chiu <visitorckw@gmail.com>", "Subject": "[PATCH 3/3] board: Add QEMU m68k virt board support", "Date": "Thu, 18 Dec 2025 18:52:52 +0000", "Message-ID": "<20251218185252.957388-4-visitorckw@gmail.com>", "X-Mailer": "git-send-email 2.52.0.322.g1dd061c0dc-goog", "In-Reply-To": "<20251218185252.957388-1-visitorckw@gmail.com>", "References": "<20251218185252.957388-1-visitorckw@gmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Mailman-Approved-At": "Thu, 18 Dec 2025 20:05:51 +0100", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.39", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>", "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de", "X-Virus-Status": "Clean" }, "content": "Add support for the QEMU 'virt' machine on the m68k architecture. This\nboard emulates a generic machine based on the Motorola 68040 CPU\nequipped with Goldfish virtual peripherals.\n\nIntroduce the necessary board configuration and initialization\ninfrastructure. The implementation includes logic to parse the QEMU\nbootinfo interface, enabling dynamic detection of system RAM size to\nadapt to the virtual machine's configuration.\n\nEnable the Goldfish TTY driver to provide a serial console, which\nfacilitates interaction when running QEMU with the -nographic option.\nAdditionally, include comprehensive documentation covering build\ninstructions and usage examples to guide users in deploying U-Boot\nwithin the virtualization environment.\n\nSigned-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>\n---\n arch/m68k/Kconfig | 8 +++\n board/emulation/qemu-m68k/Kconfig | 12 ++++\n board/emulation/qemu-m68k/MAINTAINERS | 10 ++++\n board/emulation/qemu-m68k/Makefile | 5 ++\n board/emulation/qemu-m68k/qemu-m68k.c | 84 +++++++++++++++++++++++++++\n configs/qemu-m68k_defconfig | 17 ++++++\n doc/board/emulation/qemu-m68k.rst | 38 ++++++++++++\n include/configs/qemu-m68k.h | 18 ++++++\n 8 files changed, 192 insertions(+)\n create mode 100644 board/emulation/qemu-m68k/Kconfig\n create mode 100644 board/emulation/qemu-m68k/MAINTAINERS\n create mode 100644 board/emulation/qemu-m68k/Makefile\n create mode 100644 board/emulation/qemu-m68k/qemu-m68k.c\n create mode 100644 configs/qemu-m68k_defconfig\n create mode 100644 doc/board/emulation/qemu-m68k.rst\n create mode 100644 include/configs/qemu-m68k.h", "diff": "diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig\nindex a41c375f6be..afc21dc2bc3 100644\n--- a/arch/m68k/Kconfig\n+++ b/arch/m68k/Kconfig\n@@ -179,6 +179,13 @@ config TARGET_STMARK2\n select CF_DSPI\n select M54418\n \n+config TARGET_QEMU_M68K\n+ bool \"Support QEMU m68k virt\"\n+ select M68040\n+ help\n+ This target supports the QEMU m68k virtual machine (-M virt).\n+ It simulates a Motorola 68040 CPU with Goldfish peripherals.\n+\n endchoice\n \n config SYS_CPU\n@@ -207,6 +214,7 @@ source \"board/freescale/m5329evb/Kconfig\"\n source \"board/freescale/m5373evb/Kconfig\"\n source \"board/sysam/amcore/Kconfig\"\n source \"board/sysam/stmark2/Kconfig\"\n+source \"board/emulation/qemu-m68k/Kconfig\"\n \n config M68K_QEMU\n \tbool \"Build with workarounds for incomplete QEMU emulation\"\ndiff --git a/board/emulation/qemu-m68k/Kconfig b/board/emulation/qemu-m68k/Kconfig\nnew file mode 100644\nindex 00000000000..e4001d67288\n--- /dev/null\n+++ b/board/emulation/qemu-m68k/Kconfig\n@@ -0,0 +1,12 @@\n+if TARGET_QEMU_M68K\n+\n+config SYS_BOARD\n+ default \"qemu-m68k\"\n+\n+config SYS_VENDOR\n+ default \"emulation\"\n+\n+config SYS_CONFIG_NAME\n+ default \"qemu-m68k\"\n+\n+endif\ndiff --git a/board/emulation/qemu-m68k/MAINTAINERS b/board/emulation/qemu-m68k/MAINTAINERS\nnew file mode 100644\nindex 00000000000..c2f4cc40a56\n--- /dev/null\n+++ b/board/emulation/qemu-m68k/MAINTAINERS\n@@ -0,0 +1,10 @@\n+QEMU M68K VIRT BOARD\n+M: Kuan-Wei Chiu <visitorckw@gmail.com>\n+S: Maintained\n+F: board/emulation/qemu-m68k/\n+F: board/emulation/common/\n+F: include/configs/qemu-m68k.h\n+F: configs/qemu-m68k_defconfig\n+F: arch/m68k/cpu/m68040/\n+F: arch/m68k/include/asm/bootinfo.h\n+F: doc/board/emulation/qemu-m68k.rst\ndiff --git a/board/emulation/qemu-m68k/Makefile b/board/emulation/qemu-m68k/Makefile\nnew file mode 100644\nindex 00000000000..036b7596c18\n--- /dev/null\n+++ b/board/emulation/qemu-m68k/Makefile\n@@ -0,0 +1,5 @@\n+# SPDX-License-Identifier: GPL-2.0+\n+#\n+# Copyright (C) 2025, Kuan-Wei Chiu <visitorckw@gmail.com>\n+\n+obj-y += qemu-m68k.o\ndiff --git a/board/emulation/qemu-m68k/qemu-m68k.c b/board/emulation/qemu-m68k/qemu-m68k.c\nnew file mode 100644\nindex 00000000000..92da828eed3\n--- /dev/null\n+++ b/board/emulation/qemu-m68k/qemu-m68k.c\n@@ -0,0 +1,84 @@\n+// SPDX-License-Identifier: GPL-2.0+\n+/*\n+ * Copyright (C) 2025, Kuan-Wei Chiu <visitorckw@gmail.com>\n+ */\n+\n+#include <config.h>\n+#include <init.h>\n+#include <asm/global_data.h>\n+#include <asm-generic/sections.h>\n+#include <linux/errno.h>\n+#include <asm/io.h>\n+#include <dm/platdata.h>\n+#include <serial.h>\n+#include <goldfish_tty.h>\n+#include <asm/bootinfo.h>\n+\n+DECLARE_GLOBAL_DATA_PTR;\n+\n+/* QEMU Virt Machine Hardware Map */\n+#define VIRT_GF_TTY_MMIO_BASE 0xff008000\n+#define VIRT_CTRL_MMIO_BASE 0xff009000\n+#define VIRT_CTRL_RESET 0x01\n+\n+int board_early_init_f(void)\n+{\n+\treturn 0;\n+}\n+\n+int checkboard(void)\n+{\n+\tputs(\"Board: QEMU m68k virt\\n\");\n+\treturn 0;\n+}\n+\n+int dram_init(void)\n+{\n+\tstruct bi_record *record;\n+\tulong addr;\n+\n+\t/* Default: 16MB */\n+\tgd->ram_size = 0x01000000;\n+\n+\t/* QEMU places bootinfo after _end, aligned to 2 bytes */\n+\taddr = (ulong)&_end;\n+\tif (addr & 1)\n+\t\taddr++;\n+\n+\trecord = (struct bi_record *)addr;\n+\n+\tif (record->tag != BI_MACHTYPE)\n+\t\treturn 0;\n+\n+\twhile (record->tag != BI_LAST) {\n+\t\tif (record->tag == BI_MEMCHUNK) {\n+\t\t\tgd->ram_size = record->data[1];\n+\t\t\tbreak;\n+\t\t}\n+\t\trecord = (struct bi_record *)((ulong)record + record->size);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+void reset_cpu(unsigned long addr)\n+{\n+\twritel(VIRT_CTRL_RESET, VIRT_CTRL_MMIO_BASE);\n+\twhile (1)\n+\t\t;\n+}\n+\n+int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])\n+{\n+\treset_cpu(0);\n+\treturn 0;\n+}\n+\n+static const struct goldfish_tty_plat serial_plat = {\n+\t.base = (void __iomem *)VIRT_GF_TTY_MMIO_BASE,\n+};\n+\n+U_BOOT_DRVINFO(goldfish_serial) = {\n+\t.name = \"serial_goldfish\",\n+\t.plat = &serial_plat,\n+};\ndiff --git a/configs/qemu-m68k_defconfig b/configs/qemu-m68k_defconfig\nnew file mode 100644\nindex 00000000000..765ed9b7424\n--- /dev/null\n+++ b/configs/qemu-m68k_defconfig\n@@ -0,0 +1,17 @@\n+CONFIG_M68K=y\n+CONFIG_TARGET_QEMU_M68K=y\n+CONFIG_TEXT_BASE=0x00000000\n+CONFIG_SYS_LOAD_ADDR=0x00000000\n+CONFIG_SYS_MONITOR_LEN=262144\n+CONFIG_SYS_BOOTM_LEN=0x1000000\n+CONFIG_SYS_MALLOC_LEN=0x20000\n+# CONFIG_DISPLAY_BOARDINFO is not set\n+CONFIG_BAUDRATE=115200\n+\n+# CONFIG_OF_CONTROL is not set\n+CONFIG_DM=y\n+CONFIG_DM_SERIAL=y\n+CONFIG_SERIAL_GOLDFISH=y\n+CONFIG_SYS_MALLOC_F_LEN=0x2000\n+CONFIG_SYS_LDSCRIPT=\"arch/m68k/cpu/m68040/u-boot.lds\"\n+CONFIG_BOARD_EARLY_INIT_F=y\ndiff --git a/doc/board/emulation/qemu-m68k.rst b/doc/board/emulation/qemu-m68k.rst\nnew file mode 100644\nindex 00000000000..19898e17cfc\n--- /dev/null\n+++ b/doc/board/emulation/qemu-m68k.rst\n@@ -0,0 +1,38 @@\n+.. SPDX-License-Identifier: GPL-2.0+\n+.. Copyright (C) 2025, Kuan-Wei Chiu <visitorckw@gmail.com>\n+\n+QEMU m68k\n+=========\n+\n+QEMU for m68k supports a special 'virt' machine designed for emulation and\n+virtualization purposes. This document describes how to run U-Boot under it.\n+\n+The QEMU virt machine models a generic m68k virtual machine with Goldfish\n+interfaces. It supports the Motorola 68040 CPU architecture.\n+\n+Building U-Boot\n+---------------\n+Set the CROSS_COMPILE environment variable to your m68k toolchain, and run:\n+\n+.. code-block:: bash\n+\n+ export CROSS_COMPILE=m68k-linux-gnu-\n+ make qemu-m68k_defconfig\n+ make\n+\n+Running U-Boot\n+--------------\n+The minimal QEMU command line to get U-Boot up and running is:\n+\n+.. code-block:: bash\n+\n+ qemu-system-m68k -M virt -cpu m68040 -nographic -kernel u-boot\n+\n+Note that the `-nographic` option is used to redirect the console to stdio,\n+which connects to the emulated Goldfish TTY device.\n+\n+Hardware Support\n+----------------\n+The following QEMU virt peripherals are supported in U-Boot:\n+\n+* Goldfish TTY (Serial Console)\ndiff --git a/include/configs/qemu-m68k.h b/include/configs/qemu-m68k.h\nnew file mode 100644\nindex 00000000000..90f59c7b850\n--- /dev/null\n+++ b/include/configs/qemu-m68k.h\n@@ -0,0 +1,18 @@\n+/* SPDX-License-Identifier: GPL-2.0+ */\n+/*\n+ * Copyright (C) 2025, Kuan-Wei Chiu <visitorckw@gmail.com>\n+ */\n+\n+#ifndef __QEMU_M68K_H\n+#define __QEMU_M68K_H\n+\n+/* Memory Configuration */\n+#define CFG_SYS_SDRAM_BASE 0x00000000\n+\n+/*\n+ * Initial Stack Pointer:\n+ * Place the stack at 4MB offset to avoid overwriting U-Boot code/data.\n+ */\n+#define CFG_SYS_INIT_SP_ADDR (CFG_SYS_SDRAM_BASE + 0x400000)\n+\n+#endif /* __QEMU_M68K_H */\n", "prefixes": [ "3/3" ] }