blob: aa6d45f0f8af310e8442755cc2a1642863e4a8a1 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Hao Zhangc13cbcf2014-10-22 16:32:33 +03002/*
3 * Keystone2: DDR3 initialization
4 *
5 * (C) Copyright 2014
6 * Texas Instruments Incorporated, <www.ti.com>
Hao Zhangc13cbcf2014-10-22 16:32:33 +03007 */
8
Hao Zhangc13cbcf2014-10-22 16:32:33 +03009#include "ddr3_cfg.h"
10#include <asm/arch/ddr3.h>
11
Hao Zhangc13cbcf2014-10-22 16:32:33 +030012static struct pll_init_data ddr3_400 = DDR3_PLL_400;
13
Vitaly Andrianova9554d62015-02-11 14:07:58 -050014u32 ddr3_init(void)
Hao Zhangc13cbcf2014-10-22 16:32:33 +030015{
16 init_pll(&ddr3_400);
17
18 /* No SO-DIMM, 2GB discreet DDR */
19 printf("DRAM: 2 GiB\n");
Hao Zhangc13cbcf2014-10-22 16:32:33 +030020
21 /* Reset DDR3 PHY after PLL enabled */
22 ddr3_reset_ddrphy();
23
24 ddr3_init_ddrphy(KS2_DDR3A_DDRPHYC, &ddr3phy_1600_2g);
25 ddr3_init_ddremif(KS2_DDR3A_EMIF_CTRL_BASE, &ddr3_1600_2g);
Hao Zhangc13cbcf2014-10-22 16:32:33 +030026
Vitaly Andrianova9554d62015-02-11 14:07:58 -050027 return 2;
Hao Zhangc13cbcf2014-10-22 16:32:33 +030028}