* [U-Boot] [PATCH v2] MPC8260: fixup device tree by property instead of path
@ 2009-05-12 13:17 Wolfgang Denk
2009-05-13 6:00 ` Heiko Schocher
2009-05-15 20:03 ` Wolfgang Denk
0 siblings, 2 replies; 5+ messages in thread
From: Wolfgang Denk @ 2009-05-12 13:17 UTC (permalink / raw)
To: u-boot
cpu/mpc8260/cpu.c used to use do_fixup_by_path_u32() to update the
clock frequencies in the device tree, using a CPU path
"/cpus/OF_CPU", with OF_CPU beind defined in the board config file.
However, this does not work when one board config file (here:
MPC8260ADS.h) is intended to be used for several diffrent CPUs and
therefor contains a generic definition like "cpu at 0", as the device
trees that will then be loaded will contain specific names like
"PowerPC,8272 at 0".
We switch to using do_fixup_by_prop_u32() instead, so we can search
for device_type="cpu", as it is done in other architectures, too.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Heiko Schocher <hs@denx.de>
---
v2: Fix typo in Heiko's name.
Heiko, could you please test if this works with mgcoge, too?
cpu/mpc8260/cpu.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/cpu/mpc8260/cpu.c b/cpu/mpc8260/cpu.c
index d4622ca..17e6248 100644
--- a/cpu/mpc8260/cpu.c
+++ b/cpu/mpc8260/cpu.c
@@ -304,8 +304,6 @@ void watchdog_reset (void)
#if defined(CONFIG_OF_LIBFDT) && defined (CONFIG_OF_BOARD_SETUP)
void ft_cpu_setup (void *blob, bd_t *bd)
{
- char * cpu_path = "/cpus/" OF_CPU;
-
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
fdt_fixup_ethernet(blob);
@@ -314,9 +312,12 @@ void ft_cpu_setup (void *blob, bd_t *bd)
do_fixup_by_compat_u32(blob, "fsl,cpm2-brg",
"clock-frequency", bd->bi_brgfreq, 1);
- do_fixup_by_path_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1);
- do_fixup_by_path_u32(blob, cpu_path, "timebase-frequency", OF_TBCLK, 1);
- do_fixup_by_path_u32(blob, cpu_path, "clock-frequency", bd->bi_intfreq, 1);
+ do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
+ "bus-frequency", bd->bi_busfreq, 1);
+ do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
+ "timebase-frequency", OF_TBCLK, 1);
+ do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
+ "clock-frequency", bd->bi_intfreq, 1);
}
#endif /* CONFIG_OF_LIBFDT */
--
1.6.0.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v2] MPC8260: fixup device tree by property instead of path
2009-05-12 13:17 [U-Boot] [PATCH v2] MPC8260: fixup device tree by property instead of path Wolfgang Denk
@ 2009-05-13 6:00 ` Heiko Schocher
2009-05-13 9:07 ` Detlev Zundel
2009-05-15 20:03 ` Wolfgang Denk
1 sibling, 1 reply; 5+ messages in thread
From: Heiko Schocher @ 2009-05-13 6:00 UTC (permalink / raw)
To: u-boot
Hello Wolfgang,
Wolfgang Denk wrote:
> cpu/mpc8260/cpu.c used to use do_fixup_by_path_u32() to update the
> clock frequencies in the device tree, using a CPU path
> "/cpus/OF_CPU", with OF_CPU beind defined in the board config file.
>
> However, this does not work when one board config file (here:
> MPC8260ADS.h) is intended to be used for several diffrent CPUs and
> therefor contains a generic definition like "cpu at 0", as the device
> trees that will then be loaded will contain specific names like
> "PowerPC,8272 at 0".
>
> We switch to using do_fixup_by_prop_u32() instead, so we can search
> for device_type="cpu", as it is done in other architectures, too.
>
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Heiko Schocher <hs@denx.de>
> ---
> v2: Fix typo in Heiko's name.
>
> Heiko, could you please test if this works with mgcoge, too?
It works fine on the mgcoge:
=> tftp 400000 mgcoge/mgcoge.dtb-hs
Using SCC ETHERNET device
TFTP from server 192.168.1.1; our IP address is 192.168.20.3
Filename 'mgcoge/mgcoge.dtb-hs'.
Load address: 0x400000
Loading: #
done
Bytes transferred = 6000 (1770 hex)
=> fdt addr 400000
=> fdt print
[...]
cpus {
#address-cells = <0x1>;
#size-cells = <0x0>;
PowerPC,8247 at 0 {
device_type = "cpu";
reg = <0x0>;
d-cache-line-size = <0x20>;
i-cache-line-size = <0x20>;
d-cache-size = <0x4000>;
i-cache-size = <0x4000>;
timebase-frequency = <0x0>;
clock-frequency = <0x0>;
bus-frequency = <0x0>;
};
=> fdt board
=> fdt print /cpus
cpus {
#address-cells = <0x1>;
#size-cells = <0x0>;
PowerPC,8247 at 0 {
device_type = "cpu";
reg = <0x0>;
d-cache-line-size = <0x20>;
i-cache-line-size = <0x20>;
d-cache-size = <0x4000>;
i-cache-size = <0x4000>;
timebase-frequency = <0xfbc520>;
clock-frequency = <0xbcd3d80>;
bus-frequency = <0x3ef1480>;
};
};
=>
Also Linux boots fine :-)
so this patch looks good to me, so:
Acked-by: Heiko Schocher<hs@denx.de>
bye
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v2] MPC8260: fixup device tree by property instead of path
2009-05-13 6:00 ` Heiko Schocher
@ 2009-05-13 9:07 ` Detlev Zundel
2009-05-13 16:27 ` Heiko Schocher
0 siblings, 1 reply; 5+ messages in thread
From: Detlev Zundel @ 2009-05-13 9:07 UTC (permalink / raw)
To: u-boot
Hi Heiko,
> Acked-by: Heiko Schocher<hs@denx.de>
Apart from fixing the inverse whitespace problemn, am I correct that
strictly speaking we should now also add the following?
Tested-by: Heiko Schocher <hs@denx.de>
Cheers
Detlev
--
To summarize: It is a well known and lamented fact that those people who
most want to rule people are, ipso facto, those least suited to do it.
To summarize the summary: anyone who is capable of getting themselves made
President should on no account be allowed to do the job.
-- The Hitchhikers Guide To The Galaxy
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v2] MPC8260: fixup device tree by property instead of path
2009-05-13 9:07 ` Detlev Zundel
@ 2009-05-13 16:27 ` Heiko Schocher
0 siblings, 0 replies; 5+ messages in thread
From: Heiko Schocher @ 2009-05-13 16:27 UTC (permalink / raw)
To: u-boot
Hello Detlev,
Detlev Zundel wrote:
>> Acked-by: Heiko Schocher<hs@denx.de>
>
> Apart from fixing the inverse whitespace problemn, am I correct that
> strictly speaking we should now also add the following?
>
> Tested-by: Heiko Schocher <hs@denx.de>
Ah, you are right.
bye
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v2] MPC8260: fixup device tree by property instead of path
2009-05-12 13:17 [U-Boot] [PATCH v2] MPC8260: fixup device tree by property instead of path Wolfgang Denk
2009-05-13 6:00 ` Heiko Schocher
@ 2009-05-15 20:03 ` Wolfgang Denk
1 sibling, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2009-05-15 20:03 UTC (permalink / raw)
To: u-boot
In message <1242134255-7295-1-git-send-email-wd@denx.de> you wrote:
> cpu/mpc8260/cpu.c used to use do_fixup_by_path_u32() to update the
> clock frequencies in the device tree, using a CPU path
> "/cpus/OF_CPU", with OF_CPU beind defined in the board config file.
>
> However, this does not work when one board config file (here:
> MPC8260ADS.h) is intended to be used for several diffrent CPUs and
> therefor contains a generic definition like "cpu at 0", as the device
> trees that will then be loaded will contain specific names like
> "PowerPC,8272 at 0".
>
> We switch to using do_fixup_by_prop_u32() instead, so we can search
> for device_type="cpu", as it is done in other architectures, too.
>
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Heiko Schocher <hs@denx.de>
> ---
> v2: Fix typo in Heiko's name.
>
> Heiko, could you please test if this works with mgcoge, too?
>
> cpu/mpc8260/cpu.c | 11 ++++++-----
> 1 files changed, 6 insertions(+), 5 deletions(-)
Applied.
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
Only two things are infinite, the universe and human stupidity, and
I'm not sure about the former. -- Albert Einstein
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-05-15 20:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-12 13:17 [U-Boot] [PATCH v2] MPC8260: fixup device tree by property instead of path Wolfgang Denk
2009-05-13 6:00 ` Heiko Schocher
2009-05-13 9:07 ` Detlev Zundel
2009-05-13 16:27 ` Heiko Schocher
2009-05-15 20:03 ` Wolfgang Denk
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.