On Fri, Apr 11, 2014 at 5:45 PM, Peter Maydell <peter.mayd...@linaro.org> wrote:
> On 11 April 2014 07:34, Alistair Francis <alistair.fran...@xilinx.com> wrote:
>> This removes the old method to connect devices and replaces it
>> with three calls to the three qdev-monitor functions added
>> in the previous patch.
>>
>> This allows complete machines to be built via the command line as
>> well as just attaching simple sysbus devices.
>
>>  static int device_init_func(QemuOpts *opts, void *opaque)
>>  {
>>      DeviceState *dev;
>> +    QEMUMachineInitArgs *current_machine = (QEMUMachineInitArgs *) opaque;
>> +    DeviceState *intc = current_machine->intc;
>>
>> -    dev = qdev_device_add(opts);
>> -    if (!dev)
>> -        return -1;
>> -    object_unref(OBJECT(dev));
>> +    dev = qdev_device_init(opts, intc);
>> +
>> +    if (dev && (dev->num_gpio_in > 32)) {
>> +        /* Store the Interupt Controller */
>> +        current_machine->intc = dev;
>> +    }
>
> What is this doing here?? Interrupt controllers should
> not be special cases, and they're certainly not
> guaranteed to be the only things with 32 GPIO
> inputs...
>
They are only special cases to connect the other devices to. This is not ideal
and I couldn't figure out any way to determine what the interrupt controller is.

As discussed in the other thread, this could be fixed with named GPIOs and that
is a much better idea

> thanks
> -- PMM
>

Reply via email to