From patchwork Sun Sep 23 13:42:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 973697 X-Patchwork-Delegate: sjg@chromium.org 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="JoMJLDxl"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42J82s1J19z9sBW for ; Sun, 23 Sep 2018 23:54:29 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id CE1CAC21E4F; Sun, 23 Sep 2018 13:44:07 +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, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 D3D2FC21EBE; Sun, 23 Sep 2018 13:39:01 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id CE833C21E16; Sun, 23 Sep 2018 13:38:35 +0000 (UTC) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by lists.denx.de (Postfix) with ESMTPS id 0A8C9C21DB6 for ; Sun, 23 Sep 2018 13:38:31 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id y4-v6so8023548pgp.9 for ; Sun, 23 Sep 2018 06:38:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mF+ltkaweYFCFn9Jn7hde4NKy4tHP8+EJ04Ud+CoIyE=; b=JoMJLDxlXYdpucKBGmg75pP26zzsdua8YTPVAvDUJlsdhsY1Rfvdyrm7tntHM5HAFF 163atDnHWG20RIaLS5kFHxQ5/OQFaJXvsJfJpSvHhL3qeUFYPt8fY1XuAT2w6hPUO3Zi RxPir0sQrtfsp0ho/DWzvA1+Kdu2NNzKiAe7+RECAbwfBaGFEbvpOWMyzZfXr/mz9WV6 6Zk4DD6BjybqbvFbRlY2pfzKrloHrgS9rLQpMUXYKnNm0Vvk0s/rk2YB2v5hNBqSSI/q 7j/3g1xj4qjjAku0xbidhPM++WlCifu8piRcB109twfT/GWpnm4vqogmmZR3gIwiPYJ+ cOCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mF+ltkaweYFCFn9Jn7hde4NKy4tHP8+EJ04Ud+CoIyE=; b=h2kMJBKNR6Z7LMCyVdWqVpv96Bm5KHNqIUzO9LS+7W4VJ1wBX2dGEo0kle+gnSTkQl F2pHSpxUCRbgmPXuBS/mVBh6EeoD6eREOsy3LskhM+qzcATcIAsSio5u1A0C2mvURu+i 7vO7wB/K3tta9W+f51AMPaGW/3JbwNZR8gAgiJpdQG0n5FMJaZAJ6DR9yIBwy4xEme4H 9d/Tz5gA332fOrduq6q2+B9cVjpjKAc0hT0JRKQoIZSvPVnmPoTFDKBTCAyouqijA1UB 3jjRGDSlRTPfBN+5agFWyhJkfus1dGTOGf8aJjd6h117ugYxa9aKquIHSMQsBwzwD6XM XIlQ== X-Gm-Message-State: ABuFfohT4sk3qKPPUpSPeBnJySDLTEfiyobDz0/ZL132Nzf6vN7df2MS UG46NB5SPUhqmLmK26tOg+8pVLF0 X-Google-Smtp-Source: ACcGV62SPzHpwGx6FeeiFBHdRuml+84Ce6vzHQSJ2m+0a+WaGegAcVXtqDKPkvS0MB7vF8Mj5eMVNA== X-Received: by 2002:a63:f14a:: with SMTP id o10-v6mr3362591pgk.339.1537709909680; Sun, 23 Sep 2018 06:38:29 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-156-139.windriver.com. [147.11.156.139]) by smtp.gmail.com with ESMTPSA id b126-v6sm51286073pga.49.2018.09.23.06.38.28 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Sep 2018 06:38:28 -0700 (PDT) From: Bin Meng To: Simon Glass , U-Boot Mailing List Date: Sun, 23 Sep 2018 06:42:14 -0700 Message-Id: <1537710145-1888-17-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1537710145-1888-1-git-send-email-bmeng.cn@gmail.com> References: <1537710145-1888-1-git-send-email-bmeng.cn@gmail.com> Subject: [U-Boot] [PATCH 16/27] arm: qemu: Enumerate virtio bus during early boot 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" Currently devices on the virtio bus is not automatically enumerated, which means peripherals on the virtio bus are not discovered by their drivers. This uses board_init() to do the virtio enumeration. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- board/emulation/qemu-arm/Kconfig | 3 +++ board/emulation/qemu-arm/qemu-arm.c | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/board/emulation/qemu-arm/Kconfig b/board/emulation/qemu-arm/Kconfig index d1c08c2..16b80fe 100644 --- a/board/emulation/qemu-arm/Kconfig +++ b/board/emulation/qemu-arm/Kconfig @@ -5,5 +5,8 @@ config SYS_TEXT_BASE config BOARD_SPECIFIC_OPTIONS # dummy def_bool y + imply VIRTIO_MMIO + imply VIRTIO_NET + imply VIRTIO_BLK endif diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c index 812c906..428498e 100644 --- a/board/emulation/qemu-arm/qemu-arm.c +++ b/board/emulation/qemu-arm/qemu-arm.c @@ -4,6 +4,7 @@ */ #include #include +#include #ifdef CONFIG_ARM64 #include @@ -58,6 +59,12 @@ struct mm_region *mem_map = qemu_arm64_mem_map; int board_init(void) { + /* + * Make sure virtio bus is enumerated so that peripherals + * on the virtio bus can be discovered by their drivers + */ + virtio_init(); + return 0; }