[PATCH v2] lib: utils/irqchip: Automatically delegate T-HEAD PLIC access
Peter Korsgaard
peter at korsgaard.com
Thu Nov 4 07:24:22 PDT 2021
>>>>> "Anup" == Anup Patel <anup at brainfault.org> writes:
Hi,
> On Mon, Oct 18, 2021 at 11:04 AM Samuel Holland <samuel at sholland.org> wrote:
>>
>> The T-HEAD PLIC implementation requires setting a delegation bit
>> to allow access from S-mode. Now that the T-HEAD PLIC has its own
>> compatible string, set this bit automatically from the PLIC driver,
>> instead of reaching into the PLIC's MMIO space from another driver.
>>
>> Signed-off-by: Samuel Holland <samuel at sholland.org>
>>
>> ---
>>
>> Changes in v2:
>> - Use the thead,c900-plic compatible instead of the D1 compatible.
>> - Also apply this change to other T-HEAD device tree examples.
>> - Remove the plic-delegate code from the thead,reset-sample driver.
>> - Drop the return value from thead_plic_plat_init().
> Looks good to me.
> Reviewed-by: Anup Patel <anup.patel at wdc.com>
> Applied this patch to the riscv/opensbi repo.
..
>> static const struct fdt_match irqchip_plic_match[] = {
>> { .compatible = "riscv,plic0" },
>> { .compatible = "sifive,plic-1.0.0" },
>> + { .compatible = "thead,c900-plic",
>> + .data = thead_plic_plat_init },
>> { },
>> };
Sorry, old thread but I just noticed now that the thead,c900-plic
compatible should ideally have been before the sifive one, so DTBs with
both compatibles behave correctly (drivers are matched according to the
order of the driver compatible, NOT the order of the compatible in the
DTB).
--
Bye, Peter Korsgaard
More information about the opensbi
mailing list