Re: [PATCH] hw/timer/armv7m_systick: Update clock source before enabling timer

2022-02-08 Thread Peter Maydell
On Tue, 1 Feb 2022 at 23:15, Richard Petri wrote: > And if you still want to do a debug session: I think there is another > related problem. The `systick_reset` function sets the right clock > source, but I guess at the time of calling reset the `cpuclk` doesn't > have the right value (probably ze

Re: [PATCH] hw/timer/armv7m_systick: Update clock source before enabling timer

2022-02-07 Thread Peter Maydell
On Tue, 1 Feb 2022 at 19:28, Richard Petri wrote: > > Starting the SysTick timer and changing the clock source a the same time > will result in an error, if the previous clock period was zero. For exmaple, > on the mps2-tz platforms, no refclk is present. Right after reset, the > configured ptimer

Re: [PATCH] hw/timer/armv7m_systick: Update clock source before enabling timer

2022-02-01 Thread Richard Petri
On Tue, Feb 01 2022, Peter Maydell wrote: > Thanks, you've saved me a debugging session! I had a bug report about > a problem with the systick timer a couple of days back, but I hadn't yet > got round to investigating it, and now I don't have to, because this > patch fixes the reported failure :-)

[PATCH] hw/timer/armv7m_systick: Update clock source before enabling timer

2022-02-01 Thread Richard Petri
Starting the SysTick timer and changing the clock source a the same time will result in an error, if the previous clock period was zero. For exmaple, on the mps2-tz platforms, no refclk is present. Right after reset, the configured ptimer period is zero, and trying to enabling it will turn it off r

Re: [PATCH] hw/timer/armv7m_systick: Update clock source before enabling timer

2022-02-01 Thread Peter Maydell
On Tue, 1 Feb 2022 at 19:28, Richard Petri wrote: > > Starting the SysTick timer and changing the clock source a the same time > will result in an error, if the previous clock period was zero. For exmaple, > on the mps2-tz platforms, no refclk is present. Right after reset, the > configured ptimer