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=-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, 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 8519BC11F67 for ; Tue, 29 Jun 2021 18:03:35 +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 030E961DD7 for ; Tue, 29 Jun 2021 18:03:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 030E961DD7 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 733F4831C8; Tue, 29 Jun 2021 20:03:33 +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="bD61da+g"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0F20B831CE; Tue, 29 Jun 2021 20:03:32 +0200 (CEST) Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (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 40B92831C8 for ; Tue, 29 Jun 2021 20:03:28 +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-x829.google.com with SMTP id f20so15946715qtk.10 for ; Tue, 29 Jun 2021 11:03:28 -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=0v6aNmgf3PIqL2kzUSIqKUKssoh+cW73VPLhbwp9CDo=; b=bD61da+gb0HfzSFDTa36zenbw8TjSmmp5RrCg1jji2teYD8+ISY/Td/76Sjauq/V9N enIMxv3khcqyd8idk6T9JLejbCsvT6cYjCxldeBqRWKVY2TRKoijDxGUBCX01v+tQaIs H2nnYAiSuepClo9SDF/vGZnYzYkvDOGHEYczE= 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=0v6aNmgf3PIqL2kzUSIqKUKssoh+cW73VPLhbwp9CDo=; b=NCnHN5yco9IOmTr5dar/N72q5y4an4/OQT3KJdliQchw5MNB2Tpa2K6zOcOyFc5FNa ooghOmaoFts5GlWPxcYaRSu0t5+q73dQcB4s1kMG6YHiFxk93nnqjSJFpGZA1tqDLTXs wsKw7fYMUWw8rtJ6JxMmL6dvW1rcB5G5ZK58eKH6hpZdNm9bP9sMHT/P8wk7YnmQcNj8 9+ubcVsanpi2KQgDD/eNiCqy/MoZER4cBUpf5SWHHiav6NPLYPyYWvdy0zb5kok6TNOG hfNYhYUv1BTmUNWX4LnfCDJeflIEm9zeVntPfBoguYSUfjIX6/bmvnKvF77YmZgsOvW4 sohA== X-Gm-Message-State: AOAM532xQ3rQMorb05vCVfJXL3rbYDwel9MdtQ5iy8/NqjHyBxwkxt2V 2Z9DNoZZOkrQkofbZT9NOxJCYQ== X-Google-Smtp-Source: ABdhPJzO4zpSS1ZGNot2+Say3fcHDonfhP8k+aCbO1KRCf3Yfn3ZZ4Ao3Iw9IopXHWPlVtkxaDkqeg== X-Received: by 2002:ac8:7f50:: with SMTP id g16mr15926839qtk.195.1624989807054; Tue, 29 Jun 2021 11:03:27 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-1dab-ad46-3d7e-2f8f.res6.spectrum.com. [2603:6081:7b01:cbda:1dab:ad46:3d7e:2f8f]) by smtp.gmail.com with ESMTPSA id m139sm3827027qke.116.2021.06.29.11.03.25 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Jun 2021 11:03:26 -0700 (PDT) Date: Tue, 29 Jun 2021 14:03:23 -0400 From: Tom Rini To: Andre Przywara Cc: Simon Glass , u-boot@lists.denx.de, Linus Walleij , Liviu Dudau Subject: Re: [PATCH] arm: Add (back) VExpress boards support Message-ID: <20210629180323.GA9516@bill-the-cat> References: <20210629114555.20805-1-andre.przywara@arm.com> <20210629121122.GV9516@bill-the-cat> <20210629151552.756ab8b2@slackpad.fritz.box> <20210629175210.1468b1e1@slackpad.fritz.box> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2ONAGsQnGlc6kpQd" Content-Disposition: inline In-Reply-To: <20210629175210.1468b1e1@slackpad.fritz.box> 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 --2ONAGsQnGlc6kpQd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 29, 2021 at 05:52:10PM +0100, Andre Przywara wrote: > On Tue, 29 Jun 2021 15:15:52 +0100 > Andre Przywara wrote: >=20 > Hi, >=20 > > On Tue, 29 Jun 2021 08:11:22 -0400 > > Tom Rini wrote: > >=20 > > > On Tue, Jun 29, 2021 at 12:45:55PM +0100, Andre Przywara wrote: > > > =20 > > > > The v2021.07 merge window saw the removal of the Arm Ltd. Versatile > > > > Express platform, along with their CA5, CA9 and TC2 boards. The tri= gger > > > > was the missing conversion of the MMC driver. > > > >=20 > > > > Some folks complained about that internally, so bring those boards = back, > > > > but better than ever: > > > > - Use DM and OF_CONTROL for all the boards. Use the .dts files from= the > > > > latest Linux kernel (5.13) for that. > > > > - Move the board selection choice into the platform's Kconfig. > > > > - Clean up some shared config and common definitions. > > > > - Drop obsolete features like ATAGs support. > > > > - Switch to the DM_ETH version of the SMC911X Ethernet driver. > > > > - Drop MMC support. > > > >=20 > > > > The PL180 MMC driver actually supports DM_MMC, but that requires a > > > > DM_GPIO driver for the card detect GPIO, which we don't have. This > > > > specific GPIO is actually handled via the "sysregs" device, so we w= ould > > > > need a driver for that. QEMU does not emulate this part, also the DT > > > > description is somewhat "special", so this is left for later. > > > >=20 > > > > This version compiles without any warning for all three boards now. > > > > Tested on QEMU. > > > >=20 > > > > Signed-off-by: Andre Przywara > > > > --- > > > > Hi, > > > >=20 > > > > this relies on the SMC911x driver DT changes, as posted here: > > > > https://lists.denx.de/pipermail/u-boot/2021-June/452989.html > > > > I put a version with the changes broken down here: > > > > https://github.com/Andre-ARM/u-boot/commits/tc2-history > > > >=20 > > > > This was tested on QEMU, for vexpress_ca15_tc2_defconfig with: > > > > $ qemu-system-arm -M vexpress-a15,secure=3Don -cpu cortex-a15 -m 1G= -smp 1 \ > > > > -drive file=3Dtramp-tc2.bin,if=3Dpflash,format=3Draw,read-only \ > > > > -device loader,file=3Du-boot.bin,addr=3D0x80800000 -nographic > > > >=20 > > > > Where tramp-tc2.bin is a trampoline replacing the board's firmware: > > > > 00000000 00 00 a0 e3 80 00 48 e3 10 ff 2f e1 > > > > (mov r0, #0; movt r0, #0x8080; bx r0) > > > >=20 > > > > The vexpress_ca9x4_defconfig uses a different memory map, so the ru= nes are: > > > > $ qemu-system-arm -M vexpress-a9 -cpu cortex-a9 -m 1G -smp 1 \ > > > > -drive file=3Dtramp-ca9.bin,if=3Dpflash,format=3Draw,read-only \ > > > > -device loader,file=3Du-boot.bin,addr=3D0x60800000 -nographic > > > >=20 > > > > tramp-ca9.bin: > > > > 00000000 00 00 a0 e3 80 00 46 e3 10 ff 2f e1 > > > > (mov r0, #0; movt r0, #0x6080; bx r0) =20 > > >=20 > > > My big question is how do we run this in CI? Or does it not _need_ t= hat > > > firmware file to really exist? Or is there a pending change to > > > https://gitlab.denx.de/u-boot/u-boot-test-hooks.git to generate / just > > > have exist those magic empty bins? Thanks! =20 > >=20 > > So from digging into this I see that this loads U-Boot's ELF build, via > > QEMU's -kernel parameter. Which is fine, but not really what is > > happening on real hardware. > > I checked and the v2021.04 version worked with this approach, but my > > build does not. > > I will have a look into this now. >=20 > The new build uses OF_CONTROL and OF_SEPARATE, so the DTB gets appended > to the U-Boot *image*. The ELF file is not treated this way, so the > code reads only 0s after the end of the U-Boot code - which makes it > die silently. Manually loading the DTB into DRAM would be fragile at > best, but is also rejected by QEMU, because the LOAD program header > extend for a few dozen bytes beyond U-Boot's "end" symbol, so it > overlaps. Can't we pass the device tree to qemu (and in turn through to U-Boot) in a clean and out of the box way? I thought there was a way to do that.. > IIRC we don't have position independent code for ARM, so we can't load > U-Boot into flash directly (which also would require some code changes > first). Do you mean generate a file to use as the system flash and have U-Boot be in the correct spot within that file? If so bin/travis-ci/conf.qemu_mips_na in the test hooks repo might give you some hints. > Anyway I don't think we should change any code to cope with that (by > using another method to find the DTB), so adjusting the QEMU recipe > sounds like a better idea. >=20 > Is there a way to add those 12 byte trampoline files to the CI repo? Or > shall they be created on the fly somehow? If we need to include the trampoline files, however it's easiest is fine. --=20 Tom --2ONAGsQnGlc6kpQd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmDbYGEACgkQFHw5/5Y0 tyzCOAv+MCsfNvtOF86ZzWab6dYNynneCveTNnM0k3MjSDXH1Ku/R/x8a1VsHcaU GfF/NzUuLgGMDl6KMRmaeatS1ZCO+nkd6F0mTTJ8QAf9KhjNY1ByJn/O+o67UFij FF2QfiX48ZY4VmNIBMJvPDRdhehsSYpq6NrD+67G7X5EobqYBE7czAALk5Osg/C/ TdGbWckq3+ABSsLXS5DMUThtdZ9eQVq2fBWWY9a7V5lSHE9KngkplzPcdelheq0O +qa/f97e0EbjtCuPF6R3l0dfMXRb9VhAPA6rz+yIvE/n/t3i0hpMETCZ7Bkpwp1s ZsaUJr+eQ4RQdm3h52cWuDkxYZmT6vWJM1ue9MR+UN5nmRxPUDc4ju4eFbzB9561 Q/RAxuo15SCEdNd4v3bL+cdQUTBW5+XXuqIyD5YMz0Uek6DyvvpsmDCoIrW+I0AW LZ3CCAPtz2r9LatdxX1skN819JD7LNVLhA3u1EIuyeS1VglXnkO/E4g2M+Z8PKyT N/xmsgNg =C4RA -----END PGP SIGNATURE----- --2ONAGsQnGlc6kpQd--