-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can not correctly add spi rtc m41t93 chip to raspberry pi 4 64bit. #913
Comments
hi all, now after patched is the following, any help? my patch, I remove spidev0 spidev1, now it is the following:&spi0 { }; |
it strange, why I use hwclock -r to read the rtc chip , the time is correct,
|
Hi all, I check again, I think my rtc chip is working, set rtc command:"hwclock --systohc --utc". and read rtc command "hwclock -r" work well, but normally, when I use command: "date" to show it, it always shows my kernel compiling time, so the error is in kernel config or in linux system config somewhere? |
hi all, |
HI all, CONFIG_RTC_HCTOSYS=y |
hi all, but after startup, the date time is still my compilation time. |
if you are using sysvinit then you might want to add |
@kraj I searched online "RTC and System clock not in sync" ,find someone mentioned to use "/sbin/hwclock --hctosys" in init.d . |
yes
you need to include the hwclock init scripts and thats what above option will do |
got it. let me do and test. thanks |
@kraj Thu Sep 23 18:20:55 UTC 2021 |
@kraj and all Thank you very much. |
thanks closing |
Hi all,
I want to add a spi rtc chip m41t93 to pi 4 64-bit(yocto ,Linux raspberrypi4-64 4.19.66) , I change the kernel config to add CONFIG_RTC_DRV_M41T93=y to make sure the kernel driver is on.
I make sure my rtc hardware board works well, I added it to Maaxboard before, it worked well ,see here: https://community.nxp.com/t5/i-MX-Processors/how-to-make-spi-interface-rtc-function-work-for-imx8mq-maaxboard/m-p/1168938
so similarly, I need to change dtb in pi 4 to make it work, but after I added the blow patch(which is almost same as that I added in maaxboard,see the attached file :0002-rtc-m41t93-patch.txt,the display on webpage is not correct), it does not work in pi 4.
any help?
Thank you very much.
how can I do it?
the debug info:
date --set="20201016 20:56:30"
Fri Oct 16 20:56:30 UTC 2020
root@raspberrypi4-64:
# hwclock --systohc --utc --rtc=/dev/rtc0# dmesg | grep rtcroot@raspberrypi4-64:
[ 3.451357] rtc-m41t93 spi0.0: OF bit is set, write time to restart.
[ 3.458578] rtc-m41t93 spi0.0: rtc core: registered rtc-m41t93 as rtc0
dmesg | grep spi
[ 3.472773] rtc-m41t93 spi0.0: rtc core: registered rtc-m41t93 as rtc0
root@raspberrypi4-64:
# dmesg | grep rtc# dmesg | grep spi[ 3.472773] rtc-m41t93 spi0.0: rtc core: registered rtc-m41t93 as rtc0
root@raspberrypi4-64:
[ 3.472773] rtc-m41t93 spi0.0: rtc core: registered rtc-m41t93 as rtc0
root@raspberrypi4-64:~# uname -a
Linux raspberrypi4-64 4.19.66 #1 SMP PREEMPT Tue Sep 21 14:41:35 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
my patch, I remove spidev0 spidev1, now it is the following:
&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
cs-gpios = <&gpio 8 1>, <&gpio 7 1>;
status = "okay";
rtc@0 {
compatible = "rtc-m41t93";
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
spi-max-frequency = <5000000>;
};
};
my patch end.
I find someone used the following in raspbian image(not yocto image), but I do not know how to use it and add it where, I list the patch here too:
/dts-v1/;
/plugin/;
/ {
};
0002-rtc-m41t93-patch.txt
The text was updated successfully, but these errors were encountered: