wdenk | abf7a7c | 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 | 95bed1f | 2012-03-26 21:49:04 +0000 | [diff] [blame] | 5 | * Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved. |
6 | * | ||||
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 7 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | abf7a7c | 2003-12-08 01:34:36 +0000 | [diff] [blame] | 8 | */ |
9 | |||||
10 | #include <common.h> | ||||
TsiChungLiew | 1692b48 | 2007-08-15 20:32:06 -0500 | [diff] [blame] | 11 | #include <asm/immap.h> |
Alison Wang | 95bed1f | 2012-03-26 21:49:04 +0000 | [diff] [blame] | 12 | #include <asm/io.h> |
wdenk | abf7a7c | 2003-12-08 01:34:36 +0000 | [diff] [blame] | 13 | |
wdenk | e65527f | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 14 | |
15 | int checkboard (void) { | ||||
16 | puts ("Board: "); | ||||
TsiChungLiew | 1692b48 | 2007-08-15 20:32:06 -0500 | [diff] [blame] | 17 | puts ("Freescale MCF5272C3 EVB\n"); |
wdenk | abf7a7c | 2003-12-08 01:34:36 +0000 | [diff] [blame] | 18 | return 0; |
wdenk | e65527f | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 19 | }; |
20 | |||||
Becky Bruce | bd99ae7 | 2008-06-09 16:03:40 -0500 | [diff] [blame] | 21 | phys_size_t initdram (int board_type) { |
Alison Wang | 95bed1f | 2012-03-26 21:49:04 +0000 | [diff] [blame] | 22 | sdramctrl_t * sdp = (sdramctrl_t *)(MMAP_SDRAM); |
wdenk | e65527f | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 23 | |
Alison Wang | 95bed1f | 2012-03-26 21:49:04 +0000 | [diff] [blame] | 24 | out_be16(&sdp->sdram_sdtr, 0xf539); |
25 | out_be16(&sdp->sdram_sdcr, 0x4211); | ||||
wdenk | e65527f | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 26 | |
27 | /* Dummy write to start SDRAM */ | ||||
28 | *((volatile unsigned long *)0) = 0; | ||||
29 | |||||
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 30 | return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; |
wdenk | e65527f | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 31 | }; |
32 | |||||
33 | int testdram (void) { | ||||
34 | /* TODO: XXX XXX XXX */ | ||||
35 | printf ("DRAM test not implemented!\n"); | ||||
wdenk | abf7a7c | 2003-12-08 01:34:36 +0000 | [diff] [blame] | 36 | |
wdenk | e65527f | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 37 | return (0); |
wdenk | abf7a7c | 2003-12-08 01:34:36 +0000 | [diff] [blame] | 38 | } |