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=-17.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,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 05027C4338F for ; Sat, 24 Jul 2021 20:40:13 +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 1BEA360725 for ; Sat, 24 Jul 2021 20:40:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1BEA360725 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.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 E101883128; Sat, 24 Jul 2021 22:40:09 +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="TMBl/vuT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 475F98311C; Sat, 24 Jul 2021 22:40:07 +0200 (CEST) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (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 7329482E05 for ; Sat, 24 Jul 2021 22:40:03 +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-qt1-x836.google.com with SMTP id h10so4197207qth.5 for ; Sat, 24 Jul 2021 13:40:03 -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=2ehderYMCGj5Pxsxb1fDer1liuW15FV2LQ7Lk3yy9GQ=; b=TMBl/vuT6pacCOK+EevHwcHP32Wnl8/ZCBEQeqleJnic42F8PDkoS5ShU2tQzOcCGs pKFbmXfVPdYDhTeuAevHEnDzJi97HTvSxbJ8cwmtgi9CUtAkkCD3nuJ4oH/GzWa3xHKw z+oxj+H7o+L4KVJKkPoIjxaNEMRJFJVxYX6FA= 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=2ehderYMCGj5Pxsxb1fDer1liuW15FV2LQ7Lk3yy9GQ=; b=CQExJPDWPxcp/sUU8IDz2iwD7NCrOPtNHPIScn6zIj1LqnTvlm0RBNTjiPZqft8WAr UJ4ganSyKXzob/rdBkIGZSpczu6FfDkTaLsMmlAN3YmZ1JVEI/1JHVcsf8EyidLZSkkw 9wHZnQ8g0AxJFgmPc5YuevHQDzmWurXa7jXCzSL3xdaiuNod4oLkih7v0D789N5nEZex AY7YbzuuEAI/amPloVrrF+Qlisayi5O/DEl5Ap9MwTvA8cJDLskrwx2OSw8dV904pLW6 O+PXJTYlndZhhuSKAdQ8xRzc0NEyNl+6xBt4kYlxaUVW22RB26YFSlnbwlBY1M+hUDnt TDZw== X-Gm-Message-State: AOAM533qauhmnHLrCQL6jQg/RbVDQ8629i884yyNrvozfRvYmWj9khXU BJjXamhu5/iKXDFDjuxl38l2Lg== X-Google-Smtp-Source: ABdhPJzwFqGOoWW/47ryObkAe+Ewde48+WODCLSN3Mji09jNd/oP0wjaU5mWQkEnoFlyCAe9zgcluA== X-Received: by 2002:ac8:7491:: with SMTP id v17mr9334620qtq.228.1627159202068; Sat, 24 Jul 2021 13:40:02 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-0853-2920-f0b9-3dd6.res6.spectrum.com. [2603:6081:7b01:cbda:853:2920:f0b9:3dd6]) by smtp.gmail.com with ESMTPSA id p22sm12972863qtq.64.2021.07.24.13.40.00 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 24 Jul 2021 13:40:01 -0700 (PDT) Date: Sat, 24 Jul 2021 16:39:59 -0400 From: Tom Rini To: Stephan Gerhold Cc: u-boot@lists.denx.de, Ramon Fried , Jorge Ramirez-Ortiz , Nicolas Dechesne Subject: Re: [PATCH] board: dragonboard410c: Load U-Boot directly without LK Message-ID: <20210724203959.GN9379@bill-the-cat> References: <20210707090602.32515-1-stephan@gerhold.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="AnoCzHCzU/Mgm7Oo" Content-Disposition: inline In-Reply-To: <20210707090602.32515-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 --AnoCzHCzU/Mgm7Oo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 07, 2021 at 11:06:02AM +0200, Stephan Gerhold wrote: > At the moment the U-Boot port for the DragonBoard 410c is designed > to be loaded as an Android boot image after Qualcomm's Little Kernel (LK) > bootloader. This is simple to set up but LK is redundant in this case, > since everything done by LK can be also done directly by U-Boot. >=20 > Dropping LK entirely has at least the following advantages: > - Easier installation/board code (no need for Android boot images) > - (Slightly) faster boot > - Boot directly in 64-bit without a round trip to 32-bit for LK >=20 > So far this was not possible yet because of unsolved problems: >=20 > 1. Signing tool: The firmware expects a "signed" ELF image with extra > (Qualcomm-specific) ELF headers, usually used for secure boot. > The DragonBoard 410c does not have secure boot by default but the > extra ELF headers are still required. >=20 > 2. PSCI bug: There seems to be a bug in the PSCI implementation > (part of the TrustZone/tz firmware) that causes all other CPU cores > to be started in 32-bit mode if LK is missing in the boot chain. > This causes Linux to hang early during boot. >=20 > There is a solution for both problems now: >=20 > 1. qtestsign (https://github.com/msm8916-mainline/qtestsign) > can be used as a "signing" tool for U-Boot and other firmware. >=20 > 2. A workaround for the "PSCI bug" is to execute the TZ syscall when > entering U-Boot. That way PSCI is made aware of the 64-bit switch > and starts all other CPU cores in 64-bit mode as well. >=20 > Simplify the dragonboard410c board by removing all the extra code that > is only used to build an Android boot image that can be loaded by LK. > This allows dropping the custom linker script, special image magic, > as well as most of the special build/installation instructions. >=20 > CONFIG_REMAKE_ELF is used to build a new ELF image that has both U-Boot > and the appended DTB combined. The resulting u-boot.elf can then be > passed to the "signing" tool (e.g. qtestsign). >=20 > The PSCI workaround is placed in the "boot0" hook that is enabled > with CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK. The extra check for EL1 allows > compatibility with custom firmware that enters U-Boot in EL2 or EL3, > e.g. qhypstub (https://github.com/msm8916-mainline/qhypstub). >=20 > As a first step these changes apply only to DragonBoard410c. > Similar changes could likely also work for the DragonBoard 820c. >=20 > Note that removing LK wouldn't be possible that easily without a lot of > work already done three years ago by Ramon Fried. A lot of missing > initialization, pinctrl etc was already added back then even though > it was not strictly needed yet. >=20 > Cc: Ramon Fried > Signed-off-by: Stephan Gerhold Applied to u-boot/master, thanks! --=20 Tom --AnoCzHCzU/Mgm7Oo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmD8epgACgkQFHw5/5Y0 tywT6wv/VO1ck0FPqGJe111x+U9XC12jDZLOV7LZdAtNxMGQK1v7XYnRc9RERFXq CwtKQDYSVfQW2R9BBGrgaOo2TnhmXgVZkp/ClerGd0fcmP7ck8z9o9wRGSWU0Wp7 pZ5fKc1yAie0jJaAqhcmLORPo2SJq3M9GKyu52JmLG9LIDeQSoInkDb6pLNpP1xL FYwOP8mcDlHkySLFUDMcy4Kpqp3YwYcIFiYHbSQN8e47fxoleCPTGQVb6etuPZA2 H/rX/yhUlyMmlVse3a+5CQWnZN34YR22s/0TeGwcVFEIOZxHLk+Ske6mOtCYZfgI fJ6mtaE4JhAPXuyDF2IZATX3LzSblwmmFkNctSpynxhDHpVbXiMrouJNuUu+uVex vhWTwh9gH0qd6+7r1EfLApUQDiPgAhNaakQrSV7Yr6dY87KLQ9+Yf/61wjF5lerc hRTr1lzzaOha4tPieHVwE9dkCIdzFapH2kcppgFYmF/mH7ShFmwF+Y5ASdy/RDpF zBfe7E+I =1Q6e -----END PGP SIGNATURE----- --AnoCzHCzU/Mgm7Oo--