DragonFly BSD
DragonFly kernel List (threaded) for 2004-05
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: New DFly ISO CD image available 20040506


From: Rahul Siddharthan <rsidd@xxxxxxxxx>
Date: Fri, 7 May 2004 22:03:27 -0400

Matthew Dillon wrote:
> 
>     Rahul, please try acpica5 instead of acpica.  Add 'device acpica5'
>     nad remove 'device acpica' from your kernel config.

OK, I'm doing this now.  Also kern.mmxopt=1.  So far so good.

My module attempt was actually with the patch posted to submit@ by
Tomokazu Yonetani on Apr 29; perhaps that was responsible for the
hangs, I should have backed it out.

It's still not as functional as acpi on linux.  Basically, the
embedded controller doesn't work (this was also a problem on FreeBSD
5).  As a result, no battery status, and the LCD brightness keys don't
work.  I got feedback from Nate Lawson some time back on it, he said
we need to program the ELCR registers, that's what linux does but the
linux way was ugly.  He was referring to the following code from
linux/arch/i386/kernel/acpi.c .



#ifdef  CONFIG_ACPI_BUS
/*
 * "acpi_pic_sci=level" (current default)
 * programs the PIC-mode SCI to Level Trigger.
 * (NO-OP if the BIOS set Level Trigger already)
 *
 * If a PIC-mode SCI is not recogznied or gives spurious IRQ7's
 * it may require Edge Trigger -- use "acpi_pic_sci=edge"
 * (NO-OP if the BIOS set Edge Trigger already)
 *
 * Port 0x4d0-4d1 are ECLR1 and ECLR2, the Edge/Level Control Registers
 * for the 8259 PIC.  bit[n] = 1 means irq[n] is Level, otherwise Edge.
 * ECLR1 is IRQ's 0-7 (IRQ 0, 1, 2 must be 0)
 * ECLR2 is IRQ's 8-15 (IRQ 8, 13 must be 0)
 */

static __initdata int   acpi_pic_sci_trigger;   /* 0: level, 1: edge */

void __init
acpi_pic_sci_set_trigger(unsigned int irq)
{
        unsigned char mask = 1 << (irq & 7);
        unsigned int port = 0x4d0 + (irq >> 3);
        unsigned char val = inb(port);


        printk(PREFIX "IRQ%d SCI:", irq);
        if (!(val & mask)) {
                printk(" Edge");

                if (!acpi_pic_sci_trigger) {
                        printk(" set to Level");
                        outb(val | mask, port);
                }
        } else {
                printk(" Level");

                if (acpi_pic_sci_trigger) {
                        printk(" set to Edge");
                        outb(val | mask, port);
                }
        }
        printk(" Trigger.\n");
}

int __init
acpi_pic_sci_setup(char *str)
{
        while (str && *str) {
                if (strncmp(str, "level", 5) == 0)
                        acpi_pic_sci_trigger = 0;       /* force level trigger */
                if (strncmp(str, "edge", 4) == 0)
                        acpi_pic_sci_trigger = 1;       /* force edge trigger */
                str = strchr(str, ',');
                if (str)
                        str += strspn(str, ", \t");
        }
        return 1;
}

__setup("acpi_pic_sci=", acpi_pic_sci_setup);

#endif /* CONFIG_ACPI_BUS */



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