On 13/01/2017 13:43, Peter Maydell wrote:
On 13 January 2017 at 12:35, James Hanley <jhan...@dgtlrift.com> wrote:
How should system_clock_scale be set in hw/intc/armv7m_nvic.c - there is no
API for the global, and I've defaulted the global to SYSTICK_SCALE which
seems to work, but is not obvious. This was needed as this value was set to
zero and the arm firmware was selecting the external clock source causing
zero to be returned from systick_scale() and the interrupt to run
If I recall correctly, this is an external-to-the-CPU thing
(wired up by the SoC or the board), which suggests that it
ought to be a property on the CPU object (or perhaps on a
currently-nonexistent container object which has the CPU
and the NVIC and the other M profile devices).
If you are going to add this in the future, I would suggest making it
a settable "board" property, since most "boards" are really just
families of somewhat similar SoC chips, and this frequency might thus
(on real hardware) vary even more easily than e.g. the size of the
As the code stands today, I think the answer is that the
board has to set the global -- this is what stellaris.c does.
Jakob Bohm, CIO, Partner, WiseMo A/S. https://www.wisemo.com
Transformervej 29, 2860 Søborg, Denmark. Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded