From patchwork Fri Jul 30 09:47:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1511572 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=AsJ1loeP; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GbjHh0Sjfz9sXM for ; Fri, 30 Jul 2021 19:47:44 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C45F48329B; Fri, 30 Jul 2021 11:47:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="AsJ1loeP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A94EC8329E; Fri, 30 Jul 2021 11:47:39 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A4B598328E for ; Fri, 30 Jul 2021 11:47:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ej1-x631.google.com with SMTP id e19so15745782ejs.9 for ; Fri, 30 Jul 2021 02:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=a/0GZWA1VhB1jSkSbIRLeuhSB8oVjhN15SVxvDfzT2g=; b=AsJ1loePq44a/W+0TqddHXXDmFML/L8QVjtuarXxtw4Xw1uT4OXL4uYoqp7zPjicQa pOIfoMBTfwcYptwd5r1UprdGjSIyHDcDqtn3F8/6p3wqNNc3+68HkzdM7pNrpp7r+kbF Q5HJFiB3GOsfB0pROlye6JKsKlKXYtM6ccdT3xw2jy0r1cLmwadjEXQwa83JwOqz3nZ5 qMiwYS9mDjprNSFHHcHgjOpGDuQ6c1uhuq4oXQL1JznZ8b9MwKvJeltLjUGr2SWAoZ/r 2mb63Oi13gwxCOc1QIc3roQbh718f8URYTxo7Ey1i4E5codIGmY++lChNOKkqKgp/JMQ Wpeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=a/0GZWA1VhB1jSkSbIRLeuhSB8oVjhN15SVxvDfzT2g=; b=kCyFF3t9rer1vFYJKiVRkAbx4SMGPWNDSViyoztSPApP5tJ7ZG3L4zD8VchTPUfaei TKqVWnj+V+Nx2VZuqndTz7B6b1KczejhDR6eZf4RtUGthne097DJdEJ9R7rQTOc5iN4W uZPFQAj/wfFmZcYWJi5/i7rLc/bFH99eu5nZchr8yV7vIuKphHwymQG8g0O/wZ+Tx7eK SHaKJWP+De6weAUZLi7aDIPN67MdU/ZmVKwwLpKgZk//ZX4dq2KLmTByLpiSGliiMM/e pjRTZMNauTDFoPOf7P0xQYHYDR3AE9OV7cQcYBlIDPOjU4alOPGquRtMcLltJkTPPNNE Yqag== X-Gm-Message-State: AOAM533hT5NpxkwsLZVvEP9cVADbKHzstC5ObCcVNoWdC63vdybmloXi uazH4HL5+D+HGUqE6EN76740rW5PZCwz176I X-Google-Smtp-Source: ABdhPJy3K+eF0lKglnQugJBQkS/T4Bo4MfEAzGKOmu+e03tFi2Ci3UJmKaBbIntz2YDeVAsMpGdw2g== X-Received: by 2002:a17:906:b794:: with SMTP id dt20mr1667790ejb.363.1627638456132; Fri, 30 Jul 2021 02:47:36 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6:f44b:4166:f09c:e722]) by smtp.gmail.com with ESMTPSA id p3sm395586ejy.20.2021.07.30.02.47.35 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jul 2021 02:47:35 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com, xypron.glpk@gmx.de, sughosh.ganu@linaro.org, ilias.apalodimas@linaro.org, takahiro.akashi@linaro.org Cc: Ashok Reddy Soma , Michal Simek , T Karthik Reddy Subject: [PATCH] xilinx: zynqmp: Reset usb and scsi via preboot Date: Fri, 30 Jul 2021 11:47:34 +0200 Message-Id: X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 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.103.2 at phobos.denx.de X-Virus-Status: Clean Based on thread https://lists.denx.de/pipermail/u-boot/2021-June/451828.html especially "Overall we have a deficiency in the UEFI implementation in that we cannot deal with block devices added or removed after initialization." there is a need to deal with removable media as usb/scsi/sata. That's why bridge this gap in EFI implementation by resetting usb and scsi resets to get all disks before efi_init_obj_list() is called. In our standard boot flow, where we use distro boot, order is fixed as "jtag mmc0 mmc1 qspi0 nand0 usb0 usb1 scsi0 pxe dhcp" with prioritizing boot device added by commit 2882b39d564b ("arm64: zynqmp: Setup the first boot_target at run time"). When device has ESP partition all devices should be detected because then efi_disk_register() in efi_init_obj_list() is called only once. The first such a device is sd/emmc(mmc0/mmc1) and then disks on usb/sata are not handled at all. The commit 6bb577dbb30f ("arm64: zynqmp: Disable EFI_CAPSULE_ON_DISK_EARLY") also pointed out on this issue but detection of removable media wasn't solved that's why do it now via preboot command. I have tested cases without usb and scsi and there is no problem with calling resets without devices itself. Signed-off-by: Michal Simek --- configs/xilinx_zynqmp_virt_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig index 43ab4e7bd990..748e6d668654 100644 --- a/configs/xilinx_zynqmp_virt_defconfig +++ b/configs/xilinx_zynqmp_virt_defconfig @@ -22,6 +22,7 @@ CONFIG_FIT_VERBOSE=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x10000000 CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="scsi reset;usb reset" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_BOARD_EARLY_INIT_F=y CONFIG_BOARD_EARLY_INIT_R=y