From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sun, 30 Jun 2019 01:03:47 +0200 Subject: [U-Boot] What if ATF can be part of U-Boot source, like SPL? In-Reply-To: References: Message-ID: <0aa82db6-be91-2775-41de-e936b6344da0@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de On 6/29/19 8:49 PM, Andr=C3=A9 Przywara wrote: > On 29/06/2019 16:02, Jagan Teki wrote: >> In terms of code maintenance and development feasibility it is always >> a better approach to have out-of-tree code or binary to be part of >> in-house source tree. >=20 > I am not sure this is really true. If I get you right, you want to > mirror and sync the ATF source into the U-Boot tree, which sounds like a > pain: > - ATF development is quite dynamic, with just shy of 1000 commits alone > this year. I don't think ATF development is anywhere near as dynamic as U-Boot, there's over 1000 commits in each U-Boot release, with quarterly release cycle. > This would mean constant churn of keeping the source up-to-date. > - The overlap of U-Boot and ATF users is not that big: ATF has support > for a lot more platforms (most of them typically paired with EDK-2), Can you elaborate on how you came to this conclusion ? Last time I counted (a few days ago, in ATF master), the upstream ATF supported some low tens of boards, upstream U-Boot around a thousand. And then there's the part where ATF is ARM-centric while U-Boot is platform-agnostic. > also provides a lot more code than U-Boot platforms typically use: BL1, > BL2, secure payload support, etc. I am not sure a lot of people are > happy if we add tons of code lines to the repo which will never be used. BL1 is bootrom, right ? BL2 is hardware initialization, which is roughly doing the same thing as U-Boot SPL. Secure payload support was in U-Boot for a very long time too. >> This is what exactly it was done for SPL, if I'm not wrong. >=20 > But this SPL/proper code sharing does not come without a price. Think > about the problems with DM and the often limited SPL code size, which > causes us some headaches. Also I wonder how much code they actually > share? Thinking about DRAM init, the separate SPI flash driver for > Allwinner and all those #ifdefs everywhere. Maybe you should take a look at some other platform(s), rather than draw conclusion from one platform, that's not a good statistical practice. SoCFPGA for example uses the same drivers in SPL as it does in U-Boot, same for TI, and I can go on. Allwinner has severe SRAM limitations, so there it cannot be helped that it needs custom driver. I don't see how using ATF would make any difference here. > I am not questioning the current design, but just want to point out that > this might not be best thing since sliced bread. It would certainly help if we could have one, or a few, bootloader project(s) and work on those few, to make them great. Currently there are many, each with a limited developer community. Adding more does not help, it only increases the fragmentation and the mess. >> So can we >> do the same thing for ATF on ARM64 SoCs? >> >> We are using ATF (on Allwinner) to switch EL3 to EL2 for start loading >> U-Boot proper and minimal PSCI >=20 > Minimal PSCI? TF-A is the full fledged reference implementation of PSCI, > it always supports the newest revisions, including Spectre/Meltdown > support. This alone is a killer argument for me to use ATF. So ARM creates new PSCI version, ARM implements it into ARM trusted firmware, and then presents it to the users as the latest greatest. That sounds a bit like the old windows development model -- one company does everything and then presents it to developers for them to consume. My recent impression of ATF development is there is no community around ATF, so I presume there is no interest from collecting any feedback on the PSCI development from people outside of ARM, is that right ? [...] --=20 Best regards, Marek Vasut