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/AM3352: MII connected to Marvell switch

Part Number: AM3352

Tool/software: Linux

Hi,

We have a new board based on the AM335X beagle bone black.

I am using the Beagle U-Boot and Kernel and it looks that everything is working except Networking.

The difference is that in our board the AM3352 is connected via MII to a Marvell 5 ports switch.

What modifications should I do in the U-Boot (or also in the Kernel) in order to support that architecture?

Thanks

Avner

  • Hi Avner,
    Does this switch have a PHY port that you are connecting to? I ask because direct MAC-to-MAC connections are not supported on this device.
  • DK,

    The sitara is connected to the switch with MII - no PHY, of course there are other ports that are connected with PHY and RJ-45 to the network
    (I had something like that with PPC processor - there I manipulate the u-boot to think the CPU port is always ON)

    Thanks
  • DK,

    I have additional information from our H/W guy:

    We are using Marvell Source 88e6341

    We are working with switch port 0 has PHY, and connected via MII to the CPU MAC. The transmit and receive generate from the PHY , all the pins of the CPU  " crs , col , rx err " are pulled to ground and not participate in the MII connectivity.

    Attached is the figure from the switch manual:

    Thanks

    Avner 

  • Avner,
    Have you run the PinMux tool and implemented the resulting output?
    Which TI SDK version are you using?
  • DK,

    As far as I understand, the pimux is the same as the beagle, but I need to enable the switch ports.

    Do you know what do i need to modify/do in the uboot to enable the switch ports?

    Thanks

    Avner

  • Hi Avner,

    Unfortunately TI does not support external ethernet switches on the catalog processors. The switch manufacturer will probably be the best source for any necessary modifications to U-Boot. Supporting the switch may require some driver code to initialize the switch.

    I can suggest to look at the function board_eth_init in this file in the u-boot source tree: board/ti/am335x/board.c. This is the function that has support for interface initialization on the different am335x EVMs and would serve as the entry point for any code necessary to support the switch.

    Best Regards,
    Schuyler
  • Hi,

    Thanks for the reply.
    Do you have uboot reference code to any switch MII connected to AM335x?
    It seem that the code is specific for phy that the beagle is using

    Thanks

    Avner
  • Hi Avner,
    As I mentioned in the previous post TI does not support external ethernet switches connected to the CPSW. All of the reference code provided by TI for the EVMs only use Ethernet PHYs, none of the TI supported EVMs has an external switch connected to the CPSW. Unfortunately there is not any reference code that TI can offer as an example.

    I have not looked but you might search the u-boot source tree, other contributors may have used an external switch on other products that might serve as an example.

    Best Regards,
    Schuyler
  • Hi Schuyler,

    Thanks for your reply

    As soon as I will have it - I will publish it here

    I think it is a rather common use case 

    Thanks

    Avner

  • It has been several years since I dealt with a Marvell DSA (phyless). Back then, one would have to manually patch code in a few places to stop the code from configuring the PHY and hard-coding the connection attributes that would normally come from PHY discovery. The most recent code appears to have an "official" way to this.

    In linux, I think what you are looking for is under "drivers/net/dsa". Search the configs to see what boards use any DSA than review the source on how to set it up.

    In u-boot, all network code is under "drivers/net/phy". The Kconfig hints at MV88E6352_SWITCH. Trace the symbol down to code to see what it does.

    Beaglebone has it own ways to do things and some of the code may be in device trees.
  • Hi,

    As I promised, I am publishing here the solution how to modify the u-boot in order to support boards based on the beagle bone black and instead of Ethernet PHY, it has Marvell Switch (in my case it is 88e6341) connected with MII:

    First, use Fix PHY driver - the only issue that it aimed to work with DT, so if it is not ETH DT - change the code to ignore the CONFIG. Make sure the software takes the Fix driver as the port phy driver. Set it hardcoded to 100 MB speed, and Full Duplex.

    The other issue is the initialization of the switch CPU port and switch ports:

    In the routine board_eth_init (in board.c) add the following initializations (after the cpsw initialization):

    // Set port 0,1,2 to forwarding Mode (through Switch Port registers)

    miiphy_write(name, 16,4, 0x7f);
    miiphy_write(name, 17,4, 0x7f);
    miiphy_write(name, 18,4, 0x7f);

    /* RGMII Delay on Port 0 (CPU port), force link to 100Mbps */

    miiphy_write(name, 16,1, 0x283d);

    /* Power up PHY 1, 2, 3 (through Global 2 registers) */
    miiphy_write(name, 28,25, 0x1140);
    miiphy_write(name, 28,24, 0x9620);
    miiphy_write(name, 28,24, 0x9640);
    miiphy_write(name, 28,24, 0x9660);

    Good Luck

    Avner