Skip to content
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

Rpi 4.1.y spi bcm2835 patches clock-polarity issues #1125

Conversation

msperl
Copy link
Contributor

@msperl msperl commented Sep 4, 2015

merge from 4.3-pre back to 4.1 to fix #1077.

When using reverse polarity for clock (spi-cpol) on a device
the clock line gets altered after chip-select has been asserted
resulting in an additional clock beat, which confuses hardware.

This did not show when using native-CS, as the same register
is used to control cs as well as polarity, so the changes came
into effect at the same time. Unfortunately this is not true
with gpio-cs.

To avoid this situation this patch moves the setup of polarity
(spi-cpol and spi-cpha) outside of the chip-select into
prepare_message, which is run prior to asserting chip-select.

Also fixes resetting 3-wire mode after use of rx-mode, so that
a 3-Wire sequence TX, RX, TX works as well (right now it runs
TX, RX, RX instead)

Reported-by: Noralf Tronnes <noralf@tronnes.org>
Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
(cherry picked from commit acace73)
This resulted in the use of polling mode when other approaches
(dma or interrupts) would have been more appropriate.

Happened for transfers longer than 477 bytes.

Reported-by: Noralf Tronnes <noralf@tronnes.org>
Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 0122a51)
@msperl
Copy link
Contributor Author

msperl commented Sep 4, 2015

@notro: please check

@pelwell
Copy link
Contributor

pelwell commented Sep 4, 2015

Looks OK to me.

@notro
Copy link
Contributor

notro commented Sep 4, 2015

I haven't got time to actually test it now, but it looks like what I tested previously.
Thanks for getting this fixed Martin. This means that I don't have to provide a prebuilt spi-dma kernel for the fbtft users anymore :-)

@msperl
Copy link
Contributor Author

msperl commented Sep 4, 2015

@notro: it is exactly what you have tested before - it is exactly upstream, so it should work...

popcornmix added a commit that referenced this pull request Sep 4, 2015
…xpolarity

Rpi 4.1.y spi bcm2835 patches clock-polarity issues
@popcornmix popcornmix merged commit 5a63610 into raspberrypi:rpi-4.1.y Sep 4, 2015
@msperl
Copy link
Contributor Author

msperl commented Sep 5, 2015

It may be valuable to push this into 4.2 as well, as it will only show up officially in 4.3!

@popcornmix
Copy link
Collaborator

popcornmix added a commit to raspberrypi/firmware that referenced this pull request Sep 10, 2015
See: raspberrypi/linux#756

kernel: spi-bcm2835: merge upstream patches allowing DMA transfers
See: raspberrypi/linux#1085

kernel: rpisense-fb: add low-light mode and gamma control
See: raspberrypi/linux#1104

kernel: bcm2708-dmaengine: Use more DMA channels (but not 12)
See:  raspberrypi/linux#1113

kernel: Add /dev/gpiomem device for rootless user GPIO access
See: raspberrypi/linux#1112

kernel: Add RaspiDAC3 support

kernel: Rpi 4.1.y spi bcm2835 patches clock-polarity issue
See: raspberrypi/linux#1125

kernel: BCM270X_DT: Add SDIO overlay
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request Sep 10, 2015
See: raspberrypi/linux#756

kernel: spi-bcm2835: merge upstream patches allowing DMA transfers
See: raspberrypi/linux#1085

kernel: rpisense-fb: add low-light mode and gamma control
See: raspberrypi/linux#1104

kernel: bcm2708-dmaengine: Use more DMA channels (but not 12)
See:  raspberrypi/linux#1113

kernel: Add /dev/gpiomem device for rootless user GPIO access
See: raspberrypi/linux#1112

kernel: Add RaspiDAC3 support

kernel: Rpi 4.1.y spi bcm2835 patches clock-polarity issue
See: raspberrypi/linux#1125

kernel: BCM270X_DT: Add SDIO overlay
neuschaefer pushed a commit to neuschaefer/raspi-binary-firmware that referenced this pull request Feb 27, 2017
See: raspberrypi/linux#756

kernel: spi-bcm2835: merge upstream patches allowing DMA transfers
See: raspberrypi/linux#1085

kernel: rpisense-fb: add low-light mode and gamma control
See: raspberrypi/linux#1104

kernel: bcm2708-dmaengine: Use more DMA channels (but not 12)
See:  raspberrypi/linux#1113

kernel: Add /dev/gpiomem device for rootless user GPIO access
See: raspberrypi/linux#1112

kernel: Add RaspiDAC3 support

kernel: Rpi 4.1.y spi bcm2835 patches clock-polarity issue
See: raspberrypi/linux#1125

kernel: BCM270X_DT: Add SDIO overlay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants