[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 6/9] hw/intc: sifive_plic: Add a reset function
From: |
Bin Meng |
Subject: |
Re: [PATCH v1 6/9] hw/intc: sifive_plic: Add a reset function |
Date: |
Thu, 21 Oct 2021 15:37:03 +0800 |
On Mon, Oct 18, 2021 at 10:40 AM Alistair Francis
<alistair.francis@opensource.wdc.com> wrote:
>
> From: Alistair Francis <alistair.francis@wdc.com>
>
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
> hw/intc/sifive_plic.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/hw/intc/sifive_plic.c b/hw/intc/sifive_plic.c
> index 877e76877c..5444368ad4 100644
> --- a/hw/intc/sifive_plic.c
> +++ b/hw/intc/sifive_plic.c
> @@ -355,6 +355,18 @@ static const MemoryRegionOps sifive_plic_ops = {
> }
> };
>
> +static void sifive_plic_reset(DeviceState *dev)
> +{
> + SiFivePLICState *s = SIFIVE_PLIC(dev);
> +
> + memset(s->claimed, 0, sizeof(uint32_t) * s->bitfield_words);
This line should be removed.
> + memset(s->source_priority, 0, sizeof(uint32_t) * s->num_sources);
> + memset(s->target_priority, 0, sizeof(uint32_t) * s->num_addrs);
> + memset(s->pending, 0, sizeof(uint32_t) * s->bitfield_words);
> + memset(s->claimed, 0, sizeof(uint32_t) * s->bitfield_words);
> + memset(s->enable, 0, sizeof(uint32_t) * s->num_enables);
> +}
> +
> /*
> * parse PLIC hart/mode address offset config
> *
> @@ -501,6 +513,7 @@ static void sifive_plic_class_init(ObjectClass *klass,
> void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
>
> + dc->reset = sifive_plic_reset;
> device_class_set_props(dc, sifive_plic_properties);
> dc->realize = sifive_plic_realize;
> dc->vmsd = &vmstate_sifive_plic;
Regards,
Bin
- [PATCH v1 1/9] hw/riscv: opentitan: Update to the latest build, Alistair Francis, 2021/10/17
- [PATCH v1 2/9] hw/intc: Remove the Ibex PLIC, Alistair Francis, 2021/10/17
- [PATCH v1 3/9] hw/intc: sifive_plic: Move the properties, Alistair Francis, 2021/10/17
- [PATCH v1 4/9] hw/intc: sifive_plic: Cleanup the realize function, Alistair Francis, 2021/10/17
- [PATCH v1 5/9] hw/intc: sifive_plic: Cleanup the irq_request function, Alistair Francis, 2021/10/17
- [PATCH v1 6/9] hw/intc: sifive_plic: Add a reset function, Alistair Francis, 2021/10/17
- Re: [PATCH v1 6/9] hw/intc: sifive_plic: Add a reset function,
Bin Meng <=
- [PATCH v1 7/9] hw/intc: sifive_plic: Cleanup the write function, Alistair Francis, 2021/10/17
- [PATCH v1 8/9] hw/intc: sifive_plic: Cleanup the read function, Alistair Francis, 2021/10/17
- [PATCH v1 9/9] hw/intc: sifive_plic: Cleanup remaining functions, Alistair Francis, 2021/10/17
- Re: [PATCH v1 1/9] hw/riscv: opentitan: Update to the latest build, Bin Meng, 2021/10/21