F-Tile Architecture and PMA and FEC Direct PHY IP User Guide

ID 683872
Date 11/04/2024
Public
Document Table of Contents

A.3. FGT Internal Serial Loopback Calibration Sequence for RX Manual Adaptation

For a FGT RX manual adaptation design, the optimal flow to enable the internal serial loopback requires you to configure an additional sequence of calibration registers.
The following table summarizes the list of registers that you need to set during serial internal loopback (SILB) enablement.
Table 122.  Calibration Registers
Register ID Register Address Value
0 0x41450[18] 0x1
1 0x41584[15:14] 0x1
2 0x415dc[29:28] 0x0
3 0x41674[28:27] 0x0
0x41674[30:29] 0x0
4 0x4167c[23:22] 0x3
0x4167c[25:24] 0x3
5 0x41680[31:30] 0x0
6 0x41684[28:27] 0x0
0x41684[31:30] 0x0
7 0x41758[30:29] 0x3
8 0x4175c[15:14] 0x3
0x4175c[17:16] 0x3
9 0x41808[16:15] 0x2
10 0x41938[3:2] 0x1
0x41938[11:10] 0x1
0x41938[13:12] 0x1
0x41938[15:14] 0x1
0x41938[9:8] 0x1
0x41938[19:18] 0x3
0x41938[27:26] 0x3
0x41938[29:28] 0x3
0x41938[31:30] 0x3
0x41938[25:24] 0x3
11 0x4193c[3:2] 0x3
0x4193c[5:4] 0x3
0x4193c[7:6] 0x3
0x4193c[1:0] 0x3
12 0x41960[29] 0x1
13 0x419b4[28] 0x1
14 0x419b8[27] 0x1
15 0x41a88[28:27] 0x1
0x41a88[30:29] 0x3
16 0x41a8c[28:27] 0x1
0x41a8c[30:29] 0x3
17 0x41a90[28:27] 0x3
18 0x41a94[30:29] 0x1
19 0x41a98[30:29] 0x1
0x41a98[28:27] 0x3
20 0x41a9c[13:12] 0x1
0x41a9c[27:26] 0x1
0x41a9c[17:16] 0x3
0x41a9c[31:30] 0x3
0x41a9c[3:2] 0x3
0x41a9c[15:14] 0x3
0x41a9c[29:28] 0x3
0x41a9c[1:0] 0x3
21 0x41aa4[29:22] 0xf9
0x41aa4[21:14] 0xf9
22 0x41c10[11:8] 0x0
0x41c10[15:12] 0x0
0x41c10[19:16] 0x1
0x41c10[31:28] 0x4
0x41c10[23:20] 0x6
0x41c10[27:24] 0x6
23 0x41c14[7:4] 0x2
0x41c14[19:16] 0x2
0x41c14[3:0] 0x3
0x41c14[15:12] 0x3
0x41c14[11:8] 0x4
0x41c14[23:20] 0x5
0x41c14[27:24] 0x5
24 0x41c64[15:8] 0xf9
0x41c64[20:19] 0x1
0x41c64[24:23] 0x1
0x41c64[22:21] 0x3
0x41c64[28:27] 0x3
0x41c64[26:25] 0x3

Example Tcl scripts for Register Definition, Cache, Calibration to Enable SILB, and Revert to Disable SILB are provided below.

Register Definition:

proc register_def {} {
set ::address0 0x41450
set ::address1 0x41584
set ::address2 0x415dc
set ::address3 0x41674
set ::address4 0x4167c  
set ::address5 0x41680  
set ::address6 0x41684  
set ::address7 0x41758  
set ::address8 0x4175c  
set ::address9 0x41808  
set ::address10 0x41938  
set ::address11 0x4193c  
set ::address12 0x41960  
set ::address13 0x419b4  
set ::address14 0x419b8  
set ::address15 0x41A88  
set ::address16 0x41A8C  
set ::address17 0x41A90  
set ::address18 0x41A94  
set ::address19 0x41A98  
set ::address20 0x41A9C  
set ::address21 0x41AA4  
set ::address22 0x41C10  
set ::address23 0x41C14  
set ::address24 0x41C64
}

Cache:

