2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2003-12-08 01:34:36 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2000-2003
|
|
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
*
|
2012-03-26 21:49:04 +00:00
|
|
|
* Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved.
|
2003-12-08 01:34:36 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2019-12-28 17:45:06 +00:00
|
|
|
#include <init.h>
|
2020-10-31 03:38:53 +00:00
|
|
|
#include <asm/global_data.h>
|
2007-08-16 01:32:06 +00:00
|
|
|
#include <asm/immap.h>
|
2012-03-26 21:49:04 +00:00
|
|
|
#include <asm/io.h>
|
2003-12-08 01:34:36 +00:00
|
|
|
|
2017-03-31 14:40:25 +00:00
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
2004-02-12 00:47:09 +00:00
|
|
|
|
|
|
|
int checkboard (void) {
|
|
|
|
puts ("Board: ");
|
2007-08-16 01:32:06 +00:00
|
|
|
puts ("Freescale MCF5272C3 EVB\n");
|
2003-12-08 01:34:36 +00:00
|
|
|
return 0;
|
2004-02-12 00:47:09 +00:00
|
|
|
};
|
|
|
|
|
2017-04-06 18:47:05 +00:00
|
|
|
int dram_init(void)
|
2017-03-31 14:40:24 +00:00
|
|
|
{
|
2012-03-26 21:49:04 +00:00
|
|
|
sdramctrl_t * sdp = (sdramctrl_t *)(MMAP_SDRAM);
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2012-03-26 21:49:04 +00:00
|
|
|
out_be16(&sdp->sdram_sdtr, 0xf539);
|
|
|
|
out_be16(&sdp->sdram_sdcr, 0x4211);
|
2004-02-12 00:47:09 +00:00
|
|
|
|
|
|
|
/* Dummy write to start SDRAM */
|
|
|
|
*((volatile unsigned long *)0) = 0;
|
|
|
|
|
2017-03-31 14:40:25 +00:00
|
|
|
gd->ram_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
|
|
|
|
|
|
|
|
return 0;
|
2004-02-12 00:47:09 +00:00
|
|
|
};
|
|
|
|
|
2019-12-28 17:45:06 +00:00
|
|
|
int testdram(void)
|
|
|
|
{
|
2004-02-12 00:47:09 +00:00
|
|
|
/* TODO: XXX XXX XXX */
|
|
|
|
printf ("DRAM test not implemented!\n");
|
2003-12-08 01:34:36 +00:00
|
|
|
|
2004-02-12 00:47:09 +00:00
|
|
|
return (0);
|
2003-12-08 01:34:36 +00:00
|
|
|
}
|