Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

TSE and SGDMA

Hi all,

I need help .... I'm porting u-boot (the latest nioswiki release) on a custom board...

I have a big problem with altera_tse driver... I can ping my PC from the board but only one time...next time I try to ping the driver check if sgdma is busy in rx and stay there waiting for sgdma release...SWRESET doesen't have any effect...

No problem on Tx...therefore I see on the PC the icmp coming from the board and the reply going to the board...but that never reaches the upper layers....

I don't understand if the problem is on the PHY that doesn't signal TSE about a new received packet...or if the TSE stay busy and discard the reply...

If someone experimented a similar problem...any hint is welcome...

THX

6 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi all, it is very frustrating to see that none can help... but I know it can happen...

    I Hope to be useful to some other people with the same or similar problem:

    the problem is in altera_tse.c (/u-boot/driver/net)

    in tse_eth_reset (called every time we start a new transfer) rx_gdma cannot be reset with

    rx_sgdma->control &= ALT_SGDMA_CONTROL_SOFTWARERESET_MSK;

    rx_sgdma->control &= ALT_SGDMA_CONTROL_SOFTWARERESET_MSK;

    in my experience that doesn't reset nothing...

    With:

    rx_sgdma->control = ALT_SGDMA_CONTROL_SOFTWARERESET_MSK;

    rx_sgdma->control = ALT_SGDMA_CONTROL_SOFTWARERESET_MSK;

    you finally reset sgdma and the driver works very well... Hope this help...

    Bye Carlo
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hmm.

    I never played with SGDMA up to now, and did not yet look into the sources, but two instructions toggling one or more bits should look more like this:

    rx_sgdma->control &= ALT_SGDMA_CONTROL_SOFTWARERESET_MSK;

    rx_sgdma->control |= ~ALT_SGDMA_CONTROL_SOFTWARERESET_MSK;

    Moreover rx_sgdma needs to be defined volatile to make it work.

    -Michael
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Yes...you are right...that's beacuse, at first, I didn't find the problem...then I tried by hand assigning the MASK (not or-ing or and-ing) and it worked...strange no??? :)

    Ok I will verify if or-ing works too...
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The "and" statement instead of "=" should not solve the problem, but should set just the reset bit(s) to active (zero), while leaving the other bits as they are.

    The "or" statement should not solve the problem, but should just redo what the "and" statement did.

    I more suspect a problem with the "volatile" definition.

    -Michael
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Michael,

    thanx for your reply...registers are indeed already volatile...no problem about that....

    The user guide states that writing the reset bit twice reset sgdma...no indication about values to be written... :confused:

    I found that (in my case) the reset bit must be set to 1 to activate sgdma reset....

    Therefore the right command is (or-ing):

    rx_sgdma->control |= ALT_SGDMA_CONTROL_SOFTWARERESET_MSK;

    rx_sgdma->control |= ALT_SGDMA_CONTROL_SOFTWARERESET_MSK;

    And-ing the bit doesn't reset....now tftp also works without any problem...;)

    Carlo
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    The user guide states that writing the reset bit twice reset sgdma

    I found that ... the reset bit must be set to 1 to activate sgdma reset....

    --- Quote End ---

    So the user guide seems to be unclear. I hope anybody can fix this.

    -Michael