From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A315AC4320A for ; Fri, 27 Aug 2021 12:16:58 +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 4555C60FDA for ; Fri, 27 Aug 2021 12:16:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4555C60FDA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=thorsis.com 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 B46128326B; Fri, 27 Aug 2021 14:16:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=thorsis.com 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 EEC96832A5; Fri, 27 Aug 2021 14:16:48 +0200 (CEST) Received: from mail.thorsis.com (mail.thorsis.com [92.198.35.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 58FAF832B8 for ; Fri, 27 Aug 2021 14:16:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=thorsis.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ada@thorsis.com Received: from localhost (localhost [127.0.0.1]) by mail.thorsis.com (Postfix) with ESMTP id D9514274 for ; Fri, 27 Aug 2021 14:16:37 +0200 (CEST) Received: from mail.thorsis.com ([127.0.0.1]) by localhost (mail.thorsis.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Zdm848UHdV76 for ; Fri, 27 Aug 2021 14:16:37 +0200 (CEST) Received: by mail.thorsis.com (Postfix, from userid 109) id 995471A81; Fri, 27 Aug 2021 14:16:37 +0200 (CEST) From: Alexander Dahl To: u-boot@lists.denx.de Cc: Roelf-Erik Carsjens Subject: Re: boot hangs on new board with SAMA5D27C-D5M Date: Fri, 27 Aug 2021 14:16:33 +0200 Message-ID: <3944538.54PfVXhSk8@ada> In-Reply-To: <2243264.XLWg60qqE0@ada> References: <2243264.XLWg60qqE0@ada> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" 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 Hello, for the record =E2=80=A6 see below. Am Donnerstag, 22. Juli 2021, 19:01:36 CEST schrieb Alexander Dahl: > Hello, >=20 > I'm currently porting a brand new custom board with Microchip's 64 MiB > SAMA5D2 SiP SoC. Second stage bootloader is at91bootstrap, for development > I load U- Boot directly to RAM with SAM-BA to the same address (0x23f0000= 0) > and execute from there. RAM base address is 0x20000000 and size 0x04000000 > (64 MiB). Code is based on the U-Boot v2021.07 upstream code of the > SAMA5D2-SOM1-EK1 board (which has 128 MiB). >=20 > I get to a U-Boot shell and can access SD card and LEDs if I do not activ= ate > NAND flash support in menuconfig. The log with debug messages is attached. > From IRC marex and I suspect some overwritten memory if the u-boot-dtb.bin > file gets too big, but I can not spot any error in those addresses in deb= ug > output. >=20 > The last function called is initr_malloc() from common/board_r.c but I can > not spot what's wrong with that, especially because mem_malloc_init() > prints a probably valid memory area and malloc_bin_reloc() should be a > noop. >=20 > If I disable CONFIG_SYS_MALLOC_CLEAR_ON_INIT, I get to a shell, if I enab= le > it again, boot hangs. >=20 > So the memset() of the malloc area, which is supposed to be valid to my > knowledge, causes the hang. >=20 > I can try one of the other boards (there are 4 prototype boards) to rule = out > an hardware issue, but I'm curious if anyone has an idea what's wrong her= e? Not sure what was the root cause of the issue, but I changed the initial lo= ad=20 address to 0x21f00000 which is 1 MiB below half of the RAM (at offset 31 Mi= B=20 of 64 MiB, instead of at offset 63 MiB). Now U-Boot works without hangs or= =20 hiccups. So the change in at91bootstrap3 was: =2DCONFIG_JUMP_ADDR=3D"0x23f00000" +CONFIG_JUMP_ADDR=3D"0x21f00000" and in U-Boot: =2DCONFIG_SYS_TEXT_BASE=3D0x23f00000 +CONFIG_SYS_TEXT_BASE=3D0x21f00000 Greets Alex