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.

TDA4VH-Q1: Synchronization of est configuration

Part Number: TDA4VH-Q1
Other Parts Discussed in Thread: TDA4VH

Hi TI experts,

I am using the switch mode under TDA4VH native driver 0900 to test the EST(3.2.2.10.3.3.2.2. EST — Processor SDK Linux for J784s4 Documentation). At the end of  the following command, there is a command "sleep 120", which is used for sync to complete. Can we avoid waiting 2 minutes by reading the value of the registers to confirm that the synchronization is complete?

#!/bin/sh

ifconfig eth0 down
ifconfig eth1 down
ethtool -L eth0 tx 4
ethtool -L eth1 tx 4
ethtool --set-priv-flags eth0 p0-rx-ptype-rrobin off
ethtool --set-priv-flags eth1 p0-rx-ptype-rrobin off

devlink dev param set platform/8000000.ethernet name switch_mode value true cmode runtime
ip link add name br0 type bridge
ip link set dev br0 type bridge ageing_time 1000
ip link set dev eth0 up
ip link set dev eth1 up
sleep 10
ip link set dev eth0 master br0
ip link set dev eth1 master br0
ip link set dev br0 up
ip link set dev br0 type bridge vlan_filtering 1
bridge vlan add dev br0 vid 1 self
bridge vlan add dev br0 vid 1 pvid untagged self
bridge vlan add dev eth0 vid 100 master
bridge vlan add dev eth1 vid 100 master

#sync system time to CPSW CPTS
phc2sys -s CLOCK_REALTIME -c eth0 -m -O 0 > /dev/null &

#calc base_time as now + 2min, give it time to sync
base=$(((`date +%s` + 2 * 60)*1000000000))

tc qdisc replace dev eth0 parent root handle 100 taprio \
    num_tc 3 \
    map 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 \
    queues 1@0 1@1 1@2 \
    base-time $base \
    sched-entry S 4 10000 \
    sched-entry S 2 30000 \
    sched-entry S 1 60000 \
    flags 2
tc qdisc replace dev eth1 parent root handle 100 taprio \
    num_tc 3 \
    map 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 \
    queues 1@0 1@1 1@2 \
    base-time $base \
    sched-entry S 4 10000 \
    sched-entry S 2 30000 \
    sched-entry S 1 60000 \
    flags 2

# Wait for 2 minutes for sync to complete
sleep 120

echo "Switch setup completed."

Best Regards,
Lei

  • Hi,

    At the end of  the following command, there is a command "sleep 120"

    There is System time Sync with CPSW CPTS time required for EST configuration. It might take some time to sync both times.
    Refer below commands used for time sync.

    #sync system time to CPSW CPTS phc2sys -s CLOCK_REALTIME -c eth0 -m -O 0 > /dev/null &

    So, above could be possible reason for delaying EST by 2minutes for time sync.

    #calc base_time as now + 2min, give it time to sync base=$(((`date +%s` + 2 * 60)*1000000000))

    Above also we are programming EST base time as 2minutes ahead time, considering Sync will happen in this time b/w CPTS time and system time.

    Can we avoid waiting 2 minutes by reading the value of the registers to confirm that the synchronization is complete?

    May be you have to read system time and CPTS of CPSW and compare both if match then you can proceed further configuration of EST.


    Best Regards,
    Sudheer