DS1307 RTC 설정 ?

manpage의 이미지

부팅 시 RTC에 있는 내용이 시스템에 반영되지 않아서 문의 드립니다.
아래 처럼 수동으로 설정하면 동작됩니다.
뭘 잘못했는지 알 수가 없습니다.
고수님의 조언을 부탁드립니다.

제반 사항
- OS: Linux 2.6.34
- CPU : MPC8309
- RTC : DS1307
- i2c-1로 RTC detect, get, set 정상 (i2cdump, i2cset, i2cget)

[dts 파일]
        i2c@3000 {
            #address-cells = <1>;
            #size-cells = <0>;
            cell-index = <0>;
            compatible = "fsl-i2c";
            reg = <0x3000 0x100>;
            interrupts = <14 0x8>;
            interrupt-parent = <&ipic>;
            clock-frequency = <400000>;
            dfsrr;
 
            rtc@68 {
                compatible = "dallas,ds1307";
                reg = <0x68>;
            };
        };
 
[arch/powerpc/platforms/83xx/platform 파일]  
static struct i2c_board_info __initdata ds1307_i2c_devices[] = {
    {
        I2C_BOARD_INFO("rtc-ds1307", 0x68),
        .type   = "ds1307",
    },
};
 
static int  setup_rtc (void)
{
    printk(KERN_INFO "RTC: Register DS1307/8 I2C devices.\n");
    return i2c_register_board_info(0, ds1307_i2c_devices, ARRAY_SIZE(ds1307_i2c_devices));
}
machine_device_initcall(pmc8309_som, setup_rtc);
Device Drivers  --->
   <*> Real Time Clock  --->
[*]   Set system time from RTC on startup and resume
(rtc0)  RTC used to set the system time
[ ]   RTC debug support
*** RTC interfaces ***
[*]   /sys/class/rtc/rtcN (sysfs)
[*]   /proc/driver/rtc (procfs for rtc0)
[*]   /dev/rtcN (character devices)
*** I2C RTC drivers ***
<*>   Dallas/Maxim DS1307/37/38/39/40, ST M41T00, EPSON RX-8025
 
[script 파일]
 /bin/mknod /dev/rtc  c `awk "\\$2==\"rtc\" {print \\$1}" /proc/devices` 0
 #if ( /usr/sbin/i2cdetect -y 1 | grep -q 68 ) ; then
 #     echo ds1307 0x68 >  /sys/class/i2c-adapter/i2c-1/new_device
 #fi
 
[부팅 메시지]
rootfs image is not initramfs (no cpio magic); looks like an initrd
Freeing initrd memory: 16299k freed
RTC: Register DS1307/8 I2C devices.
JFFS2 version 2.2. (NAND) ⓒ 2001-2006 Red Hat, Inc.
. . . .
i2c /dev entries driver
mpc-i2c e0003000.i2c: clock 400000 Hz (dfsrr=6 fdr=2)
mpc-i2c e0003100.i2c: clock 400000 Hz (dfsrr=6 fdr=2)
Netfilter messages via NETLINK v0.30.
nf_conntrack version 0.5.0 (7914 buckets, 31656 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_conntrack.acct=1 kernel parameter, acct=1 nf_conntrack module option or
sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
ctnetlink v0.93: registering with nfnetlink.
xt_time: kernel timezone is -0000
ip_tables: (C) 2000-2006 Netfilter Core Team
ClusterIP Version 0.8 loaded successfully
arp_tables: (C) 2002 David S. Miller
TCP cubic registered
NET: Registered protocol family 10
NET: Registered protocol family 17
NET: Registered protocol family 15
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)  <-- 반영되지 않은 부분
RAMDISK: gzip image found at block 0
 
[내용 확인]
cat /proc/devices
 89 i2c
254 rtc
 
ls -al /dev/rtc*
crw-r--r--    1 root     root      254,   0 Jan  1 09:00 /dev/rtc
 
hwclock
hwclock: can't open '/dev/misc/rtc': No such file or directory
 
ls -al /sys/class/rtc  내용 없음
 
echo ds1307 0x68 >  /sys/class/i2c-adapter/i2c-1/new_device
ls -al /dev/rtc*
lrwxrwxrwx    1 root     root             4 Jan  1 09:12 /dev/rtc -> rtc0
crw-r--r--    1 root     root      254,   0 Jan  1 09:12 /dev/rtc0
 
위의 명령을 입력하면 /sys/class/rtc/rtc0/에 파일들이 정상으로 올라옴.
 
cat /proc/driver/rtc   <-- 위 명령을 실행하기 전에는 없음
rtc_time        : 23:42:37
rtc_date        : 2011-09-01
24hr            : yes
 
date
Thu Jan  1 09:14:27 KST 1970
hwclock -s
date
Thu Sep  1 23:43:19 KST 2011

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.