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