Forum Discussion
TSE MAC and Marvell 88E1111
I'm having trouble to bring up the TSE MAC to Ethernet interface on the Stratix II GX PCIe board. I was able to instantiate a triple speed Ethernet MAC and build logic around it. The loopback at the GMII interface seems work fine. However, I'm not able to send any packet out via the on board Marvell 88E1111 Ethernet transceiver. I suspect I need to program the registers in it via the MDIO. Is there a register map or data sheet of the 88E1111? Or is there anything else I'm missing?
Thanks.42 Replies
- Altera_Forum
Honored Contributor
--- Quote Start --- As for the empty data packet, it can come from the CPU data cache. Try to flush the data cache before sending the packet, or use the alt_remap_uncached() function to modify your pointer to the memory buffer that you fill in. --- Quote End --- I tried to use uncashed but the result is the same.
Where can I have a look of configuring of SGDMA and how to бфлу a descriptor for daata memory to transmit?8 Frame 69 (126 bytes on wire, 126 bytes captured) Arrival Time: Nov 24, 2009 13:50:20.538005000 Frame Number: 69 Frame Length: 126 bytes capture Length: 126 bytes 0 Ethernet II, src: 00:07:ab:f0:Od:ba (00:07:ab:f0:Od:ba), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00) S Destination: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) 0 = IG bit: individual address (unicast) 0 = LG bit: Globally unique address (factory default) Ј В mds Header(unknown(0)/unknown(0)) В mds Header ...0 0000 0000 0000 = Packet Len: 0 0000 0000 00.. = Dst index: 0x0000 00 0000 0000 = src index: 0x0000 0000 0000 0000 = VSAN: 0 В mds Trailer eof: unknown (0) CRC: 0x00000000 - Altera_Forum
Honored Contributor
Is the packet size correct?
To build a descriptor, you can use the functions defined in altera_avalon_sgdma.h. The alt_avalon_sgdma_construct_mem_to_stream_desc() can build the descriptor for you. It is well described in the SGDMA datasheet. If it isn't a cache problem, it could be because the SGDMA isn't reading the memory at the correct address. But at least it seems to try to read 126 bytes. - Altera_Forum
Honored Contributor
The size of packet is correct. I also use the standard functions from SGDMA.
Unfortunatelly I don't have any workable example with correct configured registers of TSE and SGDMA, maybe there is special bit I should set to make it work =( I try to make it using the user guide of TSE and SGDMA with it examples. here is the example of my code for Marvell 88e1111, if anybody would have a need of half worked example or anybody would look through the text of program and will find any mistakes or bugs it would be greatfull. - Altera_Forum
Honored Contributor
I can see a few problems in tse_mac_raw_sendM.
First you don't bypass the cache when writing the packet contents. Second, in the "recopy to buf2" loop, you are reading the contents back using IORD_8DIRECT, whereas you filled it the [] operator. The second method uses the cache, but the first one bypasses it, so you may read back completely different data. Third, you don't use the ActualData pointer in the SGDMA descriptor. I would first create two uncached pointers:
Then use the uncached versions to access the data:char *uncached_pkt = alt_remap_uncached ((volatile void*) pkt, 256); char *uncached_buf2 = alt_remap_uncached ((volatile void*) buf2, 1560);uncached_pkt=0xCC; uncached_pkt=0xCC; for(k=2;k<254;k++){ uncached_pkt=0xA5; } uncached_pkt=0xEE; uncached_pkt=0xEE;
(by the way, I'm not sure buf2 will be properly 32-bit aligned this way...) Then to remove bit 31 before building the descriptor, you need to call remap_cached, not remap_uncached:for(i=0;i<length;i++) { uncached_buf2 = uncached_pkt; } ActualData = (unsigned int*)buf2;
And finally build the descriptor with ActualData:ActualData = (unsigned int*)alt_remap_cached ((volatile void*) ActualData, 256);
I hope this helpsalt_avalon_sgdma_construct_mem_to_stream_desc( (alt_sgdma_descriptor *) desc, // descriptor I want to work with (alt_sgdma_descriptor *) desc,// pointer to "next" (alt_u32 *)ActualData, // starting read address (length), //# bytes 1, // don't read from constant address 1, // generate sop 1, // generate endofpacket signal 0); // atlantic channel (don't know/don't care: set to 0) - Altera_Forum
Honored Contributor
unfortunatelly after the alt_avalon_sgdma_check_descriptor_status(desc) desc_stat = 119
Owned_by_HW = 1 and i get not free of errors descritor # define EINPROGRESS 119 /* Connection already in progress */ - Altera_Forum
Honored Contributor
Try to use a separate descriptor for the "next" argument in alt_avalon_sgdma_construct_mem_to_stream_desc.
Maybe something like
I'm not sure about what happens if you make the descriptor point to itself as "next". If that's not it, I don't have any other idea... I never had this problem with the SGDMA.alt_avalon_sgdma_construct_mem_to_stream_desc( (alt_sgdma_descriptor *) desc, // descriptor I want to work with ((alt_sgdma_descriptor *) desc)+1,// pointer to "next" (alt_u32 *)ActualData, // starting read address (length), //# bytes 1, // don't read from constant address 1, // generate sop 1, // generate endofpacket signal 0); // atlantic channel (don't know/don't care: set to 0) - Altera_Forum
Honored Contributor
You are supposed to get that status until the transfer has been done. Try to call alt_avalon_sgdma_do_async_transfer() or alt_avalon_sgdma_do_sync_transfer() and check the status again.
- Altera_Forum
Honored Contributor
didn't notice there is a TSE topic here.
http://www.alteraforum.com/forum/showthread.php?t=19915 - Altera_Forum
Honored Contributor
Could anyone help me with my weird 88e1111 tx problem?
http://www.alteraforum.com/forum/showthread.php?t=20140 - Altera_Forum
Honored Contributor
Good day.
I have a problem with NicheStack and a PHY. I am using the 3sl150 Stratix III based devkit. As I am a beginner, I am using NIOS II standard design that comes with the board. As I tried to launch the Simple Socket Server (SSS) application, it could not allocate the PHY (the board's PHY is Marvell 88E1111 that is supported by the driver by default, as it is written in the documentation) and came up with the error: [tse_mac_init] INFO : TSE MAC 0 found at address 0x00001400 ERROR : MAC Group[0] - No PHY connected! ERROR : PHY[0.0] - No PHY connected! Speed = 100, Duplex = Full OK, x=401, CMD_CONFIG=0x00000000 The design uses Triple Speed Ethernet in RGMII mode for networking. There are no other MAC interfaces (like lan91c111) in the design. What can be wrong?