Well, slight success on my investigation. First off, I found a few more GPIOs: the onboard serial console (P1) can be used as GPIOs, but I think it might be a good idea to disable the driver for serial port in that case (either while compiling firmware image or maybe anywhere in sysfs). So the new GPIO table looks someway like this:
| | | Output Value | Input Value
GPIO |Common Name |PCB Name | +3,3 V | 0 V | Open |Pulled-GND|Pulled-Vcc
=======================================================================================
0 | | | | | | |
1 | USB | D18 | 0 | 1 | 1 | 1 | 1
2 | SYS | D19 | 0 | 1 | 1 | 1 | 1
3 | RESET | SW6 | 1 | 0 | 1 | 0 | 1
4 | | | | | | |
5 | QSS | D31 | 1 | 0 | 0 | 0 | 1
6 | | | | | | |
7 | QSS-Button | SW8 | 1 | 0 | 1 | 0 | 1
8 | Setting data direction to output and value to 0 causes hard reset of the SoC
9 | WLAN | D11 | 0 | 1 | 1 | 1 | 1
10 | P1-Tx | | override by tty-mod | 1 | 0 | 1
11 | | | | | | |
12 | | | | | | |
13 | P1-Rx | | 1 | 0 | 0 | 0 | 1
14 | | | | | | |
15 | | | | | | |
16 | | | | | | |
17 | | | | | | |
18 | Data line of the RTL8366RB
19 | Clock line of the RTL8366RB
20 | | GPIO20 | 1 | 0 | 1 | 0 | 1
21 | | | | | | |
Someway confusing circuit-logic is used for some LEDs, since they do light up if the GPIO-value is set to 0. In input mode I was just unable to change their value to something different than 1. I tried to pull down to GND by temporarily connecting a 2,2k resistor - or if that failed, I connected straight with some wire. I also did some test with a pull up resistor of 2,2k to Vcc of P1.
Tests of GPIO10 in output mode always led to +3,3V, no matter which value was set. I guess that is caused by the serial console driver, which was still in charge. I just don't want to waste some time to disable it for one single test.
Now, there is even some progress on my main topic: I²C. I finally managed to get the module i2c-gpio-custom built, installed and loaded. The part of my OpenWRT-config file, which made it possible looks like that:
#
# I2C support
#
CONFIG_PACKAGE_kmod-i2c-core=y
CONFIG_PACKAGE_kmod-i2c-algo-bit=y
# CONFIG_PACKAGE_kmod-i2c-algo-pca is not set
# CONFIG_PACKAGE_kmod-i2c-algo-pcf is not set
CONFIG_PACKAGE_kmod-i2c-gpio=y
CONFIG_PACKAGE_kmod-i2c-gpio-custom=y
Besides that, I checked in the kernel-config, that the support for I²C character device was selected. In the kernel config file the appropriate line should look like that:
Alternatively, this option can be set to y. This module will create files like /dev/i2c-0, which are very convenient if using the i2c-tools. So far, some success. Now I hooked up a test pcb to USB- (SDA) and QSS-LED (SCL), successfully loaded the i2c-module with
insmod i2c-gpio-custom bus0=0,1,5
dmesg shows that it has started the i2c-bus, the character device is created in /dev and i2cdetect works - but doesn't detect my PCA9555. Either that weird circuit logic is confusing the I²C-bus, or I did not properly solder the PCA9555 (I hate SMD soldering). I need to investigate more on that, maybe I will use QSS-Button and Reset-Button instead (though I would not have a fancy LED indicating bus access).
Finally there is another investigation. SW7 seems to be a hard reset connector. At least whenever I pulled it to GND, the device entered straight into the boot loader.
(Last edited by MBS on 30 Jul 2010, 23:26)