Skip to contentSkip to conversation

Use IPB bus frequency for SOC peripherals

PATCH New Grant Likely 5 participants 8 messages Nov 6, 2006 – Nov 30, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use IPB bus frequency for SOC peripherals

The soc node of the mpc52xx needs to be loaded with the IPB bus frequency, not the XLB frequency.

This patch depends on the previous patches for MPC52xx device tree support

---
 cpu/mpc5xxx/cpu.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
cpu/mpc5xxx/cpu.c +4 -5
index 20e6735..813aa79 100644
@@ -112,21 +112,20 @@ void
 ft_cpu_setup(void *blob, bd_t *bd)
 {
 	u32 *p;
-	ulong clock;
 	int len;
 
-	clock = bd->bi_busfreq;
+	/* Core XLB bus frequency */
 	p = ft_get_prop(blob, "/cpus/" OF_CPU "/bus-frequency", &len);
 	if (p != NULL)
-		*p = cpu_to_be32(clock);
+		*p = cpu_to_be32(bd->bi_busfreq);
 
+	/* SOC peripherals use the IPB bus frequency */
 	p = ft_get_prop(blob, "/" OF_SOC "/bus-frequency", &len);
 	if (p != NULL)
-		*p = cpu_to_be32(clock);
+		*p = cpu_to_be32(bd->bi_ipbfreq);
 
 	p = ft_get_prop(blob, "/" OF_SOC "/ethernet at 3000/mac-address", &len);
 	if (p != NULL)
 		memcpy(p, bd->bi_enetaddr, 6);
-
 }
 #endif
Signature · 1 line
1.4.3.rc2.g0503
#1 lore raw

PATCH 1/1 Use IPB bus frequency for SOC peripherals

Quoted 2 lines · In message <[email protected]> you wrote:

The soc node of the mpc52xx needs to be loaded with the IPB bus frequency, not the XLB frequency.

...

cpu/mpc5xxx/cpu.c void · line 120

Quoted 4 lines
cpu/mpc5xxx/cpu.c +1 -1
 	p = ft_get_prop(blob, "/cpus/" OF_CPU "/bus-frequency", &len);
 	if (p != NULL)
-		*p = cpu_to_be32(clock);
+		*p = cpu_to_be32(bd->bi_busfreq);

"/bus-frequency" ==> bi_busfreq. OK.

cpu/mpc5xxx/cpu.c void · line 125

Quoted 4 lines
cpu/mpc5xxx/cpu.c +1 -1
 	p = ft_get_prop(blob, "/" OF_SOC "/bus-frequency", &len);
 	if (p != NULL)
-		*p = cpu_to_be32(clock);
+		*p = cpu_to_be32(bd->bi_ipbfreq);

"/bus-frequency" ==> bi_ipbfreq. ???

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You see but you do not observe.
Sir Arthur Conan Doyle, in "The Memoirs of Sherlock Holmes"
#2 lore raw

PATCH 1/1 Use IPB bus frequency for SOC peripherals

Quoted 11 lines · Wolfgang Denk
Quoted 2 lines · In message <[email protected]> you wrote:

The soc node of the mpc52xx needs to be loaded with the IPB bus frequency, not the XLB frequency.

...

cpu/mpc5xxx/cpu.c void · line 120

Quoted 4 lines
      p = ft_get_prop(blob, "/cpus/" OF_CPU "/bus-frequency", &len);
      if (p != NULL)
cpu/mpc5xxx/cpu.c +1 -1
-             *p = cpu_to_be32(clock);
+             *p = cpu_to_be32(bd->bi_busfreq);

"/bus-frequency" ==> bi_busfreq. OK.

/cpus/mpc5200 at 0/bus-frequency ==> bi_busfreq

Quoted 7 lines

Review

Quoted 5 lines
      p = ft_get_prop(blob, "/" OF_SOC "/bus-frequency", &len);
      if (p != NULL)
(quoted diff) +1 -1
-             *p = cpu_to_be32(clock);
+             *p = cpu_to_be32(bd->bi_ipbfreq);

"/bus-frequency" ==> bi_ipbfreq. ???

