Hello @GuilhermeS32G ,
ADMINBASETIME should be understood as the absolute time reference/phase reference for the Qbv schedule. It is used to align the start of the repeating Qbv cycle to the synchronized time domain. It is not calculated from the port speed and it is not based on the TRIGGER_TIME granularity.
In a multi-switch TSN system, gPTP / IEEE 802.1AS provides the common synchronized time base, but it does not automatically configure the Qbv schedule. The Qbv configuration, including ADMINBASETIME, must be programmed by a TSN management stack/CNC or by application-specific/custom software running on the host processor. IEEE 802.1Qcc describes centralized TSN configuration models where a CNC computes and distributes TSN configuration to the network devices.
https://www.ieee802.org/1/files/public/docs2017/cc-Kehrer-StartOfCycleReference-0117-v01.pdf
A typical procedure might look like:
1. Start gPTP / 802.1AS and wait until all relevant TSN devices are synchronized.
2. Read the current synchronized time from the device/PTP time domain.
3. Choose a future base time: ADMINBASETIME = current_gPTP_time + safety_margin
The safety margin should be large enough to allow the configuration to be written to all switches/ports before the selected base time is reached.
4. Program the same ADMINBASETIME and the same cycle time on all switches/ports that must share the same Qbv cycle phase.
5. Program the per-port GCL entries according to the required schedule.
If alignment to the gPTP time epoch is required, the selected base time can also be aligned to the cycle boundary, e.g.:
ADMINBASETIME = ceil((current_gPTP_time + safety_margin) / cycle_time) * cycle_time
This is the same general idea used by Linux taprio: base-time defines when the schedule starts; if the base time is already in the past, the active start time is derived by adding an integer number of cycle times until the resulting start time is in the future.
https://www.cisco.com/c/en/us/td/docs/switches/lan/cisco_ie4000/tsn/b_tsn_ios_support/b_tsn_ios_supp...
https://deepwiki.com/nxp-qoriq/tsntool/5.2-device-configuration
For SJA1110, the final ADMINBASETIME value must be encoded according to the time format expected by the SJA1110 Qbv configuration, and then split into:
ADMINBASETIME[31:0] = lower 32 bits
ADMINBASETIME[63:32] = upper 32 bits
So, in summary: gPTP provides the common time; another software/configuration layer must choose and program the Qbv ADMINBASETIME relative to that time. This may be done by a TSN management stack/CNC or by custom application code in a simpler embedded system.
Best regards,
Pavel