2 * (C) Copyright 2000-2003
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * Copyright (C) 2004-2008, 2012 Freescale Semiconductor, Inc.
6 * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
8 * SPDX-License-Identifier: GPL-2.0+
13 #include <asm/immap.h>
16 DECLARE_GLOBAL_DATA_PTR;
21 puts("Freescale M53017EVB\n");
27 sdram_t *sdram = (sdram_t *)(MMAP_SDRAM);
30 dramsize = CONFIG_SYS_SDRAM_SIZE * 0x100000;
32 for (i = 0x13; i < 0x20; i++) {
33 if (dramsize == (1 << i))
38 out_be32(&sdram->cs0, CONFIG_SYS_SDRAM_BASE | i);
39 #ifdef CONFIG_SYS_SDRAM_BASE1
40 out_be32(&sdram->cs1, CONFIG_SYS_SDRAM_BASE | i);
42 out_be32(&sdram->cfg1, CONFIG_SYS_SDRAM_CFG1);
43 out_be32(&sdram->cfg2, CONFIG_SYS_SDRAM_CFG2);
48 out_be32(&sdram->ctrl, CONFIG_SYS_SDRAM_CTRL | 2);
51 /* Perform two refresh cycles */
52 out_be32(&sdram->ctrl, CONFIG_SYS_SDRAM_CTRL | 4);
53 out_be32(&sdram->ctrl, CONFIG_SYS_SDRAM_CTRL | 4);
57 out_be32(&sdram->mode, CONFIG_SYS_SDRAM_MODE);
59 out_be32(&sdram->mode, CONFIG_SYS_SDRAM_EMOD);
62 out_be32(&sdram->ctrl, CONFIG_SYS_SDRAM_CTRL | 2);
65 out_be32(&sdram->ctrl,
66 (CONFIG_SYS_SDRAM_CTRL & ~0x80000000) | 0x10000c00);
71 gd->ram_size = dramsize;
78 /* TODO: XXX XXX XXX */
79 printf("DRAM test not implemented!\n");