Home»Projects »Linux for Cisco 2500 routers»Synchronous Serials Mapping

Synchronous Serials Mapping

I've been looking for the 2500 serials; and sometimes one has luck.

 

The 3104 memory map shows:
 02132000-021320FF Serial controller ---
 02132100-02132101 Serial 0 device register ---
 02132102-02132103 Serial 1 device register ---

I've been looking at these locations on a 2503.
Krysztof Halasa was right - the hd64570 chip is mapped as 256 8-byte registers on a 0x100 boundary.
Thanks, Krysztof.



Router#sh controllers serial 0
HD unit 0, idb = 0xAB91C, driver structure at 0xAFDE0
buffer size 1524 HD unit 0, No cable
cpb = 0xE2, eda = 0x4140, cda = 0x4000
RX ring with 16 entries at 0xE24000
00 bd_ptr=0x4000 pak=0x0AFFCC ds=0xE249E4 status=80 pak_size=0
01 bd_ptr=0x4014 pak=0x0B0164 ds=0xE250A0 status=80 pak_size=0
02 bd_ptr=0x4028 pak=0x0B02FC ds=0xE2575C status=80 pak_size=0
03 bd_ptr=0x403C pak=0x0B0494 ds=0xE25E18 status=80 pak_size=0
04 bd_ptr=0x4050 pak=0x0B062C ds=0xE264D4 status=80 pak_size=0
05 bd_ptr=0x4064 pak=0x0B07C4 ds=0xE26B90 status=80 pak_size=0
06 bd_ptr=0x4078 pak=0x0B095C ds=0xE2724C status=80 pak_size=0
07 bd_ptr=0x408C pak=0x0B0AF4 ds=0xE27908 status=80 pak_size=0
08 bd_ptr=0x40A0 pak=0x0B0C8C ds=0xE27FC4 status=80 pak_size=0
09 bd_ptr=0x40B4 pak=0x0B0E24 ds=0xE28680 status=80 pak_size=0
10 bd_ptr=0x40C8 pak=0x0B0FBC ds=0xE28D3C status=80 pak_size=0
11 bd_ptr=0x40DC pak=0x0B1154 ds=0xE293F8 status=80 pak_size=0
12 bd_ptr=0x40F0 pak=0x0B12EC ds=0xE29AB4 status=80 pak_size=0
13 bd_ptr=0x4104 pak=0x0B1484 ds=0xE2A170 status=80 pak_size=0
14 bd_ptr=0x4118 pak=0x0B161C ds=0xE2A82C status=80 pak_size=0
15 bd_ptr=0x412C pak=0x0B17B4 ds=0xE2AEE8 status=80 pak_size=0
16 bd_ptr=0x4140 pak=0x0B194C ds=0xE2B5A4 status=80 pak_size=0
cpb = 0xE2, eda = 0x4800, cda = 0x4800
TX ring with 2 entries at 0xE24800
00 bd_ptr=0x4800 pak=0x000000 ds=0x000000 status=80 pak_size=0
01 bd_ptr=0x4814 pak=0x000000 ds=0x000000 status=80 pak_size=0
02 bd_ptr=0x4828 pak=0x000000 ds=0x000000 status=80 pak_size=0
0 missed datagrams, 0 overruns
0 bad datagram encapsulations, 0 memory errors
0 transmitter underruns


In the above output , 'cpb' is short for "Chain Pointer Base".
Serial 0 has cpb at 0x86 or 0x87, depending upon the mode the chip is in.
And, lo and behold:


Router#sh mem 0x2132000
02132000: FF000000 0000FF00 8004FFFF FFFFFFFF ................
02132010: 0000FF00 BB88FF00 FF00FF00 FF00FFFF ....;...........
02132020: FFFF0001 08000000 00000000 00FF0000 ................
02132030: 0100FFFF 01FF0000 1F00FF00 0101FFFF ................
02132040: FFFF0001 08000000 00000000 00FF0000 ................
02132050: 0100FFFF 01FF0000 1F00FF00 0101FFFF ................
02132060: 00000000 0000FFFF 00000000 0000FFFF ................
02132070: 00000000 0000FFFF 00000000 0000FFFF ................
02132080: 0000FF00 0000FFE2 40004140 05F40000 .......b@.A@.t..
02132090: 000100FF 000000FF FFFFFFFF FFFFFFFF ................
021320A0: 0000FF00 0000FFE2 48004800 FFFF0000 .......bH.H.....
021320B0: 000100FF 000000FF FFFFFFFF FFFFFFFF ................
021320C0: 0000FF00 0000FFE3 28002940 05F40000 .......c(.)@.t..
021320D0: 000100FF 000000FF FFFFFFFF FFFFFFFF ................
021320E0: 0000FF00 0000FFE3 30003000 FFFF0000 .......c0.0.....
021320F0: 000100FF 000000FF FFFFFFFF FFFFFFFF ................
02132100: 06000600 FFFFFFFF XXXXXXXX XXXXXXXX ........XXXXXXXX
02132110: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXXXXXXXXXX


at 0x213200 + 0x87 we fine the value 0xe2. The same for eda - "Error descriptor address".


Adresses 0x2132000 up to 0x21320ff are thus easily decoded.
Adress 0x2132100 and higher aren't part of the chip.
They seem to indicate the cable plugged into the serials.
0x2132100:
06000600 no cable
07000600 DTE x.21 cable on serial 0
06000700 DTE x.21 cable on serial 1


"show stacks" says that interrupt 3 is the serials.
Together with the datasheet of the chip and the hd64570 kernel driver there is enough information to get the sync serials working.

 

Back to uClinux-cisco2500