Add DDR3 memory support for SMDK5250.
v2 cover Add DDR3 memory support for SMDK5250.
SMDK5250 boards are available with different DDR memory variants like LPDDR2, LPDDR3 and DDR3. This patch series adds support for DDR3 memory @ 667Mhz for SMDK5250 board.
In this patchset:
* Renamed dmc_init.c file to dmc_init_lpddr2.c
* Moved functions common to LPDDR2 and DDR3 memory setup from dmc_init_lpddr2.c to dmc_common.c
* Replaced register hex values with macro values for clarity.
Hatim Ali (4):
SMDK5250: LPDDR2: Renaming the dmc_init.c file to dmc_init_lpddr2.c
SMDK5250: LPDDR2: Renaming the PHY_RESET_VAL macro and fixing a minor
typo.
SMDK5250: Creating a common file to be used by all variants of DDR
SMDK5250: DDR3: Add memory initialization code for DDR3.
board/samsung/smdk5250/Makefile | 9 +-
board/samsung/smdk5250/dmc_common.c | 133 ++++++++++
board/samsung/smdk5250/dmc_init_ddr3.c | 276 ++++++++++++++++++++
.../smdk5250/{dmc_init.c => dmc_init_lpddr2.c} | 166 +-----------
board/samsung/smdk5250/setup.h | 199 +++++++++++++--
include/configs/smdk5250.h | 6 +
6 files changed, 607 insertions(+), 182 deletions(-)
create mode 100644 board/samsung/smdk5250/dmc_common.c
create mode 100644 board/samsung/smdk5250/dmc_init_ddr3.c
rename board/samsung/smdk5250/{dmc_init.c => dmc_init_lpddr2.c} (66%)Signature · 1 line
1.7.2.3
PATCH v2 1/4 SMDK5250: LPDDR2: Renaming the dmc_init.c file to dmc_init_lpddr2.c
SMDK5250 board support different type of memory chips like DDR3, LPDDR2 and LPDDR3. Since the memory setup sequence for different types of chips are different, therefore, we will have different dmc_init_xxx.c files. Hence, renaming the dmc_init.c file (which is specific to LPDDR2) to dmc_init_lpddr2.c
board/samsung/smdk5250/Makefile +1 -1
@@ -27,7 +27,7 @@ LIB = $(obj)lib$(BOARD).o SOBJS := lowlevel_init.o COBJS := clock_init.o -COBJS += dmc_init.o +COBJS += dmc_init_lpddr2.o COBJS += tzpc_init.o ifndef CONFIG_SPL_BUILD
board/samsung/smdk5250/dmc_init_lpddr2.c renamed from board/samsung/smdk5250/dmc_init.c +0 -0
Signature · 1 line
1.7.2.3
PATCH v2 2/4 SMDK5250: LPDDR2: Renaming the PHY_RESET_VAL macro and fixing a minor typo.
In reply to Hatim AliThe patch renames the macro PHY_RESET_VAL to LPDDR3PHY_CTRL_PHY_RESET for clarity and also fixes a minor typo error to make the bit description similar to as described in the Exynos user manual.
board/samsung/smdk5250/dmc_init_lpddr2.c +3 -3
@@ -53,7 +53,7 @@ static void reset_phy_ctrl(void) {struct exynos5_clock *clk = (struct exynos5_clock *)EXYNOS5_CLOCK_BASE ; -writel (PHY_RESET_VAL , &clk->lpddr3phy_ctrl); +writel (LPDDR3PHY_CTRL_PHY_RESET_OFF , &clk->lpddr3phy_ctrl);sdelay (0x10000 ); }
@@ -246,9 +246,9 @@ static void config_rdlvl(struct exynos5_dmc *dmc,/* * Set ctrl_gateadj, ctrl_readadj * ctrl_gateduradj, rdlvl_pass_adj -* rdlvl_rddataPadj +* rdlvl_rddata_adj */ - val =SET_RDLVL_RDDATAPADJ ; + val =SET_RDLVL_RDDATA_ADJ ;writel (val, &phy0_ctrl->phy_con1);writel (val, &phy1_ctrl->phy_con1);
board/samsung/smdk5250/setup.h +5 -4
@@ -353,7 +353,8 @@/* (Memory Interleaving Size = 1 << IV_SIZE) */ #define CONFIG_IV_SIZE 0x07 -#define PHY_RESET_VAL (0 << 0) +#define LPDDR3PHY_CTRL_PHY_RESET (1 << 0) +#define LPDDR3PHY_CTRL_PHY_RESET_OFF (0 << 0)/*ZQ Configurations */ #define PHY_CON16_RESET_VAL 0x08000304
@@ -397,9 +398,9 @@#define SET_CTRL_DDR_MODE (x, y) (x = (x & ~(0x3 << 11)) | y << 11)#define PHY_CON1_RESET_VAL 0x9210100 -#define RDLVL_RDDATAPADJ 0x1 -#define SET_RDLVL_RDDATAPADJ ((PHY_CON1_RESET_VAL & ~(0xFFFF << 0))\ - | RDLVL_RDDATAPADJ << 0) +#define RDLVL_RDDATA_ADJ 0x1 +#define SET_RDLVL_RDDATA_ADJ ((PHY_CON1_RESET_VAL & ~(0xFFFF << 0)) \ + | RDLVL_RDDATA_ADJ << 0)#define PHY_CON2_RESET_VAL 0x00010004#define RDLVL_EN (1 << 25)
Signature · 1 line
1.7.2.3
PATCH v2 3/4 SMDK5250: Creating a common file to be used by all variants of DDR
In reply to Hatim AliThe patch creates a common file containing functions which will be used by all variants of DDR.
board/samsung/smdk5250/Makefile +1 -0
@@ -27,6 +27,7 @@ LIB = $(obj)lib$(BOARD).o SOBJS := lowlevel_init.o COBJS := clock_init.o +COBJS += dmc_common.o COBJS += dmc_init_lpddr2.o COBJS += tzpc_init.o
board/samsung/smdk5250/dmc_common.c new file +133 -0
133 lines not on this page · raw message
board/samsung/smdk5250/dmc_init_lpddr2.c +3 -157
182 lines not on this page · raw message
board/samsung/smdk5250/setup.h +6 -0
@@ -28,6 +28,7 @@#include <config.h> #include <version.h> #include <asm/arch/cpu.h> +#include <asm/arch/dmc.h> /* GPIO Offsets for UART: GPIO Contol Register */ #define EXYNOS5_GPIO_A0_CON_OFFSET 0x0
@@ -448,5 +449,10 @@ void sdelay(unsigned long);void mem_ctrl_init (void );void system_clock_init (void );void tzpc_init (void ); +void config_zq (struct exynos5_phy_control *,struct exynos5_phy_control *); +void update_reset_dll (struct exynos5_dmc *); +void config_mrs (struct exynos5_dmc *); +void config_prech (struct exynos5_dmc *); +void config_memory (struct exynos5_dmc *);#endif
Signature · 1 line
1.7.2.3
PATCH v2 4/4 SMDK5250: DDR3: Add memory initialization code for DDR3.
In reply to Hatim AliThe patch adds memory initialization sequence for DDR3 @667Mhz and enables DDR3 memory by default.
board/samsung/smdk5250/Makefile +6 -0
@@ -28,7 +28,13 @@ SOBJS := lowlevel_init.o COBJS := clock_init.o COBJS += dmc_common.o +ifdef CONFIG_DDR3 +COBJS += dmc_init_ddr3.o +else +ifdef CONFIG_LPDDR2 COBJS += dmc_init_lpddr2.o +endif +endif COBJS += tzpc_init.o ifndef CONFIG_SPL_BUILD
board/samsung/smdk5250/dmc_init_ddr3.c new file +276 -0
276 lines not on this page · raw message
board/samsung/smdk5250/setup.h +167 -17
269 lines not on this page · raw message
include/configs/smdk5250.h +6 -0
@@ -37,6 +37,12 @@#define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO +/* Choose DDR Type below: +* Uncomment the type of DDR present on your board +*/ +#define CONFIG_DDR3 +/* #define CONFIG_LPDDR2 */ +/* Keep L2 Cache Disabled */ #define CONFIG_SYS_DCACHE_OFF
Signature · 1 line
1.7.2.3