-
Notifications
You must be signed in to change notification settings - Fork 5k
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
add pcf2123 RTC overlay on SPI0.0 #1510
Conversation
Most of your warnings were due to specifiying '#address-cells' and '#size-cells' at the wrong location. There is also a subtle problem with including a node that overwrites an existing one - this won't work when the overlay is dynamically loaded. Instead you should create a separate fragment that targets the existing node and overwrites its properties. But even when the overlay is correct the latest dtc still produces a warning message for each fragment because it uses the Try the patch here - it replaces your device-specific overlay with a container for multiple SPI RTC devices (c.f. i2c-rtc), although at the moment there is only one device. If it works, replace your commit with the new one and use |
b2658f5
to
3408762
Compare
Thanks @pelwell - this worked perfectly. Just to clarify, with this change, I still have to load the kernel module |
3408762
to
722adcd
Compare
Although I haven't been able to test it I would have expected the module to be loaded automatically, so I don't know why it isn't. Are you saying that you need an explicit Is it possible that you have blacklisted the driver? That would explain the behaviour, although it seems unlikely. What do you get from this command?:
|
Yes, I have to manually load it (either with |
Without loading the
Does the i2c overlay automatically load correct the kernel module? |
It ought to. Try this command:
If that doesn't return anything, try:
and repeat the grep. |
|
That looks fine - buried in that string you can see the "compatible" string for the pcf2123, which is what should cause the module to be loaded. Perhaps there is a timing problem - if the device isn't ready at boot time the module may not be loaded. You could try loading the overlay from the command line instead:
|
I assume we should load
|
|
With the overlay loaded:
|
OK - you've just named the overlay inconsistently. The old scheme was name-overlay.dtb, and the new way is name.dtbo. When you have modprobed the driver, does it appear to the system as an RTC? I'm asking because you can modprobe any module but it won't necessarily do anything useful. |
Yes, when I modprobe the module (or have it automatically loaded at boot by adding it to I will rename the file to the new scheme. |
From
|
This currently supports PCF2123 chips on SPI0.0
722adcd
to
314347a
Compare
For reasons I haven't figured out yet, the SPI bus doesn't seem to use compatible strings when locating a driver. There is a code to create a DT compatible lookup string but it is an ACPI code path that doesn't get called for the PCF2123 driver. Unlike most of the other SPI drivers, the PCF2123 driver does not register a module alias and doesn't include a If this was a Pi-specific driver I would patch it, but it is an unmodified upstream driver. You could try emailing the maintainer - Alessandro Zummo a.zummo@towertech.it. |
@pelwell I contacted Alessandro Zummo (no response yet), and also the original author from the pcf2123.c driver (email seems to be discontinued or invalid). Apart from the missing auto-load issue, are there any other concerns with this PR? |
That was the only issue. I think the overlay is correct as it stands - would you like me to merge it even though the end result of applying it isn't what it ought to be? |
I guess it's better than nothing :-) Maybe we should add a note to the readme, that manual loading of the kernel module is required? |
Initial version only supports PCF2123 RTC. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Actually I had made a few small changes, so I've merged the updated version. And the lack of that alias is such an annoyingly small glitch I've pushed a patch to add it. Should it get fixed upstream our patch will get dropped. |
Yeah! 🎉 |
Initial version only supports PCF2123 RTC. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
Without this alias, Device Tree won't cause the driver to be loaded. See: #1510
I'm not sure is this is the correct way to add it, maybe someone could help me get this into a cleaner form and fix the dtc warnings.
Thanks.