设备树学习之(六)RTC
来源:互联网 发布:reveal.js echarts 编辑:程序博客网 时间:2024/06/05 11:15
转载自:http://blog.csdn.net/lizuobin2/article/details/54564621
开发板:tiny4412SDK + S702 + 4GB Flash
要移植的内核版本:Linux-4.4.0 (支持device tree)
u-boot版本:友善之臂自带的 U-Boot 2010.12
busybox版本:busybox 1.25
目标:
Linux4.4 中已经对 tiny4412 rtc 有了支持,但是使能设备树之后启动报错,简单修改,使 rtc 正常工作。
设备树:
rtc: rtc@10070000 { compatible = "samsung,s3c6410-rtc"; reg = <0x10070000 0x100>; interrupt-parent = <&pmu_system_controller>;//注释掉此行 interrupts = <0 44 0>, <0 45 0>; clocks = <&clock CLK_RTC>; clock-names = "rtc"; status = "disabled"; };
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
启动错误信息:
[ 2.193630] s3c-rtc 10070000.rtc: failed to find rtc source clock [ 2.198950] s3c-rtc: probe of 10070000.rtc failed with error -2
- 1
- 2
- 1
- 2
简单修改:
修改:driver/rtc/rtc-s3c.c注释掉以下代码/* if (info->data->needs_src_clk) { info->rtc_src_clk = devm_clk_get(&pdev->dev, "rtc_src"); if (IS_ERR(info->rtc_src_clk)) { dev_err(&pdev->dev, "failed to find rtc source clock\n"); clk_disable_unprepare(info->rtc_clk); return PTR_ERR(info->rtc_src_clk); } clk_prepare_enable(info->rtc_src_clk); }*/或者修改:static struct s3c_rtc_data const s3c6410_rtc_data = { .max_user_freq = 32768, .needs_src_clk = true, //修改为false .irq_handler = s3c6410_rtc_irq, .set_freq = s3c6410_rtc_setfreq, .enable_tick = s3c6410_rtc_enable_tick, .save_tick_cnt = s3c6410_rtc_save_tick_cnt, .restore_tick_cnt = s3c6410_rtc_restore_tick_cnt, .enable = s3c24xx_rtc_enable, .disable = s3c6410_rtc_disable,};
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
linux 下更改系统时间:
date: invalid option -- 'h' BusyBox v1.25.0 (2016-12-16 21:42:21 ULAT) multi-call binary. Usage: date [OPTIONS] [+FMT] [TIME] Display time (using +FMT), or set time [-s,--set] TIME Set time to TIME -u,--utc Work in UTC (don't convert to local time) -R,--rfc-2822 Output RFC-2822 compliant date string -I[SPEC] Output ISO-8601 compliant date string SPEC='date' (default) for date only, 'hours', 'minutes', or 'seconds' for date and time to the indicated precision -r,--reference FILE Display last modification time of FILE -d,--date TIME Display TIME, not 'now' -D FMT Use FMT for -d TIME conversion Recognized TIME formats: hh:mm[:ss] [YYYY.]MM.DD-hh:mm[:ss] YYYY-MM-DD hh:mm[:ss] [[[[[YY]YY]MM]DD]hh]mm[.ss] 'date TIME' form accepts MMDDhhmm[[YY]YY][.ss] instead date -s 2017-01-01date -s 22:50:00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
系统时间和硬件rtc的同步:
/ # hwclock -h hwclock: invalid option -- 'h' BusyBox v1.25.0 (2016-12-16 21:42:21 ULAT) multi-call binary. Usage: hwclock [-r|--show] [-s|--hctosys] [-w|--systohc] [-t|--systz] [-l|--loc]Query and set hardware clock (RTC) -r Show hardware clock time -s Set system time from hardware clock -w Set hardware clock from system time -t Set in-kernel timezone, correct system time if hardware clock is in local time -u Assume hardware clock is kept in UTC -l Assume hardware clock is kept in local time -f FILE Use specified device (e.g. /dev/rtc2)
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
阅读全文
0 0
- 设备树学习之(六)RTC
- 设备树学习之(六)RTC
- 设备树学习之(六)RTC
- 从RTC设备学习中断
- 从RTC设备学习中断
- CUDA学习之六(设备运行时组件)
- 字符设备驱动之RTC驱动分析
- 寒假学习之stm32( 12)----RTC与BKP
- USB之(六)USB设备驱动
- 实例二——从RTC设备学习中断(系统实时钟)
- 设备树学习之(九)SPI设备注册过程
- 设备树学习之(九)SPI设备注册过程
- 设备树学习之(九)SPI设备注册过程
- ARM9硬件接口学习之二 RTC
- RTC 学习
- 设备树学习之(二)点灯
- 设备树学习之(三)Clock
- 设备树学习之(五)watchdog
- 导数的几何意义
- 写了一个Mac快速设置、打开和关闭Web代理的Shell命令
- cocos2d控件(1)-使用URL创建的Sprite
- Axon Framework管理复杂的业务事务
- 设备树学习之(五)watchdog
- 设备树学习之(六)RTC
- 设备树学习之(七)I2C设备的注册过程分析
- 数据契约(DataContract)DataMember 用法
- 设备树学习之(八)eeprom
- 设备树学习之(九)SPI设备注册过程
- 设备树学习之(十)spi flash
- 学习设备树之(十一)Backlight
- Http协议
- 设备树学习之(十二)LCD驱动