MarvellEmbeddedProcessors/atf-marvell

Patch to fix build issues with recent versions of u-boot

Opened this issue · 8 comments

Hello,

I found build errors like below when using u-boot 2020-xx or so:

plat/marvell/a8k/a80x0_mcbin/board/dram_port.c:50:2: error: braces around scalar initializer [-Werror]
   50 |  { {0} },   /* raw spd data */
      |  ^

The reason is that some fields moved in the struct and the initialization doesn't specify field names, it only relies on the declaration order. I fixed it with the attached patch, and with this one it works till 2021.04 (there are other issues in other areas with 2021.07 and later that make the board reboot when loading the kernel but it's no more this one).

I'm attaching the patch, feel free to apply it.

0001-plat-marvell-fix-build-with-recent-versions-of-u-boo.patch.txt

pali commented

Hello Willy! You should report ARM Trusted-Firmware issues to the upstream project as described in the TF-A documentation: https://trustedfirmware-a.readthedocs.io/en/latest/about/contact.html#issue-tracker

All Marvell ARM Trusted-Firmware code for A3K/A7K/A8K/CN913x was integrated to the upstream TF-A project and is developed in upstream for a longer time.

Hi Pali! Thanks for the info, I had never heard about TF-A, I just applied the mcbin build process as described on their wiki. Reading the first link above achieved to discourage me with tons of complicated dependencies, but I'm seeing on your second link that for the Marvell stuff you managed to preserve the initial simplicity of just loading a few repositories and passing a few variables to a make command, so I'll eventually try it.

For the record, I had to rebuild because I bought a 16GB DDR4 stick to put into my mcbin and it didn't boot (unsupported CL setting). This stick is DDR4-3200 CL16. At 2400 the mcbin wants CL=17 and doesn't find any such setting (and I verified and there are only 10-16). I find it strange that it only accepts larger ones. I finally managed to get it work by returning the largest one that below than or equal to the requested value, and now I'm having a working setup with 16G. I'm not proposing to upstream this since it looks more like a hack and few people might be concerned with this nowadays.

@pali thank you again, I've tested the build procedure above and it works perfectly even with u-boot 2023.04. My fix isn't needed. You should add your link above in the project's description to indicate that it's outdated and users should go there now, it would be very helpful.

Thanks!

pali commented

Nice to hear that in upstream it is already fixed.

But I do not know what you mean by updating project description and where... Because this issue tracker in atf-marvell repository is for older Marvell fork of Trusted Firmware, which was already merged into upstream Trusted Firmware project.

If some wiki/guideline is refererring to use this older fork of TF then it would be better to update that guideline. Build instructions for upstream project are in the link which I mentioned in the previous post.

About DDR configuration, as you can see in the build instructions, for A3K and Mocha there are make variables which configures selected DDR configuration. If you have something special which does not work with default configuration, feel free to send patch to upstream TF-A project which adds a new make variable for new DDR configuration. For A3K plat I helped to add more other configurations which people wanted.

What I meant by "updating the description" is that when you land on atf-marvell here, you have no way to know that it's a fork of something else, it looks totally genuine. It's linked to from plenty of places (commit messages, mailing list archives, forums, wikis etc) which by nature will not be updatable nor updated. Users will generally come here to see if there are more recent versions than the branches that are often suggested (2017 or 2018). So if you go to settings and edit the description of this repository to mention that it is no more updated and that it was reintegrated into the trusted firmware project, users will figure it.

Regarding the DDR config, that's good to know. I don't think there's any need to change anything at this step anyway.

pali commented

This repository is owned by Marvell, so for any description update you need to ask Marvell people. I do not have any github permissions here, I was helping and developing in upstream TF-A project.

OK, no worries, and thanks again for your help. I thought you were one of the repo's owners given you responded immediately ;-) At least your links are now visible in this issue, so this may help other people in the future.