* how to get a physical address from the mmaped address area?
@ 2001-07-21 7:25 hychon
0 siblings, 0 replies; only message in thread
From: hychon @ 2001-07-21 7:25 UTC (permalink / raw)
To: linuxppc-embedded
I want to "how to get a physical address from the mmaped address area !
"
Hi !!
I am working a HDLC program (not device driver) as Embedded Linux
system , that used SCC2 on the MPC860T target board .
I worked initialzed SCC2 and allocat memory buffer with the
kernel-2.2.13 based on PowerPC arch .
In my program, I allocated the BD (Buffer Descriptor) in a temporary
place of DPMEM.
RxTxBD = (BDRINGS *)(&IMMR->udata_bd[0x600]);
IMMR->PRAM[PAGE2].pg.scc.h.rbase = (UHWORD)&RxTxBD->RxBD[0]; /*
1 */
IMMR->PRAM[PAGE2].pg.scc.h.rbase =
(UHWORD)0x2E00; /* 2 */
case 1 : BD state not change and down .the system
case 2 : BD state are change
I think that the RBASE and TBASE in SCC PARAM is a physical address of
Buffer Descriptor
I want to get a place of BD in DPMEM itself and retun as physical
address. (as if , CPM get a BD pointer in commproc.c file )
Question1) How to get a place(pointer) of BD in DPMEM and give RBASE
(TBASE) the physical address ?
And Buffer are allocated in a virtual area , by following
mem_addr_buf1 = mmap(0,1024,(PROT_READ|PROT_WRITE),MAP_SHARED,
mem_buf1,0x100000);
buf = (unsigned char *)mem_addr_buf1;
when I write buf as Buffer addr of BD, that do not change Buffer
(BD) state
I think that don't find the buffer address
and the Buffer pointer of BD structure was recognized as physical
address of the Buffer (buf) .
Question2) How to get a buffer address pointer of BD struct (a place of
Buffer) from kernel (virtual address) as physical address?
Help me !
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-07-21 7:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-21 7:25 how to get a physical address from the mmaped address area? hychon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).