u-boot/drivers
Thomas Hebb 95052b4b40 ram: rk3399: don't assume phy_io_config() uses real regs
In the RK3399 DRAM driver, the function set_ds_odt() supports operating
in two different modes, selected by the ctl_phy_reg argument: when true,
the function reads and writes directly from the DRAM registers, accessed
through "chan->pctl->denali_*"; when false, the function reads and
writes from an array, accessed through "params->pctl_regs.denali_*",
which is written to DRAM registers at a later time.

However, phy_config_io(), which is called by set_ds_odt() to do a subset
of its register operations, operates directly on DRAM registers at all
times. This means that it reads incorrect values (and writes new values
prematurely) when ctl_phy_reg in set_ds_odt() is false. Fix this by
passing in the address of the registers to work with.

This prevents an "Invalid DRV value" error in the SPL debug log and
(presumably) results in a more correct end state. See the following logs
from a RK3399 NanoPi M4 board (4GB LPDDR3):

Before:

  sdram_init() Starting SDRAM initialization...
  phy_io_config() Invalid DRV value.
  phy_io_config() Invalid DRV value.
  sdram_init() sdram_init: data trained for rank 2, ch 0
  phy_io_config() Invalid DRV value.
  phy_io_config() Invalid DRV value.
  sdram_init() sdram_init: data trained for rank 2, ch 1
  Channel 0: LPDDR3, 933MHz
  BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
  Channel 1: LPDDR3, 933MHz
  BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
  256B stride
  256B stride
  sdram_init() Finish SDRAM initialization...

