Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1394023

Re: [PATCH RESEND 05/12] sh: DeviceTree support update

From Geert Uytterhoeven <geert@linux-m68k.org>
Newsgroups linux.kernel
Subject Re: [PATCH RESEND 05/12] sh: DeviceTree support update
Date 2016-05-04 08:50 +0200
Message-ID <ruYNb-7b5-1@gated-at.bofh.it> (permalink)
References <rtRNL-3JV-5@gated-at.bofh.it> <rtRNL-3JV-7@gated-at.bofh.it> <ruVvY-3Xv-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, May 4, 2016 at 5:10 AM, Rich Felker <dalias@libc.org> wrote:
>On Sun, May 01, 2016 at 02:08:29PM +0900, Yoshinori Sato wrote:
>>  static void __init sh_of_setup(char **cmdline_p)
>>  {
>> -     unflatten_device_tree();
>> -
>> -     board_time_init = sh_of_time_init;
>> +     struct device_node *cpu;
>> +     int freq;

You better make freq unsigned.

>>       sh_mv.mv_name = of_flat_dt_get_machine_name();
>>       if (!sh_mv.mv_name)
>>               sh_mv.mv_name = "Unknown SH model";
>>
>>       sh_of_smp_probe();
>> +     cpu = of_find_node_by_name(NULL, "cpu");
>> +     if (!of_property_read_u32(cpu, "clock-frequency", &freq))
>> +             preset_lpj = freq / 500;
>>  }
>
> I setup the DT-based pseudo-board to use the generic calibrate-delay
> rather than hard-coding lpj. Ideally we could just get rid of bogomips
> completely but there are probably still some things using it. Is there
> a reason you prefer making up a value for lpj based on the cpu clock
> rate?

Calibrating the delay loop takes some time.
However, you shouldn't hardcode 500, but take HZ into account.
I assume you used the default HZ=250, so

        preset_lpj = freq / HZ / 2;

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH RESEND 05/12] sh: DeviceTree support update Yoshinori Sato <ysato@users.sourceforge.jp> - 2016-05-01 07:10 +0200
  Re: [PATCH RESEND 05/12] sh: DeviceTree support update Rich Felker <dalias@libc.org> - 2016-05-04 05:20 +0200
    Re: [PATCH RESEND 05/12] sh: DeviceTree support update Geert Uytterhoeven <geert@linux-m68k.org> - 2016-05-04 08:50 +0200
      Re: [PATCH RESEND 05/12] sh: DeviceTree support update Yoshinori Sato <ysato@users.sourceforge.jp> - 2016-05-10 10:30 +0200
    Re: [PATCH RESEND 05/12] sh: DeviceTree support update Yoshinori Sato <ysato@users.sourceforge.jp> - 2016-05-10 10:30 +0200
      Re: [PATCH RESEND 05/12] sh: DeviceTree support update Rich Felker <dalias@libc.org> - 2016-05-10 18:30 +0200

csiph-web