proc cache {} {
	set ::data0 [master_read_32 $::m $::address0 1]
	set ::data1 [master_read_32 $::m $::address1 1]
	set ::data2 [master_read_32 $::m $::address2 1]
	set ::data3 [master_read_32 $::m $::address3 1]
	set ::data4 [master_read_32 $::m $::address4 1]
	set ::data5 [master_read_32 $::m $::address5 1]
	set ::data6 [master_read_32 $::m $::address6 1]
	set ::data7 [master_read_32 $::m $::address7 1]
	set ::data8 [master_read_32 $::m $::address8 1]
	set ::data9 [master_read_32 $::m $::address9 1]
	set ::data10 [master_read_32 $::m $::address10 1]
	set ::data11 [master_read_32 $::m $::address11 1]
	set ::data12 [master_read_32 $::m $::address12 1]
	set ::data13 [master_read_32 $::m $::address13 1]
	set ::data14 [master_read_32 $::m $::address14 1]
	set ::data15 [master_read_32 $::m $::address15 1]
	set ::data16 [master_read_32 $::m $::address16 1]
	set ::data17 [master_read_32 $::m $::address17 1]
	set ::data18 [master_read_32 $::m $::address18 1]
	set ::data19 [master_read_32 $::m $::address19 1]
	set ::data20 [master_read_32 $::m $::address20 1]
	set ::data21 [master_read_32 $::m $::address21 1]
	set ::data22 [master_read_32 $::m $::address22 1]
	set ::data23 [master_read_32 $::m $::address23 1]
	set ::data24 [master_read_32 $::m $::address24 1]
}

Calibration to Enable SILB:

proc enable_silb {} {
# For 0x41450, OR with 0x40000 to set bit [18] to 0x1.
master_write_32 $::m $::address0 [expr $::data0 | 0x40000]

# For 0x41584, OR with 0x4000, AND with ~(0x8000) to set bits [15:14] to 0x1.
master_write_32 $::m $::address1 [expr [expr $::data1 | 0x4000] &
0xFFFF7FFF]

# For 0x415dc, AND with ~(0x30000000) to set bits [29:28] to 0x0.
master_write_32 $::m $::address2 [expr $::data2 & 0xCFFFFFFF]

# For 0x41674, AND with ~(0x78000000) to set bits [30:27] to 0x0.
master_write_32 $::m $::address3 [expr $::data3 & 0x87FFFFFF]

# For 0x4167c, OR with 0x3C00000 to set bits [23:22] & [25:24] to 0x3.
master_write_32 $::m $::address4 [expr $::data4 | 0x3C00000]

# For 0x41680, AND with ~(0xC0000000) to set bits [31:30] to 0x0.
master_write_32 $::m $::address5 [expr $::data5 & 0x3FFFFFFF]

# For 0x41684, AND with ~(0xD8000000) to set bits [28:27] & [31:30] to 0x0.
master_write_32 $::m $::address6 [expr $::data6 & 0x27FFFFFF]

# For 0x41758, OR with 0x60000000 to set bits [30:29] to 0x3.
master_write_32 $::m $::address7 [expr $::data7 | 0x60000000]

# For 0x4175c, OR with 0x3C000 to set bits [17:14] to 0xF.
master_write_32 $::m $::address8 [expr $::data8 | 0x0003C000]

# For 0x41808, OR with 0x10000, AND with ~(0x8000) to set bits [16:15] to 0x2.
master_write_32 $::m $::address9 [expr [expr $::data9 | 0x10000] &
0xFFFF7FFF]

# For 0x41938, set bits [3:2, 9:8, 11:10, 13:12, 15:14] to 0x1 and bits
[19:18, 25:24, 27:26, 29:28, 31:30] to 0x3.
# OR with 0xff0c5504 to set bits [2, 8, 10, 12, 14] to 0x1 and bits
[19:18, 25:24, 27:26, 29:28, 31:30] to 0x3.
# AND with ~(0xaa08) to set bits [3, 9, 11, 13, 15] to 0x0
master_write_32 $::m $::address10 [expr [expr $::data10 | 0xff0c5504] &
0xFFFF55F7]

# For 0x4193c, OR with 0xFF to set bits [3:0] and [7:4] to 0xF.
master_write_32 $::m $::address11 [expr $::data11 | 0xFF]

# For 0x41960, OR with 0x20000000 to set bit [29] to 0x1.
master_write_32 $::m $::address12 [expr $::data12 | 0x20000000]

# For 0x419b4, OR with 0x10000000 to set bit [28] to 0x1.
master_write_32 $::m $::address13 [expr $::data13 | 0x10000000]

# For 0x419b8, OR with 0x8000000 to set bit [27] to 0x1.
master_write_32 $::m $::address14 [expr $::data14 | 0x8000000]

# For 0x41A88, OR with 0x68000000, AND with ~(0x10000000) to set bits [28:27]
to 0x1 and [30:29] to 0x3.
master_write_32 $::m $::address15 [expr [expr $::data15 | 0x68000000] &
0xEFFFFFFF]

# For 0x41A8C, OR with 0x68000000, AND with ~(0x10000000) to set bits [28:27]
to 0x1 and [30:29] to 0x3.
master_write_32 $::m $::address16 [expr [expr $::data16 | 0x68000000] &
0xEFFFFFFF]

# For 0x41A90, OR with 0x18000000 to set bits [28:27] to 0x3.
master_write_32 $::m $::address17 [expr $::data17 | 0x18000000]

# For 0x41A94, OR with 0x20000000, AND with ~(0x40000000) to set bits [30:29]
to 0x1.
master_write_32 $::m $::address18 [expr [expr $::data18 | 0x20000000] &
0xBFFFFFFF]

# For 0x41A98, OR with 0x38000000, AND with ~(0x40000000) to set bits [30:29]
to 0x1 and bit [28:27] to 0x3.
master_write_32 $::m $::address19 [expr [expr $::data19 | 0x38000000] &
0xBFFFFFFF]

# For 0x41A9C, set bits [13:12, 27:26] to 0x1 and bits [1:0, 3:2, 15:14,
17:16, 29:28, 31:30] to 0x3.
# OR with 0xF403D00F to set bits [12, 26] to 0x1 and bits [1:0, 3:2,
15:14, 17:16, 29:28, 31:30] to 0x3.
# AND with ~(0x8002000) to set bits [13, 27] to 0x0
master_write_32 $::m $::address20 [expr [expr $::data20 | 0xF403D00F] &
0xF7FFDFFF]

