9
0
Fork 0
Commit Graph

28 Commits

Author SHA1 Message Date
Alexander Kurz 28a0baffb9 ARM i.MX31: add SPI support
The i.MX31 SPI interface was refered by freescale as spi_ver_0_4 in one
of their older vendor extended linux releases. spi_ver_0_4 differs only
in minor aspects to spi_ver_0_7 (i.MX35) which is already supported by
barebox.
Regarding barebox, the differences boil down to the location and length
of the CHIP SELECT and BIT COUNT/BURST LENGTH elements of CONREG. The
spi_ver_0_4 variant is limited to single word bursts with a maximum of
32 bits_per_word.

Add support for the i.MX31 SPI interface to the barebox spi_ver_0_7
implementation.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-03 07:30:41 +02:00
Sascha Hauer 412a0e1750 spi: i.MX: optimize transfers for ECSPI v2.3
Instead of writing one word to the txfifo and then wait until
one is received in the rxfifo we can write while the txfifos
are not full and read as long the rxfifos contain data. This
makes transfers for the m25p80 driver around 7 times faster
here.

Unlike the last version this time we only optimize the common
case with 8 bits per word and SPI_LSB_FIRST cleared. The other
cases would require more bit shuffling of the data.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-30 08:22:31 +01:00
Sascha Hauer 694c5b8794 Revert "spi: i.MX: optimize transfers for ECSPI v2.3"
This does not work on the Efika MX Smartbook which uses SPI
to connect the MC13892. Needs some rework.

This reverts commit 746a5530be.
2015-10-05 09:47:37 +02:00
Sascha Hauer 746a5530be spi: i.MX: optimize transfers for ECSPI v2.3
Instead of writing one word to the txfifo and then wait until
one is received in the rxfifo we can write until the txfifos
are not full and read as long the rxfifos contain data. This
makes transfers for the m25p80 driver around 7 times faster
here.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-31 17:12:38 +02:00
Sascha Hauer cd4df8f82b spi: i.MX: use start mode control bit
The i.MX SPI controller in version 2.3 can immediately start a transfer
when the txfifo is written to. In this mode we no longer have to trigger
the transfer with the xch bit which makes the code a bit simpler.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-31 17:12:28 +02:00
Sascha Hauer 4d6665c33a spi: i.MX: move register defines to include/
The register defines will be used by the SPI xload code, so move
them to a place where the xload code can include them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-16 09:46:02 +02:00
Sebastian Hesselbarth 301765846b spi: Add SPI GPIO bitbang driver
This adds a driver for SPI master by GPIO pins.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-27 08:09:34 +02:00
Sascha Hauer 98360be0fe Documentation: remove doxygen documentation
The doxygen documentation is long outdated. Remove it. It will
be replaced with sphinx based documentation later.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-06-26 10:09:52 +02:00
Sascha Hauer fd5b82e640 spi: Call spi_of_register_slaves from core
Makes individual handling of OF spi slaves unnecessary in the bus drivers.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-31 12:53:05 +01:00
Sascha Hauer b381e781bf treewide include/: Add missing includes
This adds several missing includes to files under include/ which
we relied on being included implicitly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-31 08:32:59 +02:00
Alexander Shiyan e4588cf311 Introduce device_spi_driver() macro and use it for SPI drivers
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-14 07:15:45 +01:00
Alexander Shiyan 2f65379c98 SPI: Rename spi_register_driver() for using with register_driver_macro()
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-14 07:15:44 +01:00
Antony Pavlov 773f635186 spi: fix compiler warning
Fixes:
 drivers/spi/spi.c:59: warning: no previous prototype for 'spi_new_device'

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-26 22:21:56 +01:00
Sascha Hauer 0bf6b41cfa Merge branch 'for-next/spi' 2012-11-16 14:02:49 +01:00
Jean-Christophe PLAGNIOL-VILLARD 968d444cdd spi: introduce spi_get_master
so we can request a master usefull for the spi command

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-12 08:32:16 +01:00
Jean-Christophe PLAGNIOL-VILLARD 44a293471a mtd: add dataflash support
from linux 3.6

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-10-15 19:53:43 +02:00
Sascha Hauer 5888a3b5c9 spi: add oftree support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-14 13:35:47 +02:00
Sascha Hauer 617bfbcbeb SPI: Put SPI devices on their own bus
This patch adds a SPI bus on which the SPI devices and drivers register.
This makes it cleaner as SPI devices won't accidently end up probed by
a platform_device driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-14 11:47:24 +02:00
Paul Fertser d68f29f08f spi: indicate in the docs that per-transfer bpw setting is not supported
Currently it's not implemented by any driver so add a note to the
documentation.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-29 12:27:32 +02:00
Franck Jullien e705ccd130 nor: Add SPI flash driver
This patch adds the m25p80 driver. It has been ported from
Linux. MTD code has been removed. It has been tested with
a m25p40 chip and the Altera SPI master driver.

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-24 18:44:31 +02:00
Franck Jullien 4c35079c1c spi: add bits_per_word to proxy structure
During the creation of a new spi device, we need to
have the possiblility to give the bits_per_word value
to master->setup.

As a matter of fact, spi master could check the spi
device bits_per_word and compare this value against its
capabilities.

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-06 10:25:39 +02:00
Hubert Feurstein f568880f8f eeprom: add at25 eeprom driver
This commit adds support for most spi eeproms, such as the
Atmel at25 models.

Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-06-21 13:56:49 +02:00
Hubert Feurstein c0b9629867 spi: add more spi transfer functions
This commit adds the following spi transfer functions:
  - spi_write
  - spi_read
  - spi_write_then_read
  - spi_w8r8

The code has been ported from the linux kernel.

Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-06-21 13:56:49 +02:00
Hubert Feurstein 76f46b5619 spi: add platform_data pointer to spi_board_info
In the spi layer this pointer will be assigned to the
platform_data pointer of the new spi device, thus it can
be accessed in the drivers 'probe' handler.

Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-06-21 13:56:49 +02:00
Juergen Beisert dac84c7b9d documentation updates
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-12-15 11:32:02 +01:00
Sascha Hauer fd12d4cd77 SPI: Add empty spi_register_board_info function when SPI is disabled
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-13 16:52:15 +02:00
Sascha Hauer a14a5c02f0 first (partly) running spi support 2008-03-14 12:59:55 +01:00
Sascha Hauer 906eea397a beginning of SPI support 2008-03-11 22:13:06 +01:00