aboutsummaryrefslogtreecommitdiff
path: root/board/socrates/socrates.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/socrates/socrates.c')
-rw-r--r--board/socrates/socrates.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/board/socrates/socrates.c b/board/socrates/socrates.c
index cb58994..d791f11 100644
--- a/board/socrates/socrates.c
+++ b/board/socrates/socrates.c
@@ -35,7 +35,11 @@
#include <flash.h>
#include <libfdt.h>
#include <fdt_support.h>
+#include <asm/io.h>
+#if defined(CFG_FPGA_BASE)
+#include "upm_table.h"
+#endif
DECLARE_GLOBAL_DATA_PTR;
extern flash_info_t flash_info[]; /* FLASH chips info */
@@ -45,6 +49,9 @@ ulong flash_get_size (ulong base, int banknum);
int checkboard (void)
{
+ volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
+ char *src;
+ int f;
char *s = getenv("serial#");
puts("Board: Socrates");
@@ -55,8 +62,15 @@ int checkboard (void)
putc('\n');
#ifdef CONFIG_PCI
- printf ("PCI1: 32 bit, %d MHz (compiled)\n",
- CONFIG_SYS_CLK_FREQ / 1000000);
+ /* Check the PCI_clk sel bit */
+ if (in_be32(&gur->porpllsr) & (1<<15)) {
+ src = "SYSCLK";
+ f = CONFIG_SYS_CLK_FREQ;
+ } else {
+ src = "PCI_CLK";
+ f = CONFIG_PCI_CLK_FREQ;
+ }
+ printf ("PCI1: 32 bit, %d MHz (%s)\n", f/1000000, src);
#else
printf ("PCI1: disabled\n");
#endif
@@ -65,7 +79,10 @@ int checkboard (void)
* Initialize local bus.
*/
local_bus_init ();
-
+#if defined(CFG_FPGA_BASE)
+ /* Init UPMA for FPGA access */
+ upmconfig(UPMA, (uint *)UPMTableA, sizeof(UPMTableA)/sizeof(int));
+#endif
return 0;
}
@@ -207,5 +224,15 @@ ft_board_setup(void *blob, bd_t *bd)
if (rc)
printf("Unable to update property NOR mapping, err=%s\n",
fdt_strerror(rc));
+
+#if defined (CFG_FPGA_BASE)
+ memset(val, 0, sizeof(val));
+ val[0] = CFG_FPGA_BASE;
+ rc = fdt_find_and_setprop(blob, "/localbus/fpga", "virtual-reg",
+ val, sizeof(val), 1);
+ if (rc)
+ printf("Unable to update property \"fpga\", err=%s\n",
+ fdt_strerror(rc));
+#endif
}
#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */