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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27133C433EF for ; Tue, 26 Oct 2021 08:45:27 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4B2D660F0F for ; Tue, 26 Oct 2021 08:45:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4B2D660F0F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 754D38336D; Tue, 26 Oct 2021 10:45:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1635237924; bh=VMTROeMRqT+rlf12K2oFGsNrR2tk1F1TKZzuFCrBzPo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=IwIOd3+pnTuESGOA/DrJ9U/7RwD/I/REGIjz7C68P8RYh29DSSB0/dn1zwLpPEhxB eMuqMzN7wD1aBAJgLiZtFimVEqw+ETmt3XDavtYcE7M8u8G9HA28TMjOXMrMJd4qzY wySfJ+ywpfaadWU/OjgaW1vR88dirC+t39sLtu51eENbqU7CUqx9mOP1EBmBBX5A0g J/gvJYDtC8xKxuCMMOKjxNmAINAbT+AbJE0gzLAXaR8hOBjEO4yEPYDnB4kK1l36Cq e4CNPLG+IuPTvEdDX/lrtiZFFXGvc/HDiZql8AkLkkBiHSYBbPG0xRxiKh2+w1ENkb gn0U7k5X10/Lw== Received: by phobos.denx.de (Postfix, from userid 109) id 3651583395; Tue, 26 Oct 2021 10:45:21 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [91.198.250.253]) (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 C072F83323 for ; Tue, 26 Oct 2021 10:45:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4Hdll045HNzQkHX; Tue, 26 Oct 2021 10:45:16 +0200 (CEST) Subject: Re: [PATCH u-boot-marvell 00/13] Yet another kwboot improvements To: =?UTF-8?Q?Pali_Roh=c3=a1r?= Cc: =?UTF-8?Q?Marek_Beh=c3=ban?= , u-boot@lists.denx.de, =?UTF-8?Q?Marek_Beh=c3=ban?= References: <20211025131304.21310-1-kabel@kernel.org> <20211025144237.667ktcmuge4r2tpw@pali> <20211026083305.bm3lvoevgp62y4fe@pali> From: Stefan Roese Message-ID: <1d9e63ba-bb86-8a86-d7f0-02fdf6e1da52@denx.de> Date: Tue, 26 Oct 2021 10:45:09 +0200 MIME-Version: 1.0 In-Reply-To: <20211026083305.bm3lvoevgp62y4fe@pali> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 50672184D 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 On 26.10.21 10:33, Pali Rohár wrote: > On Monday 25 October 2021 17:15:14 Stefan Roese wrote: >> Hi Pali, >> >> On 25.10.21 16:42, Pali Rohár wrote: >>> On Monday 25 October 2021 16:39:44 Stefan Roese wrote: >>>> Hi Marek, >>>> >>>> On 25.10.21 15:12, Marek Behún wrote: >>>>> From: Marek Behún >>>>> >>>>> Hello Stefan, >>>>> >>>>> these are another improvements for kwboot, please apply only after series >>>>> arm: mvebu: nandpagesize support for kwbimage v1 >>>> >>>> I'm checking right now and have applied the 3 NAND patches on current >>>> master. But this patchset fails at this one: >>>> >>>> tools: kwboot: Do not modify kwbimage header before increasing its size >>>> >>>> [stefan@ryzen u-boot-marvell (kwboot-test1)]$ git am -3 ~/tmp/kwboot2/* >>>> Applying: tools: kwboot: Initialize rfds to zero >>>> Applying: tools: kwboot: Fix initialization of tty device >>>> Applying: tools: kwboot: Reserve enough space for patching kwbimage in >>>> memory >>>> Applying: tools: kwboot: Validate 4-byte image data checksum >>>> Applying: tools: kwboot: Inject baudrate change back code after data part >>>> Applying: tools: kwboot: Recalculate 4-byte data checksum after injecting >>>> baudrate code >>>> Applying: tools: kwboot: Correctly set configuration of UART for BootROM >>>> messages >>>> Applying: tools: kwboot: Show verbose message when waiting for baudrate >>>> change magic >>>> Applying: tools: kwboot: Simplify code for aligning image header >>>> Applying: tools: kwboot: Do not modify kwbimage header before increasing its >>>> size >>>> error: sha1 information is lacking or useless (tools/kwboot.c). >>>> error: could not build fake ancestor >>>> Patch failed at 0010 tools: kwboot: Do not modify kwbimage header before >>>> increasing its size >>>> hint: Use 'git am --show-current-patch=diff' to see the failed patch >>>> When you have resolved this problem, run "git am --continue". >>>> If you prefer to skip this patch, run "git am --skip" instead. >>>> To restore the original branch and stop patching, run "git am --abort". >>>> >>>> Any idea what's missing here? >>> >>> Hello! I'm using also this patch: >>> https://patchwork.ozlabs.org/project/uboot/patch/20211021144609.9319-2-pali@kernel.org/ >> >> Ah, yes. That does the trick. Now all patches apply clean. Thanks. >> >> Testing with all these patches on my AXP target does show, it still >> does not work with baudrate > 115k: >> >> [stefan@ryzen u-boot-marvell (kwboot-test1)]$ ./tools/kwboot -B 230400 -b >> u-boot-spl.kwb -t >> /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A1019EGY-if00-port0 >> Patching image boot signature to UART >> Injecting binary header code for changing baudrate to 230400 Bd >> Injecting code for changing baudrate back >> Sending boot message. Please reboot the target...| >> Waiting 2s and flushing tty >> Sending boot image header (90112 bytes)... >> 0 % >> [......................................................................] >> 10 % >> [......................................................................] >> 20 % >> [......................................................................] >> 29 % >> [......................................................................] >> 39 % >> [......................................................................] >> 49 % >> [......................................................................] >> 59 % >> [......................................................................] >> 69 % >> [......................................................................] >> 79 % >> [......................................................................] >> 89 % >> [......................................................................] >> 99 % [.... ] >> Done >> >> U-Boot SPL 2021.10-00908-gc129aa2f173a (Oct 25 2021 - 17:10:55 +0200) >> High speed PHY - Version: 2.1.5 (COM-PHY-V20) >> High speed PHY - Ended Successfully >> DDR3 Training Sequence - Ver 5.7.4 >> DDR3 Training Sequence - Ended Successfully >> Trying to boot from BOOTROM >> Returning to BootROM (return address 0xffff0aa0)... >> >> Changing baudrate to 230400 Bd >> Baudrate was not changed >> >> >> xmodem: Protocol error >> [stefan@ryzen u-boot-marvell (kwboot-test1)]$ >> >> >> Not changing the baudrate still works. Any idea what I should test? Or >> do you have further changes in the queue that I should wait upon? > > Could you try to boot with baudrate 115201? This value would trigger to > use baudrate change code and because it is too close to standard 115200 > there would be no real change. Ok. This seems to work at least partly (SPL): [stefan@ryzen u-boot-marvell (kwboot-test1)]$ ./tools/kwboot -B 115201 -b u-boot-spl.kwb -t /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A1019EGY-if00-port0 Patching image boot signature to UART Injecting binary header code for changing baudrate to 115201 Bd Injecting code for changing baudrate back Sending boot message. Please reboot the target...| Waiting 2s and flushing tty Sending boot image header (90112 bytes)... 0 % [......................................................................] 10 % [......................................................................] 20 % [......................................................................] 29 % [......................................................................] 39 % [......................................................................] 49 % [......................................................................] 59 % [......................................................................] 69 % [......................................................................] 79 % [......................................................................] 89 % [......................................................................] 99 % [.... ] Done U-Boot SPL 2021.10-00908-gc129aa2f173a (Oct 26 2021 - 10:39:55 +0200) High speed PHY - Version: 2.1.5 (COM-PHY-V20) High speed PHY - Ended Successfully DDR3 Training Sequence - Ver 5.7.4 DDR3 Training Sequence - Ended Successfully Trying to boot from BOOTROM Returning to BootROM (return address 0xffff0aa0)... Changing baudrate to 115201 Bd Sending boot image data (549892 bytes)... 0 % [......................................................................] 1 % [......................................................................] ... 97 % [......................................................................] 99 % [........................... ] Done Finishing transfer Waiting 1s for baudrate change magic Changing baudrate back to 115200 Bd [Type Ctrl-\ + c to quit] BootROM 1.20 Booting from SPI flash So the CPU has run through a reset here. > And what is the output of following command immediately after kwboot? > > stty -F /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A1019EGY-if00-port0 Changing baudrate to 230400 Bd Baudrate was not changed xmodem: Protocol error [stefan@ryzen u-boot-marvell (kwboot-test1)]$ stty -F /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A1019EGY-if00-port0 speed 230400 baud; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; discard = ; min = 1; time = 0; -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke > Also, could try to catch whole strace log and send it to me? I'll try to do this later today. Thanks, Stefan