wdenk | 4e5ca3e | 2003-12-08 01:34:36 +0000 | [diff] [blame] | 1 | /* |
2 | * (C) Copyright 2000-2003 | ||||
3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | ||||
4 | * | ||||
Alison Wang | 32dbaaf | 2012-03-26 21:49:04 +0000 | [diff] [blame] | 5 | * Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved. |
6 | * | ||||
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 7 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | 4e5ca3e | 2003-12-08 01:34:36 +0000 | [diff] [blame] | 8 | */ |
9 | |||||
10 | #include <common.h> | ||||
TsiChungLiew | f28e1bd | 2007-08-15 20:32:06 -0500 | [diff] [blame] | 11 | #include <asm/immap.h> |
Alison Wang | 32dbaaf | 2012-03-26 21:49:04 +0000 | [diff] [blame] | 12 | #include <asm/io.h> |
wdenk | 4e5ca3e | 2003-12-08 01:34:36 +0000 | [diff] [blame] | 13 | |
Simon Glass | 088454c | 2017-03-31 08:40:25 -0600 | [diff] [blame] | 14 | DECLARE_GLOBAL_DATA_PTR; |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 15 | |
16 | int checkboard (void) { | ||||
17 | puts ("Board: "); | ||||
TsiChungLiew | f28e1bd | 2007-08-15 20:32:06 -0500 | [diff] [blame] | 18 | puts ("Freescale MCF5272C3 EVB\n"); |
wdenk | 4e5ca3e | 2003-12-08 01:34:36 +0000 | [diff] [blame] | 19 | return 0; |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 20 | }; |
wdenk | 4e5ca3e | 2003-12-08 01:34:36 +0000 | [diff] [blame] | 21 | |
Simon Glass | 088454c | 2017-03-31 08:40:25 -0600 | [diff] [blame] | 22 | int initdram(void) |
Simon Glass | 52c4118 | 2017-03-31 08:40:24 -0600 | [diff] [blame] | 23 | { |
Alison Wang | 32dbaaf | 2012-03-26 21:49:04 +0000 | [diff] [blame] | 24 | sdramctrl_t * sdp = (sdramctrl_t *)(MMAP_SDRAM); |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 25 | |
Alison Wang | 32dbaaf | 2012-03-26 21:49:04 +0000 | [diff] [blame] | 26 | out_be16(&sdp->sdram_sdtr, 0xf539); |
27 | out_be16(&sdp->sdram_sdcr, 0x4211); | ||||
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 28 | |
29 | /* Dummy write to start SDRAM */ | ||||
30 | *((volatile unsigned long *)0) = 0; | ||||
31 | |||||
Simon Glass | 088454c | 2017-03-31 08:40:25 -0600 | [diff] [blame] | 32 | gd->ram_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; |
33 | |||||
34 | return 0; | ||||
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 35 | }; |
36 | |||||
37 | int testdram (void) { | ||||
38 | /* TODO: XXX XXX XXX */ | ||||
39 | printf ("DRAM test not implemented!\n"); | ||||
40 | |||||
41 | return (0); | ||||
wdenk | 4e5ca3e | 2003-12-08 01:34:36 +0000 | [diff] [blame] | 42 | } |