qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [4943] Fix OMAP GPMC register offsets and SYSCTL 8bit io (K


From: Andrzej Zaborowski
Subject: [Qemu-devel] [4943] Fix OMAP GPMC register offsets and SYSCTL 8bit io (Kyungmin Park).
Date: Fri, 25 Jul 2008 21:07:22 +0000

Revision: 4943
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4943
Author:   balrog
Date:     2008-07-25 21:07:21 +0000 (Fri, 25 Jul 2008)

Log Message:
-----------
Fix OMAP GPMC register offsets and SYSCTL 8bit io (Kyungmin Park).

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

Modified: trunk/hw/omap2.c
===================================================================
--- trunk/hw/omap2.c    2008-07-25 07:42:14 UTC (rev 4942)
+++ trunk/hw/omap2.c    2008-07-25 21:07:21 UTC (rev 4943)
@@ -3528,6 +3528,32 @@
     uint32_t msuspendmux[5];
 };
 
+static uint32_t omap_sysctl_read8(void *opaque, target_phys_addr_t addr)
+{
+
+    struct omap_sysctl_s *s = (struct omap_sysctl_s *) opaque;
+    int offset = addr - s->base;
+    int pad_offset, byte_offset;
+    int value;
+
+    switch (offset) {
+    case 0x030 ... 0x140:      /* CONTROL_PADCONF - only used in the POP */
+        pad_offset = (offset - 0x30) >> 2;
+        byte_offset = (offset - 0x30) & (4 - 1);
+
+        value = s->padconf[pad_offset];
+        value = (value >> (byte_offset * 8)) & 0xff;
+
+        return value;
+
+    default:
+        break;
+    }
+
+    OMAP_BAD_REG(addr);
+    return 0;
+}
+
 static uint32_t omap_sysctl_read(void *opaque, target_phys_addr_t addr)
 {
     struct omap_sysctl_s *s = (struct omap_sysctl_s *) opaque;
@@ -3629,6 +3655,31 @@
     return 0;
 }
 
+static void omap_sysctl_write8(void *opaque, target_phys_addr_t addr,
+                uint32_t value)
+{
+    struct omap_sysctl_s *s = (struct omap_sysctl_s *) opaque;
+    int offset = addr - s->base;
+    int pad_offset, byte_offset;
+    int prev_value;
+
+    switch (offset) {
+    case 0x030 ... 0x140:      /* CONTROL_PADCONF - only used in the POP */
+        pad_offset = (offset - 0x30) >> 2;
+        byte_offset = (offset - 0x30) & (4 - 1);
+
+        prev_value = s->padconf[pad_offset];
+        prev_value &= ~(0xff << (byte_offset * 8));
+        prev_value |= ((value & 0x1f1f1f1f) << (byte_offset * 8)) & 0x1f1f1f1f;
+        s->padconf[pad_offset] = prev_value;
+        break;
+
+    default:
+        OMAP_BAD_REG(addr);
+        break;
+    }
+}
+
 static void omap_sysctl_write(void *opaque, target_phys_addr_t addr,
                 uint32_t value)
 {
@@ -3726,14 +3777,14 @@
 }
 
 static CPUReadMemoryFunc *omap_sysctl_readfn[] = {
+    omap_sysctl_read8,
     omap_badwidth_read32,      /* TODO */
-    omap_badwidth_read32,      /* TODO */
     omap_sysctl_read,
 };
 
 static CPUWriteMemoryFunc *omap_sysctl_writefn[] = {
+    omap_sysctl_write8,
     omap_badwidth_write32,     /* TODO */
-    omap_badwidth_write32,     /* TODO */
     omap_sysctl_write,
 };
 
@@ -4139,7 +4190,7 @@
         cs = (offset - 0x060) / 0x30;
         offset -= cs * 0x30;
         f = s->cs_file + cs;
-        switch (offset - cs * 0x30) {
+        switch (offset) {
             case 0x60: /* GPMC_CONFIG1 */
                 return f->config[0];
             case 0x64: /* GPMC_CONFIG2 */






reply via email to

[Prev in Thread] Current Thread [Next in Thread]