-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Adafruit DPI display blank after 1.20150923-1 upgrade #1144
Comments
Just to check: I'd expect it to be a firmware change rather than the kernel. |
Confirmed (I got bored) - it's something in commit 2e142eec that is screwing with GPIOs 0&1.
You can restore it once the Pi has booted by using
but that's a bodge rather than a fix. I do see a firmware source repo commit bf3605ae that appears to be fiddling with I2C muxing. Having decompiled the Adafruit blob, I think it is the change on ID_SDA and ID_SCL not being reflected in that blob. (The original values of 0&1 being incorrect, but ignored as the firmware actually used CAMERA_0_SDA_PIN and CAMERA_0_SCL_PIN). That's a bit of a pain as now everyone has to recompile their blobs if they reconfigure GPIOs 0&1 :-( |
Actually I do have a thought, although it's not a full fix. |
I think the problem is a bug in the dt-bin.dtb file which specified ID_SDA and ID_SCL as pins 0 and 1, which interferes with the DPI display. Can you test this blob file which removes the incorrect ID_SDA/ID_SCL definitions: |
@6by9 has produced this (untested) overlay file: If you remove the curent dt-blob.bin file, add the new overlay file, and add to config.txt: |
Just to emphasise, you do need all the other lines in config.txt that the Adafruit tutorial tells you to add. The |
Thanks for looking into it. I'll test as soon as I'm with my Pi again. |
I'm slightly confused now. |
The blob, from https://github.com/robertely/dpi666/blob/master/setup/dt-blob-dpi.dts, seems OK. The display data starts on the DPI bus, but shortly after startup the clock and de pins are assigned back to I2C. Switching this back via an overlay seems like a workaround. Why does the HAT code ignore the devicetree? Is there no way to disable the HAT I2C bus via the config.txt? |
The blob on github is identical to Adafruit's blob. Both have incorrectly defined ID_SDA and ID_SCL as being 0 & 1, not 28 & 29. This "device tree" is configuring the firmware side, not the kernel. There aren't the same restrictions within the firmware on peripheral access control. On the Compute Module, I2C0 is dynamically muxed between GPIOs 0&1 or 28&29 for when running two cameras (they both have the same I2C address). After each use, the GPIO is reset back to input. That is why you will generally see 28&29 assigned as input even with the camera running. The HAT code is running only on boot, but after it has accessed the incorrectly defined GPIOs 0&1, it puts them back to inputs. Correcting ID_SDA and ID_SCL to 28 & 29 is the correct fix - without that HATs won't work (but they're unlikely to anyway as all the GPIOs are nicked for DPI). I will sort out an updated dt-blob for robertely and Adafruit when I get 2 minutes, but there may be many other copies floating around - this is not a controlled release process. There was discussion about putting back the muxing after I2C use, but that was mainly because people were trying to allow both ARM and VC access to I2C0 at the same time, and the ARM kept losing out because the pins were remuxed back to inputs. I still don't see there being a real argument for it here. The discussion over a kernel dt-overlay for dpi is really as it makes it an easier way to configure for a DPI screen - dt-blob.bin really is a low level thing that general users shouldn't need to fiddle with. @popcornmix I see config.txt option force_eeprom_read. Am I right in thinking setting this to 0 will stop HAT probing and work around this issue? Possibly easier to get people to make a config.txt change than a blob change. (I'll still sort out an overlay anyway) |
Ahh, this section? Edit: It works. Thank you! :) |
Ah, got confused over which GPIOs it was meant to be on. (How have HATs worked in the past when it was using the camera SDA/SCL defines? Perhaps they haven't and that was why the firmware changed! Doesn't really matter, just puzzled). There is no way to use a HAT as well as a DPI display, so removing the HAT probing is one option. Have I read it right that "force_eeprom_read=0" will do that? Ta to Phil - I just ran out of time when I was looking at it the other day. Shout if he wants display hardware - I have it with me and can drop it over to you. |
So it turns out that, while not perfect, the original hat_probe code was correct. Its use of the camera pins was to prevent I2C0 from being mapped to multiple pin groups simultaneously, and the ID pins were hackily hard-coded to 0 and 1. The effect of the previous change was to leave the camera pins alone, which would cause problems if they were using I2C0, and to save the state of the ID pins twice, setting them to inputs in-between. Since the original values were restored in the same (not reversed) sequence, this has the effect of leaving 0 and 1 as inputs. I've given @popcornmix a patch. |
Ouch! Nice bit of detective work - glad I hadn't dug into it too much. |
kernel: config: Add CONFIG_CRYPTO_USER_API_SKCIPHER See: https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=121892&p=824204&hilit=cryptsetup#p824204 kernel: config: Add options for supporting openlabs 802.15.4 radio See: raspberrypi/linux#1151 firmware: arm_loader: Add clear of polled register so linux doesn't report a timeout in bcm2709_boot_secondary See: #369 firmware: arm_loader: Fix HAT probing to always restore the original state See: raspberrypi/linux#1144
kernel: config: Add CONFIG_CRYPTO_USER_API_SKCIPHER See: https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=121892&p=824204&hilit=cryptsetup#p824204 kernel: config: Add options for supporting openlabs 802.15.4 radio See: raspberrypi/linux#1151 firmware: arm_loader: Add clear of polled register so linux doesn't report a timeout in bcm2709_boot_secondary See: raspberrypi/firmware#369 firmware: arm_loader: Fix HAT probing to always restore the original state See: raspberrypi/linux#1144
The latest firmware release includes the patch. Please update and retest. |
Display works again, thanks ! |
Since upgrading to kernel 4.1.19 my analog audio is coming out high pitched (about 1.2 times the correct frequency) when I use the blobs here. |
The overlay from robertely/dpi666 works well for me, with the awful proviso that my audio sounds speeded up afterwards (by a factor of about 1.2). Any ideas or help? I have tried to rebuild the dts file with trial-and-error changes to the clock stuff, but it's black magic to me. |
Complied my own dts using |
kernel: config: Add CONFIG_CRYPTO_USER_API_SKCIPHER See: https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=121892&p=824204&hilit=cryptsetup#p824204 kernel: config: Add options for supporting openlabs 802.15.4 radio See: raspberrypi/linux#1151 firmware: arm_loader: Add clear of polled register so linux doesn't report a timeout in bcm2709_boot_secondary See: raspberrypi#369 firmware: arm_loader: Fix HAT probing to always restore the original state See: raspberrypi/linux#1144
The latest official kernel update release broke my Adafruit DPI display (https://www.adafruit.com/products/2454), it stays white.
Going back with rpi-update to revision 6ade0bac40feeaaaf8ef20eb6b90843e99fbf9a7 makes it work again.
I'm using the dt blob and config available on https://learn.adafruit.com/adafruit-dpi-display-kippah-ttl-tft/installation
The text was updated successfully, but these errors were encountered: