About wait states

For some time I’m struggling with the external Interface of ASUS WL-HDD Router models.

I’m now trying to connect a T6963 based LCD. This failed because of the speed of the external bus. So I searched the linux code and found the initialization in sbmips.c under linux/arch/mips32/bcm47xxx/sbmips.c.

I copied the code to my module and build a function to slow down the speed:

static void extif_slowDown()  {
ulong hz,ns,tmp;
extifregs_t *eir;

if ((hz = sb_clock(sbh)) == 0)
hz = 100000000;
ns = 1000000000 / hz;

if ((eir = sb_setcore(sbh, SB_EXTIF, 0))) {
tmp = CEIL(1, ns) < < FW_W3_SHIFT;
tmp = tmp | (CEIL(1,ns) << FW_W2_SHIFT);
tmp = tmp | (CEIL(200, ns) << FW_W1_SHIFT);
tmp = tmp | CEIL(240, ns);
W_REG(&eir->prog_waitcount, tmp);
}
}

I had no clue what those parameters are for. For a first test the old values where doubled. Using a oscilloscope I could figure out 2 values:

bild1.png bild2.png bild3.png
W3 = 40ns
W2 = 40ns
W1 = 100ns
W0 = 200ns
W3 = 100ns
W2 = 40ns
W1 = 100ns
W0 = 200ns
W3 = 40ns
W2 = 100ns
W1 = 100ns
W0 = 200ns

The upper signal is the /CS line and the lower the /WR line. As you can see W3 defines the time from /WR high to /CS high, while W2 defines the time from /CS low to /RD low. What W1 and W0 are for I can only guess. The total low time of /CS increases with W0 but for W1 I coudn’t find a change (maybe it’s a timing value for reading from the interface).

I’m now playing with the timing parameters and looking what the LCD will display. Sometimes I can ge something on it and sometimes not. I think I got the writing timing correct but reading to check the status bits is not in time…

Tags: , ,

Leave a Reply