u-boot/drivers/ram/rockchip
Jagan Teki d0ba88f5dd ram: rk3399: Add rank detection support
Right now the rk3399 sdram driver assume that the board
has configured with 2 channels, so any possibility to
enable single channel on the same driver will encounter
channel #1 data training failure.

Log:
U-Boot TPL board init
sdram_init: data training failed
rk3399_dmc_init DRAM init failed -5

So, add an algorithm that can capable to compute the active
or configured rank with associated channel like
a) do rank loop to compute the active rank, with associated
   channel numbers
b) then, succeed the data training only for configured channel
c) preserve the rank for given channel
d) do channel loop for setting the active channel
e) if given rank is zero or inactive on the specific channel,
   clear the timings for the associated channel
f) finally, return error if number of channels is zero

Tested in NanoPI-NEO4 since it support single channel sdram
configuration.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: YouMin Chen <cym@rock-chips.com>
Reviewed-by: Kever Yang <Kever.yang@rock-chips.com>
(add PI_READ_GATE_TRAINING for LPDDR3 to support rk3399-evb case)
Signed-off-by: Kever Yang <Kever.yang@rock-chips.com>
2019-07-20 23:54:32 +08:00
..
dmc-rk3368.c rockchip: dmc: rk3368: update rank number for evb-px5 2019-05-08 17:34:12 +08:00
Kconfig ram: rockchip: Add debug sdram driver 2019-07-19 11:11:09 +08:00
Makefile ram: rockchip: Add debug sdram driver 2019-07-19 11:11:09 +08:00
sdram_debug.c ram: rk3399: debug: Add sdram_print_stride 2019-07-19 11:11:10 +08:00
sdram_rk322x.c Revert "rockchip: rk322x: ram: enable DRAM init in SPL instead of TPL" 2019-05-08 17:34:12 +08:00
sdram_rk3128.c rockchip: use 'arch-rockchip' as header file path 2019-05-01 00:00:05 +02:00
sdram_rk3188.c rockchip: use 'arch-rockchip' as header file path 2019-05-01 00:00:05 +02:00
sdram_rk3288.c rockchip: use 'arch-rockchip' as header file path 2019-05-01 00:00:05 +02:00
sdram_rk3328.c rockchip: use 'arch-rockchip' as header file path 2019-05-01 00:00:05 +02:00
sdram_rk3399.c ram: rk3399: Add rank detection support 2019-07-20 23:54:32 +08:00