Skip to contentSkip to conversation

From: Sergei Poselenov <[email protected]>

U-Boot-Users Wolfgang Denk 5 participants 8 messages May 27, 2008 – Jun 4, 2008

lore
Share & tools
lore
#0 lore raw
---
 board/socrates/socrates.c  |   13 +++++++++++--
 include/configs/socrates.h |    3 ++-
 2 files changed, 13 insertions(+), 3 deletions(-)
board/socrates/socrates.c +11 -2
index cb58994..15c6478 100644
@@ -45,6 +45,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 +58,14 @@ int checkboard (void)
 	putc('\n');
 
 #ifdef CONFIG_PCI
-	printf ("PCI1:  32 bit, %d MHz (compiled)\n",
-		CONFIG_SYS_CLK_FREQ / 1000000);
+	if (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
include/configs/socrates.h +2 -1
index 00c0dab..028a772 100644
@@ -227,7 +227,8 @@
  */
 #define CFG_PCI_PHYS		0x80000000	/* 1G PCI TLB */
 
-
+/* PCI is clocked by the external source@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			*/
Signature · 1 line
1.5.4.2
#1 lore raw
Quoted 5 lines · Wolfgang Denk
---
 board/socrates/socrates.c  |   13 +++++++++++--
 include/configs/socrates.h |    3 ++-
 2 files changed, 13 insertions(+), 3 deletions(-)

Better subject line, please?

Thanks,
gvb

#3 lore raw
In reply to Wolfgang Denk
Quoted 21 lines · Wolfgang Denk
---
 board/socrates/socrates.c  |   13 +++++++++++--
 include/configs/socrates.h |    3 ++-
 2 files changed, 13 insertions(+), 3 deletions(-)
board/socrates/socrates.c +3 -0
index cb58994..15c6478 100644
@@ -45,6 +45,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");

board/socrates/socrates.c int checkboard (void) · line 61

Quoted 6 lines
board/socrates/socrates.c +1 -2
@@ -55,8 +58,14 @@ int checkboard (void)
 	putc('\n');
 
 #ifdef CONFIG_PCI
-	printf ("PCI1:  32 bit, %d MHz (compiled)\n",
-		CONFIG_SYS_CLK_FREQ / 1000000);
+	if (gur->porpllsr & (1<<15)) {

Please don't use pointer access for such SoC registers. in_be32() is recommended here.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================

#2 lore raw
In reply to Jerry Van Baren
Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 5 lines · Wolfgang Denk
---
 board/socrates/socrates.c  |   13 +++++++++++--
 include/configs/socrates.h |    3 ++-
 2 files changed, 13 insertions(+), 3 deletions(-)

Better subject line, please?

Yes, of course. That was a problem with git-send-email, and I didn't try --dry-run first:

-> git-send-email --dry-run --from 'Wolfgang Denk <[email protected]>' -to u-boot-users at lists.sourceforge.net /tmp/patch
/tmp/patch
(non-mbox) Adding cc: >From ff94ec343d1259286d0ae49c71d19adb9c3c2ea2 Mon Sep 17 00:00:00 2001 from line '>From ff94ec343d1259286d0ae49c71d19adb9c3c2ea2 Mon Sep 17 00:00:00 2001' (sob) Adding cc: Sergei Poselenov <[email protected]> from line 'Signed-off-by: Sergei Poselenov <[email protected]>
'
Use of uninitialized value in string eq at /usr/bin/git-send-email line 575.
W: unable to extract a valid address from: >From ff94ec343d1259286d0ae49c71d19adb9c3c2ea2 Mon Sep 17 00:00:00 2001
W: unable to extract a valid address from: >From ff94ec343d1259286d0ae49c71d19adb9c3c2ea2 Mon Sep 17 00:00:00 2001
Dry-OK. Log says:
Sendmail: /usr/sbin/sendmail -i u-boot-users at lists.sourceforge.net sposelenov at emcraft.com
From: Wolfgang Denk <[email protected]>
To: u-boot-users at lists.sourceforge.net
Cc: Sergei Poselenov <[email protected]>
Subject: From: Sergei Poselenov <[email protected]>
...

But to me the patch looks not too bad:

| >From ff94ec343d1259286d0ae49c71d19adb9c3c2ea2 Mon Sep 17 00:00:00 2001
| From: Sergei Poselenov <[email protected]>
| Date: Tue, 27 May 2008 13:47:00 +0200
| Subject: [PATCH] Socrates: Fix PCI bus frequency report
| 
| Signed-off-by: Sergei Poselenov <[email protected]>
| ...

Seems git-send-email barfs on the ">From' line :-(

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
My brother sent me a postcard the other day with this  big  sattelite
photo  of the entire earth on it. On the back it said: "Wish you were
here".                                                - Steven Wright
#4 lore raw
In reply to Stefan Roese

Hello Stefan,

Quoted 24 lines · Stefan Roese
Quoted 23 lines · Wolfgang Denk
---
 board/socrates/socrates.c  |   13 +++++++++++--
 include/configs/socrates.h |    3 ++-
 2 files changed, 13 insertions(+), 3 deletions(-)
board/socrates/socrates.c +3 -0
index cb58994..15c6478 100644
@@ -45,6 +45,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 +58,14 @@ int checkboard (void)
 	putc('\n');
 
Quoted 8 lines

board/socrates/socrates.c int checkboard (void) · line 61

Quoted 4 lines
board/socrates/socrates.c +1 -2
 #ifdef CONFIG_PCI
-	printf ("PCI1:  32 bit, %d MHz (compiled)\n",
-		CONFIG_SYS_CLK_FREQ / 1000000);
+	if (gur->porpllsr & (1<<15)) {

Please don't use pointer access for such SoC registers. in_be32() is recommended here.

What is the reason for doing this? Compiler issues? I see the direct pointer addressing is used all over the 85xx code.

Regards,
Sergei

Quoted 9 lines

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#5 lore raw

Hi Sergei,

Quoted 7 lines · Sergei Poselenov
Quoted 4 lines

board/socrates/socrates.c int checkboard (void) · line 61

Quoted 1 line
board/socrates/socrates.c +1 -0
+	if (gur->porpllsr & (1<<15)) {

Please don't use pointer access for such SoC registers. in_be32() is recommended here.

What is the reason for doing this? Compiler issues? I see the direct pointer addressing is used all over the 85xx code.

Yes, I just noticed that these registers are accessed this way on (all?) MPC85xx boards. So it is perhaps not a problem with these registers. Not sure though, since I'm no MPC85xx expert. Perhaps somebody from FSL can comment here.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#6 lore raw
Quoted 3 lines · Stefan Roese
Quoted 2 lines · Sergei Poselenov

What is the reason for doing this? Compiler issues? I see the direct pointer addressing is used all over the 85xx code.

Either the compiler or the hardware could reorder direct accesses.

Quoted 4 lines

Yes, I just noticed that these registers are accessed this way on (all?) MPC85xx boards. So it is perhaps not a problem with these registers. Not sure though, since I'm no MPC85xx expert. Perhaps somebody from FSL can comment here.

The accessors should be used; please don't copy bad examples. :-)

-Scott

#7 lore raw
In reply to Wolfgang Denk
Quoted 5 lines · In message <[email protected]> you wrote:
---
 board/socrates/socrates.c  |   13 +++++++++++--
 include/configs/socrates.h |    3 ++-
 2 files changed, 13 insertions(+), 3 deletions(-)

Applied (wwith cleaned-up subject).

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Q: Why do PCs have a reset button on the front?
A: Because they are expected to run Microsoft operating systems.