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 5830EC433F5 for ; Sun, 6 Feb 2022 23:02:53 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A8D5483BED; Mon, 7 Feb 2022 00:02:51 +0100 (CET) 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="opI9HLUW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6D3C483BED; Mon, 7 Feb 2022 00:02:50 +0100 (CET) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (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 74AF583BD8 for ; Mon, 7 Feb 2022 00:02:47 +0100 (CET) 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-x72e.google.com with SMTP id 200so9642786qki.2 for ; Sun, 06 Feb 2022 15:02:47 -0800 (PST) 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; bh=gC9Y+bslxYFPF5AH1mqDMbB66BSSB1W4FbmSDhRRkCY=; b=opI9HLUWsMI3+WOxNw7jcQ230mQZryRjuY9y/D8EfdKFrlRqISSIPLVmpsSpIjserA ysPrDOVGBKH1+oKnAmxUxGccEVjF+FRrPqA46cYOwrXo0wdt3xt49srVrM/dV93seUe/ 20vc24IItft6eZ0Tuz8zgvApi1XPufNv61C3g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gC9Y+bslxYFPF5AH1mqDMbB66BSSB1W4FbmSDhRRkCY=; b=AW4I3u0lRTK8Qy4rXOp4VXfhB64YE+KVNQh5hUYVWry2vDxY2HJaeYw+SEfYewRmr5 oqENnkM8bCMXhV8uRSxRlGYSYMPaCBuAuwlsOcHGo5Jb5asvHKwG9kgpWPR4+RiESUnE zYk961koKp/S71YOKuRfAajZS2hHMgljyrKMKJVoQcDgVrLpm9UKQowx7W0ieuKrlzdA 1/a3hIfuHWaQoMPI8et75D5sEEtoG4XzK2q1X5KoaWbDYC4FipofPBVPQcRKhXrKBHyV twFQFV/HfTyE66uTIFob4/IkFwToxMeGCiAH46fqMbLGi/NdH0V3opJeMpAKhd1PWbfQ FmCg== X-Gm-Message-State: AOAM533Me6Le2u31BsXqJYaX7Kfph2h2AiFsObXGiiVNBtYANiMNWIoD dCWvh9MDfO8SSHBf04f3Y4AymQ== X-Google-Smtp-Source: ABdhPJzaOdfQfLkSOryRyUixwRA6xceQx8LDyqURZ2IuypWfR3XcI+3uc6zsPs/986A7Olg23JGcwQ== X-Received: by 2002:ae9:c016:: with SMTP id u22mr5168761qkk.504.1644188566173; Sun, 06 Feb 2022 15:02:46 -0800 (PST) Received: from bill-the-cat (2603-6081-7b01-cbda-2ef0-5dff-fedb-a8ba.res6.spectrum.com. [2603:6081:7b01:cbda:2ef0:5dff:fedb:a8ba]) by smtp.gmail.com with ESMTPSA id bq33sm4783984qkb.64.2022.02.06.15.02.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Feb 2022 15:02:45 -0800 (PST) Date: Sun, 6 Feb 2022 18:02:43 -0500 From: Tom Rini To: Janne Grunau Cc: u-boot@lists.denx.de, Mark Kettenis , sjg@chromium.com Subject: Re: [PATCH 1/1] arm: apple: Switch to fully dynamic mem layout Message-ID: <20220206230243.GV7515@bill-the-cat> References: <20220206210704.29138-1-j@jannau.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="x9eD2RskteXOQWXz" Content-Disposition: inline In-Reply-To: <20220206210704.29138-1-j@jannau.net> X-Clacks-Overhead: GNU Terry Pratchett 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.5 at phobos.denx.de X-Virus-Status: Clean --x9eD2RskteXOQWXz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 06, 2022 at 10:07:04PM +0100, Janne Grunau wrote: > Support for Apple M1 Pro and Max will allow using a single binary for > all M1 SoCs. The M1 Pro/Max have a different memory layout. The RAM > start address is 0x100_0000_0000 instead of 0x8_0000_0000. > Replace the hardcoded memory layout with dynamic initialized > environment variables in board_late_init(). >=20 > Tested on Mac Mini (2020) and Macbook Pro 14-inch (2021). >=20 > Signed-off-by: Janne Grunau [snip] > +int board_late_init(void) > +{ > + ulong max_size; > + u32 status =3D 0; > + > + max_size =3D gd->start_addr_sp - CONFIG_STACK_SIZE; > + max_size =3D round_down(max_size, SZ_16M); > + > + status |=3D env_set_hex("scriptaddr", max_size + SZ_2M); > + > + status |=3D env_set_hex("pxefile_addr_r", max_size + SZ_1M); > + > + status |=3D env_set_hex("fdt_addr_r", gd->ram_base + SZ_32M - SZ= _1M); > + > + status |=3D env_set_hex("kernel_addr_r", gd->ram_base + SZ_32M); > + > + status |=3D env_set_hex("ramdisk_addr_r", gd->ram_base + SZ_64M); > + > + if (status) > + printf("%s: Saving run time variables FAILED\n", __func_= _); This should be "Setting" rather than saving, since we don't (and shouldn't) save the environment here. --=20 Tom --x9eD2RskteXOQWXz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmIAU44ACgkQFHw5/5Y0 tyyFAgv/UghouM+SIAZLKcpZL/BsuNiCqZbnRJ+qSchzJ6VowstB2//HibWc9mPq J53QrtGEtlC+p+P36MbGVQUc0G7duA4MbjWGdPCkzmBCqL8IbupBhaSDV9nOjKgP rnEcgp77fMScLcRoYKgYVXZKDr8zNdxFNfFi7/Eq/SUUhPZvgh3OuFWZ9VrWfVzB HlXFibn35Vi3ZZjJFlQjRtPi492NT1vLstdK4Ca9ubOi6BcTKx9iBtF2MlHCl69o MNKwCEOJAZ3AtgCYh+7U1e+tHQIJWgVGCnewSmQeh79IQkXgJgnvsPJbAvOT4tkI +3LLn3TMy5zX8z0gxk4ZO/XDM7w4HRBLr9KTsFPBNujnuqxRvLA5n1zWGXFsDAbs JFpT3KpCH/Nkryqq8avcUb0vUgxk2cg6OpS3iZD4xSnckOLjNP4HXBAWk6SmaxYz JeieZuc1M1Yy+asCIXmmbL+2SckXVK4diI48K+tAv5U2dnGznHPwHVMoM5ogJop8 XgMG7dUy =YVCO -----END PGP SIGNATURE----- --x9eD2RskteXOQWXz--