<html><body>
<p>Hi Bart.<br>
<br>
I just got my hands on another ALIX3C3 as I hadn't had a chance to try your suggestion until now. I also have problems compiling your program on Voyage itself and on Ubuntu. Not sure what packages I need for those C headers, but I WAS able to compile it on my CentOS 4.5 box. I've attached that for others. Here's my output from your program:<br>

<ul><font face="Courier New">iopl succeeded</font><br>
<br>
<br>
<font face="Courier New">before                l_LOCK: [613C]        0</font><br>
<font face="Courier New">execute                     : [613C]        0</font><br>
<font face="Courier New">after                 l_LOCK: [613C]        0</font><br>
<br>
<font face="Courier New">before                h_LOCK: [61BC]        0</font><br>
<font face="Courier New">execute                     : [61BC]        0</font><br>
<font face="Courier New">after                 h_LOCK: [61BC]        0</font><br>
<br>
<font face="Courier New">before               l_INPUT: [6120]  F7AF085</font><br>
<font face="Courier New">execute                     : [6120]   400000</font><br>
<font face="Courier New">after                l_INPUT: [6120]  F7AF085</font><br>
<br>
<font face="Courier New">before                l_AUX1: [6110] 3FFDC002</font><br>
<font face="Courier New">execute                     : [6110]   400000</font><br>
<font face="Courier New">after                 l_AUX1: [6110] 3FFDC002</font><br>
<br>
<font face="Courier New">before                l_AUX2: [6114] FFFF0000</font><br>
<font face="Courier New">execute                     : [6114]   400000</font><br>
<font face="Courier New">after                 l_AUX2: [6114] FFFF0000</font><br>
<br>
<font face="Courier New">before          l_OPEN_DRAIN: [6108] FFBF0040</font><br>
<font face="Courier New">execute                     : [6108]       40</font><br>
<font face="Courier New">after           l_OPEN_DRAIN: [6108] FFBF0040</font><br>
<br>
<font face="Courier New">before              l_OUTPUT: [6104] 3FBDC042</font><br>
<font face="Courier New">execute                     : [6104]       40</font><br>
<font face="Courier New">after               l_OUTPUT: [6104] 3FBDC042</font><br>
<br>
<font face="Courier New">before               h_INPUT: [61A0] EBFF1400</font><br>
<font face="Courier New">execute                     : [61A0]  A000000</font><br>
<font face="Courier New">after                h_INPUT: [61A0] EBFF1400</font><br>
<br>
<font face="Courier New">before                h_AUX1: [6190] FEFF0100</font><br>
<font face="Courier New">execute                     : [6190]  A000000</font><br>
<font face="Courier New">after                 h_AUX1: [6190] FEFF0100</font><br>
<br>
<font face="Courier New">before                h_AUX2: [6194] FFFF0000</font><br>
<font face="Courier New">execute                     : [6194]  A000000</font><br>
<font face="Courier New">after                 h_AUX2: [6194] FFFF0000</font><br>
<br>
<font face="Courier New">before          h_OPEN_DRAIN: [6188] F5FF0A00</font><br>
<font face="Courier New">execute                     : [6188]      A00</font><br>
<font face="Courier New">after           h_OPEN_DRAIN: [6188] F5FF0A00</font><br>
<br>
<font face="Courier New">before              h_OUTPUT: [6184] F4FF0B00</font><br>
<font face="Courier New">execute                     : [6184]      A00</font><br>
<font face="Courier New">after               h_OUTPUT: [6184] F4FF0B00</font><br>
<font face="Courier New">Disable all leds</font><br>
<br>
<font face="Courier New">before                l_PINS: [6100] FFBF0040</font><br>
<font face="Courier New">execute                     : [6100]       40</font><br>
<font face="Courier New">after                 l_PINS: [6100] FFBF0040</font><br>
<br>
<font face="Courier New">before                h_PINS: [6180] FFFF0000</font><br>
<font face="Courier New">execute                     : [6180]      A00</font><br>
<font face="Courier New">after                 h_PINS: [6180] F5FF0A00</font><br>
<font face="Courier New">Enable led 1</font><br>
<br>
<font face="Courier New">before                l_PINS: [6100] FFBF0040</font><br>
<font face="Courier New">execute                     : [6100]   400000</font><br>
<font face="Courier New">after                 l_PINS: [6100] FFFF0000</font><br>
<font face="Courier New">Enable led 2</font><br>
<br>
<font face="Courier New">before                h_PINS: [6180] F5FF0A00</font><br>
<font face="Courier New">execute                     : [6180]  2000000</font><br>
<font face="Courier New">after                 h_PINS: [6180] F7FF0800</font><br>
<font face="Courier New">Enable led 3</font><br>
<br>
<font face="Courier New">before                h_PINS: [6180] F7FF0800</font><br>
<font face="Courier New">execute                     : [6180]  8000000</font><br>
<font face="Courier New">after                 h_PINS: [6180] FFFF0000</font></ul>
<br>
It sequences through the LED's a couple times and then leaves them all on. I then try (as suggested in Voyage README):<br>
<br>
<font face="Courier New">To turn off LED:<br>
                 # echo 0 > /sys/class/leds/alix\:1/brightness</font><font size="4" face="DANNY"><br>
