[patch] RSPRO RTC hack

Luiz Otavio O Souza lists.br at gmail.com
Fri Nov 12 11:32:21 UTC 2010


Hello mips,

Here are my patches for the RTC on RSPRO.

Please apply the ar71xx_spi_cs_mux.diff first and then the rspro-rtc.diff.

The first patch (ar71xx_spi_cs_mux.diff) is just a cleanup on code that does the CS selection on SPI driver. It _will_ change the CS number for onboard flash (please check the RSPRO.hints sample), but other than that it don't change the behaviour of spi driver (i.e. it doesn't fix the RTC problem).

The real fix (which is a hack) is the second patch (rspro-rtc.diff).

The problem with RSPRO RTC is that ar71xx_spi_chip_deactivate() wants to disable all chips in spi bus by setting all CS pins to high, but in RSPRO case the CS0 high enables the RTC chip, so (in short) it will never be disabled (well it is disabled only when flash is used)...

With this cenario the RTC chip got lost and fail to understand the first byte sent as 'command'.

My patch simply disables the chip for a while (100ms) before it get enabled again (it works on activate time). That is the simplest solution i've found, but it applies only for RSPRO and right now we don't have anything to track the board model we're running on and enable this (and others) software hacks as needed.

It should not break others boards, but it will add a 100ms delay for every spi access (without any good reason).

Cheers,
Luiz



-------------- next part --------------
A non-text attachment was scrubbed...
Name: ar71xx_spi_cs_mux.diff
Type: application/octet-stream
Size: 2516 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-mips/attachments/20101112/ab9912a2/ar71xx_spi_cs_mux.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rspro-rtc.diff
Type: application/octet-stream
Size: 577 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-mips/attachments/20101112/ab9912a2/rspro-rtc.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RSPRO.hints
Type: application/octet-stream
Size: 1488 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-mips/attachments/20101112/ab9912a2/RSPRO.obj


More information about the freebsd-mips mailing list