On Fri, 7 Apr 2023 at 17:05, Huang Canming <huangcm...@gmail.com> wrote:
>
> Sorry for the wrong cmd. It'a typo after I edit the sample command.
> my command is: ./qemu-system-arm -M mymachine -smp cpus=2 -kernel test1.elf 
> -bios test2.elf -serial stdio -serial tcp::5678,server=on,wait=off
> which use 'kernel' and "bios" to load different firmwares to the 2 cpus.
>
>> You should only call armv7m_load_kernel() once, even if there
>> is more than one CPU in the system.
>
> So I need to use  generic loader to load file into cpu and then do cpu reset 
> by myself(which was done in armv7m_load_kernel).

No, you don't need to do cpu reset yourself. Your board
code must call armv7m_load_kernel() once and only once.

> I have a few further question:
> in such cases, do I need a second sysbus? or can the 2 cpus use the same 
> sysbus?

"sysbus" is just an odd artefact of an old bit of QEMU's
design. There is no "bus" there particularly - it only matters
for ensuring that devices of type SYSBUS get reset.
There is always exactly one sysbus.

> and why the armv7m_load_kernel can only be called once?

It must be called exactly once because it does some work like
arranging for the CPUs to be reset. If you don't call it,
the CPU reset doesn't work right; if you call it twice then
it gets confused.

-- PMM

Reply via email to