Port Linux2.6.24.4 to S3C2410 (nano2410): RTC -- general Linux technology-Linux programming and kernel information. For more information, see the following. [Platform information]
Target Board Nano2410
CPU: S3C2410X
SDRAM: HY57V561620 (32 MB)
FLASH: K9F1208 (64 MB)
NET: CS8900
HOST
Linux Realse Version: Fecora Cor 8 (FC8)
CrossCompiler: gcc-4.1.1/glibc-2.3.2
The startup information shows that the RTC driver is not loaded successfully!
TCP cubic registered
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
Drivers/rtc/hctosys. c: unable to open rtc device (rtc0)
IP-Config: Complete:
Device = eth0, addr = 192.168.0.69, mask = 255.255.255.0, gw = 192.168.0.1,
Host = www, domain =, nis-domain = kevin.com,
Bootserver = 192.168.0.104, rootserver = 192.168.0.104, rootpath =
Looking up port of RPC 100003/2 on 192.168.0.104
The RTC of S3C2410 is already in 2.6.24.4 kernel, but it is not added to the SMDK2410 targetboard,
Therefore, you only need to add RTC to the initialized device list.
1. Use the default settings for the RTC section in menu config.
2. Modify the file mach-smdk2410.c (/linux2.6.24.4/arch/arm/mach-s3c2410/mach-smdk2410.c), and add & amp.
3. Create the rtc Device File rtc in the/etc directory.
Mknod rtc? C 10 135
4. recompile the kernel. Check the startup information.
The preceding information indicates that the RTC time may not be set. The initial RTC time is Wed Dec 31 23:59:59 1969. From the kernel function int rtc_valid_tm (struct rtc_time * tm), we can see that when year is less than 1970, it is considered as the time invalid, and the function returns-EINVAL. Let's verify this idea. J
[Root @ kevin/] # hwclock
Wed Dec 31 23:59:59 1969 0.000000 seconds
[Root @ kevin/] # date
Thu Jan 1 00:06:58 UTC 1970
The system time is set by date, And the RTC time is set by hwclock. When the system is started, the system time is obtained through RTC. When RTC is not set, Wed Dec 31 23:59:59 1969 is also used for the system time.
Options:
-R Read hardware clock and print result
-S Set the system time from the hardware clock
-W Set the hardware clock to the system time
-U The hardware clock is kept in coordinated universal time
-L The hardware clock is kept in local time
-F FILE Use the specified clock (e.g./dev/rtc2)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.