After:

  sdram_init() Starting SDRAM initialization...
  sdram_init() sdram_init: data trained for rank 2, ch 0
  sdram_init() sdram_init: data trained for rank 2, ch 1
  Channel 0: LPDDR3, 933MHz
  BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
  Channel 1: LPDDR3, 933MHz
  BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
  256B stride
  256B stride
  sdram_init() Finish SDRAM initialization...

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2020-01-30 11:44:01 +08:00
..
adc adc: stm32: Fix warnings when compiling with W=1 2019-07-12 11:50:55 +02:00
ata ata: fsl_sata: Continue probing other sata port when failed current port. 2020-01-08 09:27:44 -05:00
axi
bios_emulator bios_emulator: remove stray break 2019-08-09 22:24:02 +08:00
block common: fix regression on block cache init 2020-01-26 13:36:14 -05:00
board drivers: board: Add get_fit_loadable() 2020-01-07 11:13:24 -05:00
bootcount bootcount: add a DM i2c eeprom backing store for bootcount 2020-01-10 10:25:13 -05:00
cache common: Move hang() to the same header as panic() 2020-01-24 23:06:49 +05:30
clk clk: imx: pllv3: fix potential 'divide by zero' in av_set_rate() 2020-01-26 21:57:08 +01:00
core dm: Add a debug message when devices are skipped pre-reloc 2020-01-07 16:03:01 -07:00
cpu Move strtomhz() to vsprintf.h 2019-12-02 18:23:09 -05:00
crypto crypto: make mod_exp_sw() static 2020-01-25 12:04:36 -05:00
ddr arm: mvebu: fix A38x breakage from commit bb872dd930 2020-01-26 13:36:07 -05:00
demo
dfu dfu: Add optional timeout parameter 2020-01-07 14:37:50 +01:00
dma dma: ti: k3-udma: Fix build warnings when building for 32 bit platforms 2020-01-20 10:10:28 +05:30
fastboot fastboot: mt85xx: add command to flash/erase emmc hwpart 2020-01-25 12:04:36 -05:00
firmware firmware: Remove probe which is causing extra bind 2020-01-14 09:05:55 +01:00
fpga arm: socfpga: Convert system manager from struct to defines 2020-01-07 14:38:33 +01:00
gpio gpio: bcm6345: allow to use this driver on arm bcm68360 2020-01-23 07:29:58 -05:00
hwspinlock hwspinlock: add stm32 hardware spinlock support 2018-12-06 23:26:33 -05:00
i2c i2c: designware_i2c: Do more in the probe() method 2020-01-27 07:25:00 +01:00
input input: Move input.o to be built only in some cases 2019-11-19 17:43:04 -05:00
led led: bcm6858: allow to use this driver on arm bcm68360 2020-01-23 07:29:58 -05:00
mailbox common: Move get_ticks() function out of common.h 2019-12-02 18:23:13 -05:00
memory
misc common: Move hang() to the same header as panic() 2020-01-24 23:06:49 +05:30
mmc Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-samsung 2020-01-28 21:10:32 -05:00
mtd mtd: spi-nor-core: Add octal mode support 2020-01-27 22:27:22 +05:30
net Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq 2020-01-25 12:20:51 -05:00
nvme common: Move ARM cache operations out of common.h 2019-12-02 18:24:58 -05:00
pch x86: Allow removal of standard PCH drivers 2019-12-15 11:44:16 +08:00
pci common: Move ll_boot_init() to init.h 2020-01-24 23:06:48 +05:30
pci_endpoint pci_ep: Fix Coverity warning 2019-08-07 15:31:04 -04:00
phy Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-sunxi 2020-01-26 12:05:11 -05:00
pinctrl pinctrl: mediatek: add support for different pinctrl 2020-01-16 09:39:45 -05:00
power power: regulator: add driver for Dialog DA9063 PMIC 2020-01-27 19:54:20 -05:00
pwm pwm: rk_pwm: Make PWM driver to support all Rockchip Socs 2019-12-06 00:06:23 +08:00
qe crc32: Use the crc.h header for crc functions 2019-12-02 18:23:08 -05:00
ram ram: rk3399: don't assume phy_io_config() uses real regs 2020-01-30 11:44:01 +08:00
remoteproc remoteproc: elf_loader: fix program header parsing 2020-01-24 11:19:52 -05:00
reset ARC: HSDK: introduce reset driver 2019-11-01 16:45:40 +03:00
rng lib: Kconfig dependencies for pseudo-random library 2020-01-25 12:04:36 -05:00
rtc rtc: s35392a: encode command correctly 2020-01-27 19:54:20 -05:00
scsi scsi: Add dma direction member to command structure 2019-10-23 20:47:12 -04:00
serial common: Move hang() to the same header as panic() 2020-01-24 23:06:49 +05:30
smem
soc soc: ti: k3-navss-ringacc: Get SYSFW reference from DT phandle 2020-01-20 10:10:28 +05:30
sound common: Move get_ticks() function out of common.h 2019-12-02 18:23:13 -05:00
spi spi: cadence-qspi: Add compatible for TI AM654 2020-01-27 22:27:22 +05:30
spmi
sysreset common: Move hang() to the same header as panic() 2020-01-24 23:06:49 +05:30
tee drivers: optee: rpmb: fix returning CID to TEE 2019-12-05 10:28:38 -05:00
thermal thermal: ti-bandgap: Fix adc value datatype 2020-01-20 10:10:28 +05:30
timer timer: Add driver for Nomadik Multi Timer Unit (MTU) 2020-01-22 17:47:56 -05:00
tpm dm: gpio: Allow control of GPIO uclass in SPL 2019-12-15 08:52:29 +08:00
ufs ufs: Add glue layer driver for TI J721E devices 2019-10-23 20:47:12 -04:00
usb usb: musb-new: mt85xx: add musb-new gadget driver. 2020-01-25 12:04:36 -05:00
video common: Move ll_boot_init() to init.h 2020-01-24 23:06:48 +05:30
virtio virtio: fix typo devicd 2020-01-10 14:18:26 -05:00
w1 w1: Add driver for i.MX bus master controller 2019-01-01 14:12:18 +01:00
w1-eeprom
watchdog common: Move hang() to the same header as panic() 2020-01-24 23:06:49 +05:30
Kconfig dm: rng: Add random number generator(rng) uclass 2020-01-07 18:08:21 +01:00
Makefile Kconfig: Rename CONFIG_SPL_DMA_SUPPORT to CONFIG_SPL_DMA 2020-01-15 19:50:27 -05:00