Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 Feb 2006 15:39:40 -0700
From:      Scott Long <scottl@samsco.org>
To:        Andrew Gallatin <gallatin@cs.duke.edu>
Cc:        freebsd-current@www.freebsd.org
Subject:   Re: mapping "random" physical memory into kernel
Message-ID:  <43E28A2C.8000903@samsco.org>
In-Reply-To: <17378.35192.656884.935489@grasshopper.cs.duke.edu>
References:  <17378.34270.630897.473143@grasshopper.cs.duke.edu>	<43E288B0.6080804@samsco.org> <17378.35192.656884.935489@grasshopper.cs.duke.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Andrew Gallatin wrote:
> Scott Long writes:
>  > Andrew Gallatin wrote:
>  > > Can somebody please remind me what the supported way to establish a
>  > > kernel virtual address for a "random" chunk of physical memory is?
>  > > I'm currently using pmap_mapdev() directly, but that just feels
>  > > dirty...
>  > > 
>  > > I need to twiddle the settings of an Nvidia NF4 bridge in extended
>  > > PCI config space (offset 0x178).  These offsets are not accessible
>  > > via normal pci config space writes, but are doable when you use the
>  > > 0xe000000 mapping.
>  > 
>  > Extended pci config space is supported by default on i386, but I
>  > haven't gotten around to figuring out the right strategy for
>  > amd64.  I'd like to be able to map the entire 256MB range instead
>  > of the on-demand approach with i386, but I need to learn more about
>  > the various VM maps on amd64 first.
> 
> Cool.  It would be great if it worked; I'd love to remove
> a bunch of grotty code ;)
> 

If you, Peter, Alan, etc, have any suggestions, I'm all ears.

>  > > 
>  > > The problem is that this memory is not really associated with
>  > > anything, so a normal bus_alloc_resource() allocation doesn't
>  > > seem like it would work.
>  > 
>  > pmap_mapdev is the correct interface for this.
> 
> Except it doesn't appear to exist on sparc64.  But I doubt
> we'd ever see an NF4 bridge there, so I suppose I can ifdef
> it for i386/amd64.
> 
> Drew
> 

That's quite reasonable.

Scott




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43E28A2C.8000903>