From patchwork Wed Dec 23 07:03:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 346988 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp5970175jai; Tue, 22 Dec 2020 23:04:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLB64rwzQeX9jKuFdv46pjd2TAzxaqrW/1eVTqwDYy15nqnnoRGPR8msKgTxqgzcCVPpZV X-Received: by 2002:a17:906:6449:: with SMTP id l9mr17421071ejn.320.1608707056350; Tue, 22 Dec 2020 23:04:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608707056; cv=none; d=google.com; s=arc-20160816; b=TINq6vU1OdYs6fXnZpvrnFo73vHMv0zBBdHO81yB68GmNQzojk9C6bFnc305YZ95dn HJtDseeUN6l+SuZGHav8QG9kHeTfybPEDuwd2jlgAIFjccIIrkMpZdDePPzO+/iJEd53 EIDzPqy8M99oWlzAN/Rt6pIiW4lTCq8IiHJmRQ9mEpZQBIFVB5QwrxohqR2f1gQdHkee VC+wfpXcP3XCABfd35IARB5odCcGltIoQuyR6hFLV1GyfFwTHJdOabmPS1/uI5dAGjVw likWp3VqiZxaC9tXAfZFyczLrils+vIW9PibRZ8npU9ucAutHmLbw379IpbcVTgafq4h mUKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:cc:to:from; bh=d6JHnUixnSmwWv8R5SBKEfjiqQhMJQBUaHrap+cX6qk=; b=BbeFNhdNwGR/qKX94U39+vHcjXliQIESIagx8DD767kxhDdfl+thdemthzi1fIweVS EC8C2fBST9zyF4jmHBm+Jfo4WXJ+nsDLHBQQv0Zdd2Qblswx+iXXT5OXQWspvv9vurae Jp7fzh+RHRFxmuxL+ABu2uUmOp8VFE5OAeD9/abhFcYlZHZacbUaYiqUVfYkAemnuyXk Xx1jmNDcThPXdGFKaWeu3LybGbqaA8bw4XSaddsjPyvEdlh/1A/BBDz7//QR/XEFtWAd zstBj6eWwnKvmdzaV8vPTd9O+K/sQUMFKaMR/xvlhELMImArQkAjPgCnEOde9Xl0WPNu fLuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id h19si6550347edt.159.2020.12.22.23.04.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Dec 2020 23:04:16 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D37A582A19; Wed, 23 Dec 2020 08:03:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id B99B5827DF; Wed, 23 Dec 2020 08:03:54 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id A23F2827DF for ; Wed, 23 Dec 2020 08:03:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 156C911D4; Tue, 22 Dec 2020 23:03:50 -0800 (PST) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.16.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 729753F66E; Tue, 22 Dec 2020 23:03:47 -0800 (PST) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Takahiro Akashi , Heinrich Schuchardt , Alexander Graf , Lukasz Majewski , Tuomas Tynkkynen , Tom Rini , Ilias Apalodimas , Sughosh Ganu Subject: [PATCH v3 02/14] qemu: arm: Initialise virtio devices in board_late_init Date: Wed, 23 Dec 2020 12:33:18 +0530 Message-Id: <20201223070330.21361-3-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201223070330.21361-1-sughosh.ganu@linaro.org> References: <20201223070330.21361-1-sughosh.ganu@linaro.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean On the qemu arm platform, the virtio devices are initialised in the board_init function, which gets called before the initr_pci. With this sequence, the virtio block devices on the pci bus are not initialised. Move the initialisation of the virtio devices to board_late_init which gets called after the call to initr_pci. Signed-off-by: Sughosh Ganu --- Changes since V2: * Enable building of board_late_init for both of the Qemu arm and arm64 variants * Move the selection the CONFIG_BOARD_LATE_INIT to mach-qemu Kconfig file arch/arm/mach-qemu/Kconfig | 2 ++ board/emulation/qemu-arm/qemu-arm.c | 5 +++++ 2 files changed, 7 insertions(+) -- 2.17.1 diff --git a/arch/arm/mach-qemu/Kconfig b/arch/arm/mach-qemu/Kconfig index 588d2d3102..186c3582eb 100644 --- a/arch/arm/mach-qemu/Kconfig +++ b/arch/arm/mach-qemu/Kconfig @@ -16,12 +16,14 @@ choice config TARGET_QEMU_ARM_32BIT bool "ARMv7-A, 32bit" select ARCH_SUPPORT_PSCI + select BOARD_LATE_INIT select CPU_V7A select SYS_ARCH_TIMER config TARGET_QEMU_ARM_64BIT bool "ARMv8, 64bit" select ARM64 + select BOARD_LATE_INIT endchoice diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c index f18f2ed7da..aa68bef469 100644 --- a/board/emulation/qemu-arm/qemu-arm.c +++ b/board/emulation/qemu-arm/qemu-arm.c @@ -64,6 +64,11 @@ struct mm_region *mem_map = qemu_arm64_mem_map; #endif int board_init(void) +{ + return 0; +} + +int board_late_init(void) { /* * Make sure virtio bus is enumerated so that peripherals