LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 05-03-2023, 11:46 AM   #1
eduardr
Member
 
Registered: Sep 2011
Distribution: Slackware64 15.0+ (-current)
Posts: 114

Rep: Reputation: Disabled
hwclock issue pcf8523 (slackwareaarch64-current RPi 4)


Used the standard slackwareaarch64-current image to set up an RPi4. No SARPI.

This Slackware installer hardcodes the ds1307 clock module, which is not installed in my RPi. Instead I have the pcf8523.

After quite some digging around I extracted the initrd contents (initrd-armv8-6.1.27), and made changes to it to reference pcf8523 instead, and the correct module loads now but hwclock still fails to get data from the module. On a previous installation I used SARPI and that worked great with this same module, once I enabled the appropriate line in /boot/config.txt

File "load_kernel_modules.scr/platform/aarch64/bcm2711"
Code:
...
MOD_RTC="rtc-pcf8523"
...
echo pcf8523 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
...
File "bcm2837"
Code:
MOD_RTC="rtc-pcf8523"
Code:
[root@rpi1a ~]# dmesg|grep -i rtc
[Thu Jan  1 02:00:14 1970] rtc-pcf8523 1-0068: registered as rtc0
[Thu Jan  1 02:00:14 1970] rtc-pcf8523 1-0068: hctosys: unable to read the hardware clock
[Thu Jan  1 02:00:19 1970] vc4-drm gpu: bound fe206000.pixelvalve (ops vc4_crtc_ops [vc4])
[Thu Jan  1 02:00:19 1970] vc4-drm gpu: bound fe207000.pixelvalve (ops vc4_crtc_ops [vc4])
[Thu Jan  1 02:00:19 1970] vc4-drm gpu: bound fe20a000.pixelvalve (ops vc4_crtc_ops [vc4])
[Thu Jan  1 02:00:19 1970] vc4-drm gpu: bound fe216000.pixelvalve (ops vc4_crtc_ops [vc4])

[root@rpi1a ~]# hwclock
hwclock: ioctl(RTC_RD_TIME) to /dev/rtc0 to read the time failed: Invalid argument

[root@rpi1a ~]# ls -al /dev/rtc*
lrwxrwxrwx 1 root root      4 Jan  1 02:00 /dev/rtc -> rtc0
crw-r--r-- 1 root root 251, 0 Jan  1 02:00 /dev/rtc0

[root@rpi1a ~]# lsmod|grep rtc
rtc_pcf8523            16384  0
Thanks for any hints!

Last edited by eduardr; 05-03-2023 at 11:49 AM. Reason: Added whitespace
 
Old 05-05-2023, 05:05 AM   #2
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,552

Rep: Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314
Try using the Device Tree Overlays.
I did not succeed in making DTO work for the ds1307 which is why it's still set up from the OS InitRD, but if anybody does make it work with DTO, let me know as that's the preferred route for this stuff.
 
1 members found this post helpful.
Old 05-05-2023, 06:26 AM   #3
eduardr
Member
 
Registered: Sep 2011
Distribution: Slackware64 15.0+ (-current)
Posts: 114

Original Poster
Rep: Reputation: Disabled
Thanks Stuart, I'll look into dto and try to get my clocks working (pcf8523 and RasClock pcf212x) - don't have any clocks working yet in my new installs. Worked fine on SARPI in the past but I'm not using SARPI currently.
 
Old 05-05-2023, 08:19 AM   #4
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,552

Rep: Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314
Quote:
Originally Posted by eduardr View Post
Thanks Stuart, I'll look into dto and try to get my clocks working (pcf8523 and RasClock pcf212x) - don't have any clocks working yet in my new installs. Worked fine on SARPI in the past but I'm not using SARPI currently.
Interesting. I wonder if it's that the mainline Kernel is missing support.

If you like I can build a proper set of Slackware Kernel packages from the RPi Kernel fork of Linux 6.1.27 and put them online. You can upgradepkg to them from Slackware, and roll back to the proper packages if you want.

I've also just made a change to kernel.SlackBuild to make it easier to store the resulting packages in an alternate directory, so if anybody does want to provide such packages to the community it's even easier than before. I'll update the Kernel build doc once I push out the updates.
 
Old 05-05-2023, 10:35 AM   #5
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,552

Rep: Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314
I've uploaded the kernel and kernel-modules packages which is all that's required. If you or anybody fancies using them, have fun ;-)

Caveat - I haven't tested these.

I've updated the custom Kernel document as well so that the packages can be created outside of the Slackware tree.
 
1 members found this post helpful.
Old 05-07-2023, 01:40 PM   #6
eduardr
Member
 
Registered: Sep 2011
Distribution: Slackware64 15.0+ (-current)
Posts: 114

Original Poster
Rep: Reputation: Disabled
Thank you very much Stewart. It looks like I was able to get the RasClock at least to work (pcf2129, uses the pcf2127 module) using the manual approach by writing to address 51 instead of 68. Now I need to replace the CR1220 battery on it and make sure it works by making this change in the initrd. If it fails and I can't get dto to work either, will try the kernel fork approach as well.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
A few driver kernel configuration items are disabled by default in slackwareaarch64-current sunying@nj.iscas.ac.cn Slackware - ARM 2 09-25-2022 09:41 PM
Slackwareaarch64-current (up-to-date) running on rpi4 new install. mpv fail, execvp error glorsplitz Slackware - ARM 5 04-25-2022 08:32 PM
Can't rsync slackwareaarch64-current dodoLQ Slackware - ARM 2 12-05-2021 05:17 AM
LXer: Mini-PC taps RPi Compute Module and supports RPi 2 LXer Syndicated Linux News 0 02-22-2015 03:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 02:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration