Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* obtaining physical memory address
@ 1997-02-06  0:19 Robert Allen Barker
  1997-02-06  6:25 ` Richard Henderson
  1997-02-06 16:11 ` jestabro
  0 siblings, 2 replies; 3+ messages in thread
From: Robert Allen Barker @ 1997-02-06  0:19 UTC (permalink / raw)


I am attempting to write an alpha/linnux driver for the BT848 multimedia and
frame grabber chip. To capture a frame the chip dumps the video data
directly into the system main memory. To do this the chip must be provided
with the physical address of an array in the driver program running under
linux.

Q: How can I get the physical address of a data array in my program? I am
still using redhat 3, the function phys() does not seem the be implimented.

Many thanks.

Allan

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: obtaining physical memory address
  1997-02-06  0:19 obtaining physical memory address Robert Allen Barker
@ 1997-02-06  6:25 ` Richard Henderson
  1997-02-06 16:11 ` jestabro
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 1997-02-06  6:25 UTC (permalink / raw)


> Q: How can I get the physical address of a data array in my program? I am
> still using redhat 3, the function phys() does not seem the be implimented.

From user space?  You can't. 

But if you are writing, as it sounded in the first paragraph, an actual
in-kernel device driver, then the thing to use is virt_to_phys or
virt_to_bus.  Please see Documentation/IO-mapping.txt for more complete
details.

r~

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: obtaining physical memory address
  1997-02-06  0:19 obtaining physical memory address Robert Allen Barker
  1997-02-06  6:25 ` Richard Henderson
@ 1997-02-06 16:11 ` jestabro
  1 sibling, 0 replies; 3+ messages in thread
From: jestabro @ 1997-02-06 16:11 UTC (permalink / raw)


>>> Robert Allen Barker said:
> 
> I am attempting to write an alpha/linnux driver for the BT848 multimedia and
> frame grabber chip. To capture a frame the chip dumps the video data
> directly into the system main memory. To do this the chip must be provided
> with the physical address of an array in the driver program running under
> linux.
> 
> Q: How can I get the physical address of a data array in my program? I am
> still using redhat 3, the function phys() does not seem the be implimented.

As Richard Henderson said, the functions you need are virt_to_bus() or
virt_to_phys(), in this case, probably the former.

Explanation:

virt_to_phys() takes a kernel virtual address and provides you back with
the location's physical address AS SEEN BY THE CPU.

virt_to_bus() takes a kernel virtual address and provides you back with
the location's physical address AS SEEN BY A DEVICE ON THE BUS.

On the Alphas, devices on the PCI/ISA/EISA bus are provided with a "window"
into main memory, the window having a range of addresses on the bus which are
then mapped to main memory addresses; this is NOT an identity mapping.

For example: on most of the Alphas, the "window" is setup  for the range of
bus addresses from 1GB to 2Gb-1, mapping (upto) a total of 1Gb of main memory.
All the other bus addresses can be used fpr bus-local memory, such as frame
buffers for video cards, etc.

Examples of the use of virt_to_bus() can be found in the SCSI and net drivers
that have been ported to the Alphas.

--Jay++

-------------------------------------------------------------------------------
  American Non Sequitur Society: we don't make sense, but we do like pizza...

Jay A Estabrook                         Alpha Migration Tools - LINUX Project
Digital Equipment Corp.                 (508) 952-4202 or (DTN) 227-4202
151 Taylor Street - TAY1-2              enet: jestabro@amt.tay1.dec.com
Littleton, MA 01460-1407                decnet: tallis::jestabro
-------------------------------------------------------------------------------

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-02-06 16:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-02-06  0:19 obtaining physical memory address Robert Allen Barker
1997-02-06  6:25 ` Richard Henderson
1997-02-06 16:11 ` jestabro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox