On 01/18/2012 08:53 AM, Peter Maydell wrote: > On 18 January 2012 14:35, Mark Langsdorf <mark.langsd...@calxeda.com> wrote:
>> Is there a good example of how to write secondary smp boot >> code other than arm_boot.c? Should I just expect to pull >> most of arm_boot.c into highbank and adjust from there? I >> don't want to duplicate code like that, but I need more >> flexibility than I can easily add to arm_boot.c. > > Nope, I'm afraid you're the first one to run into this. > arm_boot.c started off as just implementing the realview > secondary boot protocol, and exynos4 and vexpress have > been close enough to piggyback on it. So highbank is the > first board that's different enough to need its own code. > > A big chunk of arm_boot.c is the primary CPU boot code, > which should be standard for all arm platforms, so that > shouldn't need to change. So we just need a reasonably > clean solution for a platform to provide its own secondary > boot code. I'm vaguely thinking about providing a hook > function for 'write secondary boot code' and one for > 'post-cpu-reset hook for secondary cpus', which would go > in the "if (info->nb_cpus > 1) {...}" condition in > arm_load_kernel() and in the else-clause of "if (env == > first_cpu) in do_cpu_reset(). > > Can you try something along those lines? I think so. I was worried about accessing some of the arm_boot static variables but it doesn't look like I'll need to do that. I'll do a quick refactor RFC of arm_boot.c and then get into the gory bits of getting something to work for Highbank. --Mark Langsdorf Calxeda, Inc.