[PATCH 3/3] [raspberrypi] Allow only read or write for SPI 3-wire mode

Alan Cudmore alan.cudmore at gmail.com
Thu Jun 16 02:01:56 UTC 2016


> On Jun 12, 2016, at 2:45 PM, Jan Sommer <soja-lists at aries.uberspace.de> wrote:
> 
> ---
> c/src/lib/libbsp/arm/raspberrypi/spi/spi.c | 5 +++++
> 1 file changed, 5 insertions(+)
> 
> diff --git a/c/src/lib/libbsp/arm/raspberrypi/spi/spi.c b/c/src/lib/libbsp/arm/raspberrypi/spi/spi.c
> index de3c44b..0104624 100644
> --- a/c/src/lib/libbsp/arm/raspberrypi/spi/spi.c
> +++ b/c/src/lib/libbsp/arm/raspberrypi/spi/spi.c
> @@ -550,6 +550,11 @@ static int rpi_libi2c_spi_ioctl(rtems_libi2c_bus_t * bushdl, int cmd, void *arg)
> 
>     case RTEMS_LIBI2C_IOCTL_READ_WRITE:
>       rw = (const rtems_libi2c_read_write_t*) arg;
> +      if ( bidirectional && rw.rd_buf && rw->wr_buf ) {

The patches applied cleanly for me, but I had a compilation error here.. rw->rd_buf seems to fix it. 

But the current RSB ARM tools and Git head ( from today, 15 June ) is not working on my Raspberry Pi Model A+. 
GCC/RSB/Newlib version:
gcc version 6.1.1 20160609 (RTEMS 4.12, RSB c476de6150f39afdf142c6f4420c59ba2f1aa2fe, Newlib 2.4.0.20160527) (GCC)

Does not work without the patch either. I’ll have to try some additional tests to see what is breaking.

Thanks,
Alan


> +        /* With bidirectional mode simultaneous read-write
> +         * is not supported */
> +        return -1;
> +      }
>       return rpi_spi_read_write(
>                 bushdl, 
>                 rw->rd_buf, 
> -- 
> 2.7.4
> 
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel




More information about the devel mailing list