[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/9] intc/grlib_irqmp: implements the multiprocessor status r
|
From: |
Clément Chigot |
|
Subject: |
Re: [PATCH 3/9] intc/grlib_irqmp: implements the multiprocessor status register |
|
Date: |
Fri, 5 Jan 2024 14:23:09 +0100 |
On Fri, Jan 5, 2024 at 12:32 PM Philippe Mathieu-Daudé
<philmd@linaro.org> wrote:
>
> Hi Clément,
>
> On 5/1/24 11:24, Clément Chigot wrote:
> > This implements the multiprocessor status register in grlib-irqmp and bind
> > it to a start signal, which will be later wired in leon3-generic to
> > start a cpu.
> >
> > Co-developed-by: Frederic Konrad <konrad.frederic@yahoo.fr>
> > Signed-off-by: Clément Chigot <chigot@adacore.com>
> > ---
> > hw/intc/grlib_irqmp.c | 22 +++++++++++++++++++---
> > 1 file changed, 19 insertions(+), 3 deletions(-)
>
>
> > @@ -323,6 +334,8 @@ static void grlib_irqmp_reset(DeviceState *d)
> >
> > memset(irqmp->state, 0, sizeof *irqmp->state);
> > irqmp->state->parent = irqmp;
> > + irqmp->state->mpstatus = ((irqmp->ncpus - 1) << 28)
>
> Can you #define this magic '28' number?
>
> > + | ((1 << irqmp->ncpus) - 2);
> > }
> >
> > static void grlib_irqmp_realize(DeviceState *dev, Error **errp)
> > @@ -336,6 +349,9 @@ static void grlib_irqmp_realize(DeviceState *dev, Error
> > **errp)
> > }
> >
> > qdev_init_gpio_in(dev, grlib_irqmp_set_irq, MAX_PILS);
> > + /* Transitionning from 0 to 1 starts the CPUs. */
>
> What about 1 -> 0?
It does nothing. I have updated the comment to mention it.
For the doc (also mention it in the commit message now).
| [15:1] Power-down status of CPU [n]: reads ‘1’ = power-down, ‘0’ = running.
| Write to start processor n: ‘1’=to start ‘0'=has no effect.
> > + qdev_init_gpio_out_named(dev, irqmp->start_signal, "grlib-start-cpu",
> > + IRQMP_MAX_CPU);
> > qdev_init_gpio_out_named(dev, &irqmp->irq, "grlib-irq", 1);
> > memory_region_init_io(&irqmp->iomem, OBJECT(dev), &grlib_irqmp_ops,
> > irqmp,
> > "irqmp", IRQMP_REG_SIZE);
>
[PATCH 4/9] intc/grlib_irqmp: implements multicore irq, Clément Chigot, 2024/01/05
[PATCH 5/9] target/sparc: implement asr17 feature for smp, Clément Chigot, 2024/01/05
[PATCH 6/9] target/sparc: simplify qemu_irq_ack, Clément Chigot, 2024/01/05
[PATCH 7/9] leon3: implement multiprocessor, Clément Chigot, 2024/01/05
[PATCH 8/9] leon3: check cpu_id in the tiny bootloader, Clément Chigot, 2024/01/05