[U-Boot-Users] [PATCH 01/08] Socrates: Fixed PCI bus frequency report.

Wolfgang Denk wd at denx.de
Fri Jun 6 15:42:38 CEST 2008


From: Sergei Poselenov <sposelenov at emcraft.com>

Signed-off-by: Sergei Poselenov <sposelenov at emcraft.com>
---
 board/socrates/socrates.c  |   15 +++++++++++++--
 include/configs/socrates.h |    3 ++-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/board/socrates/socrates.c b/board/socrates/socrates.c
index cb58994..0c61311 100644
--- a/board/socrates/socrates.c
+++ b/board/socrates/socrates.c
@@ -35,6 +35,7 @@
 #include <flash.h>
 #include <libfdt.h>
 #include <fdt_support.h>
+#include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -45,6 +46,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 +59,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
diff --git a/include/configs/socrates.h b/include/configs/socrates.h
index 23ed87f..6dc9eff 100644
--- a/include/configs/socrates.h
+++ b/include/configs/socrates.h
@@ -227,7 +227,8 @@
  */
 #define CFG_PCI_PHYS		0x80000000	/* 1G PCI TLB */
 
-
+/* PCI is clocked by the external source at 33 MHz */
+#define CONFIG_PCI_CLK_FREQ	33000000
 #define CFG_PCI1_MEM_BASE	0x80000000
 #define CFG_PCI1_MEM_PHYS	CFG_PCI1_MEM_BASE
 #define CFG_PCI1_MEM_SIZE	0x20000000	/* 512M			*/
-- 
1.5.4.2





More information about the U-Boot mailing list