# For 0x41AA4, set bits [21:14] and [29:22] to 0xF9.
# OR with 0x3e7e4000, to set bits [14, 17, 18, 19, 20, 21, 22, 25,
26, 27, 28, 29] to 1
# AND with ~(0x1818000) to set bits [15, 16, 23, 24] to 0
master_write_32 $::m $::address21 [expr [expr $::data21 | 0x3e7e4000] &
0xFE7E7FFF]

# For 0x41C10, to set bits [11:8] and [15:12] to 0x0, bit [19:16] to 0x1, bits
[23:20] and [27:24] to 0x6, and bits [31:28] to 0x4.
# OR with 0x46610000 to set bits [16, 21, 22, 25, 26, 30] to 0x1
# AND with ~(0xB99EFF00) to set bits [11:8, 15:12, 19:17, 20, 23, 24,
27, 29:28, 31] to 0x0
master_write_32 $::m $::address22 [expr [expr $::data22 | 0x46610000] &
0x466100FF]

# For 0x41C14, to set bit [3:0] to 0x3, bits [7:4] to 0x2, bits [11:8] to 0x4,
bits [15:12] to 0x3, bits [19:16] to 0x2, bits [23:20] and [27:24] to 0x5.
# OR with 0x5523423 to set bits [0, 1, 5, 10, 12, 13, 17, 20, 22, 24,
26] to 0x1
# AND with ~(0xAADCBDC) to set bits [2, 3, 4, 6, 7, 8, 9, 11, 14, 15,
16, 18, 19, 21, 23, 25, 27] to 0x0
master_write_32 $::m $::address23 [expr [expr $::data23 | 0x5523423] &
0xF5523423]

# For 0x41C64, to set bits [15:8] to 0xF9 and set bits [20:19], [24:23] to 0x1
and bits [22:21], [26:25], [28:27] to 0x3.
# OR with 0x1ee8f900 to set bits [8, 11, 12, 13, 14, 15, 19, 21, 22,
23, 25, 26, 27, 28] to 0x1
# AND with ~(0x1100600) to set bits [9, 10, 20, 24] to 0x0
master_write_32 $::m $::address24 [expr [expr $::data24 | 0x1ee8f900] &
0xFEEFF9FF]
}

Revert to Disable SILB:

proc disable_silb {} {
master_write_32 $::m $::address0 $::data0
	master_write_32 $::m $::address1 $::data1
	master_write_32 $::m $::address2 $::data2
	master_write_32 $::m $::address3 $::data3
	master_write_32 $::m $::address4 $::data4
	master_write_32 $::m $::address5 $::data5
	master_write_32 $::m $::address6 $::data6
	master_write_32 $::m $::address7 $::data7
	master_write_32 $::m $::address8 $::data8
	master_write_32 $::m $::address9 $::data9
	master_write_32 $::m $::address10 $::data10
	master_write_32 $::m $::address11 $::data11
	master_write_32 $::m $::address12 $::data12
	master_write_32 $::m $::address13 $::data13
	master_write_32 $::m $::address14 $::data14
	master_write_32 $::m $::address15 $::data15
	master_write_32 $::m $::address16 $::data16
	master_write_32 $::m $::address17 $::data17
	master_write_32 $::m $::address18 $::data18
	master_write_32 $::m $::address19 $::data19
	master_write_32 $::m $::address20 $::data20
	master_write_32 $::m $::address21 $::data21
	master_write_32 $::m $::address22 $::data22
	master_write_32 $::m $::address23 $::data23
	master_write_32 $::m $::address24 $::data24
}