blob: 3c20a23385c5dcf6395e9179544419479bc35406 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
wdenk4e5ca3e2003-12-08 01:34:36 +00002/*
3 * (C) Copyright 2000-2003
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 *
Alison Wang32dbaaf2012-03-26 21:49:04 +00006 * Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved.
wdenk4e5ca3e2003-12-08 01:34:36 +00007 */
8
9#include <common.h>
Simon Glass49acd562019-12-28 10:45:06 -070010#include <init.h>
Simon Glass401d1c42020-10-30 21:38:53 -060011#include <asm/global_data.h>
TsiChungLiewf28e1bd2007-08-15 20:32:06 -050012#include <asm/immap.h>
Alison Wang32dbaaf2012-03-26 21:49:04 +000013#include <asm/io.h>
wdenk4e5ca3e2003-12-08 01:34:36 +000014
Simon Glass088454c2017-03-31 08:40:25 -060015DECLARE_GLOBAL_DATA_PTR;
wdenkbf9e3b32004-02-12 00:47:09 +000016
17int checkboard (void) {
18 puts ("Board: ");
TsiChungLiewf28e1bd2007-08-15 20:32:06 -050019 puts ("Freescale MCF5272C3 EVB\n");
wdenk4e5ca3e2003-12-08 01:34:36 +000020 return 0;
wdenkbf9e3b32004-02-12 00:47:09 +000021 };
wdenk4e5ca3e2003-12-08 01:34:36 +000022
Simon Glassf1683aa2017-04-06 12:47:05 -060023int dram_init(void)
Simon Glass52c41182017-03-31 08:40:24 -060024{
Alison Wang32dbaaf2012-03-26 21:49:04 +000025 sdramctrl_t * sdp = (sdramctrl_t *)(MMAP_SDRAM);
wdenkbf9e3b32004-02-12 00:47:09 +000026
Alison Wang32dbaaf2012-03-26 21:49:04 +000027 out_be16(&sdp->sdram_sdtr, 0xf539);
28 out_be16(&sdp->sdram_sdcr, 0x4211);
wdenkbf9e3b32004-02-12 00:47:09 +000029
30 /* Dummy write to start SDRAM */
31 *((volatile unsigned long *)0) = 0;
32
Tom Riniaa6e94d2022-11-16 13:10:37 -050033 gd->ram_size = CFG_SYS_SDRAM_SIZE * 1024 * 1024;
Simon Glass088454c2017-03-31 08:40:25 -060034
35 return 0;
wdenkbf9e3b32004-02-12 00:47:09 +000036 };
37
Simon Glass49acd562019-12-28 10:45:06 -070038int testdram(void)
39{
wdenkbf9e3b32004-02-12 00:47:09 +000040 /* TODO: XXX XXX XXX */
41 printf ("DRAM test not implemented!\n");
42
43 return (0);
wdenk4e5ca3e2003-12-08 01:34:36 +000044}