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.

TMDSSK3358: CPSW switch mode

Part Number: TMDSSK3358

I just received my TMDSSK3358 and I'm able to set the IP and netmask for each interface using ifconfig, and demonstrate the dual MAC mode works. Is there an easy way to put the dev board in switch mode from the command line? Or, do I have to change kernel options and device tree to put into switch mode? I'm looking for a way to switch between dual MAC mode and switch mode "on the fly", or at lease have the mode selected at boot based on an I/O line. Is this possible?

Regards,

Daven

  • Hi,

    The switch mode is set the DTS file for the board. The default kernel options are already set for both interface types. The switch mode or dual MAC mode must be decided at kernel boot time when the CPSW driver is initialized.

    Your idea is a good one in that you could customize u-boot to read a GPIO pin and use that to determine which DTB to load with the kernel. 

    This is similar to how TI loads the same kernel but different DTB files for each of the AM335x EVM boards. There is a I2C EEPROM that has an ASCII string for each EVM board type. U-Boot parses that string and loads the appropriate DTB file. While this is not the technique you are planning you can look at the TI parsing code in board.c in the U-Boot source tree in the board/ti/am335x/ directory. Look for the function do_board_detect() and see how it is used.

    Once the board is detected a U-Boot environment variable is set and the boot command is constructed to load the correct DTB file. To look at how this works boot the board and halt in u-boot and do a printenv command. This will print out all the u-boot environment variables  and you can follow along how TI is constructing the boot sequence. 

    Best Regards,

    Schuyler