public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jonathan Gray <jsg@jsg.id.au>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/4] ARM: qemu-arm: Add support for AArch64
Date: Sat, 13 Jan 2018 18:08:47 +1100	[thread overview]
Message-ID: <20180113070847.GD58442@largo.jsg.id.au> (raw)
In-Reply-To: <20180111141126.15432-2-tuomas.tynkkynen@iki.fi>

On Thu, Jan 11, 2018 at 04:11:23PM +0200, Tuomas Tynkkynen wrote:
> This adds support for '-machine virt' on AArch64. This is rather simple:
> we just add TARGET_QEMU_ARM_xxBIT to select a few different Kconfig
> symbols, provide the ARMv8 memory map from the board file and add a new
> defconfig based on the 32-bit defconfig.

While nvme is in the defconfig it seems only ahci works with
distroboot automatically.

Booting off nvme requires manually running

=> nvme scan
=> setenv devtype nvme
=> run scan_dev_for_boot_part

Having it work automatically requires something like the below

diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 5c469a23fa..305e102cb8 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -195,6 +195,31 @@
 	BOOT_TARGET_DEVICES_references_SCSI_without_CONFIG_SCSI
 #endif
 
+#ifdef CONFIG_NVME
+#define BOOTENV_RUN_NVME_INIT "run nvme_init; "
+#define BOOTENV_SET_NVME_NEED_INIT "setenv nvme_need_init; "
+#define BOOTENV_SHARED_NVME \
+	"nvme_init=" \
+		"if ${nvme_need_init}; then " \
+			"setenv nvme_need_init false; " \
+			"nvme scan; " \
+		"fi\0" \
+	\
+	"nvme_boot=" \
+		BOOTENV_RUN_NVME_INIT \
+		BOOTENV_SHARED_BLKDEV_BODY(nvme)
+#define BOOTENV_DEV_NVME	BOOTENV_DEV_BLKDEV
+#define BOOTENV_DEV_NAME_NVME	BOOTENV_DEV_NAME_BLKDEV
+#else
+#define BOOTENV_RUN_NVME_INIT
+#define BOOTENV_SET_NVME_NEED_INIT
+#define BOOTENV_SHARED_NVME
+#define BOOTENV_DEV_NVME \
+	BOOT_TARGET_DEVICES_references_NVME_without_CONFIG_NVME
+#define BOOTENV_DEV_NAME_NVME \
+	BOOT_TARGET_DEVICES_references_NVME_without_CONFIG_NVME
+#endif
+
 #ifdef CONFIG_IDE
 #define BOOTENV_SHARED_IDE	BOOTENV_SHARED_BLKDEV(ide)
 #define BOOTENV_DEV_IDE		BOOTENV_DEV_BLKDEV
@@ -324,6 +349,7 @@
 #define BOOTENV \
 	BOOTENV_SHARED_HOST \
 	BOOTENV_SHARED_MMC \
+	BOOTENV_SHARED_NVME \
 	BOOTENV_SHARED_PCI \
 	BOOTENV_SHARED_USB \
 	BOOTENV_SHARED_SATA \
@@ -390,6 +416,7 @@
 	BOOT_TARGET_DEVICES(BOOTENV_DEV)                                  \
 	\
 	"distro_bootcmd=" BOOTENV_SET_SCSI_NEED_INIT                      \
+		BOOTENV_SET_NVME_NEED_INIT                                \
 		"for target in ${boot_targets}; do "                      \
 			"run bootcmd_${target}; "                         \
 		"done\0"
diff --git a/include/configs/qemu-arm.h b/include/configs/qemu-arm.h
index c8852cef34..8c65babb77 100644
--- a/include/configs/qemu-arm.h
+++ b/include/configs/qemu-arm.h
@@ -38,7 +38,8 @@
 #include <config_distro_defaults.h>
 
 #define BOOT_TARGET_DEVICES(func) \
-	func(SCSI, scsi, 0)
+	func(SCSI, scsi, 0) \
+	func(NVME, nvme, 0)
 
 #include <config_distro_bootcmd.h>
 

  reply	other threads:[~2018-01-13  7:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11 14:11 [U-Boot] [PATCH v2 0/4] ARM: Extend qemu_arm to support ARM64 Tuomas Tynkkynen
2018-01-11 14:11 ` [U-Boot] [PATCH v2 1/4] ARM: qemu-arm: Add support for AArch64 Tuomas Tynkkynen
2018-01-13  7:08   ` Jonathan Gray [this message]
2018-01-13 12:45     ` Tuomas Tynkkynen
2018-01-13 13:18       ` Jonathan Gray
2018-01-19 21:14   ` [U-Boot] [U-Boot, v2, " Tom Rini
2018-01-11 14:11 ` [U-Boot] [PATCH v2 2/4] ARM: Document AArch64 version of qemu-arm Tuomas Tynkkynen
2018-01-11 15:14   ` Tom Rini
2018-01-19 21:14   ` [U-Boot] [U-Boot, v2, " Tom Rini
2018-01-11 14:11 ` [U-Boot] [PATCH v2 3/4] Travis-CI: Download ARM64 version of GRUB as well Tuomas Tynkkynen
2018-01-19 21:14   ` [U-Boot] [U-Boot, v2, " Tom Rini
2018-01-11 14:11 ` [U-Boot] [PATCH v2 4/4] Travis-CI: Add job for running test.py on qemu_arm64 Tuomas Tynkkynen
2018-01-19 21:14   ` [U-Boot] [U-Boot, v2, " Tom Rini

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=20180113070847.GD58442@largo.jsg.id.au \
    --to=jsg@jsg.id.au \
    --cc=u-boot@lists.denx.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox