Commit Graph

12810 Commits

Author SHA1 Message Date
Joseph Chen fe404743f8 power: io-domain: initialize all io-domain
There maybe more than one io-domain.

Change-Id: I786544547b7c5da034e4d9685d60144c22266c3b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-07-25 16:23:07 +08:00
Adam Ford 1490eb89f4 UPSTREAM: Convert CONFIG_SPI to Kconfig
This converts the following to Kconfig:
   CONFIG_SPI

This partly involves updating code that assumes that CONFIG_SPI implies
things that are specific to the MPC8xx SPI driver.  For now, just update
the CONFIG tests.  This also involves reworking the default for
CONFIG_SYS_DEF_EEPROM_ADDR so that we don't set it when we cannot make a
reasonable default, as it does not cause any compile failures.

Signed-off-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
(cherry picked from commit f1b1f77060beadbfe9f42a3be00019bd025afbd6)
Change-Id: Ie9f15ada869105eb407f41d4df7eecbaa916b940
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-07-23 17:15:32 +08:00
Eugeniy Paltsev 300e61c1ec UPSTREAM: spi: dw: invert wait condition in dw_spi_xfer
While switching to readl_poll_timeout macros from custom code
the waiting condition was accidently inverted, so it was pure
luck that this code works at least in some conditions.

Fix that by inverting exit condition for readl_poll_timeout.

Fixes: c6b4f031d9 ("DW SPI: fix tx data loss on FIFO flush")

Change-Id: I741ce99a6b6cf57c248426549c0047d636d9e43e
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 9b14ac5cc2294ac3eaae92421abff27ed3e6caae)
2019-07-23 17:15:32 +08:00
Marek Vasut 7f3cd1e4f8 UPSTREAM: spi: sh_qspi: Make use of the 32byte FIFO
The QSPI controller on RCar Gen2 has 32byte FIFO. Instead of doing
the SPI transmission 1 byte at time, if there is a 32byte chunk of
data to be transferred, fill the FIFO completely and then transfer
the data to/from the FIFO. This increases the SPI NOR access speed
significantly.

Change-Id: Idc0280488ce052492579ee8e52f6084aa0840f3b
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit ea5512eb095067dda27930246792d2957feb9434)
2019-07-23 17:15:32 +08:00
Marek Vasut 9d14f4ef9b UPSTREAM: spi: sh_qspi: Replace ad hoc waiting with wait_for_bit
Replace the ad-hoc endless loops with wait_for_bit() with
reasonable timeout. Note that the loops had internal 10uS
delays, although there is no reason for those on this HW,
so they are dropped.

Change-Id: I0d004adc09e2fb32e88b17b0f060aecc0b7bda35
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 9573db654d1999a1dfde6469782aa8d7cf3d589f)
2019-07-23 17:15:32 +08:00
Marek Vasut 2b8aed016f UPSTREAM: spi: sh_qspi: Drop SPBDCR wait
Waiting for SPBDCR == 1 is not required and is covered by the
subsequent wait for SPSR_SPRFF, so drop this.

Change-Id: Ie943ac6feff57e478a7b2e7325eac9b5438c0374
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 118226495249268a35e604b2e6309801699f6224)
2019-07-23 17:15:32 +08:00
Marek Vasut 7950bf5ee5 UPSTREAM: spi: sh_qspi: Replace data types with short ones
Just replace unsigned {char,short,long} with u{8,16,32},
no functional change.

Change-Id: Ie9a9d331acb364d9b27a72a052a511a8da61c471
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 0e6fa20b14ed27ef667ddb31c8e7c620417ee4f5)
2019-07-23 17:15:32 +08:00
Marek Vasut 5d78ea082a UPSTREAM: mtd: spi: Add Renesas RPC SPI-flash driver
Add driver for the RPC block in SPI-flash mode. This driver allows
access to a SPI NOR flash attached to the RPC block and does not
support RPC in Hyperflash mode. Note that this block is extremely
selective when communicating with the SPI NOR.

Change-Id: I8b936d2862a1ef4bc2451d54a1808b7b49710b17
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit fbebea27e16eb760f1f2109a7535003bf359ba2b)
2019-07-23 17:15:32 +08:00
Tom Rini 10f7c0a965 UPSTREAM: Revert "spi: atmel: Drop non-dm code"
As we aren't quite able to convert some platforms with a very small size
limit in SPL yet, we need to revert this for now.

