[RFC PATCH v1 20/21] RISC-V: ACPI: Create PLIC platform device
Conor Dooley
conor at kernel.org
Tue Aug 8 04:30:03 PDT 2023
On Tue, Aug 08, 2023 at 04:27:16PM +0530, Anup Patel wrote:
> On Tue, Aug 8, 2023 at 2:12 PM Conor Dooley <conor at kernel.org> wrote:
> >
> > On Thu, Aug 03, 2023 at 11:29:15PM +0530, Sunil V L wrote:
> > > Since PLIC needs to be a platform device
> >
> > For the unwashed, why does the PLCI need to be a platform device?
> > (And while you're at that, please try to make use of the extra ~20
> > characters per line that you can use here.)
>
> As suggested by Marc Z, only timers and IPIs need to be probed early.
> Everything else needs to be a platform device. The devlink feature of
> Linux DD framework ensures that platform devices are probed in the
> right order based on the interdependency.
>
> The PATCH5 of the v7 AIA series converts the PLIC driver into a
> platform driver. This works perfectly fine.
To be clear, I want the explanation of why the "PLIC needs to be a
platform device" to be in the commit message.
Thanks,
Conor.
>
> >
> > > probe the
> > > MADT and create platform devices for each PLIC in the
> > > system. Use software node framework for the fwnode
> > > which allows to create properties and hence the
> > > actual irqchip driver doesn't need to do anything
> > > different for ACPI vs DT.
> > >
> > > Signed-off-by: Sunil V L <sunilvl at ventanamicro.com>
> > > Co-developed-by: Haibo Xu <haibo1.xu at intel.com>
> > > Signed-off-by: Haibo Xu <haibo1.xu at intel.com>
> >
> > > +static struct fwnode_handle *acpi_plic_create_fwnode(struct acpi_madt_plic *plic)
> > > +{
> > > + struct fwnode_handle *fwnode, *parent_fwnode;
> > > + struct riscv_irqchip_list *plic_element;
> > > + struct software_node_ref_args *refs;
> > > + struct property_entry props[8] = {};
> > > + int nr_contexts;
> > > +
> > > + props[0] = PROPERTY_ENTRY_U32("riscv,gsi-base", plic->gsi_base);
> > > + props[1] = PROPERTY_ENTRY_U32("riscv,ndev", plic->num_irqs);
> > > + props[2] = PROPERTY_ENTRY_U32("riscv,max_prio", plic->max_prio);
> >
> > My OCD wants to know why this gets an _ but the others have a -.
> >
> > > + props[3] = PROPERTY_ENTRY_U8("riscv,plic-id", plic->id);
> > > + props[4] = PROPERTY_ENTRY_U64("riscv,plic-base", plic->base_addr);
> > > + props[5] = PROPERTY_ENTRY_U32("riscv,plic-size", plic->size);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20230808/9dcb4c50/attachment.sig>
More information about the linux-riscv
mailing list