2 * (C) Copyright 2003-2004
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 * Mark Jonas, Freescale Semiconductor, mark.jonas@freescale.com.
8 * See file CREDITS for list of people who contributed to this
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of
14 * the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
33 #if CONFIG_TOTAL5200_REV==2
34 #include "mt48lc32m16a2-75.h"
36 #include "mt48lc16m16a2-75.h"
39 long int initdram (int board_type)
41 sdram_conf_t sdram_conf;
43 sdram_conf.ddr = SDRAM_DDR;
44 sdram_conf.mode = SDRAM_MODE;
46 sdram_conf.control = SDRAM_CONTROL;
47 sdram_conf.config1 = SDRAM_CONFIG1;
48 sdram_conf.config2 = SDRAM_CONFIG2;
49 #if defined(CONFIG_MPC5200)
50 sdram_conf.tapdelay = 0;
52 #if defined(CONFIG_MGT5100)
53 sdram_conf.addrsel = SDRAM_ADDRSEL;
55 return mpc5xxx_sdram_init (&sdram_conf);
60 #if defined(CONFIG_MPC5200)
61 #if CONFIG_TOTAL5200_REV==2
62 puts ("Board: Total5200 Rev.2 ");
64 puts ("Board: Total5200 ");
66 #elif defined(CONFIG_MGT5100)
67 puts ("Board: Total5100 ");
71 * Retrieve FPGA Revision.
73 printf ("(FPGA %08X)\n", *(vu_long *) (CFG_FPGA_BASE + 0x400));
76 * Take all peripherals in power-up mode.
78 #if CONFIG_TOTAL5200_REV==2
79 *(vu_char *) (CFG_CPLD_BASE + 0x46) = 0x70;
81 *(vu_long *) (CFG_CPLD_BASE + 0x400) = 0x70;
87 #if defined(CONFIG_MGT5100)
88 int board_early_init_r(void)
91 * Now, when we are in RAM, enable CS0
92 * because CS_BOOT cannot be written.
94 *(vu_long *)MPC5XXX_ADDECR &= ~(1 << 25); /* disable CS_BOOT */
95 *(vu_long *)MPC5XXX_ADDECR |= (1 << 16); /* enable CS0 */
102 static struct pci_controller hose;
104 extern void pci_mpc5xxx_init(struct pci_controller *);
106 void pci_init_board(void)
108 pci_mpc5xxx_init(&hose);
112 #if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
114 /* IRDA_1 aka PSC6_3 (pin C13) */
115 #define GPIO_IRDA_1 0x20000000UL
117 void init_ide_reset (void)
119 debug ("init_ide_reset\n");
121 /* Configure IRDA_1 (PSC6_3) as GPIO output for ATA reset */
122 *(vu_long *) MPC5XXX_GPIO_ENABLE |= GPIO_IRDA_1;
123 *(vu_long *) MPC5XXX_GPIO_DIR |= GPIO_IRDA_1;
126 void ide_set_reset (int idereset)
128 debug ("ide_reset(%d)\n", idereset);
131 *(vu_long *) MPC5XXX_GPIO_DATA_O &= ~GPIO_IRDA_1;
133 *(vu_long *) MPC5XXX_GPIO_DATA_O |= GPIO_IRDA_1;
136 #endif /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */