am335x system upgrade kernel i2c rtc eeprom(六)
1 Scope of Document
This document describes i2c bus hardware design and support i2c-devices: eeprom(at24c08) rtc(rx8025).
2 Requiremen
2.1 Function Requirement
Enumerate i2c bus eeprom and rtc i2c-device, load corresponding drivers
2.2 Performance Requirement
NA
3 Hardware Overview
i2c interface,pin map:
AM335X_I2C0_SCL------------------I2C0_SCL
AM335X_I2C0_SDA------------------I2C0_SDA


Figure 1 tf interface block diagram
4 Functional Description
4.1 I2C
4.1.1 Overview

Figure 2 timing diagram
- Data transfer is initiated with a start bit (S) signaled by SDA being pulled low while SCL stays high.
- SCL is pulled low, and SDA sets the first data bit level while keeping SCL low (during blue bar time).
- The data are sampled (received) when SCL rises for the first bit (B1). For a bit to be valid, SDA must not change between a rising edge of SCL and the subsequent falling edge (the entire green bar time).
- This process repeats, SDA transitioning while SCL is low, and the data being read while SCL is high (B2, ...Bn).
- The final bit is followed by a clock pulse, during which SDA is pulled low in preparation for the stop bit.
- A stop bit (P) is signaled when SCL rises, followed by SDA rising.
5 Porting
5.1 Kernel porting
Dts file :
i2c0_pins: pinmux_i2c0_pins {
pinctrl-single,pins = <
AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0)
AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0)
>;
};
&i2c0 {
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins>;
status = "okay";
clock-frequency = <400000>;
at24c08@50 {
compatible = "atmel,24c08";
pagesize = <16>
reg = <0x50>;
};
rtc@32 {
compatible = "epson,rx8025";
reg = <0x32>;
};
};
[ 1.795430] at24 0-0050: 1024 byte 24c08 EEPROM, writable, 16 bytes/write
[ 1.803203] rtc-rx8025 0-0032: rx8025_get_time: read 0x09 0x01 0x06 0x06 0x16 0x11 0x18
[ 1.803220] rtc-rx8025 0-0032: rx8025_get_time: date 9s 1m 6h 16md 10m 118y
[ 1.803504] rtc rtc0: rx8025: dev (253:0)
[ 1.803534] rtc-rx8025 0-0032: rtc core: registered rx8025 as rtc0
[ 1.809854] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[ 3.179312] rtc-rx8025 0-0032: rx8025_get_time: read 0x10 0x01 0x06 0x06 0x16 0x11 0x18
[ 3.179330] rtc-rx8025 0-0032: rx8025_get_time: date 10s 1m 6h 16md 10m 118y
[ 3.179373] rtc-rx8025 0-0032: setting system clock to 2018-11-16 06:01:10 UTC (1542348070)
6 Follow-up
Read rtc:

Write rtc:

test rtc:

eeprom access dir:
/sys/bus/i2c/devices/0-0050
am335x system upgrade kernel i2c rtc eeprom(六)的更多相关文章
- am335x system upgrade kernel f-ram fm25l16b(十六)
1 Scope of Document This document describes SPI F-RAM hardware design 2 Requiremen 2.1 ...
- am335x system upgrade kernel tf(五)
1 Scope of Document This document describes TF hardware design 2 Requiremen 2.1 Functi ...
- am335x system upgrade kernel ethernet(四)
1 Scope of Document This document describes ethernet hardware design and porting KZS8081 to ubo ...
- am335x system upgrade kernel gpio(九)
1 Hardware Overview gpio interface,pin map: AM335X_I2C0_W_C----------------------MCASP0_AXR1 /* ...
- am335x system upgrade kernel can(八)
1 Scope of Document This document describes can bus hardware design and can bus driver developm ...
- am335x system upgrade kernel uart(七)
1 Scope of Document This document describes UART hardware design, uart driver porting 2 Re ...
- am335x system upgrade kernel ec20 simcom7600ce(十一)
1 Scope of Document This document describes 4G hardware design, support quectel ec20 4G module/ ...
- am335x system upgrade kernel usb stroage(十)
1 Scope of Document This document describes USB hardware design, support stardard usb2.0 port o ...
- am335x system upgrade kernel emmc(十八)
1 Scope of Document This document describes EMMC hardware design 2 Requiremen 2.1 Func ...
随机推荐
- Linux中的两个经典宏定义:获取结构体成员地址,根据成员地址获得结构体地址;Linux中双向链表的经典实现。
倘若你查看过Linux Kernel的源码,那么你对 offsetof 和 container_of 这两个宏应该不陌生.这两个宏最初是极客写出的,后来在Linux内核中被推广使用. 1. offse ...
- jvm堆内存模型原理分析及堆内存分析工具jhat和MAT的使用超详细教程
- AS3.0 m3u8文件视频播放器
AS3.0 m3u8文件视频播放器(暂无源码): 点击欣赏! http://lxmc.aomaya.com/fengzi/m3u8/m3u8Player.swf
- ApachShiro 一个系统 两套验证方法-(后台管理员登录、前台App用户登录)同一接口实现、源码分析
需求: 在公司新的系统里面博主我使用的是ApachShiro 作为安全框架.作为后端的鉴权以及登录.分配权限等操作 管理员的信息都是存储在管理员表 前台App 用户也需要校验用户名和密码进行登录.但是 ...
- 导出Excel的2个方法
导出到Excel的两种方法 第一种: 1.首先创建Excle模板,另存为 “xml”文件.使用记事本等编辑软件打开文件的代码.然后另存为视图文件“Export.cshtml”; 2.控制器操作 pub ...
- bat 设置多个静态ip
@echo off REM 本地连接名称 set NetName="本地连接 2" REM 默认IP netsh interface ipv4 set address name=% ...
- js编写日历的思路
首先写出一个日历我们需要考虑以下2个问题: 每个月的总天数 每个月的第一天周几 这里提供了一个判断平年闰年2月份天数的方法: function leapYear(year) { return (yea ...
- mybatis异常:nested exception is org.apache.ibatis.builder.BuilderException: Error resolving JdbcType
异常详细 org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.Builde ...
- sqlite移植
编译 # tar xvf sqlite-3.6.16.tar.gz # cd sqlite-3.6.16 # ./configure # ./configure --host=arm-linux -- ...
- Invalid escape sequence at line 1 column 29 path $[0].name
编译报错:Invalid escape sequence at line 1 column 29 path $[0].name 解决:grade.properties 文件下 org.gradle.j ...