On Wed, Aug 30, 2023 at 01:19:42PM +0800, Kevin Lo wrote:
> On Tue, Aug 29, 2023 at 09:15:41PM +0200, Mark Kettenis wrote:
> > 
> > > Date: Tue, 29 Aug 2023 11:58:23 +0200
> > > From: Mark Kettenis <mark.kette...@xs4all.nl>
> > > 
> > > Upstreaming of the JH7110 PCIe device tree bindings isn't finished
> > > yet, but it seems some progress has been made and things have been
> > > reviewed by some of the key people involved:
> > > 
> > >   https://patchwork.kernel.org/project/linux-pci/list/?series=779297
> > > 
> > > Here is a diff that adjusts the driver to the current state of things
> > > such that we can use the latest device tree from:
> > > 
> > >   https://github.com/starfive-tech/linux/tree/JH7110_VisionFive2_upstream
> > > 
> > > to continue development.  The idea is to support the preliminary
> > > bindings a little bit longer such that folks can update their device
> > > trees.  Will probably drop support for the preliminary bindings in a
> > > few weeks.
> > > 
> > > ok?
> > 
> > patrick@ pointed out that the dv_unit check won't work properly if the
> > first PCIe controller is disabled.  So here is a diff that checks the
> > device address instead like we do for dwqe(4).
> > 
> > ok?
> 
> ok kevlo@
> 
> Tested on my VisionFive 2 v1.3b with the device tree from:
> 
> https://raw.githubusercontent.com/starfive-tech/linux/JH7110_VisionFive2_upstream/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2-v1.3b.dts
> 
> It works fine, the NVMe is detected.
> 
> BTW, I noticed that the memory statistics seem to be incorrect.
> The VisionFive 2 is equipped with 8GB RAM.
> 
> OpenBSD 7.3-current (GENERIC.MP) #0: Wed Aug 30 11:52:03 CST 2023
>     kevlo@vf2:/usr/src/sys/arch/riscv64/compile/GENERIC.MP
> real mem  = 4294967296 (4096MB)
>             ^^^^^^^^^^^^^^^^^^^
> avail mem = 8110370816 (7734MB)
>             ^^^^^^^^^^^^^^^^^^^

riscv64 calculates physmem (the 'real mem' number) by adding up the
ranges in the /memory device tree node, but uses the EFI memory map to
set up UVM, which is where 'avail mem' comes from.

Should riscv64 be more like arm64 here and calculate physmem by adding
up the memreg segments, which are built from the EFI memory map if available,
and the /memory node if not?

Reply via email to