From patchwork Wed Mar 31 08:17:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1460397 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=rcHa0Ls+; 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 4F9K1x6wV8z9sW4 for ; Wed, 31 Mar 2021 19:17:57 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C091E828BC; Wed, 31 Mar 2021 10:17:44 +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="rcHa0Ls+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3F034805B4; Wed, 31 Mar 2021 10:17:35 +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-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) (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 7C048801FC for ; Wed, 31 Mar 2021 10:17:32 +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-x632.google.com with SMTP id r12so28743338ejr.5 for ; Wed, 31 Mar 2021 01:17:32 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=wJKQuaWItad3RZt6a/rpNya9Adtg3k2hqPLiyZrq0gc=; b=rcHa0Ls+c0n6qyX0PTT923ri0ME6ieE3qZIQqCKFk/qShRWV7jMO86Cxr3eGFZJGkd 7Ob+Q51FoyyJTMgWKDdU5LNlH0XJ+OfFkdYR99JFT2o24YqoRN7+Vt13U7w9ebbl4RSL PiSBOM5x6psTpoTtyqKOjt35Hb8aIlCDAcp0EC4ynFWjlSj4D3P9alt8JXcPkToJoWgo UgYfP7yXPBBmgxGYAHOdgkL+tgKIgHQeHO5wfSwJprALqgj9r36Jh5kjRpuEFmu1P9RF bjMY1nof0D+NLcnZoqhjHsbxuScDBquivjfxxhC8SSlnrbQ3n+ypac8sArOBCUKNTmSV Atpw== 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 :in-reply-to:references:mime-version:content-transfer-encoding; bh=wJKQuaWItad3RZt6a/rpNya9Adtg3k2hqPLiyZrq0gc=; b=TKB4Hmrp7s9Zp8BsboaCY8ZlquxhNloMNlOh5P3ixzwdljrhaU7Fj93XHd+gzI3qYM 4+iczTLjDL8Qs5xl7JvO48eMgOYNg4Rhqvk/EzERruqCL6yj37sOZ9SNFkyqIO5ZoGVY mUWM4c4xTkM6JXDiiiMhTUSjmaO9NbIQG8GY5mh8rhP2gkYABvBe7Uk1J69upDsEbqor 46G27gI29k6ttrVsjFQDbHINPq+dPcqtUSluqYoRWt8bjeLCAMdnc2aAW+RoFH8Wu5vd G6sn6AK4OhKpg4EzXB6dTj2KmCuJ2ALm1gKpUrTch2Y+I/chq5vgKzEkDn8WJuGdBQSW KXww== X-Gm-Message-State: AOAM530Qm8/SNXv1DTFSePipmHfOSBOT0dhRtSz0IYDSU4k32Myz1eqR Fo/kOYjahKycpJJ3sb8pVi5Z1n0MGHIijGxv X-Google-Smtp-Source: ABdhPJyIvuX+We9aWVTHjYFf7QT1WUO8CU+8AazZWbJtN6VWtihCGOZY6San1LvEeIV0Ng3kAIdkuQ== X-Received: by 2002:a17:906:358c:: with SMTP id o12mr2325054ejb.156.1617178651886; Wed, 31 Mar 2021 01:17:31 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::e05]) by smtp.gmail.com with ESMTPSA id r4sm679060ejd.125.2021.03.31.01.17.31 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Mar 2021 01:17:31 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Lukasz Majewski Subject: [PATCH 1/6] cmd: dfu: Propagate error if dfu gadget fails Date: Wed, 31 Mar 2021 10:17:20 +0200 Message-Id: X-Mailer: git-send-email 2.31.0 In-Reply-To: References: 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.102.4 at phobos.denx.de X-Virus-Status: Clean On systems without usb gadget dfu core fails which was reported by error but command itself returns pass which breaks any usage in a script. That's why propagate error from run_usb_dnl_gadget(). Fixes: 16297cfb2a20 ("usb: new board-specific USB init interface") Signed-off-by: Michal Simek --- Before this patch ZynqMP> run bootcmd_usb_dfu0 No USB device found usb_gadget_initialize failed DFU0: Trying to boot script at 0x20000000 Wrong image format for "source" command DFU0: SCRIPT FAILED: continuing... After ZynqMP> run bootcmd_usb_dfu0 No USB device found usb_gadget_initialize failed DFU0: SCRIPT FAILED: continuing... --- cmd/dfu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/dfu.c b/cmd/dfu.c index ef4f897ce070..4a288f74c2c2 100644 --- a/cmd/dfu.c +++ b/cmd/dfu.c @@ -68,7 +68,7 @@ static int do_dfu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) int controller_index = simple_strtoul(usb_controller, NULL, 0); bool retry = false; do { - run_usb_dnl_gadget(controller_index, "usb_dnl_dfu"); + ret = run_usb_dnl_gadget(controller_index, "usb_dnl_dfu"); if (dfu_reinit_needed) { dfu_free_entities(); From patchwork Wed Mar 31 08:17:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1460398 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=C6e1lLKy; 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 4F9K255GmTz9sW0 for ; Wed, 31 Mar 2021 19:18:05 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AD00D828A4; Wed, 31 Mar 2021 10:17:46 +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="C6e1lLKy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 621D0828B3; Wed, 31 Mar 2021 10:17:37 +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-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) (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 3F8318006D for ; Wed, 31 Mar 2021 10:17:34 +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-x630.google.com with SMTP id e14so28687747ejz.11 for ; Wed, 31 Mar 2021 01:17:34 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=Yh72E2McSZ6rU1GHW0Ni2HXlaUpYbybEyfTE00kQHHY=; b=C6e1lLKy2wdqrvRu+YIyBtc33eQb20FPDmyzr5G1Ay1HLo0vN8SZrd4a/qRffR95wP rmfct3eRQCJcpVT039Y4OsqjYWDsLjiV0vANz/PzyOV7Yckmym7IRX1eMuA0QF/5GBfW ymjtGGZUrY7Zua1kzQdrYF9ivCrh2qwNArhf63OgEIbZVb3+x8TvIAxE1/Uj2L+xvB02 NP87M4diOhHfr/PyyWJLn3DsxBAIcgm/UeqTWJ/sBsh1hxQht384xCny1VnETQ2VHYFh 6O7p95swnTff/urQ1iPVuy95/3W5gAnxeoqocMjOBCWqdTNg5b/MvlW08qMWy2RnCNq6 JwkA== 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 :in-reply-to:references:mime-version:content-transfer-encoding; bh=Yh72E2McSZ6rU1GHW0Ni2HXlaUpYbybEyfTE00kQHHY=; b=GzYvyE2NvQJ044lwVUROhI9drqezIAYoHtOqB4vjETEBn6H2JbBl3bG/g9HY89jOvb zFoXXrvTkIlsc+SibG/B6NE3fB4Ms/lWCG7gOkHWLCgMPhvjU8mpA+newZ3eddtyyB7W S9P4bAj2lFNheXqg3gf4qN5R1Mlah6jxRZRWStxEoYpMBdc/zyP7n/+dpVkb+K3sAFjB PDLYifsszYfvfoxJOyhrT9Oibko/q6ccvY3I47D6JGHU7QJ75EUbYeCwoc33NNFsXdi2 pF3SeDqVt4qrSelZkK72e180hlt17mE6SVAq42g6Du60OrMZoj/+agUip/Ct85HUkwMs mOWQ== X-Gm-Message-State: AOAM532S8zSRxkdKlt1Ve3RQ71sq3ybFm1mz3+veiHs/6CdUjawh1y9p bLLvuAy7ZStQMkY+BzyvghuE+I1uRQY9Bn+M X-Google-Smtp-Source: ABdhPJwrB8IyO5gZNWbzSLrKx51eA/H7P4d6t0Sao+rAo7kRP5QWJYghEaX3TV1Y4QO5dy20I+mVLQ== X-Received: by 2002:a17:906:934c:: with SMTP id p12mr2211530ejw.131.1617178653694; Wed, 31 Mar 2021 01:17:33 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::e05]) by smtp.gmail.com with ESMTPSA id g20sm945224edb.7.2021.03.31.01.17.32 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Mar 2021 01:17:33 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: T Karthik Reddy Subject: [PATCH 2/6] xilinx: zynqmp: Add usb dfu/thor distro boot support Date: Wed, 31 Mar 2021 10:17:21 +0200 Message-Id: X-Mailer: git-send-email 2.31.0 In-Reply-To: References: 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.102.4 at phobos.denx.de X-Virus-Status: Clean From: T Karthik Reddy In usb boot mode distro boot should select usb device as primary boot device instead of usb host. So make usb dfu as primary boot device. But do not list it in boot_targets as fallback option because it is not classic mode for booting. Using 60s timeout by default should be enough time for dfu-utils to start transaction. In case none needs this please change timeout value in the command or disable CONFIG_DFU_TIMEOUT. Signed-off-by: T Karthik Reddy Signed-off-by: Michal Simek --- board/xilinx/zynqmp/zynqmp.c | 2 +- configs/xilinx_zynqmp_virt_defconfig | 1 + include/configs/xilinx_zynqmp.h | 30 ++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 4466717ad4fe..9bf0f4c33744 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -571,7 +571,7 @@ int board_late_init(void) switch (bootmode) { case USB_MODE: puts("USB_MODE\n"); - mode = "usb"; + mode = "usb_dfu0 usb_dfu1"; env_set("modeboot", "usb_dfu_spl"); break; case JTAG_MODE: diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig index 6eb566e30df0..a399c1761949 100644 --- a/configs/xilinx_zynqmp_virt_defconfig +++ b/configs/xilinx_zynqmp_virt_defconfig @@ -83,6 +83,7 @@ CONFIG_SCSI_AHCI=y CONFIG_SATA_CEVA=y CONFIG_CLK_ZYNQMP=y CONFIG_DFU_TFTP=y +CONFIG_DFU_TIMEOUT=y CONFIG_DFU_RAM=y CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_FASTBOOT_FLASH=y diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 15ad4198a6be..87704ff63077 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -179,11 +179,41 @@ #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \ "jtag " +#define BOOT_TARGET_DEVICES_USB_DFU(func) \ + func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1) + +#define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \ + "$scriptaddr $script_size_f && " \ + "dfu " #instance " ram " #instance " 60 && " \ + "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \ + "source ${scriptaddr}; " \ + "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \ + "" + +#define BOOT_TARGET_DEVICES_USB_THOR(func) \ + func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1) + +#define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \ + "$scriptaddr $script_size_f && " \ + "thordown " #instance " ram " #instance " && " \ + "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \ + "source ${scriptaddr}; " \ + "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \ + "" + #define BOOT_TARGET_DEVICES(func) \ BOOT_TARGET_DEVICES_JTAG(func) \ BOOT_TARGET_DEVICES_MMC(func) \ BOOT_TARGET_DEVICES_QSPI(func) \ BOOT_TARGET_DEVICES_NAND(func) \ + BOOT_TARGET_DEVICES_USB_DFU(func) \ + BOOT_TARGET_DEVICES_USB_THOR(func) \ BOOT_TARGET_DEVICES_USB(func) \ BOOT_TARGET_DEVICES_SCSI(func) \ BOOT_TARGET_DEVICES_PXE(func) \ From patchwork Wed Mar 31 08:17:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1460399 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=CPC0axDV; 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 4F9K2K6TQvz9sW0 for ; Wed, 31 Mar 2021 19:18:17 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A17FF828F8; Wed, 31 Mar 2021 10:17:48 +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="CPC0axDV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0633A828B6; Wed, 31 Mar 2021 10:17: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-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) (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 BB552801FC for ; Wed, 31 Mar 2021 10:17:35 +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-ed1-x531.google.com with SMTP id z1so21262068edb.8 for ; Wed, 31 Mar 2021 01:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JZ3wqlQSQOYKWD3yfe9eT0q5a6ZkX55SiiBiV9OhnW8=; b=CPC0axDV8tujAVOHkSbfzA7hVjCQkqTKTXcPRdyevzPysbxMQ/GIhCy0vn0MK7Dg/E JMJGAStjQe3BTFR5/aNUDiGs2PEwzEreaUoT2PSw2g4O8DiaRvS5xNqolJcwjAzxSDp+ +neoczi7vGrbBI/he8QAGnit1EQX7SvuhPyv6z9B5hEFgQtIQhpb+Gyi5KzgBWyxwE2E ywqyc8xgd58q0/KY4vwXSmSaaLcJRbqUVkykHKUM0TnYke7utx/f1Vr1Qmhr8HdunuIN xpPQzzbV6YqtXQY0GHq+QHZKnabkGfLqt/mydAgb5ESPDXE9LHhtQDZU8GrUcFxgVdxL vU5Q== 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:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=JZ3wqlQSQOYKWD3yfe9eT0q5a6ZkX55SiiBiV9OhnW8=; b=LltAQxkcCCKySJml/3NgJjxLrLSAZ4dRCjnZgTXW0W/Bx/PSuwKlhvvomwg5xoFOk2 UIfLvg+GLboQosK85BpfnBJdtoV7M/eh5rxOViR3Hlwp0bHKblcJfVgqy6ykfGG1W7XP WEUTO6Su6XGEiUM7Enq7ddq9IrO1HZg2CC50Ec+hrQ5ryCzSsYBIjkrxYKuzOGAZiNgl Ocr98QEqmYcrEy+VTr03zsXXegEFQM4MzOPcPVoC0ZEstxmva7WuzTyhpXe8jmqMAsaU T+Gbo9obqXcVU4bwOTZRnz/LDw9PD6EF+ET9w7cMGCpIfuok2co4Bzm1MXl34suyyU1p bn1g== X-Gm-Message-State: AOAM530KeCn1MF1yt94SJ621MmtK5EZc4tqoTt62NJrpPS45j96hM2th RqjvrqQwof7R4iydIMOaTbvLDWY+VGzdHv5a X-Google-Smtp-Source: ABdhPJwafNSCva4lufDpt+d1Ro9wIKIebgUfPqIUWV55ShFEAMyS0fnTiJzvw4MdaUXKsJvkXO9+pA== X-Received: by 2002:a05:6402:b31:: with SMTP id bo17mr2193501edb.113.1617178655240; Wed, 31 Mar 2021 01:17:35 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::e05]) by smtp.gmail.com with ESMTPSA id f21sm680966ejw.124.2021.03.31.01.17.34 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Mar 2021 01:17:34 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Subject: [PATCH 3/6] xilinx: zynqmp: Remove dfu_ram_info setup Date: Wed, 31 Mar 2021 10:17:22 +0200 Message-Id: X-Mailer: git-send-email 2.31.0 In-Reply-To: References: 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.102.4 at phobos.denx.de X-Virus-Status: Clean The dfu ram info is wired in connection to Linux kernel and certain setup. We should change this to be more generic as others command. That's why using boot via script is the way to go. Signed-off-by: Michal Simek --- include/configs/xilinx_zynqmp.h | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 87704ff63077..36f3d962e417 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -55,18 +55,6 @@ #define CONFIG_SYS_DFU_DATA_BUF_SIZE 0x1800000 #define DFU_DEFAULT_POLL_TIMEOUT 300 #define CONFIG_THOR_RESET_OFF -#define DFU_ALT_INFO_RAM \ - "dfu_ram_info=" \ - "setenv dfu_alt_info " \ - "Image ram 80000 $kernel_size_r\\\\;" \ - "system.dtb ram $fdt_addr_r $fdt_size_r\0" \ - "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \ - "thor_ram=run dfu_ram_info && thordown 0 ram 0\0" \ - "dfu_ram_tftp=run dfu_ram_info && setenv updatefile boot && " \ - "setenv loadaddr 10000000 && dfu tftp ram 0\0" - -#define DFU_ALT_INFO \ - DFU_ALT_INFO_RAM #ifndef CONFIG_SPL_BUILD # define PARTS_DEFAULT \ @@ -76,10 +64,6 @@ #endif #endif -#if !defined(DFU_ALT_INFO) -# define DFU_ALT_INFO -#endif - #if !defined(PARTS_DEFAULT) # define PARTS_DEFAULT #endif @@ -225,8 +209,7 @@ #ifndef CONFIG_EXTRA_ENV_SETTINGS #define CONFIG_EXTRA_ENV_SETTINGS \ ENV_MEM_LAYOUT_SETTINGS \ - BOOTENV \ - DFU_ALT_INFO + BOOTENV #endif /* SPL can't handle all huge variables - define just DFU */ From patchwork Wed Mar 31 08:17:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1460400 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=La9JpfB6; 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 4F9K2b05Vmz9sW0 for ; Wed, 31 Mar 2021 19:18:30 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ABC2B8290A; Wed, 31 Mar 2021 10:17:50 +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="La9JpfB6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5F71F828BC; Wed, 31 Mar 2021 10:17:42 +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-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (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 2B884828A4 for ; Wed, 31 Mar 2021 10:17:37 +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-ed1-x534.google.com with SMTP id dm8so21264202edb.2 for ; Wed, 31 Mar 2021 01:17:37 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=nJ/AiYEq2LGGWiRf0JcZoBrBec80i87fiaaC3q1Ep2Y=; b=La9JpfB6XNb1orws72Ox3ZcZroorsv0VSEwMwJ4mpqBV4OorSl0BnOSqyVRIDDy5Bl cSmXljhN7acbaY5XU4ALtQ2MW6okFKOu8lYLk3A0/ASpKUCgovbi+0xVOO8mosAdV8BO Fgtwvi/T9ucvb76YW0gzgwsD0oeUdpIk1UTWI+94XaypYyrZCE+9nu9ElAlrERRyG38f woYr1VIqNxxDs8Jjuxvsgfh8o3ghrmjpeAqmc3+Ckx9XGOpbwL196l+rKuacs41oL4JE ZbOtTq5WnBcPIYZ90Cjxfgk0lKHxy0WWhqLbJXbONhNGIDgIdHvwrLEYYfPgz2+QhrHP GbmA== 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 :in-reply-to:references:mime-version:content-transfer-encoding; bh=nJ/AiYEq2LGGWiRf0JcZoBrBec80i87fiaaC3q1Ep2Y=; b=UTHmdLe9U5SOWDnnmO5AjwOpoDQs9hRZaITvBmXWAqw1/lJ2sRFQQBmGADt6xKekYU nGnFVyGgEr1ER7+/TTYzRcIR4+1vNGccn1otaos8asXKuTuH+Hqk6i5icxA4aoxxH1RP WqsqHhrfZ3jECzGGdhuQ8TGWJwM5lsxmHhDVndmMBThhPUfyjRBprdj5KQ4BFj311XXV f95SXEYYP0iVshGpLmzTzuBBgmqQ5JVFgHJhy21uz9B1jrZj/lz085PRI1jTsg3s68gR 5MDCCVGMBFptBweZORCjMxUN6DHLALDigi86WGyz37CCSwVUdAh0bYhVWz7Ynh9mpFhW TV8A== X-Gm-Message-State: AOAM5307TDYcV/1YZAl8miwBgnLWq0/61eYwk4BYqtTiksD+2t1KxNa0 LvlZArJF+N14/Hu51x3dNjZa5ZwYmfNgAs8k X-Google-Smtp-Source: ABdhPJwN+5ittujenTBfq8SMBnX9n/ES0iZYnm/NBwijJrRu2EYOS6f7uGuOXAFzhtVQceU8Q0Ks6A== X-Received: by 2002:aa7:dcc7:: with SMTP id w7mr2142274edu.255.1617178656650; Wed, 31 Mar 2021 01:17:36 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::e05]) by smtp.gmail.com with ESMTPSA id l1sm936655edt.59.2021.03.31.01.17.36 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Mar 2021 01:17:36 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: T Karthik Reddy Subject: [PATCH 4/6] xilinx: versal: Add usb dfu/thor distro boot support Date: Wed, 31 Mar 2021 10:17:23 +0200 Message-Id: <69314184c28f11a11da356bf8c9833da0eb499cd.1617178642.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: References: 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.102.4 at phobos.denx.de X-Virus-Status: Clean From: T Karthik Reddy Change "dfu_usb" to "usb_dfu" for better representation and change required macros. Add 60s timeout of dfu-utils to start transaction. Add support for usb thor to distro boot. Remove DFU_ALT_INFO_RAM as we use bootcmd_usb_dfu instead of dfu_ram. Signed-off-by: T Karthik Reddy Signed-off-by: Michal Simek --- board/xilinx/versal/board.c | 2 +- include/configs/xilinx_versal.h | 52 +++++++++++++++++---------------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c index 042f3ec4f3a0..806e09b49f1e 100644 --- a/board/xilinx/versal/board.c +++ b/board/xilinx/versal/board.c @@ -130,7 +130,7 @@ int board_late_init(void) switch (bootmode) { case USB_MODE: puts("USB_MODE\n"); - mode = "dfu_usb"; + mode = "usb_dfu0 usb_dfu1"; break; case JTAG_MODE: puts("JTAG_MODE\n"); diff --git a/include/configs/xilinx_versal.h b/include/configs/xilinx_versal.h index f1d2594f3b32..380f93a2f68e 100644 --- a/include/configs/xilinx_versal.h +++ b/include/configs/xilinx_versal.h @@ -50,20 +50,6 @@ #define CONFIG_SYS_DFU_DATA_BUF_SIZE 0x1800000 #define DFU_DEFAULT_POLL_TIMEOUT 300 #define CONFIG_THOR_RESET_OFF -#define DFU_ALT_INFO_RAM \ - "dfu_ram_info=" \ - "setenv dfu_alt_info " \ - "Image ram 80000 $kernel_size_r\\\\;" \ - "system.dtb ram $fdt_addr_r $fdt_size_r\0" \ - "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \ - "thor_ram=run dfu_ram_info && thordown 0 ram 0\0" - -#define DFU_ALT_INFO \ - DFU_ALT_INFO_RAM -#endif - -#if !defined(DFU_ALT_INFO) -# define DFU_ALT_INFO #endif /* Ethernet driver */ @@ -129,23 +115,40 @@ #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \ "jtag " -#define BOOT_TARGET_DEVICES_DFU_USB(func) func(DFU_USB, dfu_usb, 0) +#define BOOT_TARGET_DEVICES_USB_DFU(func) \ + func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1) + +#define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \ + "$scriptaddr $script_size_f && " \ + "dfu " #instance " ram " #instance " 60 && " \ + "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \ + "source ${scriptaddr}; " \ + "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \ + "" + +#define BOOT_TARGET_DEVICES_USB_THOR(func) \ + func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1) -#define BOOTENV_DEV_DFU_USB(devtypeu, devtypel, instance) \ - "bootcmd_dfu_usb=setenv dfu_alt_info boot.scr ram $scriptaddr " \ - "$script_size_f; dfu 0 ram 0 && " \ - "echo DFU: Trying to boot script at ${scriptaddr} && " \ +#define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \ + "$scriptaddr $script_size_f && " \ + "thordown " #instance " ram " #instance " && " \ + "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \ "source ${scriptaddr}; " \ - "echo DFU: SCRIPT FAILED: continuing...;\0" + "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0" -#define BOOTENV_DEV_NAME_DFU_USB(devtypeu, devtypel, instance) \ - "dfu_usb " +#define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \ + "" #define BOOT_TARGET_DEVICES(func) \ BOOT_TARGET_DEVICES_JTAG(func) \ BOOT_TARGET_DEVICES_MMC(func) \ BOOT_TARGET_DEVICES_XSPI(func) \ - BOOT_TARGET_DEVICES_DFU_USB(func) \ + BOOT_TARGET_DEVICES_USB_DFU(func) \ + BOOT_TARGET_DEVICES_USB_THOR(func) \ BOOT_TARGET_DEVICES_PXE(func) \ BOOT_TARGET_DEVICES_DHCP(func) @@ -155,8 +158,7 @@ #ifndef CONFIG_EXTRA_ENV_SETTINGS #define CONFIG_EXTRA_ENV_SETTINGS \ ENV_MEM_LAYOUT_SETTINGS \ - BOOTENV \ - DFU_ALT_INFO + BOOTENV #endif #endif /* __XILINX_VERSAL_H */ From patchwork Wed Mar 31 08:17:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1460401 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=85.214.62.61; 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=EiDYnim4; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4F9K2q3cNVz9sW0 for ; Wed, 31 Mar 2021 19:18:43 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2DCE28291E; Wed, 31 Mar 2021 10:17:53 +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="EiDYnim4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1F6E3828E6; Wed, 31 Mar 2021 10:17:43 +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 AA65B828B3 for ; Wed, 31 Mar 2021 10:17:38 +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 jy13so28774012ejc.2 for ; Wed, 31 Mar 2021 01:17:38 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=xVGckAjgky0NjmMcIzkOhkumLENWU8Ra4hBC78a/tYM=; b=EiDYnim4Iw3KOufbd9qULsdYIutZ+9RPCAWGLMvSjP5xnB3zLhYOfhmD9K1hGNp+yr AsKmgXHscLdzX8l2uZod0qHZ9TKYIdtGxkNLZWNs3cit+UQMDY5JnpK2K2esCa8CT4JL aD/8BzSlsQTLHync1FLN+rIZqXxJnffvO34qVpqp14U8FuHPLFsbEeY3fW+RDlFUtj/2 +fT069OvaJPDGPo5wJCxKA/jEoDUuhr/HkI3K2eXl71cLzPfGGfmNDUJPzQMTnmGq8TD FWnT9NqwcI0IBh/rkCQ5FazGHwBO/3Sf/pIOWgBOu2MvgQfyPrQdg2WCgKPXl0wFnQX5 txsA== 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 :in-reply-to:references:mime-version:content-transfer-encoding; bh=xVGckAjgky0NjmMcIzkOhkumLENWU8Ra4hBC78a/tYM=; b=dBOnzigi6mQW+oPB6zHJ9W0k5/c62N/uDOAchVnczDJyaZrSiNmtF66+b5rUSPYzI6 ZG4xck1tql65aI5uQGl1/uiSe0VbeF4xHm2dnbILtMmB1MVCcu4V0SjFsscsX3iMtKhm ZyUCuVG9bhzC0z6WY4IpW0+vZkwhYgTscc58STbJ1+dk03DkQPgEsFCW5jdxhxzqk8sx 0UtKD1m3RsloMaT+bZhI/Ygj3wBRjtlXmqKPm2WUUe+P5ZbXJhUKENXFWoH2UgnoXtzQ vHdY9RiDeoRh87PuHlHdxm0jSviaejTxuuSgR15VqKflZDX/iSoeBo2n0VuTOpQhkYdr TwUg== X-Gm-Message-State: AOAM531oNv0+qwW/97McHSQYK7zl6QETQcJ36C4bJ0CwGiZOeazga3sY VKuRmSeAEnbxjzaS1MZkPTaB3cRaE0A16JyN X-Google-Smtp-Source: ABdhPJzsTUKi2aS9ZtK2T/7zmT8CoS6icAczFyCrd+0I4TRVI89XIdBvrK4w1IW5CtrFEsB1h5skSw== X-Received: by 2002:a17:906:5e55:: with SMTP id b21mr2224776eju.289.1617178658049; Wed, 31 Mar 2021 01:17:38 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::e05]) by smtp.gmail.com with ESMTPSA id k9sm928600edn.68.2021.03.31.01.17.37 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Mar 2021 01:17:37 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: T Karthik Reddy , Michal Simek , Mike Looijmans , Tom McLeod Subject: [PATCH 5/6] xilinx: zynq: Add usb dfu/thor distro boot support Date: Wed, 31 Mar 2021 10:17:24 +0200 Message-Id: <55bfea18c82a96352728a16fe320d3f5c4b41deb.1617178642.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: References: 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.102.4 at phobos.denx.de X-Virus-Status: Clean From: T Karthik Reddy Add support for usb dfu & thor to distro boot on zynq platform. Add 60s timeout of dfu-utils to start transaction. Remove DFU_ALT_INFO_RAM as we use bootcmd_usb_dfu instead of dfu_ram. Remove DFU_ALT_INFO_MMC as part of distro boot cleanup. Signed-off-by: T Karthik Reddy Signed-off-by: Michal Simek --- include/configs/syzygy_hub.h | 1 - include/configs/topic_miami.h | 1 - include/configs/zynq-common.h | 61 +++++++++++++++++------------------ 3 files changed, 30 insertions(+), 33 deletions(-) diff --git a/include/configs/syzygy_hub.h b/include/configs/syzygy_hub.h index e31b77c0c0b7..7af7b08eb485 100644 --- a/include/configs/syzygy_hub.h +++ b/include/configs/syzygy_hub.h @@ -58,7 +58,6 @@ "jtagboot=echo TFTPing FIT to RAM... && " \ "tftpboot ${load_addr} ${fit_image} && " \ "bootm ${load_addr}\0" \ - DFU_ALT_INFO \ BOOTENV #include diff --git a/include/configs/topic_miami.h b/include/configs/topic_miami.h index 010d28ac86f7..c12cd7ccad8f 100644 --- a/include/configs/topic_miami.h +++ b/include/configs/topic_miami.h @@ -49,7 +49,6 @@ "${devicetree_addr}; " \ "fi\0" /* Note that addresses here should match the addresses in the env */ -# undef DFU_ALT_INFO # define DFU_ALT_INFO \ "dfu_alt_info=" \ "uImage ram 0x2080000 0x500000;" \ diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h index 1607a8d06518..39035f8bebca 100644 --- a/include/configs/zynq-common.h +++ b/include/configs/zynq-common.h @@ -61,36 +61,6 @@ # define CONFIG_SYS_DFU_DATA_BUF_SIZE 0x600000 # define DFU_DEFAULT_POLL_TIMEOUT 300 # define CONFIG_THOR_RESET_OFF -# define DFU_ALT_INFO_RAM \ - "dfu_ram_info=" \ - "setenv dfu_alt_info " \ - "${kernel_image} ram 0x3000000 0x500000\\\\;" \ - "${devicetree_image} ram 0x2A00000 0x20000\\\\;" \ - "${ramdisk_image} ram 0x2000000 0x600000\0" \ - "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \ - "thor_ram=run dfu_ram_info && thordown 0 ram 0\0" - -# if defined(CONFIG_MMC_SDHCI_ZYNQ) -# define DFU_ALT_INFO_MMC \ - "dfu_mmc_info=" \ - "setenv dfu_alt_info " \ - "${kernel_image} fat 0 1\\\\;" \ - "${devicetree_image} fat 0 1\\\\;" \ - "${ramdisk_image} fat 0 1\0" \ - "dfu_mmc=run dfu_mmc_info && dfu 0 mmc 0\0" \ - "thor_mmc=run dfu_mmc_info && thordown 0 mmc 0\0" - -# define DFU_ALT_INFO \ - DFU_ALT_INFO_RAM \ - DFU_ALT_INFO_MMC -# else -# define DFU_ALT_INFO \ - DFU_ALT_INFO_RAM -# endif -#endif - -#if !defined(DFU_ALT_INFO) -# define DFU_ALT_INFO #endif /* enable preboot to be loaded before CONFIG_BOOTDELAY */ @@ -180,12 +150,42 @@ #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \ "jtag " +#define BOOT_TARGET_DEVICES_USB_DFU(func) \ + func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1) + +#define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \ + "$scriptaddr $script_size_f && " \ + "dfu " #instance " ram " #instance " 60 && " \ + "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \ + "source ${scriptaddr}; " \ + "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \ + "" + +#define BOOT_TARGET_DEVICES_USB_THOR(func) \ + func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1) + +#define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \ + "$scriptaddr $script_size_f && " \ + "thordown " #instance " ram " #instance " && " \ + "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \ + "source ${scriptaddr}; " \ + "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \ + "" + #define BOOT_TARGET_DEVICES(func) \ BOOT_TARGET_DEVICES_JTAG(func) \ BOOT_TARGET_DEVICES_MMC(func) \ BOOT_TARGET_DEVICES_QSPI(func) \ BOOT_TARGET_DEVICES_NAND(func) \ BOOT_TARGET_DEVICES_NOR(func) \ + BOOT_TARGET_DEVICES_USB_DFU(func) \ + BOOT_TARGET_DEVICES_USB_THOR(func) \ BOOT_TARGET_DEVICES_USB(func) \ BOOT_TARGET_DEVICES_PXE(func) \ BOOT_TARGET_DEVICES_DHCP(func) @@ -203,7 +203,6 @@ "kernel_addr_r=0x2000000\0" \ "scriptaddr=0x3000000\0" \ "ramdisk_addr_r=0x3100000\0" \ - DFU_ALT_INFO \ BOOTENV #endif From patchwork Wed Mar 31 08:17:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1460402 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=85.214.62.61; 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=Sj+JGbBE; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4F9K353JfLz9sW0 for ; Wed, 31 Mar 2021 19:18:57 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5E6748293A; Wed, 31 Mar 2021 10:17:55 +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="Sj+JGbBE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CD380828BF; Wed, 31 Mar 2021 10:17:43 +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-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (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 2511B801FC for ; Wed, 31 Mar 2021 10:17:40 +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-ed1-x52f.google.com with SMTP id dm8so21264362edb.2 for ; Wed, 31 Mar 2021 01:17:40 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=WURxUxdIkRT02MFpLjHdtYeu2p45DBDjBM86crcpmVc=; b=Sj+JGbBEzddIKop6sGKz4Sy9/HiNdAJXCus6jM0UaNZYjT5FPaChYXPs7QGRpsHzzt NqguKioDCHBL0navPg0HTutp0xSGbKKGjkLKOEdyPoGHp9/3o9qW7np0xNRREZlU7bIL uLIGNZXEF0Z6bFSWjjO6E8/cPZpPijR3eusBJAIBxDx4ICVqKJFBRmPWPPpcdT6NUTO/ fEcKE5DNFvltanogeSAgm0nJsFC3koS6kl/jIWfmxVL7z+8qMHBHIM0VPrfBsFts76EF uhWoMDMlMk0IfXMaFl/jI9670ube+uOltk+VHejGnsgoepH54oW9L7wC7IuCoYfsZ2hp 0bzQ== 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 :in-reply-to:references:mime-version:content-transfer-encoding; bh=WURxUxdIkRT02MFpLjHdtYeu2p45DBDjBM86crcpmVc=; b=hMG/lUaNQu6Ls7VONMREVO+4Efekfsn3yNTXeToZFRA3jr+d6CzS7LXyPVOAF8ya4o maOVutCmSmr2m4e5vWzKMqQHiXXy34bDzf9Dz7TtjPrYZIm6bmEzyLl/Idivt0tTeald Uyf06WF99KsgitqvOprYvbhevU29VDj/qv21wdMSaaVg/KEO+fLMLvV7rw9a85mar/it JZr9YIQSBcmAJ47t3duN/E2nePsWDK7tdH6NBjajlgzTe/CoEnLSxCSfx0C7lU5RqaTi 35rULlq1aTEdvj4Oaj37KGiz+eNUIQL8pB145sELdpt9JBbRAt5OaLBp1hOqZu1EzqnR S4DQ== X-Gm-Message-State: AOAM531VQGJ2qfbd7o+6t3PibCM0Y5aNSQ9lPOetbm3vsDcZ8OoaI4A9 +rF9j3Yj5kM+UdAP669FDjPhPrx8BPQXJtF5 X-Google-Smtp-Source: ABdhPJwaDdVV5vu95Au5GfgfiQITpNa+cUjBqg67mlucn1pGA/8VU7bPRBwRofFhSF2noFUY1IPTXA== X-Received: by 2002:a05:6402:95b:: with SMTP id h27mr2218333edz.93.1617178659604; Wed, 31 Mar 2021 01:17:39 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::e05]) by smtp.gmail.com with ESMTPSA id u59sm968628edc.73.2021.03.31.01.17.39 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Mar 2021 01:17:39 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: T Karthik Reddy Subject: [PATCH 6/6] xilinx: Enable DFU_TIMEOUT config Date: Wed, 31 Mar 2021 10:17:25 +0200 Message-Id: X-Mailer: git-send-email 2.31.0 In-Reply-To: References: 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.102.4 at phobos.denx.de X-Virus-Status: Clean From: T Karthik Reddy Enable CONFIG_DFU_TIMEOUT to set timeout waiting for dfu command. Signed-off-by: T Karthik Reddy Signed-off-by: Michal Simek --- configs/xilinx_versal_virt_defconfig | 1 + configs/xilinx_zynq_virt_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/xilinx_versal_virt_defconfig b/configs/xilinx_versal_virt_defconfig index da3d2c2a936f..03c81e6c2751 100644 --- a/configs/xilinx_versal_virt_defconfig +++ b/configs/xilinx_versal_virt_defconfig @@ -49,6 +49,7 @@ CONFIG_NETCONSOLE=y CONFIG_IP_DEFRAG=y CONFIG_TFTP_BLOCKSIZE=4096 CONFIG_CLK_VERSAL=y +CONFIG_DFU_TIMEOUT=y CONFIG_DFU_RAM=y CONFIG_FPGA_XILINX=y CONFIG_FPGA_VERSALPL=y diff --git a/configs/xilinx_zynq_virt_defconfig b/configs/xilinx_zynq_virt_defconfig index 3892a71eac8b..7e56395a521f 100644 --- a/configs/xilinx_zynq_virt_defconfig +++ b/configs/xilinx_zynq_virt_defconfig @@ -65,6 +65,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_NETCONSOLE=y CONFIG_SPL_DM_SEQ_ALIAS=y +CONFIG_DFU_TIMEOUT=y CONFIG_DFU_MMC=y CONFIG_DFU_RAM=y CONFIG_FPGA_XILINX=y