Hi,
I am using:
- Beaglebone white
- Ezlinux sdk: root@user-virtual-machine:/home/user/ti-sdk-am335x-evm-07.00.00.00/board-support/linux-3.12.10-ti2013.12.01#
- and DS3231 Real Time Clock breakboard from Adafruit
Until now, I was able to detect the DS3231 at the I2C bus:
root@Teste01:~# i2cdetect -y -r 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
I have enabled the DS3232 driver at menuconfig.
I have added the following code at am335x-bone-common.dtsi:
i2c1_pins: pinmux_i2c1_pins {
pinctrl-single,pins = <
0x158 (PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_d1.i2c1_sda */
0x15c (PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_cs0.i2c1_scl */
>;
};
and
i2c1: i2c@4802a000 {
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pins>;
status = "okay";
clock-frequency = <400000>;
/* Set OPP50 (0.95V) for VDD core */
sleep-sequence = /bits/ 8 <
0x02 0x24 0x0b 0x6d /* Password unlock 1 */
0x02 0x24 0x10 0x02 /* Set DCDC3 to 0.95V */
0x02 0x24 0x0b 0x6d /* Password unlock 2 */
0x02 0x24 0x10 0x02 /* Set DCDC3 to 0.95V */
0x02 0x24 0x0b 0x6c /* Password unlock 1 */
0x02 0x24 0x11 0x86 /* Apply DCDC changes */
0x02 0x24 0x0b 0x6c /* Password unlock 2 */
0x02 0x24 0x11 0x86 /* Apply DCDC changes */
>;
/* Set OPP100 (1.10V) for VDD core */
wake-sequence = /bits/ 8 <
0x02 0x24 0x0b 0x6d /* Password unlock 1 */
0x02 0x24 0x10 0x08 /* Set DCDC3 to 1.1V */
0x02 0x24 0x0b 0x6d /* Password unlock 2 */
0x02 0x24 0x10 0x08 /* Set DCDC3 to 1.1V */
0x02 0x24 0x0b 0x6c /* Password unlock 1 */
0x02 0x24 0x11 0x86 /* Apply DCDC changes */
0x02 0x24 0x0b 0x6c /* Password unlock 2 */
0x02 0x24 0x11 0x86 /* Apply DCDC changes */
>;
DS3232: DS3232@68 {
compatible = "Dallas/Maxim,DS3232";
reg = <0x68>;
};
};
And I have added the following highlighted code at board-omap3beagle.c (I have not found board-am335xevm.c as advised in other posts):
static struct i2c_board_info __initdata beagle_i2c_eeprom[] = {
{
I2C_BOARD_INFO("eeprom", 0x50),
},
{
I2C_BOARD_INFO("ds3231", 0x68),
},
};
So I try to instantiate and I get an error:
root@PRC4-01:~# echo ds3231 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
-sh: echo: write error: Invalid argument
What am I doing wrong? Do I have to add something more at the device tree to get DS3232 driver working and linked to the i2c-1?
Thanks in advance and best regards!