Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/807716/?format=api
{ "id": 807716, "url": "http://patchwork.ozlabs.org/api/patches/807716/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170830083135.9183-3-tuomas.tynkkynen@iki.fi/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/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, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170830083135.9183-3-tuomas.tynkkynen@iki.fi>", "list_archive_url": null, "date": "2017-08-30T08:31:35", "name": "[U-Boot,2/2] ARM: Add a new arch + board for QEMU's 'virt' machine", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "07eb958d63e82457be1ed1768ebc185f3df21ca7", "submitter": { "id": 32296, "url": "http://patchwork.ozlabs.org/api/people/32296/?format=api", "name": "Tuomas Tynkkynen", "email": "tuomas.tynkkynen@iki.fi" }, "delegate": { "id": 3651, "url": "http://patchwork.ozlabs.org/api/users/3651/?format=api", "username": "trini", "first_name": "Tom", "last_name": "Rini", "email": "trini@ti.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20170830083135.9183-3-tuomas.tynkkynen@iki.fi/mbox/", "series": [ { "id": 650, "url": "http://patchwork.ozlabs.org/api/series/650/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=650", "date": "2017-08-30T08:31:33", "name": "Board for QEMU's '-machine virt' on ARM", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/650/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/807716/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/807716/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"SRXEBZvX\"; dkim-atps=neutral" ], "Received": [ "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xjBJ46TqLz9sNn\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 02:47:32 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid A01A8C21F57; Wed, 30 Aug 2017 16:45:08 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 343BBC226D3;\n\tWed, 30 Aug 2017 16:44:23 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid 236B0C21E16; Wed, 30 Aug 2017 08:32:10 +0000 (UTC)", "from mail-lf0-f65.google.com (mail-lf0-f65.google.com\n\t[209.85.215.65])\n\tby lists.denx.de (Postfix) with ESMTPS id E37EAC21E11\n\tfor <u-boot@lists.denx.de>; Wed, 30 Aug 2017 08:32:08 +0000 (UTC)", "by mail-lf0-f65.google.com with SMTP id o124so3485592lfo.1\n\tfor <u-boot@lists.denx.de>; Wed, 30 Aug 2017 01:32:08 -0700 (PDT)", "from duuni.srv.tuxera.com ([194.100.106.190])\n\tby smtp.gmail.com with ESMTPSA id\n\t10sm991637ljn.38.2017.08.30.01.32.07\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 30 Aug 2017 01:32:07 -0700 (PDT)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=peNSritzLVd2oDFu1ad6oK8k7t1WXLA6j8dKDkzU2RY=;\n\tb=SRXEBZvXILt0/Zr0Y038QCmCERv4lh+7HdMQKp6W8a2F73MmEGwu71K+5szhaiV1dZ\n\tXFQ3fGWs+to04zRRDPshjfzvKuGAChqC2tOQjbYEQGLXtsh60qx572k3RAj5NHV1Gd1E\n\te62i1MksBqEdQDh7nELflzTqF7YQ72WlCnb58GAzQrRkzemARApFLF6C/Uos+Sx5VgXk\n\txxL1upISoATGr86bZeGBTI/SSfhA09XhWurg64vYg1FD/KIce5Ljn5aNvibVf154EiRr\n\t9NNFLZd96DTM4tbrPpUSf+sJs6gO7wrPqt8FodtqsTWJnvynkk6fMWkswKHDxPERpjO+\n\tK1ZA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:from:to:cc:subject:date:message-id\n\t:in-reply-to:references;\n\tbh=peNSritzLVd2oDFu1ad6oK8k7t1WXLA6j8dKDkzU2RY=;\n\tb=RGXT7COyKtDFg5eSjRivusx3pfBUlouCicw1Ai/skDVpwR21fK0uaTTKIGcFgwdKW+\n\tepL/uqLw2JuUdM2hHBMOmOizT6kSoc0gGZiqoLln/YG/eOlTu0iPXF8NFKDEvUZhtjXv\n\t0Dg97alX1GzC3pAUVSztWf4OrjGT2/jd80xt/jLLgHWcvufXlI5BzepKUrNubIhKiIWP\n\t28glXBB5zX/1N+DCIMq6PGKJ8fsumyMT0XQpST/ihj13B4Ga+zQ/rtFt5y37RyFbtIh/\n\tzCH1thzidPmTheSzq5ypvXqxTXtcpx78xcu5lUIzezlx3lPr/y6TZex9zQjqSSae+xUj\n\t8Kbg==", "X-Gm-Message-State": "AHYfb5ihaFlkF4iyPEdkctHdR3qnUDj21fkLIu3yqr14ILGV5vFsz+3k\n\tdhs+5WenSFEARid4", "X-Received": "by 10.46.68.201 with SMTP id b70mr437831ljf.82.1504081928093;\n\tWed, 30 Aug 2017 01:32:08 -0700 (PDT)", "From": "Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>", "To": "u-boot@lists.denx.de", "Date": "Wed, 30 Aug 2017 11:31:35 +0300", "Message-Id": "<20170830083135.9183-3-tuomas.tynkkynen@iki.fi>", "X-Mailer": "git-send-email 2.13.0", "In-Reply-To": "<20170830083135.9183-1-tuomas.tynkkynen@iki.fi>", "References": "<20170830083135.9183-1-tuomas.tynkkynen@iki.fi>", "X-Mailman-Approved-At": "Wed, 30 Aug 2017 16:44:19 +0000", "Cc": "Tom Rini <trini@konsulko.com>", "Subject": "[U-Boot] [PATCH 2/2] ARM: Add a new arch + board for QEMU's 'virt'\n\tmachine", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.18", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<http://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\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>" }, "content": "This board builds an U-Boot binary that is bootable with QEMU's 'virt'\nmachine on ARM. The minimal QEMU command line is:\n\n qemu-system-arm -machine virt,highmem=off -bios u-boot.bin\n\n(Note that the 'highmem=off' parameter to the 'virt' machine is required for\nPCI to work in U-Boot.) This command line enables the following:\n - u-boot.bin loaded and executing in the emulated flash at address 0x0\n - A generated device tree blob placed at the start of RAM\n - A freely configurable amount of RAM, described by the DTB\n - A PL011 serial port, discoverable via the DTB\n - An ARMv7 architected timer\n - PSCI for rebooting the system\n - A generic ECAM-based PCI host controller, discoverable via the DTB\n\nAdditionally, QEMU allows plugging a bunch of useful peripherals to the PCI bus.\nThe following ones are supported by both U-Boot and Linux:\n\n- To enable a Serial ATA disk via an Intel ICH9 AHCI controller, pass e.g.:\n -drive if=none,file=disk.img,id=mydisk -device ich9-ahci,id=ahci -device ide-drive,drive=mydisk,bus=ahci.0\n- To enable an Intel E1000 network adapter, pass e.g.:\n -net nic,model=e1000 -net user\n- To add an EHCI-compliant USB host controller, pass e.g.:\n -device usb-ehci,id=ehci\n\nSigned-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>\n---\n arch/arm/Kconfig | 10 ++++++++\n arch/arm/mach-qemu/Kconfig | 9 +++++++\n board/qemu-arm/Makefile | 5 ++++\n board/qemu-arm/qemu-arm.c | 35 ++++++++++++++++++++++++++\n configs/qemu_arm_defconfig | 27 ++++++++++++++++++++\n include/configs/qemu-arm.h | 63 ++++++++++++++++++++++++++++++++++++++++++++++\n 6 files changed, 149 insertions(+)\n create mode 100644 arch/arm/mach-qemu/Kconfig\n create mode 100644 board/qemu-arm/Makefile\n create mode 100644 board/qemu-arm/qemu-arm.c\n create mode 100644 configs/qemu_arm_defconfig\n create mode 100644 include/configs/qemu-arm.h", "diff": "diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig\nindex 53d0831935..0d01ba1b73 100644\n--- a/arch/arm/Kconfig\n+++ b/arch/arm/Kconfig\n@@ -630,6 +630,14 @@ config ARCH_MX5\n \tselect CPU_V7\n \tselect BOARD_EARLY_INIT_F\n \n+config ARCH_QEMU\n+\tbool \"QEMU Virtual Platform\"\n+\tselect CPU_V7\n+\tselect ARCH_SUPPORT_PSCI\n+\tselect DM\n+\tselect DM_SERIAL\n+\tselect OF_CONTROL\n+\n config ARCH_RMOBILE\n \tbool \"Renesas ARM SoCs\"\n \tselect DM\n@@ -1149,6 +1157,8 @@ source \"arch/arm/mach-stm32/Kconfig\"\n \n source \"arch/arm/mach-sunxi/Kconfig\"\n \n+source \"arch/arm/mach-qemu/Kconfig\"\n+\n source \"arch/arm/mach-tegra/Kconfig\"\n \n source \"arch/arm/mach-uniphier/Kconfig\"\ndiff --git a/arch/arm/mach-qemu/Kconfig b/arch/arm/mach-qemu/Kconfig\nnew file mode 100644\nindex 0000000000..89d2a36719\n--- /dev/null\n+++ b/arch/arm/mach-qemu/Kconfig\n@@ -0,0 +1,9 @@\n+if ARCH_QEMU\n+\n+config SYS_BOARD\n+\tdefault \"qemu-arm\"\n+\n+config SYS_CONFIG_NAME\n+\tdefault \"qemu-arm\"\n+\n+endif\ndiff --git a/board/qemu-arm/Makefile b/board/qemu-arm/Makefile\nnew file mode 100644\nindex 0000000000..3e9907d983\n--- /dev/null\n+++ b/board/qemu-arm/Makefile\n@@ -0,0 +1,5 @@\n+#\n+# SPDX-License-Identifier:\tGPL-2.0\n+#\n+\n+obj-y\t+= qemu-arm.o\ndiff --git a/board/qemu-arm/qemu-arm.c b/board/qemu-arm/qemu-arm.c\nnew file mode 100644\nindex 0000000000..90d7badbf4\n--- /dev/null\n+++ b/board/qemu-arm/qemu-arm.c\n@@ -0,0 +1,35 @@\n+/*\n+ * Copyright (c) 2017 Tuomas Tynkkynen\n+ *\n+ * SPDX-License-Identifier:\tGPL-2.0+\n+ */\n+#include <common.h>\n+#include <fdtdec.h>\n+\n+DECLARE_GLOBAL_DATA_PTR;\n+\n+int board_init(void)\n+{\n+\treturn 0;\n+}\n+\n+int dram_init(void)\n+{\n+\tif (fdtdec_setup_memory_size() != 0)\n+\t\treturn -EINVAL;\n+\n+\treturn 0;\n+}\n+\n+int dram_init_banksize(void)\n+{\n+\tfdtdec_setup_memory_banksize();\n+\n+\treturn 0;\n+}\n+\n+void *board_fdt_blob_setup(void)\n+{\n+\t/* QEMU loads a generated DTB for us at the start of RAM. */\n+\treturn (void *)CONFIG_SYS_SDRAM_BASE;\n+}\ndiff --git a/configs/qemu_arm_defconfig b/configs/qemu_arm_defconfig\nnew file mode 100644\nindex 0000000000..d34512dd0d\n--- /dev/null\n+++ b/configs/qemu_arm_defconfig\n@@ -0,0 +1,27 @@\n+CONFIG_ARM=y\n+CONFIG_ARM_SMCCC=y\n+CONFIG_ARCH_QEMU=y\n+CONFIG_AHCI=y\n+CONFIG_DISTRO_DEFAULTS=y\n+# CONFIG_DISPLAY_CPUINFO is not set\n+# CONFIG_DISPLAY_BOARDINFO is not set\n+# CONFIG_CMD_IMLS is not set\n+CONFIG_CMD_PCI=y\n+CONFIG_CMD_USB=y\n+CONFIG_OF_BOARD=y\n+CONFIG_AHCI_PCI=y\n+CONFIG_BLK=y\n+# CONFIG_MMC is not set\n+CONFIG_DM_ETH=y\n+CONFIG_E1000=y\n+CONFIG_PCI=y\n+CONFIG_DM_PCI=y\n+CONFIG_PCIE_ECAM_GENERIC=y\n+CONFIG_SCSI=y\n+CONFIG_DM_SCSI=y\n+CONFIG_SYSRESET=y\n+CONFIG_SYSRESET_PSCI=y\n+CONFIG_USB=y\n+CONFIG_DM_USB=y\n+CONFIG_USB_EHCI_HCD=y\n+CONFIG_USB_EHCI_PCI=y\ndiff --git a/include/configs/qemu-arm.h b/include/configs/qemu-arm.h\nnew file mode 100644\nindex 0000000000..2bcc0efad0\n--- /dev/null\n+++ b/include/configs/qemu-arm.h\n@@ -0,0 +1,63 @@\n+/*\n+ * Copyright (c) 2017 Tuomas Tynkkynen\n+ *\n+ * SPDX-License-Identifier:\tGPL-2.0+\n+ */\n+\n+#ifndef __CONFIG_H\n+#define __CONFIG_H\n+\n+#include <linux/sizes.h>\n+\n+/* Physical memory map */\n+#define CONFIG_SYS_TEXT_BASE\t\t0x00000000\n+\n+#define CONFIG_NR_DRAM_BANKS\t\t1\n+#define CONFIG_SYS_SDRAM_BASE\t\t0x40000000\n+\n+/* The DTB generated by QEMU is placed at start of RAM, stay away from there */\n+#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_2M)\n+#define CONFIG_SYS_LOAD_ADDR\t\t(CONFIG_SYS_SDRAM_BASE + SZ_2M)\n+#define CONFIG_SYS_MALLOC_LEN\t\tSZ_16M\n+\n+/* QEMU's PL011 serial port is detected via FDT using the device model */\n+#define CONFIG_PL01X_SERIAL\n+\n+/* QEMU implements a 62.5MHz architected timer */\n+/* FIXME: can we rely on CNTFREQ instead of hardcoding this fact here? */\n+#define CONFIG_SYS_ARCH_TIMER\n+#define CONFIG_SYS_HZ 1000\n+#define CONFIG_SYS_HZ_CLOCK 62500000\n+\n+/* Command prompt options */\n+#define CONFIG_SYS_CBSIZE\t\t512\t/* Console I/O Buffer Size */\n+#define CONFIG_SYS_PBSIZE\t\t(CONFIG_SYS_CBSIZE + \\\n+\t\t\t\t\tsizeof(CONFIG_SYS_PROMPT) + 16)\n+#define CONFIG_SYS_BARGSIZE\t\tCONFIG_SYS_CBSIZE\n+#define CONFIG_SYS_MAXARGS\t\t64\t/* max command args */\n+\n+/* For block devices, QEMU emulates an ICH9 AHCI controller over PCI */\n+#define CONFIG_SYS_SCSI_MAX_SCSI_ID 8\n+#define CONFIG_SCSI_AHCI\n+#define CONFIG_LIBATA\n+\n+/* Environment options */\n+#define CONFIG_ENV_SIZE\t\t\t\tSZ_64K\n+\n+#include <config_distro_defaults.h>\n+\n+#define BOOT_TARGET_DEVICES(func) \\\n+\tfunc(SCSI, scsi, 0)\n+\n+#include <config_distro_bootcmd.h>\n+\n+#define CONFIG_PREBOOT \"pci enum\"\n+#define CONFIG_EXTRA_ENV_SETTINGS \\\n+\t\"fdt_addr=0x40000000\\0\" \\\n+\t\"scriptaddr=0x40200000\\0\" \\\n+\t\"pxefile_addr_r=0x40300000\\0\" \\\n+\t\"kernel_addr_r=0x40400000\\0\" \\\n+\t\"ramdisk_addr_r=0x44000000\\0\" \\\n+\tBOOTENV\n+\n+#endif /* __CONFIG_H */\n", "prefixes": [ "U-Boot", "2/2" ] }