On Mon, May 05 2014 at 3:34:31 pm BST, Jon Loeliger <loeli...@gmail.com> wrote: > Mark, > > Not sure on which patch of your series to base the following comment, > but thought it was worth bringing up for discussion nevertheless. > > So, over in U-Boot ARMv7's arch/arm/cpu/armv7/start.S code, there > is a bit of code under the enty-point named cpu_init_cp15 that does > some I-Cache/MMU/state and Errata fi-xup for the boot CPU. As it should. > That's all splendid. > > However, any secondary CPU coming out of reset *after* the U-Boot is > gone and only the secure monitor remains will still need to execute code > that is substantially similar if not exactly the same. > > That means the same code block (that cpu_init_cp15 code) needs to be > assembled into the original out-of-reset sequence for the boot CPU, and > also needs to be assembled into the secure monitor code for secondary > CPU out-of-reset sequences. > > We clearly can not directly refactor that function, extracting it and > reusing it wiith the same entry-point as it needs to be linked into > two different sections. We could put it in some header file and > #include it into both places. We could define a macro and instantiate > it in each place. We could do some hacky assemble it twice with > different names thing. > > Thoughts?
Yes, that makes perfect sense. Can we put this into a separate object file and play some link-time hackery instead? Otherwise, the include thingy seems fine. Cheers, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot