* Martin Winistoerfer, martinwinistoerfer@gmx.ch.
* Atapted for PATI
* Denis Peter, d.peter@mpl.ch
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier: GPL-2.0+
*/
/***********************************************************************************
**********************************************************************************/
#include <common.h>
+#include <console.h>
#include <mpc5xx.h>
#include <stdio_dev.h>
#include <pci_ids.h>
asm (GEN_SYMNAME(name) " = " GEN_VALUE(value))
+DECLARE_GLOBAL_DATA_PTR;
+
/************************************************************************
* Early debug routines
*/
/*
* Get RAM size.
*/
-phys_size_t initdram(int board_type)
+int dram_init(void)
{
unsigned char board_rev;
unsigned long reg;
/* we have a x32 bit bus to the SDRAM, so shift the addr with 2 */
lmr<<=2;
in32(CONFIG_SYS_SDRAM_BASE + lmr);
- /* ok, we're done, return SDRAM size */
- return ((0x400000 << sdram_table[i].sz)); /* log2 value of 4MByte */
+ /* ok, we're done, set SDRAM size to log2 value of 4MByte*/
+ gd->ram_size = 0x400000 << sdram_table[i].sz;
+
+ return 0;
}
sysconf->sc_sgpiodt2=reg; /* Data register */
}
+int board_early_init_f(void)
+{
+ spi_init_f();
+ return 0;
+}
/****************************************************************
* Last Stage Init
PCICON_SET_REG(PCICON_DBELL_REG,PCIMSG_CON_DATA);
}
-void pci_con_putc(const char c)
+void pci_con_putc(struct stdio_dev *dev, const char c)
{
pci_con_put_it(c);
if(c == '\n')
}
-int pci_con_getc(void)
+int pci_con_getc(struct stdio_dev *dev)
{
int res;
int diff;
return res;
}
-int pci_con_tstc(void)
+int pci_con_tstc(struct stdio_dev *dev)
{
if(r_ptr==(volatile int)w_ptr)
return 0;
return 1;
}
-void pci_con_puts (const char *s)
+void pci_con_puts(struct stdio_dev *dev, const char *s)
{
while (*s) {
pci_con_putc(*s);
irq_install_handler (0x2, (interrupt_handler_t *) pci_dorbell_irq,NULL);
memset (&pci_con_dev, 0, sizeof (pci_con_dev));
strcpy (pci_con_dev.name, "pci_con");
- pci_con_dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
+ pci_con_dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT;
pci_con_dev.putc = pci_con_putc;
pci_con_dev.puts = pci_con_puts;
pci_con_dev.getc = pci_con_getc;