From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199702061611.LAA00077@linux03.amt.tay1.dec.com> Date: Thu, 06 Feb 1997 11:11:16 -0500 From: jestabro@amt.tay1.dec.com Subject: Re: obtaining physical memory address In-Reply-To: <199702060812.IAA18253@moondance.np.ac.sg> >>> 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