Single PPC with DES on V2P

Hey to all,

Background information: I am doing a project which has a single ppc and a specialize DES core in a Virtex 2 Pro using EDk 7.1 aas design tool. The situation is concerning the drivers generated by the EDK 7.1 for testing the core functionality in software. The EDK 7.1 generates a driver and with this driver comes a self test (unit test) for the driver which tests the register r/w, the fifos r/w and the DMA transfers in my case all the tests except for the DMA seem to worked fine. For some reason the DMA test doesn't give me the expected output. Here is a snippet of the code:

Note: This Test is for Single DES CBC Decrypt with Key =

0123456789ABCDEF and IV = 1234567890ABCDEF

Xuint8 SrcBuffer[MULTI_DES_SELFTEST_BUFSIZE] Xuint8 DstBuffer[MULTI_DES_SELFTEST_BUFSIZE]

// SrcBuffer is initialize via a loop to contain '0xE5C7CDDE872BF27C'

for( Index = 0; Index < MULTI_DES_SELFTEST_BUFSIZE; Index + 8) { SrcBuffer[ Index ] = 0xE5; SrcBuffer[ Index + 1 ] = 0xC7; SrcBuffer[ Index + 2 ] = 0xCD; SrcBuffer[ Index + 3 ] = 0xDE; SrcBuffer[ Index + 4 ] = 0x87; SrcBuffer[ Index + 5 ] = 0x2B; SrcBuffer[ Index + 6 ] = 0xF2; SrcBuffer[ Index + 7 ] = 0x7C; } // THe DstBuffer is initialize to zeroes ...

// The DMA is reset MULTI_DES_mResetDMA0(baseaddr);

// The DMA setup MULTI_DES_mSetDMA0Control(baseaddr, DMA_SINC_MASK | DMA_LOCAL_MASK );

// DMA transfer MULTI_DES_DMA0Transfer( baseaddr, baseaddr + MULTI_DES_WRFIFO_DATA_OFFSET, MULTI_DES_SELTEST_BUFSIZE);

but when I look at the results there are nothing like the expected value: '0x4E6F772069732074'

Thanks, Noel

Reply to
el_boricua
Loading thread data ...

Hey to all,

Background information: I am doing a project which has a single ppc and a specialize DES core in a Virtex 2 Pro using EDk 7.1 aas design tool. The situation is concerning the drivers generated by the EDK 7.1 for testing the core functionality in software. The EDK 7.1 generates a driver and with this driver comes a self test (unit test) for the driver which tests the register r/w, the fifos r/w and the DMA transfers in my case all the tests except for the DMA seem to worked fine. For some reason the DMA test doesn't give me the expected output. Here is a snippet of the code:

Note: This Test is for Single DES CBC Decrypt with Key =

0123456789ABCDEF and IV = 1234567890ABCDEF

Xuint8 SrcBuffer[MULTI_DES_SELFTEST_BUFSIZE] Xuint8 DstBuffer[MULTI_DES_SELFTEST_BUFSIZE]

// SrcBuffer is initialize via a loop to contain '0xE5C7CDDE872BF27C'

for( Index = 0; Index < MULTI_DES_SELFTEST_BUFSIZE; Index + 8) { SrcBuffer[ Index ] = 0xE5; SrcBuffer[ Index + 1 ] = 0xC7; SrcBuffer[ Index + 2 ] = 0xCD; SrcBuffer[ Index + 3 ] = 0xDE; SrcBuffer[ Index + 4 ] = 0x87; SrcBuffer[ Index + 5 ] = 0x2B; SrcBuffer[ Index + 6 ] = 0xF2; SrcBuffer[ Index + 7 ] = 0x7C; } // THe DstBuffer is initialize to zeroes ...

// The DMA is reset MULTI_DES_mResetDMA0(baseaddr);

// The DMA setup MULTI_DES_mSetDMA0Control(baseaddr, DMA_SINC_MASK | DMA_LOCAL_MASK );

// DMA transfer MULTI_DES_DMA0Transfer( baseaddr, baseaddr + MULTI_DES_WRFIFO_DATA_OFFSET, MULTI_DES_SELTEST_BUFSIZE);

but when I look at the results there are nothing like the expected value: '0x4E6F772069732074'

Thanks, Noel

Reply to
el_boricua

Perhaps a cache coherency issue? You didn't mention which PPC variant you are using. At least for the lower end PPC's, bus snooping of DMA transfers is NOT provided, and so cache coherency needs to be handled *manually* by the software.

In your case:

  1. Build source buffer.
  2. Flush the source buffer causing appropriate cache lines to be written to RAM.
  3. Issue sync (wait for cache flush to complete)
  4. Start DMA
  5. Wait for DMA complete.
  6. Invalidate destination buffer.
  7. Read the destination buffer.

This is just an "off the top of my head" guess, ymmv.

--
Michael N. Moran           (h) 770 516 7918
5009 Old Field Ct.         (c) 678 521 5460
Kennesaw, GA, USA 30144    http://mnmoran.org

"So often times it happens, that we live our lives in chains
  and we never even know we have the key."
The Eagles, "Already Gone"

The Beatles were wrong: 1 & 1 & 1 is 1
Reply to
Michael N. Moran

I am using the 405 PPC.

Reply to
el_boricua

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.