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/AM5726: CPSW driver prioritization support?

Part Number: AM5726


Tool/software: Linux

Champs,

I am trying to figure out if the CPSW driver supports traffic prioritization as described in the TRM: 24.11.4.8.3 Packet Priority Handling . Customer requires to send and receive in-band Ethernet management packets and from the driver user guide it is not quite clear how/if it can be used to prioritize Rx and Tx management packets.

your guidance is much appreciated

thanks

Michael

  • Hi Michael,

    It seems that this is supported. See drivers/net/ethernet/ti/cpsw.c:

    #define RX_PRIORITY_MAPPING 0x76543210
    #define TX_PRIORITY_MAPPING 0x33221100
    #define CPDMA_TX_PRIORITY_MAP 0x01234567

    /* CPSW_PORT_V1 */
    #define CPSW1_TX_PRI_MAP 0x10 /* Tx Header Priority to Switch Pri Mapping */

    /* CPSW_PORT_V2 */
    #define CPSW2_TX_PRI_MAP 0x18 /* Tx Header Priority to Switch Pri Mapping */

    /* CPSW_PORT_V2 only */
    #define RX_DSCP_PRI_MAP0 0x30 /* Rx DSCP Priority to Rx Packet Mapping */
    #define RX_DSCP_PRI_MAP1 0x34 /* Rx DSCP Priority to Rx Packet Mapping */
    #define RX_DSCP_PRI_MAP2 0x38 /* Rx DSCP Priority to Rx Packet Mapping */
    #define RX_DSCP_PRI_MAP3 0x3c /* Rx DSCP Priority to Rx Packet Mapping */
    #define RX_DSCP_PRI_MAP4 0x40 /* Rx DSCP Priority to Rx Packet Mapping */
    #define RX_DSCP_PRI_MAP5 0x44 /* Rx DSCP Priority to Rx Packet Mapping */
    #define RX_DSCP_PRI_MAP6 0x48 /* Rx DSCP Priority to Rx Packet Mapping */
    #define RX_DSCP_PRI_MAP7 0x4c /* Rx DSCP Priority to Rx Packet Mapping */

    /* Bit definitions for the CPSW2_CONTROL register */
    #define PASS_PRI_TAGGED (1<<24) /* Pass Priority Tagged */
    #define VLAN_LTYPE2_EN (1<<21) /* VLAN LTYPE 2 enable */
    #define VLAN_LTYPE1_EN (1<<20) /* VLAN LTYPE 1 enable */
    #define DSCP_PRI_EN (1<<16) /* DSCP Priority Enable */

    cpsw_init_host_port() ->
    /* setup host port priority mapping */
    __raw_writel(CPDMA_TX_PRIORITY_MAP,
    &cpsw->host_port_regs->cpdma_tx_pri_map);
    __raw_writel(0, &cpsw->host_port_regs->cpdma_rx_chan_map);



    Best Regards,
    Yordan