From: Valentin Longchamp <valentin.longchamp@keymile.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/4] kw_spi: backup and reset the MPP of the chosen CS pin
Date: Thu, 31 May 2012 10:45:19 +0200 [thread overview]
Message-ID: <4FC72F9F.5090204@keymile.com> (raw)
In-Reply-To: <F766E4F80769BD478052FB6533FA745D1A2FBA0182@SC-VEXCH4.marvell.com>
On 05/31/2012 10:36 AM, Prafulla Wadaskar wrote:
>> -----Original Message-----
>> From: Valentin Longchamp [mailto:valentin.longchamp at keymile.com]
>> Sent: 30 May 2012 21:12
>> To: Prafulla Wadaskar
>> Cc: Valentin Longchamp; holger.brunck at keymile.com; u-
>> boot at lists.denx.de; Prafulla Wadaskar
>> Subject: [PATCH v2 2/4] kw_spi: backup and reset the MPP of the chosen
>> CS pin
>>
>> This was not done before, and in the case of a shared pin (for MPP0
>> between NF_IO[2] and CSn) this could lead to problems.
>>
>> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
>> cc: Holger Brunck <holger.brunck@keymile.com>
>> cc: Prafulla Wadaskar <prafulla@marvell.com>
>> ---
>> drivers/spi/kirkwood_spi.c | 14 ++++++--------
>> 1 files changed, 6 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c
>> index db8ba8b..2fd89d2 100644
>> --- a/drivers/spi/kirkwood_spi.c
>> +++ b/drivers/spi/kirkwood_spi.c
>> @@ -34,16 +34,14 @@
>>
>> static struct kwspi_registers *spireg = (struct kwspi_registers
>> *)KW_SPI_BASE;
>>
>> +u32 cs_spi_mpp_back[2];
>> +
>> struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
>> unsigned int max_hz, unsigned int mode)
>> {
>> struct spi_slave *slave;
>> u32 data;
>> - u32 kwspi_mpp_config[] = {
>> - MPP0_GPIO,
>> - MPP7_SPI_SCn,
>> - 0
>> - };
>> + u32 kwspi_mpp_config[] = { 0, 0 };
>>
>> if (!spi_cs_is_valid(bus, cs))
>> return NULL;
>> @@ -70,12 +68,11 @@ struct spi_slave *spi_setup_slave(unsigned int
>> bus, unsigned int cs,
>>
>> /* program mpp registers to select SPI_CSn */
>> if (cs) {
>> - kwspi_mpp_config[0] = MPP0_GPIO;
>> - kwspi_mpp_config[1] = MPP7_SPI_SCn;
>> + kwspi_mpp_config[0] = MPP7_SPI_SCn;
>> } else {
>> kwspi_mpp_config[0] = MPP0_SPI_SCn;
>> - kwspi_mpp_config[1] = MPP7_GPO;
>> }
>> + kirkwood_mpp_read(kwspi_mpp_config, cs_spi_mpp_back);
>> kirkwood_mpp_conf(kwspi_mpp_config);
>>
>> return slave;
>> @@ -83,6 +80,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus,
>> unsigned int cs,
>>
>> void spi_free_slave(struct spi_slave *slave)
>> {
>> + kirkwood_mpp_conf(cs_spi_mpp_back);
>> free(slave);
>> }
>>
>> --
>
> Acked-By: Prafulla Wadaskar <prafulla@maravell.com>
> But as you said functionality need to be verified, I hope you have verified it on any of Kirkwood variant.
>
Sure, it's always been tested successfully on our kirkwood boards.
next prev parent reply other threads:[~2012-05-31 8:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-30 15:42 [U-Boot] [PATCH v2 0/4] kirkwood spi_claim/release_bus support Valentin Longchamp
2012-05-30 15:42 ` [U-Boot] [PATCH v2 1/4] kirkwood: add kirkwood_mpp_read function Valentin Longchamp
2012-05-31 8:30 ` Prafulla Wadaskar
2012-05-31 8:43 ` Valentin Longchamp
2012-05-31 8:49 ` Prafulla Wadaskar
2012-05-31 14:04 ` Valentin Longchamp
2012-05-30 15:42 ` [U-Boot] [PATCH v2 2/4] kw_spi: backup and reset the MPP of the chosen CS pin Valentin Longchamp
2012-05-31 8:36 ` Prafulla Wadaskar
2012-05-31 8:45 ` Valentin Longchamp [this message]
2012-05-30 15:42 ` [U-Boot] [PATCH v2 3/4] kw_spi: support spi_claim/release_bus functions Valentin Longchamp
2012-05-31 8:44 ` Prafulla Wadaskar
2012-05-30 15:42 ` [U-Boot] [PATCH v2 4/4] kw_spi: add weak functions board_spi_claim/release_bus Valentin Longchamp
2012-05-31 8:45 ` Prafulla Wadaskar
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=4FC72F9F.5090204@keymile.com \
--to=valentin.longchamp@keymile.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox