We used the am335x evm code as a template for our am3358 board. We do not use the TI power management IC. We do not have a need for I2C. We are trying to use i2c0_scl as a gpio. It is used to control the reset pin on our ethernet Phy IC.
We have defined this pin for GPIO using uboot and kernel pinmuxing. We also set the pin high during uboot and kernel board bringup to take the ethernet phy IC out of reset. In board-am335xevm.c we have removed references to I2C peripherals like the eeprom and power management IC.
Here is how we set the pin high in the kernel board-am335xevm.c:
#define LA_PHY_RESET (GPIO_TO_PIN(3,6))
gpio_set_value(LA_PHY_RESET, 1);
When bringing up the system, if we stop at uboot, this pin behaves correctly - the pin is high and it brings the ethernet phy out of reset. We can use ethernet within uboot.
If we boot to linux, the pin does not go high. If I query the system, it reports that the pin is configured correctly:
[root@MT2000 ~]# cat /sys/kernel/debug/omap_mux/i2c0_scl
name: i2c0_scl.gpio3_6 (0x44e1098c/0x98c = 0x0017), b NA, t NA
mode: OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT_PULLUP
signals: i2c0_scl | NA | NA | NA | NA | NA | NA | gpio3_6
I know we have ethernet set up correctly in linux because of the following: There is a pull-down resistor on the ethernet phy reset line to keep it in reset during early bootup. If we substitute a very weak pulldown resistor, the voltage level on this reset line does not keep the phy IC in reset. In that case, when booting to linux ethernet works fine.
It seems that there is something else after the startup in board_am335xevm.c that is inhibiting us driving this pin(?)
Thanks in advance for any insights.
Rod Campbell