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=-12.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 AF043C12002 for ; Wed, 14 Jul 2021 20:55:54 +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 366E3613D0 for ; Wed, 14 Jul 2021 20:55:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 366E3613D0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D9AB1831C4; Wed, 14 Jul 2021 22:54:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="YYfT7qOn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E6A7482BD2; Wed, 14 Jul 2021 22:53:20 +0200 (CEST) Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) (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 97B9482F08 for ; Wed, 14 Jul 2021 22:53:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x72c.google.com with SMTP id s193so3039050qke.4 for ; Wed, 14 Jul 2021 13:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=M77MHKZcVXKRaA69lGE3oI5zMq+YpHvl9Hv2B6xcisk=; b=YYfT7qOnPBLEX7jgJSINt3WIE3Ooxre9ga2JVD4cfuAzO+F7JnEfDuTGKm/zXjJBDQ 111aPtQ7ECTJVtClN//sj3d45gNdzsPxUN3AOsyy6vArAwKVWhpyD8fc/eudiIYB62xC i4vte8H6BRsNAkqJQWhu7pDpXeouCeUy/+8RQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=M77MHKZcVXKRaA69lGE3oI5zMq+YpHvl9Hv2B6xcisk=; b=KAk3fiW/htDHA/DbgoI8gWcH4VnyraLRmaF3sfUT5fmlbqJ5jp4hHmorGKoyqSaUC9 YDDf74MLJO1eOrskwQAq1BT4+AzdfnmDleQZN/Cl4ZMu4EHJAKD0v1B48rwoDasEIk2a v86VSrO2d+uUoo+IYwjbhNUIs/cTehKDbXm1AmC8N90IT8/xifORq7ILikmxYrXIYEda ehKBD0oDiY22BWeJyjdfGe1KH2hcCp+M/MU20xmU6XZhs0fSKzdEN/ZIz/uUVjwpITjI oLBBEHOx+2ByVZYP5vL0UPrI7aJhqDkJlmNhpBZIEutyCqcZ0LPQDLJbQVrlAMFGEgRU wVvA== X-Gm-Message-State: AOAM532DXzn5rfmo/+cNt0TTJ9pVWe0z4JH1/6/rTjSVSAZEXGaPS16O 9wb38HRXFhVy4uOW5HrfEVcciA== X-Google-Smtp-Source: ABdhPJzDkkkDpmRJHDQKvzGx9/wPxvkfnmnEOw5kdZoB7WtNKJf+MRqxhQAZiuYcETYejyVY1hUeVg== X-Received: by 2002:a37:9ec1:: with SMTP id h184mr12188748qke.0.1626295993401; Wed, 14 Jul 2021 13:53:13 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-715c-901d-db03-e6e4.res6.spectrum.com. [2603:6081:7b01:cbda:715c:901d:db03:e6e4]) by smtp.gmail.com with ESMTPSA id k186sm1556335qkb.29.2021.07.14.13.53.12 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Jul 2021 13:53:12 -0700 (PDT) Date: Wed, 14 Jul 2021 16:53:11 -0400 From: Tom Rini To: Stephan Gerhold Cc: u-boot@lists.denx.de, Linus Walleij Subject: Re: [PATCH 1/2] board: stemmy: Parse atags to get available memory Message-ID: <20210714205311.GE9516@bill-the-cat> References: <20210707105855.89260-1-stephan@gerhold.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="1sDmilEXOXzftCme" Content-Disposition: inline In-Reply-To: <20210707105855.89260-1-stephan@gerhold.net> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) 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 --1sDmilEXOXzftCme Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 07, 2021 at 12:58:54PM +0200, Stephan Gerhold wrote: > At the moment the "stemmy" board attempts to detect the RAM size with > a simple memory test (get_ram_size()). Unfortunately, this does not work > correctly for devices with 768 MiB RAM (e.g. Samsung Galaxy Ace 2 > (GT-I8160), "codina"). Reading/writing memory after the 768 MiB RAM > succeeds but actually overwrites some earlier parts of the memory. >=20 > For U-Boot this does not result in any major problems, but on Linux > this will eventually lead to strange crashes because of the memory > corruption. >=20 > Since the "stemmy" U-Boot port is designed to be chainloaded from > the original Samsung bootloader, the most reliable way to get the > available amount of RAM is to look at the ATAGS passed by the Samsung > bootloader. Fortunately, the header used to generate ATAGS in U-Boot > (asm/setup.h) can also be easily used to parse them. >=20 > Also clarify and simplify stemmy.h a bit to make it more clear where > some of the magic values in there are actually coming from. >=20 > Signed-off-by: Stephan Gerhold > Reviewed-by: Linus Walleij Applied to u-boot/master, thanks! --=20 Tom --1sDmilEXOXzftCme Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmDvTrYACgkQFHw5/5Y0 tywTGQwAobhfC2xDTe3BIzjVeqk2rtm2MTdkmbO23jxjliOWuBHPw/8Bx/vVSgKj oOgxW+QEK6cYHKvOr5TCgSgU7NPLR0bqNOJKL3daNMizSOsJeDxdzsC5pl6wwfGd wI2bffEjYlx5+koV4UPe4wVtou599K97JLh5lISVeX5YuyLZKtI6G+LitcA2Ed/s sviWdAzKZrR4GItXBWsnBY+zUdbZ5WOozsuEzxhW0cUZL/bIHHzDHwc5LDmo9mmw slN+dqx7dbFZqWzc9bJFsKBgPVWd+HNSA4TcpTSdvUSpM1iLERo6Ab0DsrA8EXmI T3TK5JdWmYmFAWdSAlrOgA86hcaBJJRMnvlEXriY1iClQBJX2cT9QT3kiRIvISmW ClMi39my7Mjb+SuEjuD4uazkfquGJEpPcHrwm5P7OmJpfZOzTFAOq+L5R4RXYllM A6teg+8Yx837aYdp68teyTCcKOCKLAuQAqr4/L2/YKa1GvMhfKfCnsb3N6phI6Wt yqZP/dDg =VHMK -----END PGP SIGNATURE----- --1sDmilEXOXzftCme--