To access the host (x86) memory by the agent (mpc8540)
aishwarya bhas
aish_bhaskaran at yahoo.co.in
Tue Apr 3 03:10:26 EST 2007
Hi...
We need to design a network driver..We are using linux kernel 2.6.9 and
mpc8540 as a network card in the host x86.mpc8540 acts as a agent and runs on u-boot.
The steps that we followed to accomplish the above task is as follows:-
1.)Allocated memory using kmalloc and returned the ptrdata....
ptrdata = (unsigned long *) kmalloc(sizeof(unsigned long ,
GFP_KERNEL);
2.)We write to pci outbound registers......
(a)pci translation register (b)pci base register (c) pci attribute
register.
// Converting the virtual address got using kmalloc to PCI Bus address
ulTemp = ( unsigned long ) virt_to_bus( ( void * )
ptrdata);
ulTemp = swap(ulTemp >> 12) ;
//Outbound Translatiom Register
writel(ulTemp,(unsigned long)ioaddr+ 0x8C20);
//ioaddr is address that we got after remapping ioaddr = ioremap_nocache((pio_start),
pio_len);
//Outbound Base Address Register
writel((swap(0xE0000000 >> 12)) , (unsigned long)ioaddr+ 0x8C28);
//Outbound Attribute Register
writel(swap(0x8004401A), (unsigned long)ioaddr+ 0x8C30);
3.)We used the minicom to check whether we are able to access the host
memory from the agent by doing md 0xe0000000.But we are getting all
values as zeroes.
Cud anybody solve our problem. tell us if we are missing anything,any
step.Please respond to our request.It is urgent.
Thanks in advance,
Aishwariya
---------------------------------
Heres a new way to find what you're looking for - Yahoo! Answers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20070402/32e49949/attachment.htm>
More information about the Linuxppc-dev
mailing list