This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux-c6x: Can't connect two boards via Serial RapidIO in linux on 6678



Hello, All!

I have two custom boards based on 6678 evm. I try to connect them together via SRIO interface in linux. Linux source I get from git master brunch on linux-c6x.org.

Reference clock for CPU_RIOCLK_P/N pins on my board is 156.25 MHz. I made some changes in file board-evm6678.c on struct evm6678_serdes_config[4] to correct register values related to my clock. Please look at the diff patch:

1325.diff.txt

Registers configuration:

PER_SET_CNTL = 0x10

SRIO_SERDES_CFGPLL = 0x251

PRESCALAR_SRV_CLK = 0x0C053860 <-------- leave unchanged (it is correct or not?)

SRIO_SERDES_CFGRX[0-3] = 0x00440495 <-------- leave unchanged

SRIO_SERDES_CFGTX[0-3] = 0x00180795 <-------- leave unchanged


Then I boot linux on every board with such bootargs for rio driver:
board1: riohdid=0 rioports=1,2,3,4 rioinit=enum riomode=0 rioedma-threshold=32768

borad2: riohdid=-1 rioports=1,2,3,4 rioinit=discov riomode=0 rioedma-threshold=32768

But in kernel boot log the same result:

Board 1:

TI KeyStone QMSS driver v1.1
KeyStone RapidIO driver v1.1
RIO: register sRIO controller for hostid 0
RIO: port 1 not ready
RIO: port 2 not ready
RIO: port 3 not ready
RIO: port 4 not ready

board 2:

TI KeyStone QMSS driver v1.1
KeyStone RapidIO driver v1.1
RIO: register sRIO controller for hostid 255
RIO: port 1 not ready
RIO: port 2 not ready
RIO: port 3 not ready
RIO: port 4 not ready

1) Please, tell me that else I must change in kernel driver for new reference clock?

2) Kernel parameters that I pass to kernel correct or not for properly driver initialization?

