qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 2/2] hw/exynos4210_gic.c: Introduce n_in and


From: Evgeny Voevodin
Subject: Re: [Qemu-devel] [PATCH v2 2/2] hw/exynos4210_gic.c: Introduce n_in and n_out propeties.
Date: Mon, 16 Apr 2012 15:14:32 +0400
User-agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

On 16.04.2012 15:01, Peter Maydell wrote:
On 12 April 2012 09:13, Evgeny Voevodin<address@hidden>  wrote:
With these properties irq gate could be tuned to mux up to
QDEV_MAX_IRQ inputs and ouputs. Gate will group inputs
into groups of size n_in/n_out each.
@@ -420,14 +430,20 @@ static int exynos4210_irq_gate_init(SysBusDevice *dev)
     Exynos4210IRQGateState *s =
             FROM_SYSBUS(Exynos4210IRQGateState, dev);

+    /* Gate will make each input group of size n_in / n_out */
I think it would be useful to expand this comment to describe how the
device uses its gpio_in and sysbus irq outputs. (This is necessary at
the moment because we don't have the ability to have nicely named
arrays of gpio inputs/outputs, so often the single gpio input array
is arbitrarily divided up and you just have to document in a comment
how it works; see for instance arm_gic.c and arm_mptimer.c. Something
like:

/* This device models a collection of OR gates. There are n_out
  * separate gates, and output sysbus IRQ line N is the output of
  * gate N. The input qdev gpio lines are the inputs to each gate
  * in order:
  *  [0.. n_in/n_out - 1] : inputs to gate 0
  *  [n_in/n_out .. 2*n_in/n_out - 1] : inputs to gate 1
  * and so on.
  */

Ok.

The other approach to consider would be to make each OR gate a separate
device, and just instantiate N of them. That would probably look
cleaner in the device implementation but be a little more code in
exynos4210.c. I don't have a preference either way -- just a thought.

Do you mean to have each OR gate with only two inputs? Then if we want to mux n inputs into one output, we'll have to place a number of gates after a gate output... As for me it's better
to have one configurable gate with multiple inputs.

+    if ((s->n_in % s->n_out) != 0) {
+        hw_error("n_in is not multiple of n_out in Irq Gate");
"exynos4210.irq_gate: n_in must be a multiple of n_out".

Ok.

-- PMM


Thanks!

--
Kind regards,
Evgeny Voevodin,
Leading Software Engineer,
ASWG, Moscow R&D center, Samsung Electronics
e-mail: address@hidden




reply via email to

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