</font><tt><font size="4"><br>
</font></tt>No response. Then:<br>
<br>
<font face="Courier New">To turn on LED on ALIX:<br>
                 # echo 1 > /sys/class/leds/alix\:1/brightness</font><tt><font size="4"><br>
</font></tt><br>
The first LED turns OFF (opposite to expected).<br>
<br>
So it seems like we're getting close - we can turn them all on and then off but then your program needs to be run again to turn them on again. <br>
<br>
This isn't a major priority for me anymore but just wanted to share my experiences in case someone else was concerned with getting their LED's operational.<br>
<br>
Thanks again, Joel.<br>
<i>(See attached file: testled)</i><br>
------------------------------------------------------------------------<br>
Joel Carter<br>
Internet Engineering Lab (IEL)<br>
Group for Advanced Information Technology (GAIT)<br>
British Columbia Institute of Technology<br>
<a href="http://www.bcit.ca/appliedresearch">http://www.bcit.ca/appliedresearch</a><br>
e jcarter@bcit.ca<br>
p 604 451-6929<br>
f 604 436-0286<br>
------------------------------------------------------------------------<br>
<br>
<img width="16" height="16" src="cid:2__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca" border="0" alt="Inactive hide details for Bart Jooris <Bart.Jooris@intec.ugent.be>">Bart Jooris <Bart.Jooris@intec.ugent.be><br>
<br>
<br>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td style="background-image:url(cid:3__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca); background-repeat: no-repeat; " width="40%">
<ul>
<ul>
<ul>
<ul><b><font size="2">Bart Jooris <Bart.Jooris@intec.ugent.be></font></b><font size="2"> </font>
<p><font size="2">Aug 13, 2008 07:07 AM</font></ul>
</ul>
</ul>
</ul>
</td><td width="60%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:4__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca" border="0" alt=""><br>
<div align="right"><font size="2">To</font></div></td><td width="100%"><img width="1" height="1" src="cid:4__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca" border="0" alt=""><br>
<font size="2">Joel Carter <Joel_Carter@bcit.ca>, Sancho <sancho@sancho.sk></font></td></tr>

<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:4__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca" border="0" alt=""><br>
<div align="right"><font size="2">cc</font></div></td><td width="100%"><img width="1" height="1" src="cid:4__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca" border="0" alt=""><br>
<font size="2">voyage-linux@voyage.hk</font></td></tr>

<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:4__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca" border="0" alt=""><br>
<div align="right"><font size="2">Subject</font></div></td><td width="100%"><img width="1" height="1" src="cid:4__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca" border="0" alt=""><br>
<font size="2">Re: [Voyage-linux] re: Alix 3C3 and LEDs</font></td></tr>
</table>

<table border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="58"><img width="1" height="1" src="cid:4__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca" border="0" alt=""></td><td width="336"><img width="1" height="1" src="cid:4__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca" border="0" alt=""></td></tr>
</table>
</td></tr>
</table>
<br>
<tt>Hi Joel, Sancho,<br>
<br>
Maybe you still have the led problem on the ALIX 3C3?<br>
I Checked the CS5536 datasheet and seems that the chip is not rightly <br>
configured to<br>
use the leds-alix without any reconfig.<br>
<br>
on my machines after boot (with still old bios (before July 2008))<br>
<br>
led1 was not set as output<br>
led2 was configured as input...<br>
led3 was configured to aux1<br>
<br>
see the testled output (check if "before" and "after" differ) on your <br>
machine.<br>
<br>
After running testled, leds-alix should work.<br>
<br>
Cheers,<br>
<br>
Bart Jooris<br>
Researcher<br>
IBBT-IBCN research group-Ghent University<br>
<br>
<br>
<br>
<br>
Joel Carter wrote:<br>
<br>
> Hi Sancho.<br>
><br>
> I posed this question awhile ago to the list and never got a <br>
> resolution for getting the LED's working on my 3c3. I have to agree <br>
> that it must be something to do with the different BIOS since I also <br>
> have a 3c1 and just tried it as suggested in the Voyage README and it <br>
> worked perfectly:<br>
><br>
> $modprobe leds-alix<br>
> $echo 1 > /sys/class/leds/alix\:2/brightness<br>
><br>
> Joel.<br>
><br>
>------------------------------------------------------------------------<br>
><br>
>_______________________________________________<br>
>Voyage-linux mailing list<br>
>Voyage-linux@list.voyage.hk<br>
><a href="http://list.voyage.hk/mailman/listinfo/voyage-linux">http://list.voyage.hk/mailman/listinfo/voyage-linux</a><br>
>  <br>
><br>
<br>
/*                                                                                                                                               tab:4<br>
* Copyright (c) 2008 Ghent University    <br>
* All rights reserved.<br>
 *<br>
 * @author Bart Jooris<br>
 * <br>
 * IBBT - IBCN research group - Ghent University<br>
 * E-mail: Bart.Jooris  intec.UGent.be<br>
 * Implementation testleds alix3c3.<br>
 * After config of GPIO 6, 25 and 27 (see schematics of ALIX3C3)<br>
 * all leds will be disabled<br>
 * then every second a led will be enabled<br>
 * <br>
 * compile with: gcc testled.c -o testled      <br>
 **/<br>
