From patchwork Thu Jul 18 07:34:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1133604 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BbKlXPDM"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45q62M1KGWz9s00 for ; Thu, 18 Jul 2019 17:58:19 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id DD8CDC2200A; Thu, 18 Jul 2019 07:46:43 +0000 (UTC) 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=FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8BFAFC21FBC; Thu, 18 Jul 2019 07:35:54 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id CB275C21F45; Thu, 18 Jul 2019 07:35:26 +0000 (UTC) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by lists.denx.de (Postfix) with ESMTPS id 22528C21F48 for ; Thu, 18 Jul 2019 07:35:19 +0000 (UTC) Received: by mail-pl1-f179.google.com with SMTP id c2so13384739plz.13 for ; Thu, 18 Jul 2019 00:35:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=/Zal6wnpDno7w9nJwGjqUY6KU8VeD0prIqEd4PvEVh8=; b=BbKlXPDMWLpRL8RhpaldNImclNJPZE+lyY3Imk/kG2h/iQ3PhG0oI3nocKSkg28Hro pJdOMn6mEvm4foTK1tP3yWKta9nTVnbvCjZekuBMmE2u6KHR5+5Zy0Cto7WdcvIQulKW XVgOp6MDXOvE5GBVkMaqs5eBhzsLKbk9Jeflgt13M9w9sogKpHB227qe5VARMG8kuLmk ITPKz9An4h0Qp3AE312NGiCYSBe7Vi30kn4sclVcRrsAirFjWSralO94zHHOY69+3vPM VaGSnfdf7ZP28qVf45GoqbVtBrh3FP8HaZk4oELB7FwTTUtFtus+I9s/dG6AFbSHarUY aygA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=/Zal6wnpDno7w9nJwGjqUY6KU8VeD0prIqEd4PvEVh8=; b=onV6eG5B+Wv0cgwMzrrwJY/sWZ7N5wKM0ovVlCFSr4GcU5wzZi7+wF4nBe4Oz2D6Yq blWJIZob1GYXH/i52hFLS47Q0QIzhouySo2XGyjQVxUlw6BUoWczXuuKSJ++90oq4v3/ l7ENuCWzi9DBAKnAPI7ukvZ5y9yyvl6lutg0LynnxfvC/3g+oiv6372GbBcVR7TCeiO8 /EH7pzraEx5pa7BCl1TpO6sp5Wl4r+SeK7hvnCnJ5ZO9DRvOPtzuITehEYavXrl1R1hp kAtEywJpIqCT3l/7n8yqVlc/mdbbos+nDbFYpn75AnONY1Cbpyr7/Fo2RrekjdS70JQq DuYg== X-Gm-Message-State: APjAAAVRJ5KgMmO8AU8aDFTk+4W5Ck8VwR+Jykidu4DJFDS7A4mRFLbH F/6me1PI9RkzOyy7drH+6P8= X-Google-Smtp-Source: APXvYqxe0xkOMfNwxsqPcOKCrgQRCMpt2nXISfKgZ+atBNyTsgAyo8buvTrpH3v8KwdLFgVkf1Malg== X-Received: by 2002:a17:902:d892:: with SMTP id b18mr45304552plz.165.1563435313256; Thu, 18 Jul 2019 00:35:13 -0700 (PDT) Received: from localhost.localdomain (unknown-224-80.windriver.com. [147.11.224.80]) by smtp.gmail.com with ESMTPSA id q1sm39859821pfn.178.2019.07.18.00.35.12 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 18 Jul 2019 00:35:12 -0700 (PDT) From: Bin Meng To: Tom Rini , Simon Glass , Wolfgang Denk , Heinrich Schuchardt , Mario Six , U-Boot Mailing List Date: Thu, 18 Jul 2019 00:34:14 -0700 Message-Id: <1563435275-22326-30-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1563435275-22326-1-git-send-email-bmeng.cn@gmail.com> References: <1563435275-22326-1-git-send-email-bmeng.cn@gmail.com> Subject: [U-Boot] [PATCH 29/50] doc: board: Add QEMU x86 board doc X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This extracts QEMU x86 board specific information from README.x86, converts plain text documentation to reST format and adds it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng --- doc/README.x86 | 93 ----------------------------------- doc/board/emulation/index.rst | 9 ++++ doc/board/emulation/qemu-x86.rst | 101 +++++++++++++++++++++++++++++++++++++++ doc/board/index.rst | 1 + 4 files changed, 111 insertions(+), 93 deletions(-) create mode 100644 doc/board/emulation/index.rst create mode 100644 doc/board/emulation/qemu-x86.rst diff --git a/doc/README.x86 b/doc/README.x86 index c987439..8cee320 100644 --- a/doc/README.x86 +++ b/doc/README.x86 @@ -57,99 +57,6 @@ Both tell the Makefile to build u-boot.rom as a target. --- -QEMU x86 target instructions for bare mode: - -To build u-boot.rom for QEMU x86 targets, just simply run - -$ make qemu-x86_defconfig (for 32-bit) -or -$ make qemu-x86_64_defconfig (for 64-bit) -$ make all - -Note this default configuration will build a U-Boot for the QEMU x86 i440FX -board. To build a U-Boot against QEMU x86 Q35 board, you can change the build -configuration during the 'make menuconfig' process like below: - -Device Tree Control ---> - ... - (qemu-x86_q35) Default Device Tree for DT control - -Test with QEMU for bare mode ----------------------------- -QEMU is a fancy emulator that can enable us to test U-Boot without access to -a real x86 board. Please make sure your QEMU version is 2.3.0 or above test -U-Boot. To launch QEMU with u-boot.rom, call QEMU as follows: - -$ qemu-system-i386 -nographic -bios path/to/u-boot.rom - -This will instantiate an emulated x86 board with i440FX and PIIX chipset. QEMU -also supports emulating an x86 board with Q35 and ICH9 based chipset, which is -also supported by U-Boot. To instantiate such a machine, call QEMU with: - -$ qemu-system-i386 -nographic -bios path/to/u-boot.rom -M q35 - -Note by default QEMU instantiated boards only have 128 MiB system memory. But -it is enough to have U-Boot boot and function correctly. You can increase the -system memory by pass '-m' parameter to QEMU if you want more memory: - -$ qemu-system-i386 -nographic -bios path/to/u-boot.rom -m 1024 - -This creates a board with 1 GiB system memory. Currently U-Boot for QEMU only -supports 3 GiB maximum system memory and reserves the last 1 GiB address space -for PCI device memory-mapped I/O and other stuff, so the maximum value of '-m' -would be 3072. - -QEMU emulates a graphic card which U-Boot supports. Removing '-nographic' will -show QEMU's VGA console window. Note this will disable QEMU's serial output. -If you want to check both consoles, use '-serial stdio'. - -Multicore is also supported by QEMU via '-smp n' where n is the number of cores -to instantiate. Note, the maximum supported CPU number in QEMU is 255. - -The fw_cfg interface in QEMU also provides information about kernel data, -initrd, command-line arguments and more. U-Boot supports directly accessing -these informtion from fw_cfg interface, which saves the time of loading them -from hard disk or network again, through emulated devices. To use it , simply -providing them in QEMU command line: - -$ qemu-system-i386 -nographic -bios path/to/u-boot.rom -m 1024 -kernel /path/to/bzImage - -append 'root=/dev/ram console=ttyS0' -initrd /path/to/initrd -smp 8 - -Note: -initrd and -smp are both optional - -Then start QEMU, in U-Boot command line use the following U-Boot command to -setup kernel: - - => qfw -qfw - QEMU firmware interface - -Usage: -qfw - - list : print firmware(s) currently loaded - - cpus : print online cpu number - - load : load kernel and initrd (if any) and setup for zboot - -=> qfw load -loading kernel to address 01000000 size 5d9d30 initrd 04000000 size 1b1ab50 - -Here the kernel (bzImage) is loaded to 01000000 and initrd is to 04000000. Then, -'zboot' can be used to boot the kernel: - -=> zboot 01000000 - 04000000 1b1ab50 - -To run 64-bit U-Boot, qemu-system-x86_64 should be used instead, e.g.: -$ qemu-system-x86_64 -nographic -bios path/to/u-boot.rom - -A specific CPU can be specified via the '-cpu' parameter but please make -sure the specified CPU supports 64-bit like '-cpu core2duo'. Conversely -'-cpu pentium' won't work for obvious reasons that the processor only -supports 32-bit. - -Note 64-bit support is very preliminary at this point. Lots of features -are missing in the 64-bit world. One notable feature is the VGA console -support which is currently missing, so that you must specify '-nographic' -to get 64-bit U-Boot up and running. - CPU Microcode ------------- Modern CPUs usually require a special bit stream called microcode [8] to be diff --git a/doc/board/emulation/index.rst b/doc/board/emulation/index.rst new file mode 100644 index 0000000..6d533f3 --- /dev/null +++ b/doc/board/emulation/index.rst @@ -0,0 +1,9 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +Emulation +========= + +.. toctree:: + :maxdepth: 2 + + qemu-x86 diff --git a/doc/board/emulation/qemu-x86.rst b/doc/board/emulation/qemu-x86.rst new file mode 100644 index 0000000..c2e704a --- /dev/null +++ b/doc/board/emulation/qemu-x86.rst @@ -0,0 +1,101 @@ +.. SPDX-License-Identifier: GPL-2.0+ +.. sectionauthor:: Bin Meng + +QEMU x86 +======== + +Build instructions for bare mode +-------------------------------- + +To build u-boot.rom for QEMU x86 targets, just simply run:: + + $ make qemu-x86_defconfig (for 32-bit) + $ make qemu-x86_64_defconfig (for 64-bit) + $ make all + +Note this default configuration will build a U-Boot for the QEMU x86 i440FX +board. To build a U-Boot against QEMU x86 Q35 board, you can change the build +configuration during the 'make menuconfig' process like below:: + + Device Tree Control ---> + ... + (qemu-x86_q35) Default Device Tree for DT control + +Test with QEMU for bare mode +---------------------------- + +QEMU is a fancy emulator that can enable us to test U-Boot without access to +a real x86 board. Please make sure your QEMU version is 2.3.0 or above test +U-Boot. To launch QEMU with u-boot.rom, call QEMU as follows:: + + $ qemu-system-i386 -nographic -bios path/to/u-boot.rom + +This will instantiate an emulated x86 board with i440FX and PIIX chipset. QEMU +also supports emulating an x86 board with Q35 and ICH9 based chipset, which is +also supported by U-Boot. To instantiate such a machine, call QEMU with:: + + $ qemu-system-i386 -nographic -bios path/to/u-boot.rom -M q35 + +Note by default QEMU instantiated boards only have 128 MiB system memory. But +it is enough to have U-Boot boot and function correctly. You can increase the +system memory by pass '-m' parameter to QEMU if you want more memory:: + + $ qemu-system-i386 -nographic -bios path/to/u-boot.rom -m 1024 + +This creates a board with 1 GiB system memory. Currently U-Boot for QEMU only +supports 3 GiB maximum system memory and reserves the last 1 GiB address space +for PCI device memory-mapped I/O and other stuff, so the maximum value of '-m' +would be 3072. + +QEMU emulates a graphic card which U-Boot supports. Removing '-nographic' will +show QEMU's VGA console window. Note this will disable QEMU's serial output. +If you want to check both consoles, use '-serial stdio'. + +Multicore is also supported by QEMU via '-smp n' where n is the number of cores +to instantiate. Note, the maximum supported CPU number in QEMU is 255. + +The fw_cfg interface in QEMU also provides information about kernel data, +initrd, command-line arguments and more. U-Boot supports directly accessing +these informtion from fw_cfg interface, which saves the time of loading them +from hard disk or network again, through emulated devices. To use it , simply +providing them in QEMU command line:: + + $ qemu-system-i386 -nographic -bios path/to/u-boot.rom -m 1024 \ + -kernel /path/to/bzImage -append 'root=/dev/ram console=ttyS0' \ + -initrd /path/to/initrd -smp 8 + +Note: -initrd and -smp are both optional + +Then start QEMU, in U-Boot command line use the following U-Boot command to +setup kernel:: + + => qfw + qfw - QEMU firmware interface + + Usage: + qfw + - list : print firmware(s) currently loaded + - cpus : print online cpu number + - load : load kernel and initrd (if any) and setup for zboot + + => qfw load + loading kernel to address 01000000 size 5d9d30 initrd 04000000 size 1b1ab50 + +Here the kernel (bzImage) is loaded to 01000000 and initrd is to 04000000. Then, +'zboot' can be used to boot the kernel:: + + => zboot 01000000 - 04000000 1b1ab50 + +To run 64-bit U-Boot, qemu-system-x86_64 should be used instead, e.g.:: + + $ qemu-system-x86_64 -nographic -bios path/to/u-boot.rom + +A specific CPU can be specified via the '-cpu' parameter but please make +sure the specified CPU supports 64-bit like '-cpu core2duo'. Conversely +'-cpu pentium' won't work for obvious reasons that the processor only +supports 32-bit. + +Note 64-bit support is very preliminary at this point. Lots of features +are missing in the 64-bit world. One notable feature is the VGA console +support which is currently missing, so that you must specify '-nographic' +to get 64-bit U-Boot up and running. diff --git a/doc/board/index.rst b/doc/board/index.rst index eb21a67..6d2356f 100644 --- a/doc/board/index.rst +++ b/doc/board/index.rst @@ -7,5 +7,6 @@ Board-specific doc :maxdepth: 2 coreboot/index + emulation/index google/index intel/index