public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] From: Sergei Poselenov <sposelenov@emcraft.com>
@ 2008-05-27 12:19 Wolfgang Denk
  2008-05-27 12:27 ` Jerry Van Baren
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Wolfgang Denk @ 2008-05-27 12:19 UTC (permalink / raw)
  To: u-boot

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

diff --git a/board/socrates/socrates.c b/board/socrates/socrates.c
index cb58994..15c6478 100644
--- a/board/socrates/socrates.c
+++ b/board/socrates/socrates.c
@@ -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
diff --git a/include/configs/socrates.h b/include/configs/socrates.h
index 00c0dab..028a772 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@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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot-Users] From: Sergei Poselenov <sposelenov@emcraft.com>
  2008-05-27 12:19 [U-Boot-Users] From: Sergei Poselenov <sposelenov@emcraft.com> Wolfgang Denk
@ 2008-05-27 12:27 ` Jerry Van Baren
  2008-05-27 18:52   ` Wolfgang Denk
  2008-05-27 18:17 ` Stefan Roese
  2008-06-04 22:06 ` Wolfgang Denk
  2 siblings, 1 reply; 8+ messages in thread
From: Jerry Van Baren @ 2008-05-27 12:27 UTC (permalink / raw)
  To: u-boot

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

Better subject line, please?

Thanks,
gvb

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] From: Sergei Poselenov <sposelenov@emcraft.com>
  2008-05-27 12:19 [U-Boot-Users] From: Sergei Poselenov <sposelenov@emcraft.com> Wolfgang Denk
  2008-05-27 12:27 ` Jerry Van Baren
@ 2008-05-27 18:17 ` Stefan Roese
  2008-05-28  7:53   ` Sergei Poselenov
  2008-06-04 22:06 ` Wolfgang Denk
  2 siblings, 1 reply; 8+ messages in thread
From: Stefan Roese @ 2008-05-27 18:17 UTC (permalink / raw)
  To: u-boot

On Tuesday 27 May 2008, Wolfgang Denk wrote:
> Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
> ---
>  board/socrates/socrates.c  |   13 +++++++++++--
>  include/configs/socrates.h |    3 ++-
>  2 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/board/socrates/socrates.c b/board/socrates/socrates.c
> index cb58994..15c6478 100644
> --- a/board/socrates/socrates.c
> +++ b/board/socrates/socrates.c
> @@ -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)) {

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: office@denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] From: Sergei Poselenov <sposelenov@emcraft.com>
  2008-05-27 12:27 ` Jerry Van Baren
@ 2008-05-27 18:52   ` Wolfgang Denk
  0 siblings, 0 replies; 8+ messages in thread
From: Wolfgang Denk @ 2008-05-27 18:52 UTC (permalink / raw)
  To: u-boot

In message <483BFE47.5050301@ge.com> you wrote:
> Wolfgang Denk wrote:
> > Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
> > ---
> >  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 <wd@denx.de>' -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 <sposelenov@emcraft.com> from line 'Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
'
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 <wd@denx.de>
To: u-boot-users at lists.sourceforge.net
Cc: Sergei Poselenov <sposelenov@emcraft.com>
Subject: From: Sergei Poselenov <sposelenov@emcraft.com>
...


But to me the patch looks not too bad:

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

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


Best regards,

Wolfgang Denk

-- 
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] From: Sergei Poselenov <sposelenov@emcraft.com>
  2008-05-27 18:17 ` Stefan Roese
@ 2008-05-28  7:53   ` Sergei Poselenov
  2008-05-28  8:31     ` Stefan Roese
  0 siblings, 1 reply; 8+ messages in thread
From: Sergei Poselenov @ 2008-05-28  7:53 UTC (permalink / raw)
  To: u-boot

Hello Stefan,

Stefan Roese wrote:
> On Tuesday 27 May 2008, Wolfgang Denk wrote:
>> Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
>> ---
>>  board/socrates/socrates.c  |   13 +++++++++++--
>>  include/configs/socrates.h |    3 ++-
>>  2 files changed, 13 insertions(+), 3 deletions(-)
>>
>> diff --git a/board/socrates/socrates.c b/board/socrates/socrates.c
>> index cb58994..15c6478 100644
>> --- a/board/socrates/socrates.c
>> +++ b/board/socrates/socrates.c
>> @@ -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)) {
> 
> 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

> 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
> =====================================================================
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] From: Sergei Poselenov <sposelenov@emcraft.com>
  2008-05-28  7:53   ` Sergei Poselenov
@ 2008-05-28  8:31     ` Stefan Roese
  2008-05-28 16:14       ` Scott Wood
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Roese @ 2008-05-28  8:31 UTC (permalink / raw)
  To: u-boot

Hi Sergei,

On Wednesday 28 May 2008, Sergei Poselenov wrote:
> >> +	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
=====================================================================

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] From: Sergei Poselenov <sposelenov@emcraft.com>
  2008-05-28  8:31     ` Stefan Roese
@ 2008-05-28 16:14       ` Scott Wood
  0 siblings, 0 replies; 8+ messages in thread
From: Scott Wood @ 2008-05-28 16:14 UTC (permalink / raw)
  To: u-boot

On Wed, May 28, 2008 at 10:31:09AM +0200, Stefan Roese wrote:
> On Wednesday 28 May 2008, Sergei Poselenov wrote:
> > 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.

> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] From: Sergei Poselenov <sposelenov@emcraft.com>
  2008-05-27 12:19 [U-Boot-Users] From: Sergei Poselenov <sposelenov@emcraft.com> Wolfgang Denk
  2008-05-27 12:27 ` Jerry Van Baren
  2008-05-27 18:17 ` Stefan Roese
@ 2008-06-04 22:06 ` Wolfgang Denk
  2 siblings, 0 replies; 8+ messages in thread
From: Wolfgang Denk @ 2008-06-04 22:06 UTC (permalink / raw)
  To: u-boot

In message <1211890770-20866-1-git-send-email-wd@denx.de> you wrote:
> Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
> ---
>  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

-- 
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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-06-04 22:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-27 12:19 [U-Boot-Users] From: Sergei Poselenov <sposelenov@emcraft.com> Wolfgang Denk
2008-05-27 12:27 ` Jerry Van Baren
2008-05-27 18:52   ` Wolfgang Denk
2008-05-27 18:17 ` Stefan Roese
2008-05-28  7:53   ` Sergei Poselenov
2008-05-28  8:31     ` Stefan Roese
2008-05-28 16:14       ` Scott Wood
2008-06-04 22:06 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox