int Get Crystal Frequency
- Save core index and switch to chipcommon core
- If the chip has an ID of 0x4328 or 0x5354 (?)
- Read SSB_PCICORE_PCICFG2 (0x600), mask with 0x7C, right shift by 2, and save as an index
- Find the entry with that index in the table below. If not found, select entry 9 (frequency == 20000)
- Set clock to the frequency value from the table * 1000
- Else if chip has an ID of 0x4325
- Repeat above procedure using Table 1
- Else if chip has an ID of 0x4312
- Repeat above procedure using Table 1
- Set clock to 20,000,000 (Why do step a? Is the read of SSB_PCICORE_PCICFG2 important?)
- Otherwise
- Set clock to 20,000,000
- Restore the original core
- Return clock
Table 0
Frequency
index
wbint
wbfrac
12000
1
73
349525
13000
2
67
725937
14400
3
61
116508
15360
4
57
305834
16200
5
54
336579
16800
6
52
399457
19200
7
45
873813
19800
8
44
466033
20000
9
44
0
25000
10
70
419430
26000
11
67
725937
30000
12
58
699050
38400
13
45
873813
40000
14
45
0
Table 1
frequency
index
p1div
p2div
ndiv_int
ndiv_frac
12000
1
3
22
0x9
0xFFFFEF
13000
2
1
6
0xb
0x483483
14400
3
1
10
0xa
0x1C71C7
15360
4
1
5
0xb
0x755555
16200
5
1
10
0x5
0x6E9E06
16800
6
1
10
0x5
0x3Cf3Cf
19200
7
1
9
0x5
0x17B425
19800
8
1
11
0x4
0xA57EB
20000
9
1
11
0x4
0x0
24000
10
3
11
0xa
0x0
25000
11
5
16
0xb
0x0
26000
12
1
2
0x10
0xEC4EC4
30000
13
3
8
0xb
0x0
38400
14
1
5
0x4
0x955555
40000
15
1
2
0xb
0
Note: At the moment only the first two columns of these tables are used. The others are being kept until their usage is discovered.