On Sat, 14 Aug 2021 at 10:20, Alexandre IOOSS <erdn...@crans.org> wrote:
>
>
> On 8/12/21 11:33 AM, Peter Maydell wrote:
> > Instead of passing the MSF2 SoC an integer property specifying the
> > CPU clock rate, pass it a Clock instead.  This lets us wire that
> > clock up to the armv7m object.
> >
> > Signed-off-by: Peter Maydell <peter.mayd...@linaro.org>

> > @@ -72,7 +74,10 @@ static void emcraft_sf2_s2s010_init(MachineState 
> > *machine)
> >        * in Libero. CPU clock is divided by APB0 and APB1 divisors for
> >        * peripherals. Emcraft's SoM kit comes with these settings by 
> > default.
> >        */
> > -    qdev_prop_set_uint32(dev, "m3clk", 142 * 1000000);
> > +    /* This clock doesn't need migration because it is fixed-frequency */
> > +    m3clk = clock_new(OBJECT(machine), "m3clk");
> > +    clock_set_hz(m3clk, 142 * 1000000);
>
> Maybe something could be added in the commit message to say that M3_CLK
> is changed from 100MHz to 142MHz.

I'm not sure what you mean here? This commit doesn't change the frequency:
we previously set the m3clk property to "142 * 1000000" and now we set the
clock's hz setting to the same thing.

The old m3clk property had a default value of 100 * 1000000, but nothing
ever used that because the only user of the device (this board code)
set the property explicitly to some value. With the new Clock-based
setup there is no default value at all, because the board code must
always connect a clock, and will set its frequency to whatever is
right for that board.

-- PMM

Reply via email to