qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [6206] ETRAX: Support timer count reads and correct frequencies.
Date: Wed, 07 Jan 2009 13:24:41 +0000	[thread overview]
Message-ID: <E1LKYOn-0000QQ-5n@cvs.savannah.gnu.org> (raw)

Revision: 6206
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6206
Author:   edgar_igl
Date:     2009-01-07 13:24:40 +0000 (Wed, 07 Jan 2009)

Log Message:
-----------
ETRAX: Support timer count reads and correct frequencies.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

Modified Paths:
--------------
    trunk/hw/etraxfs_timer.c

Modified: trunk/hw/etraxfs_timer.c
===================================================================
--- trunk/hw/etraxfs_timer.c	2009-01-07 13:19:21 UTC (rev 6205)
+++ trunk/hw/etraxfs_timer.c	2009-01-07 13:24:40 UTC (rev 6206)
@@ -75,15 +75,6 @@
 	uint32_t r_masked_intr;
 };
 
-static uint32_t timer_rinvalid (void *opaque, target_phys_addr_t addr)
-{
-	struct fs_timer_t *t = opaque;
-	CPUState *env = t->env;
-	cpu_abort(env, "Unsupported short access. reg=" TARGET_FMT_plx "\n",
-		  addr);
-	return 0;
-}
-
 static uint32_t timer_readl (void *opaque, target_phys_addr_t addr)
 {
 	struct fs_timer_t *t = opaque;
@@ -91,9 +82,10 @@
 
 	switch (addr) {
 	case R_TMR0_DATA:
+		r = ptimer_get_count(t->ptimer_t0);
 		break;
 	case R_TMR1_DATA:
-		D(printf ("R_TMR1_DATA\n"));
+		r = ptimer_get_count(t->ptimer_t1);
 		break;
 	case R_TIME:
 		r = qemu_get_clock(vm_clock) / 10;
@@ -111,15 +103,6 @@
 	return r;
 }
 
-static void
-timer_winvalid (void *opaque, target_phys_addr_t addr, uint32_t value)
-{
-	struct fs_timer_t *t = opaque;
-	CPUState *env = t->env;
-	cpu_abort(env, "Unsupported short access. reg=" TARGET_FMT_plx "\n",
-		  addr);
-}
-
 #define TIMER_SLOWDOWN 1
 static void update_ctrl(struct fs_timer_t *t, int tnum)
 {
@@ -155,7 +138,7 @@
 	case 4: freq_hz =  29493000; break;
 	case 5: freq_hz =  32000000; break;
 	case 6: freq_hz =  32768000; break;
-	case 7: freq_hz = 100001000; break;
+	case 7: freq_hz = 100000000; break;
 	default:
 		abort();
 		break;
@@ -163,8 +146,8 @@
 
 	D(printf ("freq_hz=%d div=%d\n", freq_hz, div));
 	div = div * TIMER_SLOWDOWN;
-	div >>= 10;
-	freq_hz >>= 10;
+	div /= 1000;
+	freq_hz /= 1000;
 	ptimer_set_freq(timer, freq_hz);
 	ptimer_set_limit(timer, div, 0);
 
@@ -309,14 +292,12 @@
 }
 
 static CPUReadMemoryFunc *timer_read[] = {
-	&timer_rinvalid,
-	&timer_rinvalid,
+	NULL, NULL,
 	&timer_readl,
 };
 
 static CPUWriteMemoryFunc *timer_write[] = {
-	&timer_winvalid,
-	&timer_winvalid,
+	NULL, NULL,
 	&timer_writel,
 };
 

                 reply	other threads:[~2009-01-07 13:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1LKYOn-0000QQ-5n@cvs.savannah.gnu.org \
    --to=edgar.iglesias@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).