In message <[EMAIL PROTECTED]>, Jean-Michel Vansteene writes:

Here is the patch for FreeBSD-current to access the net5501
error-led.  I've asked the releng team for permission to commit.

Index: geode.c
===================================================================
RCS file: /home/ncvs/src/sys/i386/i386/geode.c,v
retrieving revision 1.9
diff -u -r1.9 geode.c
--- geode.c     27 Mar 2007 21:03:37 -0000      1.9
+++ geode.c     17 Sep 2007 13:44:16 -0000
@@ -49,6 +49,16 @@
        }
 };
 
+static struct bios_oem bios_soekris_55 = {
+       { 0xf0000, 0xf1000 },
+       {
+               { "Soekris", 0, 8 },    /* Soekris Engineering. */
+               { "net5", 0, 8 },       /* net45xx */
+               { "comBIOS", 0, 54 },   /* comBIOS ver. 1.26a  20040819 ... */
+               { NULL, 0, 0 },
+       }
+};
+
 static struct bios_oem bios_pcengines = {
        { 0xf9000, 0xfa000 },
        {
@@ -94,6 +104,25 @@
        outl(gpio, u);
 }
 
+static void
+cs5536_led_func(void *ptr, int onoff)
+{
+       int bit;
+       uint16_t a;
+
+       bit = *(int *)ptr;
+       if (bit < 0) {
+               bit = -bit;
+               onoff = !onoff;
+       }
+
+       a = rdmsr(0x5140000c);
+       if (onoff)
+               outl(a, 1 << bit);
+       else
+               outl(a, 1 << (bit + 16));
+}
+
 
 static unsigned
 geode_get_timecount(struct timecounter *tc)
@@ -182,7 +211,8 @@
 #define BIOS_OEM_MAXLEN 80
        static u_char bios_oem[BIOS_OEM_MAXLEN] = "\0";
 
-       if (pci_get_devid(self) == 0x0515100b) {
+       switch (pci_get_devid(self)) {
+       case 0x0515100b:
                if (geode_counter == 0) {
                        /*
                         * The address of the CBA is written to this register
@@ -199,7 +229,8 @@
                            NULL, 0);
                        set_cputicker(geode_cputicks, 27000000, 0);
                }
-       } else if (pci_get_devid(self) == 0x0510100b) {
+               break;
+       case 0x0510100b:
                gpio = pci_read_config(self, PCIR_BAR(0), 4);
                gpio &= ~0x1f;
                printf("Geode GPIO@ = %x\n", gpio);
@@ -223,13 +254,23 @@
                }
                if ( strlen(bios_oem) )
                        printf("Geode %s\n", bios_oem);
-       } else if (pci_get_devid(self) == 0x01011078) {
+               break;
+       case 0x01011078:
                if ( bios_oem_strings(&bios_advantech,
                                bios_oem, BIOS_OEM_MAXLEN) > 0 ) {
                        printf("Geode %s\n", bios_oem);
                        EVENTHANDLER_REGISTER(watchdog_list, advantech_watchdog,
                            NULL, 0);
                }
+               break;
+       case 0x20801022:
+               if ( bios_oem_strings(&bios_soekris_55,
+                   bios_oem, BIOS_OEM_MAXLEN) > 0 ) {
+                       printf("Geode LX: %s\n", bios_oem);
+                       led1b = 6;
+                       led1 = led_create(cs5536_led_func, &led1b, "error");
+               }
+               break;
        }
        return (ENXIO);
 }
-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED]         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.
_______________________________________________
Soekris-tech mailing list
Soekris-tech@lists.soekris.com
http://lists.soekris.com/mailman/listinfo/soekris-tech

Reply via email to