This reverts commit 7b0947787358c6b277431d6b76ce043d8bec641d.

Change-Id: I9953c2529a611950db1de168d772607329f827b7
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit e80fa2c2c0870f7c17e233ecc07552e1082c1513)
2019-07-23 17:15:32 +08:00
Tom Rini 71c98550b1 UPSTREAM: Revert "spi: atmel: Drop atmel_spi.h"
As we aren't quite able to convert some platforms with a very small size
limit in SPL yet, we need to revert this for now.

This reverts commit 37434db29be495ef41f204a97b8bf13b1418f97d.

Change-Id: I91af9f7fc85430b3c0c9c095f097e6692cac91ea
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 5270df2836761909864d9b548bf4b7f7f3a51484)
2019-07-23 17:15:32 +08:00
Christophe Leroy 5bda114b50 UPSTREAM: powercp: mpc8xx: move commproc.h
include/commproc.h is dedicated to the 8xx, rename it cpm_8xx.h and
move it into arch/powerpc/include/asm

Change-Id: I37b02101bd88b607f0f9eca79fdbb7cc1e85ed4d
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 18f8d4c60d26e6cd113461c5d716c64897c3f112)
2019-07-23 17:15:32 +08:00
Christophe Leroy 87e4c6020e UPSTREAM: powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx
CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
(cherry picked from commit ee1e600c13d16febd517ab7d0d2c243db174789b)
Change-Id: I564708bb6517b699749e8a54c013d032f785e459
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-07-23 17:15:32 +08:00
Jagan Teki f92621cf93 UPSTREAM: spi: atmel: default y if DM_SPI && ARCH_AT91
ATMEL_SPI is now fully converted to driver-model and
respective boards switch to DM_SPI as well,
so make default y for ARCH_AT91

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Wenyou Yang <wenyouya@gmail.com>
(cherry picked from commit 89d4fc153bb5c3830ab9e75e1690738cccea0322)
Change-Id: I3c3da47c05f7fef7a2129c5325c4ddf7b596b2cf
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-07-23 17:15:32 +08:00
Jagan Teki d658123d48 UPSTREAM: spi: atmel: Drop atmel_spi.h
atmel_spi.h has register offsets, and atmel_spi_slave
structure, move it into .c file for better readability
and drop atmel_spi.h

Change-Id: Ia43a1c2dc2fc7e02a7d5613c8aac31c63bd0c37c
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Wenyou Yang <wenyouya@gmail.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 37434db29be495ef41f204a97b8bf13b1418f97d)
2019-07-23 17:15:32 +08:00
Jagan Teki c7aa08536c UPSTREAM:spi: atmel: Drop non-dm code
All board configs are now enabled DM_SPI for SPL and
U-Boot proper, so now its time to drop non-dm code.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Wenyou Yang <wenyouya@gmail.com>
(cherry picked from commit 7b0947787358c6b277431d6b76ce043d8bec641d)
Change-Id: Ifa87682ea641368d73be6a059c00d194a668bf4b
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-07-23 17:15:32 +08:00
Jagan Teki 48fef189ac UPSTREAM: spi: atmel: Add ifdef for DM_GPIO code
Few boards are configuring gpio directly from board instead
using drivers/gpio so add ifdef for DM_GPIO to compatible
for both the cases.

Change-Id: I12cb7f90bd11ca5687da7992382fb3b447d5ec1c
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Wenyou Yang <wenyouya@gmail.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 9bf48e2ee8a0174adfb0f18d110198e4ca042284)
2019-07-23 17:15:32 +08:00
Sjoerd Simons cafc69117e UPSTREAM: omap3: spi: Correct ti, pindir-d0-out-d1-in parsing
The ti,pindir-d0-out-d1-in property is not expected to have a value
according to the device-tree binding, so treat it as a boolean not a
uint property.

Change-Id: Icfcb73b19f630bda5faf2d8bbb03efff6db9c933
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 63018a3eddd5d9c64f7ee42615a63c6a67ab484d)
2019-07-23 17:15:32 +08:00
Eugeniy Paltsev ba102646ea UPSTREAM: DW SPI: use 32 bit access instead of 16 and 32 bit mix
Current DW SPI driver uses 32 bit access for some registers and
16 bit access for others. So if DW SPI IP is connected via bus
which doesn't support 16 bit access we will get bus error.

Fix that by switching to 32 bit access only instead of 16 and 32 bit mix

