Am 03.05.2010 um 22:18 schrieb Graham Gower:
On 4 May 2010 05:18, Dr. H. Nikolaus Schaller <h...@computer.org>
wrote:
Am 03.05.2010 um 21:35 schrieb Dr. H. Nikolaus Schaller:
So what can we learn? I think I should look into the sources of the
old RTC
driver to find out what it is doing differently (with respect to
initialization, e.g. GPIO assignment?).
Learings:
1. the working driver is at driver/character/rtc_pcf8563.c
drivers/char/rtc_pcf8563.c has been hacked to support Ingenic's i2c
code.
2. it directly calls i2c_open(), i2c_read(), i2c_close() etc. from
arch/mips/jz4730/i2c.c
Yes. This i2c driver does not register itself to the kernel as an i2c
bus driver. It is a total hack.
And that is enough reason to get rid of it...
3. is initialized (pcf_rtc_init) many dmesg lines after hctosys fails
(rtc_init)
4. no specific GPIO assignments found
5. i2c_open calls __i2c_enable
6. this is defined in kernel/include/asm/mach-jz4730/ops.h and sets
some
registers - maybe, this is missing for the "new" i2c driver (at
least I
haven't seen it in the code I copied from the Qi-Hardware project).
I had just not seen this call. And I found that the "new" driver also
uses all the __i2c_something() calls.
What I have now additionally cross-ported from the Qi-JZ4740 kernel is
the platform initialization of the i2c subsystem in arch/mips/jz4730/
platform.c.
And voila: i2c-tools now find a bus! But I am not sure if it works
since i2cdetect reports all addresses...
And the "new" RTC driver still does not initialize.
BR,
Nikolaus
_______________________________________________
Mipsbook-devel mailing list
Mipsbook-devel@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/mipsbook-devel