Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
wdenk | abf7a7c | 2003-12-08 01:34:36 +0000 | [diff] [blame] | 2 | /* |
3 | * (C) Copyright 2000-2003 | ||||
4 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | ||||
5 | * | ||||
Alison Wang | 95bed1f | 2012-03-26 21:49:04 +0000 | [diff] [blame] | 6 | * Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved. |
wdenk | abf7a7c | 2003-12-08 01:34:36 +0000 | [diff] [blame] | 7 | */ |
8 | |||||
Tom Rini | af02676 | 2024-04-30 20:41:48 -0600 | [diff] [blame] | 9 | #include <config.h> |
Simon Glass | 0ffd9db | 2019-12-28 10:45:06 -0700 | [diff] [blame] | 10 | #include <init.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 11 | #include <asm/global_data.h> |
TsiChungLiew | 1692b48 | 2007-08-15 20:32:06 -0500 | [diff] [blame] | 12 | #include <asm/immap.h> |
Alison Wang | 95bed1f | 2012-03-26 21:49:04 +0000 | [diff] [blame] | 13 | #include <asm/io.h> |
wdenk | abf7a7c | 2003-12-08 01:34:36 +0000 | [diff] [blame] | 14 | |
Simon Glass | 39f90ba | 2017-03-31 08:40:25 -0600 | [diff] [blame] | 15 | DECLARE_GLOBAL_DATA_PTR; |
wdenk | e65527f | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 16 | |
17 | int checkboard (void) { | ||||
18 | puts ("Board: "); | ||||
TsiChungLiew | 1692b48 | 2007-08-15 20:32:06 -0500 | [diff] [blame] | 19 | puts ("Freescale MCF5272C3 EVB\n"); |
wdenk | abf7a7c | 2003-12-08 01:34:36 +0000 | [diff] [blame] | 20 | return 0; |
wdenk | e65527f | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 21 | }; |
22 | |||||
Simon Glass | d35f338 | 2017-04-06 12:47:05 -0600 | [diff] [blame] | 23 | int dram_init(void) |
Simon Glass | b4de3f3 | 2017-03-31 08:40:24 -0600 | [diff] [blame] | 24 | { |
Alison Wang | 95bed1f | 2012-03-26 21:49:04 +0000 | [diff] [blame] | 25 | sdramctrl_t * sdp = (sdramctrl_t *)(MMAP_SDRAM); |
wdenk | e65527f | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 26 | |
Alison Wang | 95bed1f | 2012-03-26 21:49:04 +0000 | [diff] [blame] | 27 | out_be16(&sdp->sdram_sdtr, 0xf539); |
28 | out_be16(&sdp->sdram_sdcr, 0x4211); | ||||
wdenk | e65527f | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 29 | |
30 | /* Dummy write to start SDRAM */ | ||||
31 | *((volatile unsigned long *)0) = 0; | ||||
32 | |||||
Tom Rini | bb4dd96 | 2022-11-16 13:10:37 -0500 | [diff] [blame] | 33 | gd->ram_size = CFG_SYS_SDRAM_SIZE * 1024 * 1024; |
Simon Glass | 39f90ba | 2017-03-31 08:40:25 -0600 | [diff] [blame] | 34 | |
35 | return 0; | ||||
wdenk | e65527f | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 36 | }; |
37 | |||||
Simon Glass | 0ffd9db | 2019-12-28 10:45:06 -0700 | [diff] [blame] | 38 | int testdram(void) |
39 | { | ||||
wdenk | e65527f | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 40 | /* TODO: XXX XXX XXX */ |
41 | printf ("DRAM test not implemented!\n"); | ||||
wdenk | abf7a7c | 2003-12-08 01:34:36 +0000 | [diff] [blame] | 42 | |
wdenk | e65527f | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 43 | return (0); |
wdenk | abf7a7c | 2003-12-08 01:34:36 +0000 | [diff] [blame] | 44 | } |