Additional Documentation to Support this Change:
The DW_apb_ssi databook states:
"All registers in the DW_apb_ssi are addressed at 32-bit boundaries
to remain consistent with the AHB bus. Where the physical size of
any register is less than 32-bits wide, the upper unused bits of
the 32-bit boundary are reserved. Writing to these bits has no
effect; reading from these bits returns 0." [1]

[1] Section 6.1 of dw_apb_ssi.pdf (version 3.22a)

Change-Id: I3e52a45a49f96177d1c0d3781d8d98d7df5d9e0c
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 4b5f6c52e78d43710a0d062e31de741ec76ceea1)
2019-07-23 17:15:32 +08:00
Eugeniy Paltsev c2b2998cf0 UPSTREAM: DW SPI: add option to use external gpio for chip select
DW SPI internal chip select management has limitation:
it hold CS line in active state only when the FIFO is not
empty. If the FIFO freed before we add new data the SPI transaction will
be broken.

So add option to use external gpio for chip select. Gpio can be added
via device tree using standard gpio bindings.

Change-Id: Ifecfe693bdc9316da7d23db43f8764885e3cb786
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit bcdcb3e61ebd0550355883aed3978028d0e7778b)
2019-07-23 17:15:32 +08:00
Eugeniy Paltsev 6904f1891d UPSTREAM: DW SPI: refactor poll_transfer functions
There is no sense in waiting for RX data in dw_reader function:
there is no chance that RX data will appear in RX FIFO if
RX FIFO is empty after previous TX write in dw_writer function.
So get rid of this waiting. After that we can get rid of dw_reader
return value and make it returning void. After that we can get rid
of dw_reader return value check in poll_transfer function.

With these changes we're getting closer to Linux DW SPI driver.

Change-Id: I2654951199094c51609c5402b5abd62438bbf1dd
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit d3d8aaec7401703079f296a6460fe649fb06581b)
2019-07-23 17:15:32 +08:00
Eugeniy Paltsev 131bd2776a UPSTREAM: DW SPI: fix transmit only mode
In current implementation we get -ETIMEDOUT error when we try to use
transmit only mode (SPI_TMOD_TO)
This happens because in transmit only mode input FIFO never gets any data
which breaks our logic in dw_reader(): we are waiting until RX data will be
ready in dw_reader, but this newer happens, so we return with error.

Fix that by using SPI_TMOD_TR instead of SPI_TMOD_TO which allows to use
RX FIFO.

Change-Id: I876d86fbf05feccebf6ded5f3acfa09a6cd15ea2
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit fc282c7bcb6a622ce1a0cf82c55654dec5bcb0cd)
2019-07-23 17:15:32 +08:00
Eugeniy Paltsev cccfaa0615 UPSTREAM: DW SPI: fix tx data loss on FIFO flush
In current implementation if some data still exists in Tx FIFO it
can be silently flushed, i.e. dropped on disabling of the controller,
which happens when writing 0 to DW_SPI_SSIENR (it happens in the
beginning of new transfer)

So add wait for current transmit operation to complete to be sure
that current transmit operation is finished before new one.

Change-Id: I13be86b6b7da544ff64656fdb62ea79d5ee16d26
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit c6b4f031d96a4e1d59761b294829b058b098f3df)
2019-07-23 17:15:32 +08:00
Jagan Teki 43e86b9a68 UPSTREAM: spi: omap3: Fix redeclared error
omap3_spi_set_speed|mode redeclared bus symbol, fix the same.

error:
drivers/spi/omap3_spi.c: In function ‘omap3_spi_set_speed’:
drivers/spi/omap3_spi.c:650:18: error: ‘bus’ redeclared as different kind of symbol
  struct udevice *bus = dev->parent;

Change-Id: I6413fbdc32b1365d545033382c40fa39f85e5b84
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit b2b41d27775823b8e19f6816aa08ffca0e234ade)
2019-07-23 17:15:32 +08:00
Jagan Teki 226998e3ef UPSTREAM: spi: omap3: Skip set_mode, set_speed from claim
set_mode, set_seed functions has separate function pointers
in dm_spi_ops, so use them in relevent one instead of
calling from claim_bus.

Change-Id: Ifbe121f3a84c8b2ce007fe5a80fdd213b9f78a82
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 84807922874e03895bbf15c4472a2dcee8fbbd03)
2019-07-23 17:15:32 +08:00
Jagan Teki 0d17c3df7f UPSTREAM: spi: atcspi200: Drop non-dm code
Boards adp-ae3xx_defconfig, nx25-ae250_defconfig
already enabled DM_SPI, so non-dm code make no use
of it hence droped.

