Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3F6F2C001DF for ; Wed, 2 Aug 2023 07:11:31 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 82C7686A85; Wed, 2 Aug 2023 09:11:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="CBuZNt/2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A2BAE86AB7; Wed, 2 Aug 2023 09:11:28 +0200 (CEST) Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E414E867F7 for ; Wed, 2 Aug 2023 09:11:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=eugen.hristev@collabora.com Received: from [192.168.0.125] (unknown [82.76.24.202]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ehristev) by madras.collabora.co.uk (Postfix) with ESMTPSA id D99256607155; Wed, 2 Aug 2023 08:11:24 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1690960285; bh=iGl2EW6yvhTcs0GtlmCVwnszFtOOO/0vxSQnFCOD854=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=CBuZNt/2gpVHP8GlPuhU9RFnUb/AAh/npQVHL1uEkchjuBCG3i+uY9pyIQ2qNOPJS m3/1sSb/AXdvTX/ImJkC5QiSEOQM8FVLTxmK8rc7+0loHwbBNznUMKqmdl8RCdzw0T a1reVLYk555/veFVNr4S3M9iSYkoBO5sNfxGsOynIAa+buh+SxM5foVsT1gdC3YAPa KAKur1GaxHXz2e4WOoLd95VI5DS4EJS4gDGkZIf1/6u74r+qrlBjIiOBfALx9wiZkC xcTKV+a+hlMSgfkG0j5FSTovJSebzGESaDdA95j2/M9AjydcQbe8KlkvjZWs7yJh4W NoLtDz7uSyOsA== Message-ID: Date: Wed, 2 Aug 2023 10:11:22 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: Data abort when starting DFU on SAMA5D2 Content-Language: en-US To: =?UTF-8?Q?Alexis_Lothor=c3=a9?= , u-boot@lists.denx.de Cc: Thomas Petazzoni , romain.gantois@bootlin.com, Zixun LI , Mihai Sain , cristian.birsan@microchip.com References: From: Eugen Hristev In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean Hi Alexis, On 8/1/23 10:09, Alexis Lothoré wrote: > Hi, > I am currently using an ATSAMA5D27-WLSOM1-EK1. This boards embeds an > ATSAMA5D27-WLSOM1, which in turns holds an ATSAMA5D27 and a 8MB QSPI flash. I > have been wanting to program u-boot in the QSPI flash thanks to DFU, since the > board is able to boot from QSPI and is supported in uboot. To do so, I have > executed the following steps: > - check out recent uboot version (2023.07.02, but issed described below is > observed on master too) > - load sama5d27_wlsom1_ek_qspiflash_defconfig > - tune the configuration to enable DFU: > - CONFIG_CMD_DFU=y > - CONFIG_DFU_SF=y > - CONFIG_USB_GADGET_DOWNLOAD=y > - build uboot, upload and run it onto external ram thanks to snagrecover ([1]). > - running "bdinfo" shows that board is properly defined/recognized > - "sf probe" properly detects the qspi flash chip > - in u-boot console, configure dfu: > - setenv dfu_alt_info uboot raw 0 0x80000 > - start DFU: > - dfu 0 sf 2:0 > > Unfortunately, this step systematically and immediately leads to a data abort > with the following log: > > => dfu 0 sf 2:0 > data abort > pc : [<2fda9ee0>] lr : [<2fd8dc08>] > reloc pc : [<26f3fee0>]lr : [<26f23c08>] > sp : 2f963fe8 ip : 2f9829cc fp : 00000000 > r10: 2fde1cd9 r9 : 2f969e80 r8 : 2fdfc304 > r7 : 00000000 r6 : 00000000 r5 : 2fdf3034 r4 : 2f982948 > r3 : 0a299cfc r2 : ffffffec r1 : 00000000 r0 : 00000000 > Flags: nzCv IRQs off FIQs off Mode SVC_32 > Code: e5843058 e5950004 e3a01000 e5903008 (e5933008) > Resetting CPU ... > > resetting ... > System reset not supported on this platform > ### ERROR ### Please RESET the board ### > > A quick translation with addr2line shows that the data abort occurs in > include/linux/usb/gagdet.h, in usb_ep_alloc_request, likely because of ep being > NULL, which seems confirmed by adding some custom logs in both > usb_ep_alloc_request and its caller (composite_bind). Before digging further, > does anyone have successfully used DFU on SAMA5D2 boards (and if so, am I > missing something in the configuration) ? Or does this data abort show that some > support is still missing to make it work for SAMA5D2 ? I believe this is related to the gadget more than DFU itself. Zixun LI (in CC) has attempted gadget on this platform at some point. Mihai (also in CC) has did some tests with USB on this platform as well. Cristian has more knowledge of the USB implementation on sama5d2. Eugen > > Kind regards, > Alexis > > [1] https://github.com/bootlin/snagboot