All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org,
	aliguori@us.ibm.com, Paul Brook <paul@codesourcery.com>,
	Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [RFC PATCH] arm boot: added QOM device definition
Date: Thu, 9 Feb 2012 11:22:04 +1000	[thread overview]
Message-ID: <CAEgOgz76hOoTiA3xz5J9UJjUBbf5g-cM=o7pnXvUcCXuKY60Mw@mail.gmail.com> (raw)
In-Reply-To: <4F32A442.1090206@codemonkey.ws>

[-- Attachment #1: Type: text/plain, Size: 3616 bytes --]

Alrighty,

So it seems like the bootloader as a device idea has some support, just
need to work out a few implementaiton details. It seems the consensus is
that machine models will instantiate the device. The latest idea is the
machine model will pass some of core props to the bootloader while others
can come over the command line via a yet to be implemented -property
interface.

But pretty much any of the alternatives mentioned here start with
converting the existing bootloader parameters over to qdev props. So here
are the properties of the bootloader (from arm-misc.c):

struct arm_boot_info {
    uint32_t ram_size;
    char *kernel_filename;
    char *kernel_cmdline;
    char *initrd_filename;
    target_phys_addr_t loader_start;
    /* multicore boards that use the default secondary core boot functions
     * need to put the address of the secondary boot code, the boot reg,
     * and the GIC address in the next 3 values, respectively. boards that
     * have their own boot functions can use these values as they want.
     */
    target_phys_addr_t smp_loader_start;
    target_phys_addr_t smp_bootreg_addr;
    target_phys_addr_t smp_priv_base;
    int nb_cpus;
    uint32_t board_id;
    int (*atag_board)(const struct arm_boot_info *info, void *p);
    /* multicore boards that use the default secondary core boot functions
     * can ignore these two function calls. If the default functions won't
     * work, then write_secondary_boot() should write a suitable blob of
     * code mimicing the secondary CPU startup process used by the board's
     * boot loader/boot ROM code, and secondary_cpu_reset_hook() should
     * perform any necessary CPU reset handling and set the PC for thei
     * secondary CPUs to point at this boot blob.
     */
    void (*write_secondary_boot)(CPUState *env,
                                 const struct arm_boot_info *info);
    void (*secondary_cpu_reset_hook)(CPUState *env,
                                     const struct arm_boot_info *info);
};

The addresses, ints and string are easy, but the hard ones are the
callbacks. The qdev ptr is a possible implementation but I see a movement
away from that. I guess the solution is to provide an abstraction through
QOM no? The boards that need to implement their own secondary
boot-loop/reset (theres only 1) or atag boot sequence (again only 1) create
an object that inherits for the arm boot device and instantiate that?

Regards,
Peter

2012/2/9 Anthony Liguori <anthony@codemonkey.ws>

> On 02/08/2012 10:15 AM, Paul Brook wrote:
>
>> Ok, that sounds more workable :). So i would add my initrd_addr property
>>> to
>>> the bootloader as a qdev prop as I suggested before, then something like:
>>>
>>> qemu-system-arm -M verstailepb -property
>>> /foo/bar/arm_linux_loader.0,**initrd_addr=0x10000000
>>>
>>
>> Yes.
>>
>> There are various implementation/syntax details to resolve, but in
>> principle I
>> think it should work a lot like that.
>>
>
> There's already a qom-set that takes a path, property, and value.  It
> works with Visitors.  To bridge this to the command line, you would need to
> make a Visitor that defined some syntax for mapping strings to types
> (pretty trivial really).
>
> But before we can even think about this, we need to refactor the device
> model such that we have a clean separation between initial creation
> (including creation of children devices) and initialization that requires
> properties to be set (realization).
>
> I posted a series for the i440fx that started doing this refactoring for
> the PC.
>
> Regards,
>
> Anthony Liguori
>
>
>> Paul
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 4774 bytes --]

  reply	other threads:[~2012-02-09  1:22 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08  7:55 [Qemu-devel] [RFC PATCH] arm boot: added QOM device definition Peter A. G. Crosthwaite
2012-02-08  9:06 ` Paul Brook
2012-02-08 10:11   ` Peter Crosthwaite
2012-02-08 10:44     ` Paul Brook
2012-02-08 11:10       ` Peter Crosthwaite
2012-02-08 11:39         ` Paul Brook
2012-02-08 11:59           ` Peter Crosthwaite
2012-02-08 12:27             ` Paul Brook
2012-02-08 12:41               ` Alexander Graf
2012-02-08 13:04                 ` Peter Crosthwaite
2012-02-08 13:10                   ` Alexander Graf
2012-02-08 13:30                     ` Peter Crosthwaite
2012-02-08 13:35                       ` Alexander Graf
2012-02-08 14:05                         ` Peter Crosthwaite
2012-02-08 14:17                           ` Alexander Graf
2012-02-08 14:20                           ` Paul Brook
2012-02-08 14:39                             ` Peter Crosthwaite
2012-02-08 14:56                               ` Paul Brook
2012-02-08 15:14                                 ` Peter Crosthwaite
2012-02-08 15:57                                   ` Paul Brook
2012-02-08 16:03                                     ` Peter Crosthwaite
2012-02-08 16:15                                       ` Paul Brook
2012-02-08 16:35                                         ` Anthony Liguori
2012-02-09  1:22                                           ` Peter Crosthwaite [this message]
2012-02-09 12:03                                             ` Paul Brook
2012-02-08 16:20                                       ` Anthony Liguori
2012-02-08 13:47                 ` Anthony Liguori
2012-02-20 19:43                   ` Peter Maydell
2012-02-20 19:51                     ` Andreas Färber
2012-02-20 19:56                       ` Peter Maydell
2012-02-21  9:15                         ` Peter Crosthwaite
2012-02-21 10:20                           ` Peter Maydell
2012-02-08 13:41 ` Anthony Liguori
2012-02-09 13:22 ` Andreas Färber
2012-02-10  2:11   ` Peter Crosthwaite

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEgOgz76hOoTiA3xz5J9UJjUBbf5g-cM=o7pnXvUcCXuKY60Mw@mail.gmail.com' \
    --to=peter.crosthwaite@petalogix.com \
    --cc=agraf@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=anthony@codemonkey.ws \
    --cc=paul@codesourcery.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.