[U-Boot,v2,06/10] powerpc, 8xx: Properly set CPM frequency in the device tree
diff mbox

Message ID cac9a731c97e154ea743c5c452417df97cc58e02.1499329461.git.christophe.leroy@c-s.fr
State Accepted
Commit 6f65e75a8a80e6317729f232f135ca2cc5b99d4e
Delegated to: Tom Rini
Headers show

Commit Message

Christophe Leroy July 6, 2017, 8:33 a.m. UTC
For processors whose core runs at twice the bus frequency,
the fallback frequency calculation in Linux provides a wrong
result. Therefore, U-boot needs to pass the correct value.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/cpu/mpc8xx/fdt.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Heiko Schocher July 6, 2017, 9:46 a.m. UTC | #1
Hello Christophe,

Am 06.07.2017 um 10:33 schrieb Christophe Leroy:
> For processors whose core runs at twice the bus frequency,
> the fallback frequency calculation in Linux provides a wrong
> result. Therefore, U-boot needs to pass the correct value.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> ---
>   arch/powerpc/cpu/mpc8xx/fdt.c | 2 ++
>   1 file changed, 2 insertions(+)

Reviewed-by: Heiko Schocher <hs@denx.de>

bye,
Heiko
>
> diff --git a/arch/powerpc/cpu/mpc8xx/fdt.c b/arch/powerpc/cpu/mpc8xx/fdt.c
> index 88ee1c502c..f9b74ded5a 100644
> --- a/arch/powerpc/cpu/mpc8xx/fdt.c
> +++ b/arch/powerpc/cpu/mpc8xx/fdt.c
> @@ -20,6 +20,8 @@ void ft_cpu_setup(void *blob, bd_t *bd)
>   			     "bus-frequency", bd->bi_busfreq, 1);
>   	do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
>   			     "clock-frequency", bd->bi_intfreq, 1);
> +	do_fixup_by_compat_u32(blob, "fsl,pq1-soc", "clock-frequency",
> +			       bd->bi_intfreq, 1);
>   	do_fixup_by_compat_u32(blob, "fsl,cpm-brg", "clock-frequency",
>   			       gd->arch.brg_clk, 1);
>
>
Tom Rini July 9, 2017, 12:25 a.m. UTC | #2
On Thu, Jul 06, 2017 at 10:33:19AM +0200, Christophe Leroy wrote:

> For processors whose core runs at twice the bus frequency,
> the fallback frequency calculation in Linux provides a wrong
> result. Therefore, U-boot needs to pass the correct value.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> Reviewed-by: Heiko Schocher <hs@denx.de>

Applied to u-boot/master, thanks!

Patch
diff mbox

diff --git a/arch/powerpc/cpu/mpc8xx/fdt.c b/arch/powerpc/cpu/mpc8xx/fdt.c
index 88ee1c502c..f9b74ded5a 100644
--- a/arch/powerpc/cpu/mpc8xx/fdt.c
+++ b/arch/powerpc/cpu/mpc8xx/fdt.c
@@ -20,6 +20,8 @@  void ft_cpu_setup(void *blob, bd_t *bd)
 			     "bus-frequency", bd->bi_busfreq, 1);
 	do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
 			     "clock-frequency", bd->bi_intfreq, 1);
+	do_fixup_by_compat_u32(blob, "fsl,pq1-soc", "clock-frequency",
+			       bd->bi_intfreq, 1);
 	do_fixup_by_compat_u32(blob, "fsl,cpm-brg", "clock-frequency",
 			       gd->arch.brg_clk, 1);