* [PATCH 1/3] at91_mci: Enable MMC_CAP_SDIO_IRQ only when it actually works
@ 2008-07-17 9:34 Nicolas Ferre
2008-07-17 10:55 ` Pierre Ossman
0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Ferre @ 2008-07-17 9:34 UTC (permalink / raw)
To: Pierre Ossman
Cc: ARM Linux Mailing List, Andrew Victor, Ville Syrjala,
Linux Kernel list
According to the datasheets AT91SAM9261 does not support
SDIO interrupts, and AT91SAM9260/9263 have an erratum
requiring 4bit mode while using slot B for the interrupt
to work.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
Original patch from Ville Syrjala.
I removed the rm9200 from the original patch as this chip is not
SDIO capable (error in datasheet).
drivers/mmc/host/at91_mci.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c
index 59bf71e..f3d725e 100644
--- a/drivers/mmc/host/at91_mci.c
+++ b/drivers/mmc/host/at91_mci.c
@@ -1000,7 +1000,7 @@ static int __init at91_mci_probe(struct platform_device *pdev)
mmc->f_min = 375000;
mmc->f_max = 25000000;
mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
- mmc->caps = MMC_CAP_SDIO_IRQ;
+ mmc->caps = 0;
mmc->max_blk_size = 4095;
mmc->max_blk_count = mmc->max_req_size;
@@ -1018,6 +1018,13 @@ static int __init at91_mci_probe(struct platform_device *pdev)
" - using 1 wire\n");
}
+ /* Add SDIO capability when available */
+ if (cpu_is_at91sam9260() || cpu_is_at91sam9263()) {
+ /* AT91SAM9260/9263 erratum */
+ if (host->board->wire4 || !host->board->slot_b)
+ mmc->caps |= MMC_CAP_SDIO_IRQ;
+ }
+
/*
* Reserve GPIOs ... board init code makes sure these pins are set
* up as GPIOs with the right direction (input, except for vcc)
--
1.5.3.7
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 1/3] at91_mci: Enable MMC_CAP_SDIO_IRQ only when it actually works
2008-07-17 9:34 [PATCH 1/3] at91_mci: Enable MMC_CAP_SDIO_IRQ only when it actually works Nicolas Ferre
@ 2008-07-17 10:55 ` Pierre Ossman
2008-07-18 13:30 ` Nicolas Ferre
0 siblings, 1 reply; 7+ messages in thread
From: Pierre Ossman @ 2008-07-17 10:55 UTC (permalink / raw)
To: Nicolas Ferre
Cc: ARM Linux Mailing List, Andrew Victor, Ville Syrjala,
Linux Kernel list
[-- Attachment #1: Type: text/plain, Size: 745 bytes --]
On Thu, 17 Jul 2008 11:34:07 +0200
Nicolas Ferre <nicolas.ferre@atmel.com> wrote:
> According to the datasheets AT91SAM9261 does not support
> SDIO interrupts, and AT91SAM9260/9263 have an erratum
> requiring 4bit mode while using slot B for the interrupt
> to work.
>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
Not all SDIO cards use 4-bit mode, so it looks to me like you have to
disable it completely (unless there's a third revision where it works
without any fine print?).
Rgds
--
-- Pierre Ossman
WARNING: This correspondence is being monitored by the
Swedish government. Make sure your server uses encryption
for SMTP traffic and consider using PGP for end-to-end
encryption.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH 1/3] at91_mci: Enable MMC_CAP_SDIO_IRQ only when it actually works
2008-07-17 10:55 ` Pierre Ossman
@ 2008-07-18 13:30 ` Nicolas Ferre
2008-07-18 23:01 ` Pierre Ossman
0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Ferre @ 2008-07-18 13:30 UTC (permalink / raw)
To: Pierre Ossman
Cc: ARM Linux Mailing List, Andrew Victor, Ville Syrjala,
Linux Kernel list
Pierre Ossman :
> On Thu, 17 Jul 2008 11:34:07 +0200
> Nicolas Ferre <nicolas.ferre@atmel.com> wrote:
>
>> According to the datasheets AT91SAM9261 does not support
>> SDIO interrupts, and AT91SAM9260/9263 have an erratum
>> requiring 4bit mode while using slot B for the interrupt
>> to work.
>>
>> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>> ---
>
> Not all SDIO cards use 4-bit mode, so it looks to me like you have to
> disable it completely (unless there's a third revision where it works
> without any fine print?).
Well, I understand.
In your opinion, a printed warning that says to be sure to use only
4-bit mode SDIO cards on slot B... is not acceptable ?
It kind of disappoints me to remove this feature as the
at91sam9260ek/9xe/9g20 board uses only slot B, and I really like to
connect SDIO with IRQ on it.
Regards,
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] at91_mci: Enable MMC_CAP_SDIO_IRQ only when it actually works
2008-07-18 13:30 ` Nicolas Ferre
@ 2008-07-18 23:01 ` Pierre Ossman
2008-07-20 9:55 ` ian
0 siblings, 1 reply; 7+ messages in thread
From: Pierre Ossman @ 2008-07-18 23:01 UTC (permalink / raw)
To: Nicolas Ferre
Cc: ARM Linux Mailing List, Andrew Victor, Ville Syrjala,
Linux Kernel list
[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]
On Fri, 18 Jul 2008 15:30:40 +0200
Nicolas Ferre <nicolas.ferre@atmel.com> wrote:
> Pierre Ossman :
> >
> > Not all SDIO cards use 4-bit mode, so it looks to me like you have to
> > disable it completely (unless there's a third revision where it works
> > without any fine print?).
>
> Well, I understand.
>
> In your opinion, a printed warning that says to be sure to use only
> 4-bit mode SDIO cards on slot B... is not acceptable ?
>
It's not really up to the user. The SDIO spec does not mandate 4-bit
support, so some cards will not have it.
> It kind of disappoints me to remove this feature as the
> at91sam9260ek/9xe/9g20 board uses only slot B, and I really like to
> connect SDIO with IRQ on it.
>
I haven't seen the erratum, but is there no way to poke the hardware
into getting the interrupt running even in 1-bit mode?
--
-- Pierre Ossman
WARNING: This correspondence is being monitored by the
Swedish government. Make sure your server uses encryption
for SMTP traffic and consider using PGP for end-to-end
encryption.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH 1/3] at91_mci: Enable MMC_CAP_SDIO_IRQ only when it actually works
2008-07-18 23:01 ` Pierre Ossman
@ 2008-07-20 9:55 ` ian
2008-07-20 11:13 ` Pierre Ossman
0 siblings, 1 reply; 7+ messages in thread
From: ian @ 2008-07-20 9:55 UTC (permalink / raw)
To: Pierre Ossman
Cc: Nicolas Ferre, Linux Kernel list, ARM Linux Mailing List,
Andrew Victor
On Sat, 2008-07-19 at 01:01 +0200, Pierre Ossman wrote:
> > In your opinion, a printed warning that says to be sure to use only
> > 4-bit mode SDIO cards on slot B... is not acceptable ?
>
> It's not really up to the user. The SDIO spec does not mandate 4-bit
> support, so some cards will not have it.
That seems overly rigid.
its not linux violating the spec, its the SDIO controller in this case.
I see no harm in supporting what the hardware is actually capable of.
It wouldnt be the first bit of broken hardware supported by linux.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] at91_mci: Enable MMC_CAP_SDIO_IRQ only when it actually works
2008-07-20 9:55 ` ian
@ 2008-07-20 11:13 ` Pierre Ossman
2008-07-20 23:28 ` ian
0 siblings, 1 reply; 7+ messages in thread
From: Pierre Ossman @ 2008-07-20 11:13 UTC (permalink / raw)
To: ian
Cc: Nicolas Ferre, Linux Kernel list, ARM Linux Mailing List,
Andrew Victor, David Brownell
[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]
On Sun, 20 Jul 2008 10:55:39 +0100
ian <spyro@f2s.com> wrote:
> On Sat, 2008-07-19 at 01:01 +0200, Pierre Ossman wrote:
> > > In your opinion, a printed warning that says to be sure to use only
> > > 4-bit mode SDIO cards on slot B... is not acceptable ?
> >
> > It's not really up to the user. The SDIO spec does not mandate 4-bit
> > support, so some cards will not have it.
>
> That seems overly rigid.
>
> its not linux violating the spec, its the SDIO controller in this case.
>
> I see no harm in supporting what the hardware is actually capable of.
>
> It wouldnt be the first bit of broken hardware supported by linux.
>
It does tend to make a mess of things when you start adding up all the
gotchas of each and every broken controller out there (it seems like
every controller decides to violate the spec in their own creative
way).
What about David's idea? Reconfiguring the PIN to be a GPIO pin with an
interrupt shouldn't be that difficult?
Rgds
--
-- Pierre Ossman
WARNING: This correspondence is being monitored by the
Swedish government. Make sure your server uses encryption
for SMTP traffic and consider using PGP for end-to-end
encryption.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH 1/3] at91_mci: Enable MMC_CAP_SDIO_IRQ only when it actually works
2008-07-20 11:13 ` Pierre Ossman
@ 2008-07-20 23:28 ` ian
0 siblings, 0 replies; 7+ messages in thread
From: ian @ 2008-07-20 23:28 UTC (permalink / raw)
To: Pierre Ossman
Cc: Nicolas Ferre, Linux Kernel list, ARM Linux Mailing List,
Andrew Victor, David Brownell
On Sun, 2008-07-20 at 13:13 +0200, Pierre Ossman wrote:
> It does tend to make a mess of things when you start adding up all the
> gotchas of each and every broken controller out there (it seems like
> every controller decides to violate the spec in their own creative
> way).
True.
> What about David's idea? Reconfiguring the PIN to be a GPIO pin with
> an interrupt shouldn't be that difficult?
If it works its a better solution...
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-07-20 23:28 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-17 9:34 [PATCH 1/3] at91_mci: Enable MMC_CAP_SDIO_IRQ only when it actually works Nicolas Ferre
2008-07-17 10:55 ` Pierre Ossman
2008-07-18 13:30 ` Nicolas Ferre
2008-07-18 23:01 ` Pierre Ossman
2008-07-20 9:55 ` ian
2008-07-20 11:13 ` Pierre Ossman
2008-07-20 23:28 ` ian
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox