blob: efff465d0ff995a0b9a7ee8ddae0a31ccb314b34 [file] [log] [blame]
wdenk4e5ca3e2003-12-08 01:34:36 +00001/*
2 * (C) Copyright 2000-2003
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 *
Alison Wang32dbaaf2012-03-26 21:49:04 +00005 * Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved.
6 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02007 * SPDX-License-Identifier: GPL-2.0+
wdenk4e5ca3e2003-12-08 01:34:36 +00008 */
9
10#include <common.h>
TsiChungLiewf28e1bd2007-08-15 20:32:06 -050011#include <asm/immap.h>
Alison Wang32dbaaf2012-03-26 21:49:04 +000012#include <asm/io.h>
wdenk4e5ca3e2003-12-08 01:34:36 +000013
Simon Glass088454c2017-03-31 08:40:25 -060014DECLARE_GLOBAL_DATA_PTR;
wdenkbf9e3b32004-02-12 00:47:09 +000015
16int checkboard (void) {
17 puts ("Board: ");
TsiChungLiewf28e1bd2007-08-15 20:32:06 -050018 puts ("Freescale MCF5272C3 EVB\n");
wdenk4e5ca3e2003-12-08 01:34:36 +000019 return 0;
wdenkbf9e3b32004-02-12 00:47:09 +000020 };
wdenk4e5ca3e2003-12-08 01:34:36 +000021
Simon Glassf1683aa2017-04-06 12:47:05 -060022int dram_init(void)
Simon Glass52c41182017-03-31 08:40:24 -060023{
Alison Wang32dbaaf2012-03-26 21:49:04 +000024 sdramctrl_t * sdp = (sdramctrl_t *)(MMAP_SDRAM);
wdenkbf9e3b32004-02-12 00:47:09 +000025
Alison Wang32dbaaf2012-03-26 21:49:04 +000026 out_be16(&sdp->sdram_sdtr, 0xf539);
27 out_be16(&sdp->sdram_sdcr, 0x4211);
wdenkbf9e3b32004-02-12 00:47:09 +000028
29 /* Dummy write to start SDRAM */
30 *((volatile unsigned long *)0) = 0;
31
Simon Glass088454c2017-03-31 08:40:25 -060032 gd->ram_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
33
34 return 0;
wdenkbf9e3b32004-02-12 00:47:09 +000035 };
36
37int testdram (void) {
38 /* TODO: XXX XXX XXX */
39 printf ("DRAM test not implemented!\n");
40
41 return (0);
wdenk4e5ca3e2003-12-08 01:34:36 +000042}