[PATCH 4/4] platform: generic: tenstorrent: Add RISC-V IOMMU support
Nicholas Piggin
npiggin at gmail.com
Wed Apr 22 18:01:24 PDT 2026
On Wed, Apr 01, 2026 at 11:21:04PM +1030, Joel Stanley wrote:
> On Tue, 10 Mar 2026 at 11:19, Nicholas Piggin <npiggin at gmail.com> wrote:
>
> > --- /dev/null
> > +++ b/platform/generic/tenstorrent/iommu.c
>
> > +int tt_iommu_fdt_configure(const void *fdt)
> > +{
> > + const char *compatible = "tenstorrent,riscv-iommu";
> > + bool found_dt = false;
> > + int offset = -1;
> > +
> > + for (;;) {
> > + uint64_t addr, size;
> > + int rc;
> > +
> > + offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
> > + if (offset < 0)
> > + break;
> > +
> > + rc = fdt_get_node_addr_size_by_name(fdt, offset, "machine",
> > + &addr, &size);
> > + if (rc < 0 || !size) {
> > + sbi_printf("tenstorrent,riscv-iommu did not find "
> > + "machine regs\n");
> > + continue;
> > + }
> > +
> > + if (size < RISCV_IOMMU_REG_MACHINE_SIZE) {
> > + sbi_printf("tenstorrent,riscv-iommu at 0x%016lx "
> > + " machine regs region too small\n", addr);
> > + continue;
> > + }
>
> should this set found_dt = true here?
Yes it should.
Thanks,
Nick
More information about the opensbi
mailing list