2 * (C) Copyright 2000-2003
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
6 * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
8 * SPDX-License-Identifier: GPL-2.0+
14 #include <asm/immap.h>
17 DECLARE_GLOBAL_DATA_PTR;
22 puts("Freescale FireEngine 5475 EVB\n");
28 siu_t *siu = (siu_t *) (MMAP_SIU);
29 sdram_t *sdram = (sdram_t *)(MMAP_SDRAM);
31 #ifdef CONFIG_SYS_DRAMSZ1
35 out_be32(&siu->drv, CONFIG_SYS_SDRAM_DRVSTRENGTH);
37 dramsize = CONFIG_SYS_DRAMSZ * 0x100000;
38 for (i = 0x13; i < 0x20; i++) {
39 if (dramsize == (1 << i))
43 out_be32(&siu->cs0cfg, CONFIG_SYS_SDRAM_BASE | i);
45 #ifdef CONFIG_SYS_DRAMSZ1
46 temp = CONFIG_SYS_DRAMSZ1 * 0x100000;
47 for (i = 0x13; i < 0x20; i++) {
53 out_be32(&siu->cs1cfg, (CONFIG_SYS_SDRAM_BASE + temp) | i);
56 out_be32(&sdram->cfg1, CONFIG_SYS_SDRAM_CFG1);
57 out_be32(&sdram->cfg2, CONFIG_SYS_SDRAM_CFG2);
60 out_be32(&sdram->ctrl, CONFIG_SYS_SDRAM_CTRL | 2);
63 out_be32(&sdram->mode, CONFIG_SYS_SDRAM_EMOD);
64 out_be32(&sdram->mode, CONFIG_SYS_SDRAM_MODE | 0x04000000);
69 out_be32(&sdram->ctrl, CONFIG_SYS_SDRAM_CTRL | 2);
71 /* Perform two refresh cycles */
72 out_be32(&sdram->ctrl, CONFIG_SYS_SDRAM_CTRL | 4);
73 out_be32(&sdram->ctrl, CONFIG_SYS_SDRAM_CTRL | 4);
75 out_be32(&sdram->mode, CONFIG_SYS_SDRAM_MODE);
77 out_be32(&sdram->ctrl,
78 (CONFIG_SYS_SDRAM_CTRL & ~0x80000000) | 0x10000F00);
82 gd->ram_size = dramsize;
89 /* TODO: XXX XXX XXX */
90 printf("DRAM test not implemented!\n");
95 #if defined(CONFIG_PCI)
97 * Initialize PCI devices, report devices found.
99 static struct pci_controller hose;
100 extern void pci_mcf547x_8x_init(struct pci_controller *hose);
102 void pci_init_board(void)
104 pci_mcf547x_8x_init(&hose);
106 #endif /* CONFIG_PCI */