Change-Id: I6864c71a8e9a97619fbe1989856077285aa2408e
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 15927aef02b7e7b5921bd1470ce145c2fa03ef08)
2019-07-23 17:15:32 +08:00
Tuomas Tynkkynen 845f53cfd3 UPSTREAM: spi: Migrate CONFIG_CF_SPI to Kconfig
Change-Id: Ia9f6139d87f28ef8bbab5effb15b3e00e53e732d
Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit fbca0e66cc982325d8031094736d79ed007e42e2)
2019-07-23 17:15:32 +08:00
Tuomas Tynkkynen 5932b8bc8c UPSTREAM: spi: Migrate CONFIG_KIRKWOOD_SPI to Kconfig
Change-Id: I70b43d668f905f236e18493c07ac6c369b7ca2d1
Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 4a942f49b891872727aa0bdba58e2ca513fc455c)
2019-07-23 17:15:32 +08:00
Tuomas Tynkkynen a1f9e12a3d UPSTREAM: spi: Migrate CONFIG_LPC32XX_SSP to Kconfig
Change-Id: Ib34e1271ed6dd812bfb21bc2162b30d27b014498
Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 2c4b096b4c3e9d115b43edb23b1592a297076ae4)
2019-07-23 17:15:32 +08:00
Tuomas Tynkkynen cb90935401 UPSTREAM: spi: Migrate CONFIG_MPC8XXX_SPI to Kconfig
Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
(cherry picked from commit bbdf38698ee5c96138868d563c6825cd48bb26dc
Change-Id: I6c99c0696716c148a9f8a3255111b23749c78a6b
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-07-23 17:15:32 +08:00
Tuomas Tynkkynen d851477aa1 UPSTREAM: spi: Migrate CONFIG_MXS_SPI to Kconfig
Change-Id: Id2769d0405f96348de67cdd24df8a82a35101637
Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 7b819b569e92fd9b9b1baf160cd946a523fde1ce)
2019-07-23 17:15:32 +08:00
Tuomas Tynkkynen 3ad77667ab UPSTREAM: spi: Migrate CONFIG_SH_QSPI to Kconfig
Change-Id: I51b0a222d7f5d4bf8925f7544c50d8f35da235e2
Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit a5dfabea19f961826509118513f833cea25797bb)
2019-07-23 17:15:31 +08:00
Tuomas Tynkkynen 99c184906c UPSTREAM: spi: Migrate CONFIG_SH_SPI to Kconfig
Change-Id: I66c533e5c556c26b771037bc7eee5ceff01f5cb9
Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 95d3877a5818cc3f149a9d443637ff145bbaaabb)
2019-07-23 17:15:31 +08:00
Heinrich Schuchardt 70716f3196 UPSTREAM: atcspi200: avoid possible NULL dereference
Check if ns before and not after dereferencing it.

Indicated by cppcheck.

Change-Id: Ic9a2491051754fef64ce7ad4a9a5377fc3aad6db
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 923837e159c5886be38c7a83a2d6bc489b35c1f4)
2019-07-23 17:15:31 +08:00
Eugeniy Paltsev ccb5fa0a6b UPSTREAM: DW SPI: Get clock value from Device Tree
Add option to set spi controller clock frequency via device tree
using standard clock bindings.

Define dw_spi_get_clk function as 'weak' as some targets
(like SOCFPGA_GEN5 and SOCFPGA_ARRIA10) don't use standard clock API
and implement dw_spi_get_clk their own way in their clock manager.

Get rid of clock_manager.h include as we don't use
cm_get_spi_controller_clk_hz function anymore. (we use redefined
dw_spi_get_clk in SOCFPGA clock managers instead)

Reviewed-by: Marek Vasut <marex@denx.de>
Change-Id: Iee14939326b5512a7704ccbcfd9795d1a1f6aa3b
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 58c125b9e2b232ce73ed7b24ba7b1ca5ff41c5bd)
2019-07-23 17:15:31 +08:00
Vignesh R 613aa4d50e UPSTREAM: Revert "spi: cadence_qspi_apb: Use 32 bit indirect write transaction when possible"
This reverts commit 57897c13de.

