From patchwork Fri Nov 9 12:59:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Auer X-Patchwork-Id: 995524 X-Patchwork-Delegate: uboot@andestech.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=none (p=none dis=none) header.from=aisec.fraunhofer.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42s1033rs8z9sCs for ; Sat, 10 Nov 2018 00:17:07 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 4AC3DC22578; Fri, 9 Nov 2018 13:05:03 +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=RCVD_IN_DNSWL_BLOCKED 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 23A06C22597; Fri, 9 Nov 2018 13:00:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id ECD4EC2252C; Fri, 9 Nov 2018 13:00:27 +0000 (UTC) Received: from mail-edgeS23.fraunhofer.de (mail-edges23.fraunhofer.de [153.97.7.23]) by lists.denx.de (Postfix) with ESMTPS id 247F1C2257C for ; Fri, 9 Nov 2018 13:00:23 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2H5AAAmhOVb/xoHYZlkGwEBAQEDAQEBBwMBAQGBZYIEZnA5jG+mVQ0lCYQ+AoMiIjgWAQMBAQIBAQICAmkcDIJqS2sBAQEBAQEjAjI/BnkQUVcGDgUJgxgBggABD6h2iiAJAYdIhCqBWD+IaoEEhQ4Cin2UTwcCgRGBBwSOcgsYiU+HHyyXRYFaIoFVMxokT4JsCYsThT8+ATIBinaCTQEB X-IPAS-Result: A2H5AAAmhOVb/xoHYZlkGwEBAQEDAQEBBwMBAQGBZYIEZnA5jG+mVQ0lCYQ+AoMiIjgWAQMBAQIBAQICAmkcDIJqS2sBAQEBAQEjAjI/BnkQUVcGDgUJgxgBggABD6h2iiAJAYdIhCqBWD+IaoEEhQ4Cin2UTwcCgRGBBwSOcgsYiU+HHyyXRYFaIoFVMxokT4JsCYsThT8+ATIBinaCTQEB X-IronPort-AV: E=Sophos;i="5.54,483,1534802400"; d="scan'208";a="7622533" Received: from mail-mtas26.fraunhofer.de ([153.97.7.26]) by mail-edgeS23.fraunhofer.de with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Nov 2018 14:00:21 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CyAgDxg+Vb/xBhWMBkHAEBAQQBAQcEAQGBZYJqTyE5jG+mVQ0lhEcCg0M4FgEDAQECAQECbRwMhTsGeRBRVwYOBQmDGAGCAQ+odYogCQGHSIYCP4hqgQSFDgKKfZRPBwKBEYEHBI5yCxiJT4cfLJdFgVohgVUzGiRPgmwJixOFPz4DMAGKdoJNAQE X-IronPort-AV: E=Sophos;i="5.54,483,1534802400"; d="scan'208";a="51714177" Received: from fgdemucivp01ltm.xch.fraunhofer.de (HELO FGDEMUCIMP12EXC.ads.fraunhofer.de) ([192.88.97.16]) by mail-mtaS26.fraunhofer.de with ESMTP/TLS/AES256-SHA; 09 Nov 2018 14:00:21 +0100 Received: from muc-nb-035.aisec.fraunhofer.de (10.80.233.51) by FGDEMUCIMP12EXC.ads.fraunhofer.de (10.80.232.43) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 9 Nov 2018 14:00:20 +0100 From: Lukas Auer To: Date: Fri, 9 Nov 2018 13:59:19 +0100 Message-ID: <20181109125923.7034-25-lukas.auer@aisec.fraunhofer.de> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181109125923.7034-1-lukas.auer@aisec.fraunhofer.de> References: <20181109125923.7034-1-lukas.auer@aisec.fraunhofer.de> MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-11.0.0.4179-8.200.1013-24212.007 X-TM-AS-Result: No--3.635700-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No Cc: Heinrich Schuchardt , Alexander Graf Subject: [U-Boot] [PATCH v3 24/28] distro_bootcmd: add VirtIO distro boot command 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add a boot command to distro boot to support disks connected over the VirtIO bus. The boot command uses the shared block environment. Signed-off-by: Lukas Auer Reviewed-by: Bin Meng Reviewed-by: Alexander Graf --- Changes in v3: - New patch to add VirtIO distro boot command Changes in v2: None doc/README.distro | 3 ++- include/config_distro_bootcmd.h | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/README.distro b/doc/README.distro index f8e9752a0f..ab6e6f4e74 100644 --- a/doc/README.distro +++ b/doc/README.distro @@ -292,7 +292,7 @@ Each entry in the macro defines a single boot device (e.g. a specific eMMC device or SD card) or type of boot device (e.g. USB disk). The parameters to the func macro (passed in by the internal implementation of the header) are: -- Upper-case disk type (MMC, SATA, SCSI, IDE, USB, DHCP, PXE). +- Upper-case disk type (MMC, SATA, SCSI, IDE, USB, DHCP, PXE, VIRTIO). - Lower-case disk type (same options as above). - ID of the specific disk (MMC only) or ignored for other types. @@ -398,6 +398,7 @@ The list of possible targets consists of: * scsi * ide * usb + * virtio Other *boot* variables than the ones defined above are only for internal use of the boot environment and are not guaranteed to exist or work in the same diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index 54186efe7b..5324ede292 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -242,6 +242,18 @@ BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB #endif +#ifdef CONFIG_CMD_VIRTIO +#define BOOTENV_SHARED_VIRTIO BOOTENV_SHARED_BLKDEV(virtio) +#define BOOTENV_DEV_VIRTIO BOOTENV_DEV_BLKDEV +#define BOOTENV_DEV_NAME_VIRTIO BOOTENV_DEV_NAME_BLKDEV +#else +#define BOOTENV_SHARED_VIRTIO +#define BOOTENV_DEV_VIRTIO \ + BOOT_TARGET_DEVICES_references_VIRTIO_without_CONFIG_CMD_VIRTIO +#define BOOTENV_DEV_NAME_VIRTIO \ + BOOT_TARGET_DEVICES_references_VIRTIO_without_CONFIG_CMD_VIRTIO +#endif + #if defined(CONFIG_CMD_DHCP) #if defined(CONFIG_EFI_LOADER) /* http://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml */ @@ -350,6 +362,7 @@ BOOTENV_SHARED_IDE \ BOOTENV_SHARED_UBIFS \ BOOTENV_SHARED_EFI \ + BOOTENV_SHARED_VIRTIO \ "boot_prefixes=/ /boot/\0" \ "boot_scripts=boot.scr.uimg boot.scr\0" \ "boot_script_dhcp=boot.scr.uimg\0" \