2005-08-01 14:49:12 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2000-2005
|
|
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2005-08-01 14:49:12 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <asm/processor.h>
|
|
|
|
#include <spd_sdram.h>
|
|
|
|
|
2017-03-31 14:40:25 +00:00
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
2005-08-01 14:49:12 +00:00
|
|
|
int board_early_init_f(void)
|
|
|
|
{
|
|
|
|
/*-------------------------------------------------------------------------+
|
|
|
|
| Interrupt controller setup for the Walnut/Sycamore board.
|
|
|
|
| Note: IRQ 0-15 405GP internally generated; active high; level sensitive
|
|
|
|
| IRQ 16 405GP internally generated; active low; level sensitive
|
|
|
|
| IRQ 17-24 RESERVED
|
|
|
|
| IRQ 25 (EXT IRQ 0) FPGA; active high; level sensitive
|
|
|
|
| IRQ 26 (EXT IRQ 1) SMI; active high; level sensitive
|
|
|
|
| IRQ 27 (EXT IRQ 2) Not Used
|
|
|
|
| IRQ 28 (EXT IRQ 3) PCI SLOT 3; active low; level sensitive
|
|
|
|
| IRQ 29 (EXT IRQ 4) PCI SLOT 2; active low; level sensitive
|
|
|
|
| IRQ 30 (EXT IRQ 5) PCI SLOT 1; active low; level sensitive
|
|
|
|
| IRQ 31 (EXT IRQ 6) PCI SLOT 0; active low; level sensitive
|
|
|
|
| Note for Walnut board:
|
|
|
|
| An interrupt taken for the FPGA (IRQ 25) indicates that either
|
|
|
|
| the Mouse, Keyboard, IRDA, or External Expansion caused the
|
|
|
|
| interrupt. The FPGA must be read to determine which device
|
|
|
|
| caused the interrupt. The default setting of the FPGA clears
|
|
|
|
|
|
|
|
|
+-------------------------------------------------------------------------*/
|
|
|
|
|
2009-09-24 07:55:50 +00:00
|
|
|
mtdcr(UIC0SR, 0xFFFFFFFF); /* clear all ints */
|
|
|
|
mtdcr(UIC0ER, 0x00000000); /* disable all ints */
|
|
|
|
mtdcr(UIC0CR, 0x00000020); /* set all but FPGA SMI to be non-critical */
|
|
|
|
mtdcr(UIC0PR, 0xFFFFFFE0); /* set int polarities */
|
|
|
|
mtdcr(UIC0TR, 0x10000000); /* set int trigger levels */
|
|
|
|
mtdcr(UIC0VCR, 0x00000001); /* set vect base=0,INT0 highest priority */
|
|
|
|
mtdcr(UIC0SR, 0xFFFFFFFF); /* clear all ints */
|
2005-08-01 14:49:12 +00:00
|
|
|
|
|
|
|
/* set UART1 control to select CTS/RTS */
|
|
|
|
#define FPGA_BRDC 0xF0300004
|
|
|
|
*(volatile char *)(FPGA_BRDC) |= 0x1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Check Board Identity:
|
|
|
|
*/
|
|
|
|
int checkboard(void)
|
|
|
|
{
|
2011-05-04 10:32:28 +00:00
|
|
|
char buf[64];
|
|
|
|
int i = getenv_f("serial#", buf, sizeof(buf));
|
2005-08-01 14:49:12 +00:00
|
|
|
uint pvr = get_pvr();
|
|
|
|
|
|
|
|
if (pvr == PVR_405GPR_RB) {
|
|
|
|
puts("Board: Sycamore - AMCC PPC405GPr Evaluation Board");
|
|
|
|
} else {
|
|
|
|
puts("Board: Walnut - AMCC PPC405GP Evaluation Board");
|
|
|
|
}
|
|
|
|
|
2011-05-04 10:32:28 +00:00
|
|
|
if (i > 0) {
|
2005-08-01 14:49:12 +00:00
|
|
|
puts(", serial# ");
|
2011-05-04 10:32:28 +00:00
|
|
|
puts(buf);
|
2005-08-01 14:49:12 +00:00
|
|
|
}
|
|
|
|
putc('\n');
|
|
|
|
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2017-04-06 18:47:05 +00:00
|
|
|
* dram_init() reads EEPROM via I2c. EEPROM contains all of
|
2005-08-01 14:49:12 +00:00
|
|
|
* the necessary info for SDRAM controller configuration
|
|
|
|
*/
|
2017-04-06 18:47:05 +00:00
|
|
|
int dram_init(void)
|
2005-08-01 14:49:12 +00:00
|
|
|
{
|
2017-03-31 14:40:25 +00:00
|
|
|
gd->ram_size = spd_sdram();
|
|
|
|
|
|
|
|
return 0;
|
2005-08-01 14:49:12 +00:00
|
|
|
}
|