cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
aaron_eda
Participant
Participant
3,611 Views
Registered: ‎05-07-2009

Physcial address or virtual address?

Hi, everyone.

     I had imported a linux into my ml510 platform with your big help. Now i want to develop some drivers for my custom IP connected to PowerPC440 in Virtex-5 FPGA. I was puzzled by some problems as follows for a long time:

 

1. Could you tell me whether the peripheral address information in .MHS or .dts is virtual address or not? I refered the flow of developing a drivers in ARM-linux platform. Address mapping is a necessary step in import linux to ARM, and the following drivers work is based on this address mapping. Because the linux drivers utilizes virtual address instead of physical address to call device through linux OS. Therefore, I should get the virtual address of powerpc peripherals at first. But in the process of import linux to powerpc, only one exteral file: xilinx.dts is involved during build linux kernel.
 
     "Kernel patching of the address map is now complete" on page 8, XAPP1107. Does this words means xilinx.dts includes virtual address and I can use these information to develop drivers?

 

2. Could you tell my how to write a .dts file according to .MHS? I compared .dts and .MHS, and I found .dts missing some information in .MHS.
     Taking my custom IP as example, I add 4 RAMs in my custom IP, address range is specified in .MHS as follows:
 


BEGIN digital_inf_2
 PARAMETER INSTANCE = digital_inf_2_0
 PARAMETER HW_VER = 1.00.a
 PARAMETER C_BASEADDR = 0xc1e00000
 PARAMETER C_HIGHADDR = 0xc1e0ffff
 PARAMETER C_MEM0_BASEADDR = 0xc2240000
 PARAMETER C_MEM0_HIGHADDR = 0xc224ffff
 PARAMETER C_MEM1_BASEADDR = 0xc2260000
 PARAMETER C_MEM1_HIGHADDR = 0xc226ffff
 PARAMETER C_MEM2_BASEADDR = 0xc2200000
 PARAMETER C_MEM2_HIGHADDR = 0xc220ffff
 PARAMETER C_MEM3_BASEADDR = 0xc2220000
 PARAMETER C_MEM3_HIGHADDR = 0xc222ffff
 BUS_INTERFACE SPLB = plb_v46_0
 PORT Zout = Zout
 PORT Yout = Yout
 PORT Xout = Xout
 PORT Zbcode = Zbcode
 PORT Zcode = Zcode
 PORT Ybcode = Ybcode
 PORT Ycode = Ycode
 PORT Xbcode = Xbcode

......

END



         But there is not address range in .dts file as follows:

  digital_inf_2_0: digital-inf-2@c1e00000 {
   compatible = "xlnx,digital-inf-2-1.00.a";
   reg = < 0xc1e00000 0x10000 >;
   xlnx,family = "virtex5";
   xlnx,include-dphase-timer = <0x0>;
  } ;


 

 The .dts file is created by XPS automatically. May I modify this file according .MHS file to add these 4 RAM infomation?


 Looking forward to you reply! Thank you very much!

 

Aaron

Message Edited by aaron_eda on 01-27-2010 06:13 PM
0 Kudos
1 Reply
linnj
Xilinx Employee
Xilinx Employee
3,591 Views
Registered: ‎09-10-2008

The addresses in the dts file match the mhs file and are physical addresses.  The drivers do an ioremap to get a virtual address and this is true of all linux drivers for all processor architectures. 

 

The device tree generator is TCL such that you can modify it to generate whatever you want from the EDK.  The instructions for the device tree generator are on the wiki at http://xilinx.wikidot.com/device-tree-generator.

 

TCL is a pain IMHO, so good luck with it as I'm not fond of it.  You can always hand edit the device tree text file also.

 

Thanks.

0 Kudos