Ok first off the issue with ROM_CC and #if - #else - #endif not compiling properly.
After some testing I have at least found the problem and it only ever happens if you put a C++ style comment on the same line as the #if or #else
so in the following example
static void test_ifdef(void) {
#if TEST_IFDEF // blows up outb(50,100); outb(51,100); outb(52,100); #else /* ok */ outb(60,100); outb(61,100); outb(62,100); #endif }
Of course no comment works fine as well. Also putting a blank line after the comment produces the correct code. I can't say for the rest of the linuxbios code, but the via/epia code seems to have a good mixture of both types of comments.
Perhaps as the code is not strictly C++ you should stick to using standard C style comments.
Ok now to my problems with the EPIA board. I think in general it is working ok, but I still have some problems.
From a cold boot and also at other times, it will just hang. I am having
problems tracking down just where it hangs.
At first sight it appears to happen inside the SMBus read function, but that is a guess from the debug output. The problem I get is if I try and add any debug output inside SMBus read it gets worse and locks more frequently.
If I have the memory test enabled it can also lock up when doing the verify.
So I guess I can think of 3 reason for it to lock.
1. Some enabled, but not handled interrupt is happening. (I would assume that all interrupts are disabled at powerup but hardware so this is probably not it)
2. Southbridge is not configured properly. (would be very bad chip design if the SMBus part of the southbridge interferred with the rest of the functionality)
3. It is actually running, but serial output has stopped. ( don't think this is the case as it never boots up)
I guess I need to look for loops that can become locked, probably withing the serial output code.
Can anyone think of some other reason for it to lock up ?