Preliminary support for 68HC12
authorStephane Carrez <stcarrez@nerim.fr>
Sun, 26 Nov 2000 21:41:31 +0000 (21:41 +0000)
committerStephane Carrez <stcarrez@nerim.fr>
Sun, 26 Nov 2000 21:41:31 +0000 (21:41 +0000)
sim/m68hc11/ChangeLog
sim/m68hc11/dv-m68hc11.c
sim/m68hc11/dv-m68hc11eepr.c
sim/m68hc11/dv-m68hc11sio.c
sim/m68hc11/dv-m68hc11spi.c
sim/m68hc11/dv-m68hc11tim.c

index f477cb7c230d154678113febea65882156841823..bf0ce6491adc03a126506e8b0394dc995143a944 100644 (file)
@@ -1,3 +1,14 @@
+2000-11-26  Stephane Carrez  <Stephane.Carrez@worldnet.fr>
+
+       * dv-m68hc11.c (m68hc11cpu_io_read_buffer): Use attach_size
+       instead of a hard-coded value.
+       (m68hc11cpu_io_write_buffer): Likewise.
+       (dv_m68hc11_descriptor): Define a 68hc12 device.
+       * dv-m68hc11eepr.c (dv_m68hc11eepr_descriptor): Likewise.
+       * dv-m68hc11tim.c (dv_m68hc11tim_descriptor): Likewise.
+       * dv-m68hc11spi.c (dv_m68hc11spi_descriptor): Likewise.
+       * dv-m68hc11sio.c (dv_m68hc11sio_descriptor): Likewise.
+
 2000-11-22  Stephane Carrez  <Stephane.Carrez@worldnet.fr>
 
        * dv-m68hc11.c (attach_m68hc11_regs): Register a delete handler.
index 38000472289570067234c7846fad042929028374..f300297331a49e2bec263174d348d6dfa19c6ef4 100644 (file)
@@ -1,4 +1,4 @@
-/*  dv-m68hc11.c -- CPU 68HC11 as a device.
+/*  dv-m68hc11.c -- CPU 68HC11&68HC12 as a device.
     Copyright (C) 1999, 2000 Free Software Foundation, Inc.
     Written by Stephane Carrez (stcarrez@worldnet.fr)
     (From a driver model Contributed by Cygnus Solutions.)
 /* DEVICE
 
         m68hc11cpu - m68hc11 cpu virtual device
-
+        m68hc12cpu - m68hc12 cpu virtual device
    
    DESCRIPTION
 
-        Implements the external m68hc11 functionality.  This includes the
-        delivery of of interrupts generated from other devices and the
+        Implements the external m68hc11/68hc12 functionality.  This includes
+        the delivery of of interrupts generated from other devices and the
         handling of device specific registers.
 
 
@@ -39,7 +39,7 @@
 
    reg <base> <size>
 
-        Register base (should be 0x1000 0x03f).
+        Register base (should be 0x1000 0x03f for C11, 0x0000 0x3ff for HC12).
 
    clock <hz>
 
@@ -272,8 +272,6 @@ m68hc11cpu_finish (struct hw *me)
   attach_m68hc11_regs (me, controller);
 }
 
-
-
 /* An event arrives on an interrupt port.  */
 
 static void
@@ -442,7 +440,7 @@ m68hc11cpu_io_read_buffer (struct hw *me,
   
   while (nr_bytes)
     {
-      if (base >= 0x3F)
+      if (base >= controller->attach_size)
        break;
 
       memcpy (dest, &cpu->ios[base], 1);
@@ -574,7 +572,7 @@ m68hc11cpu_io_write_buffer (struct hw *me,
   while (nr_bytes)
     {
       uint8 val;
-      if (base >= 0x3F)
+      if (base >= controller->attach_size)
        break;
 
       val = *((uint8*) source);
@@ -588,7 +586,8 @@ m68hc11cpu_io_write_buffer (struct hw *me,
 }
 
 const struct hw_descriptor dv_m68hc11_descriptor[] = {
-  { "m68hc11", m68hc11cpu_finish, },
+  { "m68hc11", m68hc11cpu_finish },
+  { "m68hc12", m68hc11cpu_finish },
   { NULL },
 };
 
index d4aeb4833ad63a10b8e15e8b54a1d47b52d35011..a48456fa13d013106e968ee61ed2d16044199bda 100644 (file)
@@ -621,7 +621,8 @@ m68hc11eepr_io_write_buffer (struct hw *me,
 }
 
 const struct hw_descriptor dv_m68hc11eepr_descriptor[] = {
-  { "m68hc11eepr", m68hc11eepr_finish, },
+  { "m68hc11eepr", m68hc11eepr_finish },
+  { "m68hc12eepr", m68hc11eepr_finish },
   { NULL },
 };
 
index aa765cf3a4f5496687dc63dbc5e3542b8a7ff2ab..1f022c4bbe747face37ef5eb3af592a91d457441 100644 (file)
@@ -657,7 +657,8 @@ m68hc11sio_io_write_buffer (struct hw *me,
 
 
 const struct hw_descriptor dv_m68hc11sio_descriptor[] = {
-  { "m68hc11sio", m68hc11sio_finish, },
+  { "m68hc11sio", m68hc11sio_finish },
+  { "m68hc12sio", m68hc11sio_finish },
   { NULL },
 };
 
index abde515131b192c1d1fe111c660cf0874d971ea4..d0bdfda99536ef66dd472618719f6f1873cc19ac 100644 (file)
@@ -527,7 +527,8 @@ m68hc11spi_io_write_buffer (struct hw *me,
 
 
 const struct hw_descriptor dv_m68hc11spi_descriptor[] = {
-  { "m68hc11spi", m68hc11spi_finish, },
+  { "m68hc11spi", m68hc11spi_finish },
+  { "m68hc12spi", m68hc11spi_finish },
   { NULL },
 };
 
index 355139fdf526d324b9756cc160d10db47f624047..144ae4bf2037f18e7437b161083bdc6552c8334b 100644 (file)
@@ -111,7 +111,6 @@ attach_m68hc11tim_regs (struct hw *me,
                     me);
 }
 
-
 static void
 m68hc11tim_finish (struct hw *me)
 {
@@ -128,7 +127,7 @@ m68hc11tim_finish (struct hw *me)
 #else
   me->to_ioctl = m68hc11tim_ioctl;
 #endif
-
+  
   /* Preset defaults.  */
   controller->clock_prescaler = 1;
   controller->tcnt_adjust = 0;
@@ -688,7 +687,8 @@ m68hc11tim_io_write_buffer (struct hw *me,
 
 
 const struct hw_descriptor dv_m68hc11tim_descriptor[] = {
-  { "m68hc11tim", m68hc11tim_finish, },
+  { "m68hc11tim", m68hc11tim_finish },
+  { "m68hc12tim", m68hc11tim_finish },
   { NULL },
 };