memory: tegra30-emc: Firm up hardware programming sequence
authorDmitry Osipenko <digetx@gmail.com>
Fri, 20 Dec 2019 02:08:48 +0000 (05:08 +0300)
committerThierry Reding <treding@nvidia.com>
Fri, 10 Jan 2020 14:48:40 +0000 (15:48 +0100)
commit0f8bb9da5aee80d8d1b716e0fc5441575ff0ef21
treee1ff65af2cf378509954a05b2bebd15fa2557fdf
parent51bb73f93410a30550641f69d14cfb7b43fd2da1
memory: tegra30-emc: Firm up hardware programming sequence

Previously there was a problem where a late handshake handling caused
a memory corruption, this problem was resolved by issuing calibration
command right after changing the timing, but looks like the solution
wasn't entirely correct since calibration interval could be disabled as
well. Now programming sequence is completed immediately after receiving
handshake from CaR, without potentially long delays and in accordance to
the TRM's programming guide.

Secondly, the TRM's programming guide suggests to flush EMC writes by
reading any *MC* register before doing CaR changes. This is also addressed
now.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/memory/tegra/tegra30-emc.c