mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* mc13xxx: Define maximum SPI clock frequency global to driver
@ 2016-07-19 17:18 Alexander Kurz
  2016-07-19 18:15 ` Alexander Shiyan
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Kurz @ 2016-07-19 17:18 UTC (permalink / raw)
  To: Alexander Shiyan, Sascha Hauer; +Cc: barebox

Hi,
I just ran into a problem resulting from patch 6e18b3a48ee4
("mc13xxx: Define maximum SPI clock frequency global to driver").

On a kindle2 board the SPI communication between an iMX31 and a MC13783 
won't work at 20MHz. Unfortunately both ICs are BGA mounted blocking any 
access with scope probes. Attempts to tweak the pad properties to
PAD_CTL_DRV_HIGH | PAD_CTL_SRE_FAST | PAD_CTL_100K_PU
did not solve the problem - anyway this is a battery powered device where
the original implementers took great care on long battery life,
e.g. PAD_CTL_DRV_HIGH should not be nessesary for PMIC control.

I do not see any way to override the 20MHz bitrate from board code, and 
since the PMIC access is not time critical on an ebook-reader my choice
would be rather 200kHz.

Is there any way to override the driver supplied default max_speed_hz?
If not, my proposal is to either
* revert this patch and let the board code choose frequency
or
* reduce the speed to some common acceptable rate, e.g. 6MHz are fine

How was this solved with other SPI devices?

Cheers, Alexander


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mc13xxx: Define maximum SPI clock frequency global to driver
  2016-07-19 17:18 mc13xxx: Define maximum SPI clock frequency global to driver Alexander Kurz
@ 2016-07-19 18:15 ` Alexander Shiyan
  2016-07-19 20:31   ` Alexander Kurz
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Shiyan @ 2016-07-19 18:15 UTC (permalink / raw)
  To: Alexander Kurz; +Cc: barebox

>Вторник, 19 июля 2016, 20:18 +03:00 от Alexander Kurz <akurz@blala.de>:
>
>Hi,
>I just ran into a problem resulting from patch 6e18b3a48ee4
>("mc13xxx: Define maximum SPI clock frequency global to driver").
>
>On a kindle2 board the SPI communication between an iMX31 and a MC13783 
>won't work at 20MHz. Unfortunately both ICs are BGA mounted blocking any 
>access with scope probes. Attempts to tweak the pad properties to
>PAD_CTL_DRV_HIGH | PAD_CTL_SRE_FAST | PAD_CTL_100K_PU
>did not solve the problem - anyway this is a battery powered device where
>the original implementers took great care on long battery life,
>e.g. PAD_CTL_DRV_HIGH should not be nessesary for PMIC control.
>
>I do not see any way to override the 20MHz bitrate from board code, and 
>since the PMIC access is not time critical on an ebook-reader my choice
>would be rather 200kHz.
>
>Is there any way to override the driver supplied default max_speed_hz?
>If not, my proposal is to either
>* revert this patch and let the board code choose frequency
>or
>* reduce the speed to some common acceptable rate, e.g. 6MHz are fine
>
>How was this solved with other SPI devices?

For me, the MC13783 with i.MX27 works fine with 20MHz.
Anyway, you can change line in mc13xxx driver to:
mc_dev->spi->max_speed_hz = mc_dev->spi->max_speed_hz ? : 20000000;
So you can use struct spi_board_info field for specify exact frequency.

---

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mc13xxx: Define maximum SPI clock frequency global to driver
  2016-07-19 18:15 ` Alexander Shiyan
@ 2016-07-19 20:31   ` Alexander Kurz
  0 siblings, 0 replies; 3+ messages in thread
From: Alexander Kurz @ 2016-07-19 20:31 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1638 bytes --]



On Tue, 19 Jul 2016, Alexander Shiyan wrote:

> >Вторник, 19 июля 2016, 20:18 +03:00 от Alexander Kurz <akurz@blala.de>:
> >
> >Hi,
> >I just ran into a problem resulting from patch 6e18b3a48ee4
> >("mc13xxx: Define maximum SPI clock frequency global to driver").
> >
> >On a kindle2 board the SPI communication between an iMX31 and a MC13783 
> >won't work at 20MHz. Unfortunately both ICs are BGA mounted blocking any 
> >access with scope probes. Attempts to tweak the pad properties to
> >PAD_CTL_DRV_HIGH | PAD_CTL_SRE_FAST | PAD_CTL_100K_PU
> >did not solve the problem - anyway this is a battery powered device where
> >the original implementers took great care on long battery life,
> >e.g. PAD_CTL_DRV_HIGH should not be nessesary for PMIC control.
> >
> >I do not see any way to override the 20MHz bitrate from board code, and 
> >since the PMIC access is not time critical on an ebook-reader my choice
> >would be rather 200kHz.
> >
> >Is there any way to override the driver supplied default max_speed_hz?
> >If not, my proposal is to either
> >* revert this patch and let the board code choose frequency
> >or
> >* reduce the speed to some common acceptable rate, e.g. 6MHz are fine
> >
> >How was this solved with other SPI devices?
> 
> For me, the MC13783 with i.MX27 works fine with 20MHz.
> Anyway, you can change line in mc13xxx driver to:
> mc_dev->spi->max_speed_hz = mc_dev->spi->max_speed_hz ? : 20000000;
> So you can use struct spi_board_info field for specify exact frequency.
Perfect, this provides the default but provides the option to override it.
I'll send a patch for this,
thanks, Alexander

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-19 20:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-19 17:18 mc13xxx: Define maximum SPI clock frequency global to driver Alexander Kurz
2016-07-19 18:15 ` Alexander Shiyan
2016-07-19 20:31   ` Alexander Kurz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox