How to test nvram rtc with powepc kernel

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to test nvram rtc with powepc kernel

Jump to solution
1,517 Views
vinothkumars
Senior Contributor IV

Dear NXP,

 

I am working on T4240RDB-64B machine and using QORIQ-SDK-2.0 source. I needs to test NVRAM RTC in kernel.

Needs to read and write the value.

Will you please tell me how to test NVRAM RTC (CY14B116M ) ?

Do I needs to do any configuration ?

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar
Labels (1)
1 Solution
1,302 Views
yipingwang
NXP TechSupport
NXP TechSupport

1. Enable I2C-RTC driver in kernel, Eg.<DS3232>.

Device Drivers->
        Real Time Clock-->
                  [*] Set system time from RTC on startup and resume (new)
                  (rtc0) RTC used to set the system time (new)
                 <[*] /sys/class/rtc/rtcN (sysfs)
                 <[*] /proc/driver/rtc (procfs for rtc0)
                 <[*] /dev/rtcN (character devices)
                  I2C RTC drivers
                 <[*] Dallas/Maxim DS3232
After booting up Linux.
# dmesg |grep rtc
# ls -l /dev/rtc*
# cat /proc/devices |grep rtc
# mknod /dev/rtc0 c 254 0
# ln -s /dev/rtc0 /dev/rtc
# hwclock -r
# date
# date 081815202008
# hwclock -w
# date 010101012011
# date
# hwclock
# hwclock -s
# date 

If your RTC chip supports NVRAM, it will be exposed as a sysfs file named nvram. To find the file, run

find /sys -name nvram

and you will get output like

/sys/devices/platform/i2c_davinci.1/i2c-1/1-0068/nvram

If your busybox configuration includes

CONFIG_OD=y

then you can dump the contents of NVRAM using

od -x /sys/devices/platform/i2c_davinci.1/i2c-1/1-0068/nvram

and you will get output similar to

0000000     d67a    8472    5de8    b5d6    7e1d    10da    4aef    8016 0000020     26df    1027    56a5    b814    61ca    5214    1259    5aca 0000040     ba49    5930    e452    a730    f653    ec0a    f0bb    2ad0 0000060     88dc    657e    3468    9be8

You can test that you can write to NVRAM using

echo "123456789a123456789b123456789c123456789d123456789e1234" > /sys/devices/platform/i2c_davinci.1/i2c-1/1-0068/nvram

View solution in original post

2 Replies
1,303 Views
yipingwang
NXP TechSupport
NXP TechSupport

1. Enable I2C-RTC driver in kernel, Eg.<DS3232>.

Device Drivers->
        Real Time Clock-->
                  [*] Set system time from RTC on startup and resume (new)
                  (rtc0) RTC used to set the system time (new)
                 <[*] /sys/class/rtc/rtcN (sysfs)
                 <[*] /proc/driver/rtc (procfs for rtc0)
                 <[*] /dev/rtcN (character devices)
                  I2C RTC drivers
                 <[*] Dallas/Maxim DS3232
After booting up Linux.
# dmesg |grep rtc
# ls -l /dev/rtc*
# cat /proc/devices |grep rtc
# mknod /dev/rtc0 c 254 0
# ln -s /dev/rtc0 /dev/rtc
# hwclock -r
# date
# date 081815202008
# hwclock -w
# date 010101012011
# date
# hwclock
# hwclock -s
# date 

If your RTC chip supports NVRAM, it will be exposed as a sysfs file named nvram. To find the file, run

find /sys -name nvram

and you will get output like

/sys/devices/platform/i2c_davinci.1/i2c-1/1-0068/nvram

If your busybox configuration includes

CONFIG_OD=y

then you can dump the contents of NVRAM using

od -x /sys/devices/platform/i2c_davinci.1/i2c-1/1-0068/nvram

and you will get output similar to

0000000     d67a    8472    5de8    b5d6    7e1d    10da    4aef    8016 0000020     26df    1027    56a5    b814    61ca    5214    1259    5aca 0000040     ba49    5930    e452    a730    f653    ec0a    f0bb    2ad0 0000060     88dc    657e    3468    9be8

You can test that you can write to NVRAM using

echo "123456789a123456789b123456789c123456789d123456789e1234" > /sys/devices/platform/i2c_davinci.1/i2c-1/1-0068/nvram
1,302 Views
vinothkumars
Senior Contributor IV

Thank you Yiping Wang for your reply.

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos