To access the host (x86) memory by the agent (mpc8540)
aish_bhaskaran at yahoo.co.in
Tue Apr 3 03:10:26 EST 2007
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 ,
2.)We write to pci outbound registers......
(a)pci translation register (b)pci base register (c) pci attribute
// Converting the virtual address got using kmalloc to PCI Bus address
ulTemp = ( unsigned long ) virt_to_bus( ( void * )
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),
//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,
Heres a new way to find what you're looking for - Yahoo! Answers
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Linuxppc-dev