1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2000-2003
6 * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
14 #include <asm/immap.h>
16 #include <linux/delay.h>
18 DECLARE_GLOBAL_DATA_PTR;
23 puts("Freescale FireEngine 5475 EVB\n");
29 siu_t *siu = (siu_t *) (MMAP_SIU);
30 sdram_t *sdram = (sdram_t *)(MMAP_SDRAM);
32 #ifdef CONFIG_SYS_DRAMSZ1
36 out_be32(&siu->drv, CONFIG_SYS_SDRAM_DRVSTRENGTH);
38 dramsize = CONFIG_SYS_DRAMSZ * 0x100000;
39 for (i = 0x13; i < 0x20; i++) {
40 if (dramsize == (1 << i))
44 out_be32(&siu->cs0cfg, CONFIG_SYS_SDRAM_BASE | i);
46 #ifdef CONFIG_SYS_DRAMSZ1
47 temp = CONFIG_SYS_DRAMSZ1 * 0x100000;
48 for (i = 0x13; i < 0x20; i++) {
54 out_be32(&siu->cs1cfg, (CONFIG_SYS_SDRAM_BASE + temp) | i);
57 out_be32(&sdram->cfg1, CONFIG_SYS_SDRAM_CFG1);
58 out_be32(&sdram->cfg2, CONFIG_SYS_SDRAM_CFG2);
61 out_be32(&sdram->ctrl, CONFIG_SYS_SDRAM_CTRL | 2);
64 out_be32(&sdram->mode, CONFIG_SYS_SDRAM_EMOD);
65 out_be32(&sdram->mode, CONFIG_SYS_SDRAM_MODE | 0x04000000);
70 out_be32(&sdram->ctrl, CONFIG_SYS_SDRAM_CTRL | 2);
72 /* Perform two refresh cycles */
73 out_be32(&sdram->ctrl, CONFIG_SYS_SDRAM_CTRL | 4);
74 out_be32(&sdram->ctrl, CONFIG_SYS_SDRAM_CTRL | 4);
76 out_be32(&sdram->mode, CONFIG_SYS_SDRAM_MODE);
78 out_be32(&sdram->ctrl,
79 (CONFIG_SYS_SDRAM_CTRL & ~0x80000000) | 0x10000F00);
83 gd->ram_size = dramsize;
90 /* TODO: XXX XXX XXX */
91 printf("DRAM test not implemented!\n");
96 #if defined(CONFIG_PCI)
98 * Initialize PCI devices, report devices found.
100 static struct pci_controller hose;
101 extern void pci_mcf547x_8x_init(struct pci_controller *hose);
103 void pci_init_board(void)
105 pci_mcf547x_8x_init(&hose);
107 #endif /* CONFIG_PCI */