Article [#6627] Blackfin SPI Bus driver chipselect behavior doesn't act spi conform(2011)

[#6627] Blackfin SPI Bus driver chipselect behavior doesn't act spi conform

Submitted By: Michael Hennerich

Open Date

2011-06-08 04:15:09    

Priority:

Medium     Assignee:

Sonic Zhang

Status:

Open     Fixed In Release:

N/A

Found In Release:

2011R1     Release:

Any

Category:

Drivers     Board:

N/A

Processor:

ALL     Silicon Revision:

Any

Is this bug repeatable?:

Yes     Resolution:

Fixed

Uboot version or rev.:

    Toolchain version or rev.:

Any

App binary format:

N/A     

Summary: Blackfin SPI Bus driver chipselect behavior doesn't act spi conform

Details:

Blackfin SPI Bus driver chipselect behavior doesn't act spi conform.

taken from spi.h:

* All SPI transfers start with the relevant chipselect active.  Normally

* it stays selected until after the last transfer in a message.  Drivers

* can affect the chipselect signal using cs_change.

*

* If the transfer isn't the last one in the message, this flag is

* used to make the chipselect briefly go inactive in the middle of the

* message.  Toggling chipselect in this way may be needed to terminate

* a chip command, letting a single spi_message perform all of group of

* chip transactions together.

*

* (ii) When the transfer is the last one in the message, the chip may

* stay selected until the next transfer.  On multi-device SPI busses

* with nothing blocking messages going to other devices, this is just

* a performance hint; starting a message to another device deselects

* this one.  But in other cases, this can be used to ensure correctness.

* Some devices need protocol transactions to be built from a series of

* spi_message submissions, where the content of one message is determined

* by the results of previous messages and where the whole transaction

* ends when the chipselect goes intactive.

On Blackfin when the last transfer of a message sets the cs_change flag.

The chipselect is supposed to stay activated, while it doesn't behave that way

on Blackfin.

diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c

index f706dba..2936aa1 100644

--- a/drivers/spi/spi_bfin5xx.c

+++ b/drivers/spi/spi_bfin5xx.c

@@ -909,8 +909,8 @@ static void bfin_spi_pump_transfers(unsigned long data)

                message->actual_length += drv_data->len_in_bytes;

                /* Move to next transfer of this msg */

                message->state = bfin_spi_next_transfer(drv_data);

-               if (drv_data->cs_change)

-                       bfin_spi_cs_deactive(drv_data, chip);

+//             if (drv_data->cs_change)

+//                     bfin_spi_cs_deactive(drv_data, chip);

        }

        /* Schedule next transfer tasklet */

Follow-ups

--- Sonic Zhang                                              2011-06-21 06:07:21

Done.

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

File Name     File Type     File Size     Posted By

No Files Were Found

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.