qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/3] hw/omap_gpio.c: Convert to qdev


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 3/3] hw/omap_gpio.c: Convert to qdev
Date: Thu, 7 Jul 2011 17:00:48 +0100

On 7 July 2011 16:29, andrzej zaborowski <address@hidden> wrote:
> Optimally
> we should pass the clock as a pointer or name, not only the baudrate
> (clocks can be stopped, reparented, or have frequency changed
> dynamically -- in fact the OS will most likely manipulate the uart
> source clock frequency during init) and the TA region as such instead
> of only the base.  Maybe let's have a short omap_dev_connect_clock
> function that would use or alias prop_set_ptr or something like that
> (and a similar thing for the target agent).

How about we just have the devices define string properties for the
clocks? (and then the device initfn would look the clock up with
omap_findclk()). That seems more useful as a user-visible property
than a raw pointer. Something like:

   s->uart[0] = qdev_create(NULL, "omap_uart");
   s->uart[0]->id = "uart1";
   qdev_prop_set_uint32(s->uart[0], "mmio_size", 0x1000);
   qdev_prop_set_string(s->uart[0], "clock", "uart1_fclk"));
   qdev_prop_set_chr(s->uart[0], "chardev", serial_hds[0]);
   qdev_init_nofail(s->uart[0]);

-- PMM



reply via email to

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