I am using the TI-Android-JB-4.2.2-DevKit-4.1.1 to build an Android for Beaglebone Black which works perfectly well. I try to use the RTC-Cape (http://elinux.org/CircuitCo:RTC_Cape). With the "onboard" Angström on the BBB I was able to set and read the RTC manually, therefore I assume that the hardware is ok.
To put the RTC in operation with Android, I added in the file kernel/arch/arm/mach-omap2/board-am335xevm.c
in the struct
static struct i2c_board_info __initdata am335x_i2c0_boardinfo[]
at the end
{
I2C_BOARD_INFO("ds1338", 0x68),
},
In kernel/arch/arm/configs/am335x_evm_android_defconfig
I activated the CONFIG_RTC_DRV_DS1307
(CONFIG_RTC_DRV_DS1307=y
) and deactivated the CONFIG_RTC_DRV_OMAP
.
At bootup it says
<4>[ 1.880767] rtc-ds1307: probe of 1-0068 failed with error -5
<6>[ 1.886779] i2c /dev entries driver
and
<3>[ 2.306884] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
I tried to adapt the changes from this Beaglebone/Linux mailing list: https://groups.google.com/forum/#!msg/beagleboard/DegreEdtI-Q/ZEdFLNnuTvMJ.
I am new to Android/Linux kernel configuration. How do I have to include and configure the RTC in the kernel properly that it is usable at bootup?
Regards
Matthias
Update
It turns out the DS1338 on the Beaglebone Balck Cape is in fact connected to 17 and 18 on P9, which is I2C1 or i2c-2 on Android. This bus is deactivated by default in Android. As a short workaround I cut the printed curcuit paths and wired it to 19 and 20 on P9 (I2C2 oder i2c-3).
Then I moved the I2C_BOARD_INFO
block to
static struct i2c_board_info am335x_i2c2_boardinfo[]
The compiled kernel now reads the time from the RTC at bootup.
Thanks very much for the hint, user3926077.
A proper solution would be to activate the i2c-2 in the Android kernel and put the I2C-BOARD_INFO
block in static struct i2c_board_info am335x_i2c1_boardinfo[]
. Unfortunately i do not know how to achieve this at the moment and we need the RTC only for debugging, so the soldering solution works for us.
static struct i2c_board_info __initdata am335x_i2c0_boardinfo[] is accessing the internal i2c bus /dev/i2c-1 but you will be plugging the rtc into 19 and 20 on p9 which is /dev/i2c-3