qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to prevent automatic dtb load?


From: Peter Maydell
Subject: Re: how to prevent automatic dtb load?
Date: Thu, 4 Aug 2022 13:58:14 +0100

On Thu, 4 Aug 2022 at 13:51, Chan Kim <ckim@etri.re.kr> wrote:
> Yes, you are right. I tried again with that -dtb option like this.
>
> qemu-system-aarch64  -machine 
> ab21q,gic-version=max,secure=on,virtualization=true -cpu max -kernel 
> u-boot-spl -m 8M -nographic -device loader,file=Image,addr=0x80200000 -dtb 
> ab21m.dtb -chardev stdio,mux=on,id=char0 -serial chardev:char0 -serial 
> chardev:char0
>
> And it proceeded with the linux booting. Thanks!
> (I thought I tried this before and had the same error, but it works ok now. 
> Maybe I have done something wrong then.)
> So I gather qemu loads the file I provide with -dtb option at the first 
> address of the memory(0x80000000 in my case) and doesn't load the dtb it 
> generated instead. My virtual machine is a modified version of arm/virt).

Yes, if you specify a -dtb command line option that overrides
the autogenerated file. But generally you shouldn't do that.
You should decide whether your new machine:
 * expects the user to provide a DTB, like almost all of
   the other boards QEMU has. This is the normal case,
   for when QEMU is modelling a specific fixed piece of
   hardware. The idea is the user passes QEMU the same
   dtb file that they would do to boot the kernel on
   real hardware.
 * expects to autogenerate the DTB matching whatever it does,
   like the virt board. This is the unusual case -- virt
   only does this because it is a purely "virtual" board
   that doesn't match any real physical hardware and
   which changes depending on what the user asked for.

and then use it that way.

More generally, if you're writing a new machine type,
then 'virt' is a very bad choice for basing it on,
because 'virt' is not a "normal" machine type, and does
lots of things in ways that you wouldn't want to do
for a straightforward "model of real bit of hardware".

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]