Merge tag 'dm-pull-26jul22' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm.git
[platform/kernel/u-boot.git] / board / freescale / m5272c3 / m5272c3.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * (C) Copyright 2000-2003
4  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5  *
6  * Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved.
7  */
8
9 #include <common.h>
10 #include <init.h>
11 #include <asm/global_data.h>
12 #include <asm/immap.h>
13 #include <asm/io.h>
14
15 DECLARE_GLOBAL_DATA_PTR;
16
17 int checkboard (void) {
18         puts ("Board: ");
19         puts ("Freescale MCF5272C3 EVB\n");
20         return 0;
21         };
22
23 int dram_init(void)
24 {
25         sdramctrl_t * sdp = (sdramctrl_t *)(MMAP_SDRAM);
26
27         out_be16(&sdp->sdram_sdtr, 0xf539);
28         out_be16(&sdp->sdram_sdcr, 0x4211);
29
30         /* Dummy write to start SDRAM */
31         *((volatile unsigned long *)0) = 0;
32
33         gd->ram_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
34
35         return 0;
36         };
37
38 int testdram(void)
39 {
40         /* TODO: XXX XXX XXX */
41         printf ("DRAM test not implemented!\n");
42
43         return (0);
44 }