0

我正在使用 TI-Android-JB-4.2.2-DevKit-4.1.1 为 Beaglebone Black 构建一个运行良好的 Android。我尝试使用 RTC-Cape ( http://elinux.org/CircuitCo:RTC_Cape )。通过 BBB 上的“板载”Angström,我能够手动设置和读取 RTC,因此我认为硬件没问题。

为了让 RTC 在 Android 上运行,我在kernel/arch/arm/mach-omap2/board-am335xevm.cstruct 的文件中添加了

static struct i2c_board_info __initdata am335x_i2c0_boardinfo[]

在最后

{
    I2C_BOARD_INFO("ds1338", 0x68),
},

kernel/arch/arm/configs/am335x_evm_android_defconfig我激活了CONFIG_RTC_DRV_DS1307( CONFIG_RTC_DRV_DS1307=y) 并停用了CONFIG_RTC_DRV_OMAP.

在启动时它说

<4>[    1.880767] rtc-ds1307: probe of 1-0068 failed with error -5
<6>[    1.886779] i2c /dev entries driver

<3>[    2.306884] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)

我试图调整来自此 Beaglebone/Linux 邮件列表的更改:https ://groups.google.com/forum/#!msg/beagleboard/DegreEdtI-Q/ZEdFLNnuTvMJ 。

我是 Android/Linux 内核配置的新手。如何在内核中正确包含和配置 RTC 以使其在启动时可用?

问候

马蒂亚斯

更新

事实证明,Beaglebone Black Cape 上的 DS1338 实际上连接到 P9 上的 17 和 18,即 Android 上的 I2C1 或 i2c-2。默认情况下,此总线在 Android 中处于停用状态。作为一个简短的解决方法,我切断了印刷的电路路径并将其连接到 P9 上的 19 和 20(I2C2 或 i2c-3)。

然后我把I2C_BOARD_INFO块移到

static struct i2c_board_info am335x_i2c2_boardinfo[]

编译的内核现在在启动时从 RTC 读取时间。

非常感谢您的提示,user3926077。

一个合适的解决方案是在 Android 内核中激活 i2c-2 并将I2C-BOARD_INFO块放入static struct i2c_board_info am335x_i2c1_boardinfo[]. 不幸的是,我目前不知道如何实现这一点,我们只需要 RTC 进行调试,所以焊接解决方案对我们有用。

4

1 回答 1

0

static struct i2c_board_info __initdata am335x_i2c0_boardinfo[] 正在访问内部 i2c 总线 /dev/i2c-1 但您会将 rtc 插入 p9 上的 19 和 20,即 /dev/i2c-3

于 2014-08-10T00:08:56.303 回答