Port-amiga archive

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

Re: On A1200 Clock (blizzard 1230mkIV) on netbsd current (BUG!)



Found the problem (silly mistake):

        msm6242b_write(sc, MSM6242B_10MONTH, dt->dt_mon / 10);
        msm6242b_write(sc, MSM6242B_1MONTH, dt->dt_mon % 10);
        msm6242b_write(sc, MSM6242B_10YEAR, (dt->dt_mon / 10) % 10);
        msm6242b_write(sc, MSM6242B_1YEAR, dt->dt_mon % 10);

Notice dt_mon != dt_year. My guess is that the code was tested during
December 2012...

Fixed. Tested it on my A1200 and it works correctly. Patch attached.

On Tue, Dec 3, 2013 at 9:55 AM, Roc Vallès <vallesroc%gmail.com@localhost> 
wrote:
> Confirmed the problem: 2012 again (date on AmigaOS after
> netbsd-GENERIC halt & power cycle), with date and time otherwise
> correct.
>
> Just in case, I tried setting year to 2013, setclock save and some 20
> seconds of power cycle. date on AmigaOS is 2013.
>
> So, somehow, 2013 becomes 2012 when netbsd saves the date on the blizzard's 
> RTC.
--- sys/dev/ic/msm6242b.c       14 Nov 2012 17:15:25 -0000      1.2
+++ sys/dev/ic/msm6242b.c       4 Dec 2013 06:58:30 -0000
@@ -243,8 +243,8 @@
        msm6242b_write(sc, MSM6242B_1DAY, dt->dt_day % 10);
        msm6242b_write(sc, MSM6242B_10MONTH, dt->dt_mon / 10);
        msm6242b_write(sc, MSM6242B_1MONTH, dt->dt_mon % 10);
-       msm6242b_write(sc, MSM6242B_10YEAR, (dt->dt_mon / 10) % 10);
-       msm6242b_write(sc, MSM6242B_1YEAR, dt->dt_mon % 10);
+       msm6242b_write(sc, MSM6242B_10YEAR, (dt->dt_year / 10) % 10);
+       msm6242b_write(sc, MSM6242B_1YEAR, dt->dt_year % 10);
        msm6242b_write(sc, MSM6242B_WEEK, dt->dt_wday);
 
        msm6242b_free(sc);


Home | Main Index | Thread Index | Old Index