/soc5200 at f0000000/bus-frequency ==> bi_ipbfreq

They are different busses, but 'bus-frequency' is kind of a standard name

BTW, I've got ACKs from jdl on two of the previous patches. Are you cool to commit them?

Thanks,
g.

Signature · 4 lines
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195
#3 lore raw

PATCH 1/1 Use IPB bus frequency for SOC peripherals

Quoted 2 lines · In message <[email protected]> you…

/cpus/mpc5200 at 0/bus-frequency ==> bi_busfreq

...

Quoted 3 lines

/soc5200 at f0000000/bus-frequency ==> bi_ipbfreq

They are different busses, but 'bus-frequency' is kind of a standard name

I see. Sorry, by brain has been a bit dried up from all this bss discussion.

Quoted 2 lines

BTW, I've got ACKs from jdl on two of the previous patches. Are you cool to commit them?

As soon as I find a little time.

Best regards,

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Given a choice between two theories, take the one which is funnier.
#4 lore raw

PATCH 1/1 Use IPB bus frequency for SOC peripherals

Quoted 3 lines · Wolfgang Denk

I see. Sorry, by brain has been a bit dried up from all this bss discussion.

:)

Quoted 5 lines
Quoted 3 lines

BTW, I've got ACKs from jdl on two of the previous patches. Are you cool to commit them?

As soon as I find a little time.

Cool, thx

g.

Signature · 4 lines
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195
#5 lore raw

PATCH 1/1 Use IPB bus frequency for SOC peripherals / OF patches

Quoted 6 lines · Grant Likely
Quoted 2 lines · Wolfgang Denk

I see. Sorry, by brain has been a bit dried up from all this bss discussion.

:)

Quoted 7 lines
Quoted 3 lines
Quoted 2 lines

BTW, I've got ACKs from jdl on two of the previous patches. Are you cool to commit them?

As soon as I find a little time.

Cool, thx

g.

Word of Warning: I pulled Grant's changes into my working branch and had a conflict on cmd_bootm.c because I removed two commented out lines (the commented out lines were debug calls to ft_dump_blob), but Grant reworked that area. Those two deleted lines were the only changes I made to cmd_bootm.c so my changes to cmd_bootm.c can be discarded.

I have not gotten around to regenerating my oftdump command patch to remove my changes to cmd_bootm.c, I presume that is the best approach.

gvb

#6 lore raw

PATCH 1/1 Use IPB bus frequency for SOC peripherals

In reply to Wolfgang Denk
Quoted 17 lines · Wolfgang Denk
Quoted 3 lines · In message <[email protected]> you wrote:

The soc node of the mpc52xx needs to be loaded with the IPB bus frequency, not the XLB frequency.

...

cpu/mpc5xxx/cpu.c void · line 120

Quoted 5 lines
cpu/mpc5xxx/cpu.c +1 -1
 	p = ft_get_prop(blob, "/cpus/" OF_CPU "/bus-frequency", &len);
 	if (p != NULL)
-		*p = cpu_to_be32(clock);
+		*p = cpu_to_be32(bd->bi_busfreq);

"/bus-frequency" ==> bi_busfreq. OK.

Quoted 8 lines

cpu/mpc5xxx/cpu.c void · line 125

Quoted 5 lines
cpu/mpc5xxx/cpu.c +1 -1
 	p = ft_get_prop(blob, "/" OF_SOC "/bus-frequency", &len);
 	if (p != NULL)
-		*p = cpu_to_be32(clock);
+		*p = cpu_to_be32(bd->bi_ipbfreq);

"/bus-frequency" ==> bi_ipbfreq. ???

FWIW,
Looks good to me and it's a requirement for the new arch/powerpc that's coming soon.

Sylvain

Applied
#7 lore raw

PATCH 1/1 Use IPB bus frequency for SOC peripherals

In reply to Grant Likely
Quoted 4 lines · Grant Likely

The soc node of the mpc52xx needs to be loaded with the IPB bus frequency, not the XLB frequency.

This patch depends on the previous patches for MPC52xx device tree support

Applied. Thanks.

Best regards,
Stefan