All of lore.kernel.org
 help / color / mirror / Atom feed
* [OpenRISC] Running timer.c program on or1ksim
@ 2016-09-30 15:52 Prasanna Karthik
  0 siblings, 0 replies; only message in thread
From: Prasanna Karthik @ 2016-09-30 15:52 UTC (permalink / raw)
  To: openrisc

Hi,
    We want to run the attached code on the or1ksim OpenRisc simulator. The
code uses the following function to enable timers.

*Code*
static inline void timer_enable()
{
        or1k_mtspr(SPR_TTMR, SPR_TTMR_CR);
}

*Compilation*
We compiled the code(on a ubuntu machine) using the following command:
or1k-linux-musl-gcc -O -Iarch/openrisc/include
-I../baremetal-compiler/or1k-elf/or1k-elf/  main.c -o
arch/openrisc/support/initramfs/main.elf

*Execution*
We then run the elf file (on the openrisc simulator) using the following
command:
./main.elf

*Output*
WARNING: trying to write SPR while SR[SUPV] is cleared.


*Debug attempts*
We have set the following value for the SR register
 sr =  0x18001
We see that the SUPV bit is set.

Can someone help us understand what is going wrong?



-- 
Prasanna Karthik V
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.librecores.org/pipermail/openrisc/attachments/20160930/9977785a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c
Type: text/x-csrc
Size: 4451 bytes
Desc: not available
URL: <http://lists.librecores.org/pipermail/openrisc/attachments/20160930/9977785a/attachment.c>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-09-30 15:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-30 15:52 [OpenRISC] Running timer.c program on or1ksim Prasanna Karthik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.