设备树学习之(六)RTC
2017-01-15 21:05
134 查看
开发板: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 正常工作。
设备树:
启动错误信息:
简单修改:
linux 下更改系统时间:
系统时间和硬件rtc的同步:
要移植的内核版本: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"; };
启动错误信息:
[ 2.193630] s3c-rtc 10070000.rtc: failed to find rtc source clock [ 2.198950] s3c-rtc: probe of 10070000.rtc failed with error -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, };
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-01 date -s 22:50:00
系统时间和硬件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)
相关文章推荐
- 设备树学习之(六)RTC
- 设备树学习之(六)RTC
- s3c6410 RTC driver——读取实时时间信息 <LDD3 & ELDD 学习笔记>
- ARM9硬件接口学习之二 RTC
- ARM学习《十》—关于STM32的RTC调试
- STM32学习笔记6——RTC
- ARM9 mini2451裸机学习——RTC驱动设置
- 设备树(device tree)学习笔记一
- 学习笔记 --- LINUX RTC驱动分析
- STM32再学习——实时时钟(RTC)
- cortex_m3_stm32嵌入式学习笔记(十四):RTC实时时钟(秒中断)
- 【嵌入式Linux学习七步曲之第三篇 Linux系统bootlaoder移植】全面解析PowerPC架构下的扁平设备树FDT
- 实例二——从RTC设备学习中断(系统实时钟)
- WinCE板级支持包开发学习之RTC驱动程序
- 嵌入式arm学习总结(五)--RTC-TIME-PWM-Watchdog-AD-TP
- ARM学习《十》—关于STM32的RTC调试
- RTC(S3C2410)学习记录
- RTC学习记录
- RTC 学习
- STM32学习-RTC实时时钟