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