Using bounce_buf.c to handle non-DMA alignment problems is bad as
bounce_buf.c does cache manipulations which is not required. Therefore
revert this patch in favour of local bounce buffer solution in the next
patch.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Simon Goldschmidt <sgoldschmidt@de.pepperl-fuchs.com>
Reviewed-by: Jason Rush <jarush@gmail.com>
Acked-by: Jason Rush <jarush@gmail.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
(cherry picked from commit a743e2ba3837db5e8499b03f0f57c3610d03a570)
Change-Id: I793c697ad11d10259e233b2a6b0fe6e6f0b3df85
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-07-23 17:15:31 +08:00
Goldschmidt Simon 06357de766 UPSTREAM: Revert "spi: cadence_qspi_apb: Use 32 bit indirect read transaction when possible"
This reverts commit b63b46313e.

This commit changed cadence_qspi_apb to use bouncebuf.c, which invalidates
the data cache after reading. This is meant for dma transfers only and
breaks the cadence_qspi driver which copies via cpu only: data that is
copied by the cpu is in cache only and the cache invalidation at the end
throws away this data.

Change-Id: If32c692ac37cf2ee25254b7ecc49bc09096bf5d0
Signed-off-by: Simon Goldschmidt <sgoldschmidt@de.pepperl-fuchs.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Jason Rush <jarush@gmail.com>
Acked-by: Jason Rush <jarush@gmail.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 948ad4f07598a729a0de523ed3d779115b2fa2f2)
2019-07-23 17:15:31 +08:00
Jason Rush 6b7eb4157f UPSTREAM: spi: cadence_spi: Sync DT bindings with Linux
Adopt the Linux DT bindings. This also fixes an issue
with the indaddrtrig register on the Cadence QSPI
device being programmed with the wrong value for the
socfpga arch.

Tested on TI K2G platform:
Tested-by: Vignesh R <vigneshr@ti.com>

Tested on a socfpga-cyclonev board:
Tested-by: Simon Goldschmidt <sgoldschmidt@de.pepperl-fuchs.com>

Change-Id: Ic221ac76abf1a32a027b9650bc6f27667209c77c
Signed-off-by: Jason Rush <jarush@gmail.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Acked-by: Simon Goldschmidt <sgoldschmidt@de.pepperl-fuchs.com>
Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 15a70a5da33229de884f60684a562ea60fe505b2)
2019-07-23 17:15:31 +08:00
Chris Packham ab86434d69 UPSTREAM: spi: kirkwood_spi: implement workaround for FE-9144572
Erratum NO. FE-9144572: The device SPI interface supports frequencies of
up to 50 MHz.  However, due to this erratum, when the device core clock
is 250 MHz and the SPI interfaces is configured for 50MHz SPI clock and
CPOL=CPHA=1 there might occur data corruption on reads from the SPI
device.

Implement the workaround by setting the TMISO_SAMPLE value to 0x2
in the timing1 register.

Change-Id: Iee0b8cb304816d74c6442132be4cc04e6cb8adbc
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit df16881cea50a787c37591bd2168c8ea656217bd)
2019-07-23 17:15:31 +08:00
Mario Six 8849a3be8a UPSTREAM: spi: spi-uclass: Fix style violations
Remove a superfluous newline, and reduce the scope of a variable.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Change-Id: I8916ae85b0339d29d7b50382182a263848e21a39
Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 24fc1ec2ee71cd852e556f90bd352cc809ddeef9)
2019-07-23 17:15:31 +08:00
Mario Six e806bc1cf3 UPSTREAM: spi: Remove spi_setup_slave_fdt
A previous patch removed the spi_flash_probe_fdt function, which
contained the last call of the spi_setup_slave_fdt function, which is
now equally obsolete.

This patch removes the function.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Change-Id: I0836438bec6597bb99038997ae6a549d647f1666
Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 184fa1c8da54d3c5305b3e1975e284e01de68bea)
2019-07-23 17:15:31 +08:00
Mario Six b91a110b4c UPSTREAM: spi: Remove obsolete spi_base_setup_slave_fdt
0efc024 ("spi_flash: Add spi_flash_probe_fdt() to locate SPI by FDT
node") added a helper function spi_base_setup_slave_fdt to to set up a
SPI slave from a given FDT blob. The only user was the exynos SPI
driver.

But commit 73186c9 ("dm: exynos: Convert SPI to driver model") removed
the use of this function, hence rendering it obsolete.

Remove this function, as well as the CONFIG_OF_SPI option, which guarded
only this function.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Change-Id: I2a5bd866fda6d65b908c1f71160da59ab5332a15
Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit c5b88f29ba46997e1cae39153980cae475b87b82)
2019-07-23 17:15:31 +08:00
Mario Six 439ce24404 UPSTREAM: spi: Fix style violation and improve code
This patch fixes a printf specifier style violation, reduces the scope
of a variable, and turns a void pointer that is used with pointer
arithmetic into a u8 pointer.

