All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: u-boot@lists.denx.de
Subject: [PATCH] Nokia RX-51: Update documentation about QEMU
Date: Tue,  8 Mar 2022 18:59:56 +0100	[thread overview]
Message-ID: <20220308175956.4522-1-pali@kernel.org> (raw)

Add section how to run U-Boot in n900 qemu machine.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 doc/board/nokia/rx51.rst | 47 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/doc/board/nokia/rx51.rst b/doc/board/nokia/rx51.rst
index 941f78e777ee..b297e056c4e7 100644
--- a/doc/board/nokia/rx51.rst
+++ b/doc/board/nokia/rx51.rst
@@ -160,3 +160,50 @@ UBIFS support add following lines into file ``configs/nokia_rx51_defconfig``::
     CONFIG_CMD_UBIFS=y
     CONFIG_MTD_UBI_FASTMAP=y
     CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT=1
+
+Run in QEMU
+-----------
+
+Download and compile Linaro version of qemu which contains ``n900`` qemu
+machine. Source code is available in qemu-linaro git repository and the
+last working version is at commit 8f8d8e0796efe1a6f34cdd83fb798f3c41217ec1.
+
+Use following commands to compile ``qemu-system-arm`` binary with ``n900``
+qemu machine support::
+
+    git clone https://git.linaro.org/qemu/qemu-linaro.git
+    cd qemu-linaro
+    git checkout 8f8d8e0796efe1a6f34cdd83fb798f3c41217ec1
+    ./configure --enable-system --target-list=arm-softmmu --disable-werror
+    make -j4
+    cd ..
+    ln -s qemu-linaro/arm-softmmu/qemu-system-arm .
+
+Using ``n900`` qemu machine requires proprietary Nokia qemu ``qflasher`` tool
+(in reality it is just generator of qemu MTD images) with first stage images
+(``xloader-qemu.bin`` and ``secondary-qemu.bin``), similar what is required
+on the real HW. License of flasher and images allows non-commercial
+redistribution and it is available at maemo.org website::
+
+    wget -c http://repository.maemo.org/qemu-n900/qemu-n900.tar.gz
+    tar -xf qemu-n900.tar.gz
+
+To generate qemu bootable MTD image ``mtd.img`` from U-Boot binary
+``u-boot.bin`` and unpacked first stage images, run following command::
+
+    ./qflasher -v -x xloader-qemu.bin -s secondary-qemu.bin -k u-boot.bin -m rx51 -o mtd.img
+
+Instead of ``u-boot.bin`` binary it is possible to also used combined
+U-Boot + kernel binary ``combined.bin``.
+
+Finally, to boot ``mtd.img`` with graphics display and keyboard with optional
+serial console on current terminal, run::
+
+    ./qemu-system-arm -M n900 -mtdblock mtd.img -serial /dev/tty
+
+Additionally it is possible to emulate also eMMC and uSD card by appending
+qemu ``-sd`` arguments::
+
+    ./qemu-system-arm -M n900 -mtdblock mtd.img -sd emmc.img -sd sd.img -serial /dev/tty
+
+For more examples, look into the ``test/nokia_rx51_test.sh`` CI testing script.
-- 
2.20.1


                 reply	other threads:[~2022-03-08 18:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220308175956.4522-1-pali@kernel.org \
    --to=pali@kernel.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.