blob: 1017ef0c2a538ae6b0226113bb639cc7ff132b78 [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
9#include <common.h>
Simon Glass0ffd9db2019-12-28 10:45:06 -070010#include <init.h>
TsiChungLiew1692b482007-08-15 20:32:06 -050011#include <asm/immap.h>
Alison Wang95bed1f2012-03-26 21:49:04 +000012#include <asm/io.h>
wdenkabf7a7c2003-12-08 01:34:36 +000013
Simon Glass39f90ba2017-03-31 08:40:25 -060014DECLARE_GLOBAL_DATA_PTR;
wdenke65527f2004-02-12 00:47:09 +000015
16int checkboard (void) {
17 puts ("Board: ");
TsiChungLiew1692b482007-08-15 20:32:06 -050018 puts ("Freescale MCF5272C3 EVB\n");
wdenkabf7a7c2003-12-08 01:34:36 +000019 return 0;
wdenke65527f2004-02-12 00:47:09 +000020 };
21
Simon Glassd35f3382017-04-06 12:47:05 -060022int dram_init(void)
Simon Glassb4de3f32017-03-31 08:40:24 -060023{
Alison Wang95bed1f2012-03-26 21:49:04 +000024 sdramctrl_t * sdp = (sdramctrl_t *)(MMAP_SDRAM);
wdenke65527f2004-02-12 00:47:09 +000025
Alison Wang95bed1f2012-03-26 21:49:04 +000026 out_be16(&sdp->sdram_sdtr, 0xf539);
27 out_be16(&sdp->sdram_sdcr, 0x4211);
wdenke65527f2004-02-12 00:47:09 +000028
29 /* Dummy write to start SDRAM */
30 *((volatile unsigned long *)0) = 0;
31
Simon Glass39f90ba2017-03-31 08:40:25 -060032 gd->ram_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
33
34 return 0;
wdenke65527f2004-02-12 00:47:09 +000035 };
36
Simon Glass0ffd9db2019-12-28 10:45:06 -070037int testdram(void)
38{
wdenke65527f2004-02-12 00:47:09 +000039 /* TODO: XXX XXX XXX */
40 printf ("DRAM test not implemented!\n");
wdenkabf7a7c2003-12-08 01:34:36 +000041
wdenke65527f2004-02-12 00:47:09 +000042 return (0);
wdenkabf7a7c2003-12-08 01:34:36 +000043}