Change-Id: I4084bfeaba1e992f589f5190660bcbfb8627b0b3
Signed-off-by: Mario Six <mario.six@gdsys.cc>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 547bcc3d18ddcc107b8aa7ca393830590c27978f)
2019-07-23 17:15:31 +08:00
Álvaro Fernández Rojas 4bb24893b6 UPSTREAM: dm: spi: add BCM63xx HSSPI driver
This driver is a simplified version of linux/drivers/spi/spi-bcm63xx-hsspi.c

Change-Id: Ib6d47452d3699df5eb799cc0289687331192f380
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 29cc4368ad4b8d67ae457681e9249e2008d6fee5)
2019-07-23 17:15:31 +08:00
Álvaro Fernández Rojas c2d012f94d UPSTREAM: dm: spi: add BCM63xx SPI driver
This driver is a simplified version of linux/drivers/spi/spi-bcm63xx.c

Change-Id: I2a36ddc619bc5801fe6f9f9873a63d8e6d62534f
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 5ac07d2969e7f1ea2582f97ccacbe9ad9c9d62fc)
2019-07-23 17:12:17 +08:00
Adam Ford 2b9d6da418 UPSTREAM: Convert CONFIG_DAVINCI_SPI to Kconfig
This converts the following to Kconfig:
   CONFIG_DAVINCI_SPI

Signed-off-by: Adam Ford <aford173@gmail.com>
(cherry picked from commit 26410c1517bbb6d6f90de55b5fa65dac3c298bc7)
Change-Id: I7b2166d5ea20dcd0a0e79d6faa1c51fca4d6eef9
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-07-23 17:12:17 +08:00
Peng Fan c3bb0077c7 UPSTREAM: spi: fsl_qspi: support i.MX6UL/6ULLL/7D
The QSPI module on i.MX7D is modified from i.MX6SX. The module used on
i.MX6UL/6ULL is reused from i.MX7D. They share same tx buffer size.

The endianness is not set at qspi driver initialization. So if we don't
boot from QSPI, we will get wrong endianness when accessing from AHB
address directly.

Add the compatible entry for 6ul/7d.

Change-Id: I8aa660b610b39c24969560187b35d5e7a8a17f5d
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit afe8e1b03362f169b2f905d20e2b352aca9d522e)
2019-07-23 17:12:17 +08:00
Rick Chen ab1460f224 UPSTREAM: cosmetic: atcspi200: Rename function name as atcspi200
Integrate function and struct name from ae3xx to
atcspi200 will be more reasonable.

Change-Id: I932c2ed047541b6ad09344c0ceb80496ac575c64
Signed-off-by: Rick Chen <rick@andestech.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 6720e4ae7a01afa93b99a8f62b0cc98fe01abc9b)
2019-07-23 17:12:08 +08:00
Rick Chen 6b239db430 UPSTREAM: spi: nds_ae3xx: Rename nds_ae3xx_spi as atcspi200_spi
atcspi200 is Andestech spi ip which is embedded in
AE3XX and AE250 platforms. So rename as atcspi200
will be more reasonable to be used in different
platforms.

Signed-off-by: Rick Chen <rick@andestech.com>
(cherry picked from commit 41bbb8b333a6977cd28d31c58a5a209001ce5056)
Change-Id: I78d0112ba78c09ba9cd2beace324b3af9b867d71
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-07-23 17:12:08 +08:00
Heinrich Schuchardt 204b4e6872 UPSTREAM: rockchip: spi: the symbol for Hertz is Hz
fix typo

Change-Id: If467ba2cb4d16a4844400e9046e851ab0b96a4de
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 11f12c17d72499292f6e219ebbf8062faedcc5bb)
2019-07-23 17:12:08 +08:00
Heinrich Schuchardt 5385433492 UPSTREAM: omap3: spi: the symbol for Hertz is Hz
fix typo

Change-Id: Ifee202f67e4a972854ed33745de3984b6ae9e2d1
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 042de609ed49cfc41afb13639850c7b01079a527)
2019-07-23 17:12:08 +08:00