<br>
<br>
#define extern static<br>
#include <asm/io.h><br>
#undef extern<br>
#include <stdio.h><br>
#include <sys/ioctl.h><br>
<br>
#define CS5536_BASE 0x06100<br>
#define CLEAR_BIT_6  (unsigned long) 0x00400000<br>
#define SET_BIT_6    (unsigned long) 0x00000040<br>
#define CLEAR_BIT_9  (unsigned long) 0x02000000<br>
#define SET_BIT_9    (unsigned long) 0x00000200<br>
#define CLEAR_BIT_11 (unsigned long) 0x08000000<br>
#define SET_BIT_11   (unsigned long) 0x00000800<br>
<br>
void wrapped_outl (char info[], long addr, long value) {<br>
                 printf("\n");<br>
                 printf("before  %20s: [%X] %8X\n", info, addr, inl_p(addr));<br>
                 printf("execute %20s: [%X] %8X\n", "", addr, value);<br>
                 outl_p(value,addr);<br>
                 printf("after   %20s: [%X] %8X\n", info, addr, inl_p(addr));<br>
}<br>
<br>
int main (int argc, char **argv) {<br>
                 if (iopl(3)==0) printf("iopl succeeded\n\n");<br>
<br>
//-------Begin config-----------------------------------------------------------<br>
<br>
//See Registers of CS5536 @ datasheet p 480- <br>
<br>
                 //Check LOCK<br>
                 wrapped_outl ("l_LOCK",CS5536_BASE+0x03C,0);<br>
                 wrapped_outl ("h_LOCK",CS5536_BASE+0x0BC,0);<br>
<br>
                 //config LED 1 (GPIO 6)<br>
                 //Disable INPUT<br>
                 wrapped_outl("l_INPUT",CS5536_BASE+0x020,CLEAR_BIT_6);<br>
                 //Disable AUX 1<br>
                 wrapped_outl("l_AUX1",CS5536_BASE+0x010,CLEAR_BIT_6);<br>
                 //Disable AUX 2<br>
                 wrapped_outl("l_AUX2",CS5536_BASE+0x014,CLEAR_BIT_6);<br>
                 //Enable open drain<br>
                 wrapped_outl("l_OPEN_DRAIN",CS5536_BASE+0x008,SET_BIT_6);<br>
                 //Enable output<br>
                 wrapped_outl("l_OUTPUT",CS5536_BASE+0x004,SET_BIT_6);<br>
<br>
                 //config LED 2 and 3 (GPIO 25 and 27)<br>
                 //Disable INPUT<br>
                 wrapped_outl("h_INPUT",CS5536_BASE+0x0A0,CLEAR_BIT_9 | CLEAR_BIT_11);<br>
                 //Disable AUX 1<br>
                 wrapped_outl("h_AUX1",CS5536_BASE+0x090,CLEAR_BIT_9 | CLEAR_BIT_11);<br>
                 //Disable AUX 2<br>
                 wrapped_outl("h_AUX2",CS5536_BASE+0x094,CLEAR_BIT_9 | CLEAR_BIT_11);<br>
                 //Enable open drain<br>
                 wrapped_outl("h_OPEN_DRAIN",CS5536_BASE+0x088,SET_BIT_9 | SET_BIT_11);<br>
                 //Enable output<br>
                 wrapped_outl("h_OUTPUT",CS5536_BASE+0x084,SET_BIT_9 | SET_BIT_11);<br>
<br>
//-------End of config-----------------------------------------------------------<br>
<br>
                 printf("Disable all leds\n");<br>
                 //Disable LED1<br>
                 wrapped_outl("l_PINS",CS5536_BASE+0x000, SET_BIT_6);<br>
                 //disable LED 2 and 3<br>
                 wrapped_outl("h_PINS",CS5536_BASE+0x080, SET_BIT_9 | SET_BIT_11);<br>
<br>
                 sleep(1);<br>
                 printf("Enable led 1\n");<br>
                 //Enable LED1<br>
                 wrapped_outl("l_PINS",CS5536_BASE+0x000, CLEAR_BIT_6);<br>
<br>
                 sleep(1);<br>
                 printf("Enable led 2\n");<br>
                 //Enable LED2<br>
                 wrapped_outl("h_PINS",CS5536_BASE+0x080, CLEAR_BIT_9);<br>
<br>
                 sleep(1);<br>
                 printf("Enable led 3\n");<br>
                 //Enable LED3<br>
                 wrapped_outl("h_PINS",CS5536_BASE+0x080, CLEAR_BIT_11);<br>
}<br>
<br>
</tt><br>
</body></html>