sim: bfin: fix inverted W1C logic
[binutils-gdb.git] / sim / bfin / dv-bfin_otp.c
index d30a4140435dd4ff9d27de62c4527c3633ae59f1..5b15eeb118917465bd00d4b8124574204477efe3 100644 (file)
@@ -52,7 +52,8 @@ struct bfin_otp
 #define mmr_offset(mmr) (offsetof(struct bfin_otp, mmr) - mmr_base())
 #define mmr_idx(mmr)    (mmr_offset (mmr) / 4)
 
-static const char * const mmr_names[] = {
+static const char * const mmr_names[] =
+{
   "OTP_CONTROL", "OTP_BEN", "OTP_STATUS", "OTP_TIMING",
   [mmr_idx (data0)] = "OTP_DATA0", "OTP_DATA1", "OTP_DATA2", "OTP_DATA3",
 };
@@ -148,7 +149,7 @@ bfin_otp_io_write_buffer (struct hw *me, const void *source, int space,
     case mmr_offset(status):
       dv_bfin_mmr_require_16 (me, addr, nr_bytes, true);
       /* XXX: All bits seem to be W1C.  */
-      dv_w1c_2 (value16p, value, 0);
+      dv_w1c_2 (value16p, value, -1);
       break;
     case mmr_offset(timing):
     case mmr_offset(data0):
@@ -301,7 +302,8 @@ bfin_otp_finish (struct hw *me)
   bfin_otp_write_page_val (otp, FPS03, (void *)part_str);
 }
 
-const struct hw_descriptor dv_bfin_otp_descriptor[] = {
+const struct hw_descriptor dv_bfin_otp_descriptor[] =
+{
   {"bfin_otp", bfin_otp_finish,},
   {NULL, NULL},
 };