[RFT PATCH v3 1/9] RISC-V: Move DT mapping outof fixmap

Arnd Bergmann arnd at arndb.de
Tue Jul 21 04:57:24 EDT 2020


On Tue, Jul 21, 2020 at 6:18 AM Atish Patra <atishp at atishpatra.org> wrote:
> On Sat, Jul 18, 2020 at 2:24 AM Arnd Bergmann <arnd at arndb.de> wrote:
> > On Sat, Jul 18, 2020 at 3:05 AM Atish Patra <atishp at atishpatra.org> wrote:
> > > That's what the original code was doing. A fixmap entry was added to
> > > map the original fdt
> > > location to a virtual so that parse_dtb can be operated on a virtual
> > > address. But we can't map
> > > both FDT & early ioremap within a single PMD region( 2MB ). That's why
> > > we removed the DT
> > > mapping from the fixmap to .bss section. The other alternate option is
> > > to increase the fixmap space to 4MB which seems more fragile.
> >
> > Could the original location just be part of the regular linear mapping of all
> > RAM?
>
> No. Because we don't map the entire RAM until setup_vm_final().
> We need to parse DT before setup_vm_final() to get the memblocks and
> reserved memory regions.

Ok, I see how you create a direct mapping for the kernel image, plus
the fixmap for the dtb in setup_vm(), and how moving the dtb into the
kernel image simplifies that.

I'm still wondering why you can't do the same kind of PGD mapping
for the dtb that you do for the vmlinux, creating linear page table
entries exactly for the location that holds the dtb, from dtb_pa to
dtb_pa+((struct fdt_header*)dtb_pa)->totalsize.

      Arnd



More information about the linux-riscv mailing list