Skip to content

Commit 10de211

Browse files
joseph-lo-nvtwthierryreding
authored andcommitted
memory: tegra: Add EMC scaling support code for Tegra210
This is the initial patch for Tegra210 EMC frequency scaling. It has the code to program various aspects of the EMC that are standardized, but it does not yet include the specific programming sequence needed for clock scaling. The driver is designed to support LPDDR4 SDRAM. Devices that use LPDDR4 need to perform training of the RAM before it can be used. Firmware will perform this training during early boot and pass a table of supported frequencies to the kernel via device tree. For the frequencies above 800 MHz, periodic retraining is needed to compensate for changes in timing. This periodic training will have to be performed until the frequency drops back to or below 800 MHz. This driver provides helpers used during this runtime retraining that will be used by the sequence specific code in a follow-up patch. Based on work by Peter De Schrijver <[email protected]>. Signed-off-by: Joseph Lo <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 6cc8823 commit 10de211

File tree

7 files changed

+2828
-0
lines changed

7 files changed

+2828
-0
lines changed

drivers/memory/tegra/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,17 @@ config TEGRA124_EMC
3636
Tegra124 chips. The EMC controls the external DRAM on the board.
3737
This driver is required to change memory timings / clock rate for
3838
external memory.
39+
40+
config TEGRA210_EMC_TABLE
41+
bool
42+
depends on ARCH_TEGRA_210_SOC
43+
44+
config TEGRA210_EMC
45+
tristate "NVIDIA Tegra210 External Memory Controller driver"
46+
depends on TEGRA_MC && ARCH_TEGRA_210_SOC
47+
select TEGRA210_EMC_TABLE
48+
help
49+
This driver is for the External Memory Controller (EMC) found on
50+
Tegra210 chips. The EMC controls the external DRAM on the board.
51+
This driver is required to change memory timings / clock rate for
52+
external memory.

drivers/memory/tegra/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,9 @@ obj-$(CONFIG_TEGRA_MC) += tegra-mc.o
1313
obj-$(CONFIG_TEGRA20_EMC) += tegra20-emc.o
1414
obj-$(CONFIG_TEGRA30_EMC) += tegra30-emc.o
1515
obj-$(CONFIG_TEGRA124_EMC) += tegra124-emc.o
16+
obj-$(CONFIG_TEGRA210_EMC_TABLE) += tegra210-emc-table.o
17+
obj-$(CONFIG_TEGRA210_EMC) += tegra210-emc.o
1618
obj-$(CONFIG_ARCH_TEGRA_186_SOC) += tegra186.o tegra186-emc.o
1719
obj-$(CONFIG_ARCH_TEGRA_194_SOC) += tegra186.o tegra186-emc.o
20+
21+
tegra210-emc-y := tegra210-emc-core.o

drivers/memory/tegra/mc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#define MC_EMEM_ARB_TIMING_W2W 0xbc
3535
#define MC_EMEM_ARB_TIMING_R2W 0xc0
3636
#define MC_EMEM_ARB_TIMING_W2R 0xc4
37+
#define MC_EMEM_ARB_MISC2 0xc8
3738
#define MC_EMEM_ARB_DA_TURNS 0xd0
3839
#define MC_EMEM_ARB_DA_COVERS 0xd4
3940
#define MC_EMEM_ARB_MISC0 0xd8

0 commit comments

Comments
 (0)