coreboot-kgpe-d16/src/soc/rockchip/common
Simon Glass 74fedbe377 rockchip: spi: Add support for 16-bit APB reads
With a SPI clock above about 24MHz the APB cannot keep up when doing
individual byte transfers. Adjust the driver to use 16-bit reads when
it can, to remove this bottleneck.

Any transaction which involves writing bytes still uses 8-bit transfers,
to simplify the code. These are the transfers that are not time-critical
since they tend to be small. The case that really matters is reading from
SPI flash.

In general we can use 16-bit reads anytime we are transferring an even
number of bytes. If the code detects an odd number of bytes, it tries to
perform the operation in two steps: once in 16-bit mode with an even
number of bytes, and once in 8-bit mode for the final byte. This allow
us to use 16-bit reads even if asked to transfer (for example) 0xf423
bytes.

The limit on in_now and out_now is adjusted to 0xfffe to avoid an extra
transfer when transferring ~>=64KB.

CQ-DEPEND=CL:383232
BUG=chrome-os-partner:56556
BRANCH=none
TEST=boot on gru and see that things still work correctly. I tested (with
extra debugging) that the 16-bit case is being picked when it should be.

Change-Id: If5effae9a84e4de06537fd594bedf7f01d6a9c88
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: ec250b4931c7d99cc014e32ab597fca948299d08
Original-Change-Id: Idc5b7e5d82cdbdc1e8fe8b2d6da819edf2d5570c
Original-Signed-off-by: Simon Glass <sjg@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/381312
Original-Commit-Ready: Julius Werner <jwerner@chromium.org>
Original-Tested-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/16712
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-10-06 21:50:26 +02:00
..
include/soc rockchip: spi: Set rxd sample delay when using high speed 2016-10-04 21:39:51 +02:00
cbmem.c rockchip: make sure sdram top does not spill into MMIO space 2016-05-09 08:45:35 +02:00
edp.c rockchip/*: refactor edp driver 2016-05-09 08:48:35 +02:00
gpio.c rockchip: Remove pulls for gpio_output(), clean up code 2016-10-04 21:17:37 +02:00
i2c.c rockchip/rk3288: refactor i2c interface to allow support of rk3399 2016-04-13 23:38:31 +02:00
pwm.c rockchip/rk3288: refactor pwm driver 2016-04-13 23:38:50 +02:00
rk808.c rockchip/common: Set weekday to unknown in rtc_get() 2016-08-10 23:11:22 +02:00
spi.c rockchip: spi: Add support for 16-bit APB reads 2016-10-06 21:50:26 +02:00
uart.c rockchip/rk*: replace UART special snowflake with standard driver 2016-05-09 08:38:25 +02:00
vop.c rockchip: move vop driver from rk3288 to rockchip common 2016-05-09 08:51:06 +02:00