[PATCH 6/7] hw/mips/fuloong2e: Correct cpuclock env

Jiaxun Yang posted 7 patches 5 years, 1 month ago
There is a newer version of this series
[PATCH 6/7] hw/mips/fuloong2e: Correct cpuclock env
Posted by Jiaxun Yang 5 years, 1 month ago
It should be 533080000.
See clock_set_hz.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 hw/mips/fuloong2e.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
index 256c7867e4..af2d259dc4 100644
--- a/hw/mips/fuloong2e.c
+++ b/hw/mips/fuloong2e.c
@@ -159,7 +159,7 @@ static uint64_t load_kernel(CPUMIPSState *env)
     }
 
     /* Setup minimum environment variables */
-    prom_set(prom_buf, index++, "cpuclock=100000000");
+    prom_set(prom_buf, index++, "cpuclock=533080000");
     prom_set(prom_buf, index++, "memsize=%"PRIi64, loaderparams.ram_size / MiB);
     prom_set(prom_buf, index++, NULL);
 
-- 
2.29.2

Re: [PATCH 6/7] hw/mips/fuloong2e: Correct cpuclock env
Posted by Philippe Mathieu-Daudé 5 years, 1 month ago
On 12/16/20 3:31 AM, Jiaxun Yang wrote:
> It should be 533080000.
> See clock_set_hz.

Missed in 3ca7639ff00 ("hw/mips/fuloong2e: Set CPU frequency
to 533 MHz").

> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
>  hw/mips/fuloong2e.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
> index 256c7867e4..af2d259dc4 100644
> --- a/hw/mips/fuloong2e.c
> +++ b/hw/mips/fuloong2e.c
> @@ -159,7 +159,7 @@ static uint64_t load_kernel(CPUMIPSState *env)
>      }
>  
>      /* Setup minimum environment variables */
> -    prom_set(prom_buf, index++, "cpuclock=100000000");
> +    prom_set(prom_buf, index++, "cpuclock=533080000");

Actually it should be "cpuclock=%u" of clock_get_hz(cpuclk).

>      prom_set(prom_buf, index++, "memsize=%"PRIi64, loaderparams.ram_size / MiB);
>      prom_set(prom_buf, index++, NULL);
>  
>