From patchwork Thu Nov 22 10:26:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Auer X-Patchwork-Id: 1001689 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 430x183LDtz9rxp for ; Thu, 22 Nov 2018 21:45:32 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 2C3E9C21FC0; Thu, 22 Nov 2018 10:35:09 +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=none 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 595C4C21F13; Thu, 22 Nov 2018 10:29:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B1427C21F18; Thu, 22 Nov 2018 10:27:52 +0000 (UTC) Received: from mail-edgeKA27.fraunhofer.de (mail-edgeka27.fraunhofer.de [153.96.1.27]) by lists.denx.de (Postfix) with ESMTPS id D53C9C21F47 for ; Thu, 22 Nov 2018 10:27:46 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2FcAAAO4PJb/xwBYJliGgEBAQEBAgEBAQEHAgEBAQGBZYIEZnA5jG+LHYsUkCkNJQmEPgKDbiI4EgEDAQECAQECAgJpHAyCak1rAQEBAQEBIwIyPwZ5EFEhNgYOBQmDGAGBaQMUAQ+obYd2DYIZCQGHUIQrgVc/hnmBcYEEhQ4CiwiUOS4HAoERgQkEi16DIAsYiViHJSyOFYlVgV0igVUzGiRPgmwJhXiFG4U/PgEyAYwOgk0BAQ X-IPAS-Result: A2FcAAAO4PJb/xwBYJliGgEBAQEBAgEBAQEHAgEBAQGBZYIEZnA5jG+LHYsUkCkNJQmEPgKDbiI4EgEDAQECAQECAgJpHAyCak1rAQEBAQEBIwIyPwZ5EFEhNgYOBQmDGAGBaQMUAQ+obYd2DYIZCQGHUIQrgVc/hnmBcYEEhQ4CiwiUOS4HAoERgQkEi16DIAsYiViHJSyOFYlVgV0igVUzGiRPgmwJhXiFG4U/PgEyAYwOgk0BAQ X-IronPort-AV: E=Sophos;i="5.56,253,1539640800"; d="scan'208";a="12041328" Received: from mail-mtaka28.fraunhofer.de ([153.96.1.28]) by mail-edgeKA27.fraunhofer.de with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Nov 2018 11:27:47 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0C5AgDN3/JbfRBhWMBiHAEBAQQBAQcEAQGBZYJqTyE5jG+WMZApDSWERwKEDzgSAQMBAQIBAQIUAQEWOiMMhT0DA3kQUSE2Bg4FCYMYAYFpAxUPqGyHdg2CGQkBh1CGAj+GeYFxgQSFDgKLCJQ5LgcCgRGBCQSLXoMgCxiJWIclLI4ViVWBXSCBVjMaJE+CbAmFeIUbhT8+AzABjA6CTQEB X-IronPort-AV: E=Sophos;i="5.56,253,1539640800"; d="scan'208";a="19172014" Received: from fgdemucivp01ltm.xch.fraunhofer.de (HELO FGDEMUCIMP11EXC.ads.fraunhofer.de) ([192.88.97.16]) by mail-mtaKA28.fraunhofer.de with ESMTP/TLS/AES256-SHA; 22 Nov 2018 11:27:46 +0100 Received: from muc-nb-035.aisec.fraunhofer.de (10.80.233.50) by FGDEMUCIMP11EXC.ads.fraunhofer.de (10.80.232.42) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 22 Nov 2018 11:27:44 +0100 From: Lukas Auer To: Date: Thu, 22 Nov 2018 11:26:33 +0100 Message-ID: <20181122102637.17361-25-lukas.auer@aisec.fraunhofer.de> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181122102637.17361-1-lukas.auer@aisec.fraunhofer.de> References: <20181122102637.17361-1-lukas.auer@aisec.fraunhofer.de> MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-11.0.0.4179-8.200.1013-24238.005 X-TM-AS-Result: No--3.181200-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No Cc: Martyn Welch , Heinrich Schuchardt , Alexander Graf Subject: [U-Boot] [PATCH v4 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 v4: None 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 d06974c58c..555efb7433 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" \