From: Dirk Behme <dirk.behme@de.bosch.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mx6: mx6qsabrelite/nitrogen6x: Fix use of gpio number in SF chip select
Date: Thu, 30 May 2013 13:50:38 +0200 [thread overview]
Message-ID: <51A73D0E.3000407@de.bosch.com> (raw)
In-Reply-To: <6C5EA58090A5ED459815C4D04C2B466FD93304DF@EU-MBX-01.mgc.mentorg.com>
On 30.05.2013 13:32, Gabbasov, Andrew wrote:
> Hi Dirk,
> ________________________________________
>> From: Behme, Dirk - Bosch
>> Sent: Thursday, May 30, 2013 14:50
>> To: Gabbasov, Andrew
>> Cc: u-boot at lists.denx.de
>> Subject: Re: [U-Boot] [PATCH] mx6: mx6qsabrelite/nitrogen6x: Fix use of gpio number in SF chip select
>
> [skipped]
>
>> To my understanding, above change is correct, but not complete ;)
>>
>> The question is "why has it worked with the wrong setting and nobody
>> ever noticed that its wrong?"
>>
>> To my understanding the answer is "because the SPI driver does it
>> correctly":
>>
>> http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=drivers/spi/mxc_spi.c;h=5bed858787f610a9c9a46bb2214665a51d60a9e9;hb=refs/heads/master#l376
>>
>> So IMHO the gpio_direction_output() above can be removed completely.
>>
>> Best regards
>>
>> Dirk
>
> Yes, the SPI driver correctly activates and deactivates the CS signal.
> But before the first activation it relies on what signal state was set before that.
> Setting it early at startup just adds some confidence that we have correct
> (inactive) chip select state before the first activation by SPI driver.
> Otherwise we have to rely on particular pad configuration (e.g. EIM_D19).
> I understand, that we set its configuration to "pull-up" (and this is also
> the reset default), and if we do nothing here, it will be recognized as "high".
> But in order to make sure, it's more safe to explicitly set the signal to 1.
Hmm, what's 'unsure' in the time between calling setup_spi() the first
time and calling spi_setup_slave() the first time?
Are they even called in this order? How long is the time between these
two calls? What's 'unsafe' in this time frame? Why isn't it unsafe
_until_ setup_spi() is called, then?
Best regards
Dirk
next prev parent reply other threads:[~2013-05-30 11:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-30 10:02 [U-Boot] [PATCH] mx6: mx6qsabrelite/nitrogen6x: Fix use of gpio number in SF chip select Andrew Gabbasov
2013-05-30 10:50 ` Dirk Behme
2013-05-30 11:32 ` Gabbasov, Andrew
2013-05-30 11:50 ` Dirk Behme [this message]
2013-05-30 14:36 ` Gabbasov, Andrew
2013-05-30 14:50 ` Gabbasov, Andrew
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51A73D0E.3000407@de.bosch.com \
--to=dirk.behme@de.bosch.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.