Thank you.

  • Hi, Vladimir,

    In linux-c6x, we set the dip switch to sRIO boot so the SRIO bus can be activated and detected to run the demo as described in Software Ecosystem Features in linux-c6x.org. It seems that your boards does not detect the hardware, and hence the rio driver is not running. Otherwise, you would see the following logs instead of port not ready.

    p_acc48_le_1_0_2_0.fw
    TI KeyStone QMSS driver v1.1
    KeyStone RapidIO driver v1.1
    RIO: register sRIO controller for hostid 0
    RIO: port 1 registered
    RIO: enumerate master port 1, RIO1 mport
    keystone-pcie: Invoking PCI BIOS ...
    keystone-pcie: Setting up Host Controller...

     I am not familiar with the hardware setup, but I'll see if someone else can answer your questions.

    Rex

     

  • Hi, Rex!

    Thank you for your answer!

    If I've understood you correctly, you suppose that on my board SRIO bus is disable while linux booting? Can you tell me, if no cable connect for my sRIO interface, bus will be activated in linux or not? This message from your log example appeared in any case - RIO: port 1 registered or only if link is exist between two boards?

    I provide for you more information, that sRIO CCS project based on TI sRIO Benchmarking Project is working but sRIO in linux - no :( At this moment I try to compare initialization process in two case CCS and linux.

    Vladimir

  • Hi, Vladimir,

    With C6678 EVM, we are using a breakout board to connect 2 EVM's together. If the other board is not present, the driver will failed to register.

    Rex

  • Hi, Rex!

    I connect my board to Tsi758 Serial RapidIO Switch. Switch is operational after power up. I repeat, that CCS project based on TI sRIO benchmark test, can communicate with Tsi578 on the same board. But I see only messages:

    RIO: port 1 not ready

    I recompile kernel with additional logging and see that driver get error in this function:

    static int keystone_rio_port_status(int port)
    {
     ...
     if (count >= KEYSTONE_RIO_TIMEOUT_CNT) {
     return -EIO;
     }
    ...
    }
    May be somebody use sRIO interface with 156.25 MHz refernce clock in linux? 
    Please, give me some advice.
    
    
    Thank you.
  • Hi, Vladimir,

    I am not sure if you have gone through the sRIO wiki page under Software Ecosystem Features in linux-c6x.org. In the page, the riomode configures what clock speed it defaults to. I saw in your configuration having riomode=0 which is 125MHz. Shouldn't you use different value for 156MHz?

    Rex

  • Hi, Rex!

    Thank you for your answer!

    I supposed that parameter riomode for selection one of the configurations from static struct keystone_serdes_config evm6678_serdes_config[4] declared in board-evm6678.c. All values in this struct calculated for refertnce clock 312.5 MHz as mentioned in comments. I recalculate some values in this table according to documentation (sprugw1b.pdf pg. 152, Table 3-7) and my clock 156.25 MHz.

    This is original table:

    /*
     * SerDes and port mode configurations for different sRIO modes.
     * All configurations are based on a 312.5 MHz SerDes reference clock,
     * mode 0 is the default sRIO boot mode of the board.
     */
    static struct keystone_serdes_config evm6678_serdes_config[4]  = {
        /* sRIO config 0: MPY = 5x, div rate = half, link rate = 3.125 Gbps, mode 1x */
        { 0x0c053860, /* VBUS freq 313 - 626, promiscuous */
          0x0229,
          0x001e,
          { 0x00440495, 0x00440495, 0x00440495, 0x00440495 },
          { 0x00180795, 0x00180795, 0x00180795, 0x00180795 },
          { 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
        /* sRIO config 1: MPY = 5x, div rate = half, link rate = 3.125 Gbps, mode 4x */
        { 0x0c053860, /* VBUS freq 313 - 626, promiscuous */
          0x0229,
          0x001e,
          { 0x00440495, 0x00440495, 0x00440495, 0x00440495 },
          { 0x00180795, 0x00180795, 0x00180795, 0x00180795 },
          { 0x00000004, 0x00000004, 0x00000004, 0x00000004 } },
        /* sRIO config 2: MPY = 4x, div rate = half, link rate = 2.5 Gbps, mode 1x */
        { 0x0c053860, /* VBUS freq 313 - 626, promiscuous */
          0x0221,
          0x001e,
          { 0x00440495, 0x00440495, 0x00440495, 0x00440495 },
          { 0x00180795, 0x00180795, 0x00180795, 0x00180795 },
          { 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
        /* sRIO config 3: MPY = 4x, div rate = half, link rate = 2.5 Gbps, mode 4x */
        { 0x0c053860, /* VBUS freq 313 - 626, promiscuous */
          0x0221,
          0x001e,
          { 0x00440495, 0x00440495, 0x00440495, 0x00440495 },
          { 0x00180795, 0x00180795, 0x00180795, 0x00180795 },
          { 0x00000004, 0x00000004, 0x00000004, 0x00000004 } },
    };

    This is my table (I change some values in this table but no result):

    /*
     * SerDes and port mode configurations for different sRIO modes.
     * All configurations are based on a 156.25 MHz SerDes reference clock,
     * mode 0 is the default sRIO boot mode of the board.
     */
    static struct keystone_serdes_config evm6678_serdes_config[4]  = {
        /* sRIO config 0: MPY = 10x, div rate = half, link rate = 3.125 Gbps, mode 1x */
        { 0x0c053860, /* VBUS freq 313 - 626, promiscuous */
          0x0251,
          0x0010,
          { 0x00440495, 0x00440495, 0x00440495, 0x00440495 },
          { 0x00180795, 0x00180795, 0x00180795, 0x00180795 },
          { 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
        /* sRIO config 1: MPY = 10x, div rate = half, link rate = 3.125 Gbps, mode 4x */
        { 0x0c053860, /* VBUS freq 313 - 626, promiscuous */
          0x0251,
          0x0010,
          { 0x00440495, 0x00440495, 0x00440495, 0x00440495 },
          { 0x00180795, 0x00180795, 0x00180795, 0x00180795 },
          { 0x00000004, 0x00000004, 0x00000004, 0x00000004 } },
        /* sRIO config 2: MPY = 16x, div rate = half, link rate = 5 Gbps, mode 1x */
        { 0x0c053860, /* VBUS freq 313 - 626, promiscuous */
          0x0281,
          0x0010,
          { 0x00440495, 0x00440495, 0x00440495, 0x00440495 },
          { 0x00180795, 0x00180795, 0x00180795, 0x00180795 },
          { 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
        /* sRIO config 3: MPY = 16x, div rate = half, link rate = 5 Gbps, mode 4x */
        { 0x0c053860, /* VBUS freq 313 - 626, promiscuous */
          0x0281,
          0x0010,
          { 0x00440495, 0x00440495, 0x00440495, 0x00440495 },
          { 0x00180795, 0x00180795, 0x00180795, 0x00180795 },
          { 0x00000004, 0x00000004, 0x00000004, 0x00000004 } },
    };

    Rex, may be I misunderstood some portion of driver code? riomode = 0 set the configuration that marked of bold font.

    Thank you.

  • Hello, Rex, information on this wiki page http://linux-c6x.org/wiki/index.php/Serial_RapidIO is valid only for the TCI648x and 647x because they served by a single driver "tci648x-rapidio". This wiki does not apply in full range for 66x boards. Thank you.

    Does anybody used sRIO subsystem in linux?

    Vladimir