Port-i386 archive

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

Workaround for invalid firmware-date values



Hello,

When booting NetBSD on a MacBook Pro 2,2, I get the following message:

    ACPI: BIOS is too old (19070813). Set acpi_force_load to use.

This means (obviously) that ACPI does not work at all and, in turn, that
some devices such as the firewire controller do not work (failure to
assign interrupts).

I forced the load of the ACPI code and things just work.

How does the workaround below look?

Thanks!



Index: acpi_quirks.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpi_quirks.c,v
retrieving revision 1.18
diff -u -p -r1.18 acpi_quirks.c
--- acpi_quirks.c       6 Sep 2010 15:54:27 -0000       1.18
+++ acpi_quirks.c       17 Jan 2011 21:28:05 -0000
@@ -112,6 +112,7 @@ acpi_find_bios_year(void)
 {
        const char *datestr = pmf_get_platform("firmware-date");
        unsigned long date;
+       int year;
 
        if (datestr == NULL)
                return -1;
@@ -121,7 +122,15 @@ acpi_find_bios_year(void)
                return -1;
        if (date < 19000000 || date > 99999999)
                return -1;
-       return date / 10000;
+
+       year = (int)(date / 10000);
+       if (year < 1970) {
+               /* This is obviously impossible but happens in some machines.
+                * E.g. a MacBookPro2,2 reports its year as 1907 when in fact
+                * it means 2007. */
+                year += 100;
+       }
+       return year;
 }
 #endif
 


Home | Main Index | Thread Index | Old Index