Hi,

I'm back to hacking on LinuxBIOS again (I've been busy with work and
life).  I have updated the SCx200 code of LinuxBIOS so that it works
with the latest version from CVS.  The changes are:

    * Change SCx200_DOCCS_BASE from 0xc0000000 to 0x80000000 in the
      config file.  It seems that LinuxBIOS has changed the memory
      region where it allocates PCI resources, so this collided with
      the DOCCS memory region.  Using 0x80000000 works better.

    * Change the ACCESS.bus base addresses to 0x820 and 0x840 in the
      config file, this matches what the NatSemi XpressROM.

    * Change a bunch of "option FOO" to "option FOO=1".

    * Fix a bug in scx200_setup.inc.  SuperI/O device 5 was
      initialized twice, the second initialization has been changed to
      work on device 6 as it should do.

By the way, I'm seeing a really strange error:

    Finding PCI configuration type.
    PCI: Using configuration type 1
    Scanning PCI bus...PCI: pci_scan_bus for bus 0
    Error! malloc: Free_mem_ptr >= free_mem_end_ptr

I decided to try to figure out what was going on and added a debug
message to print out the values of eheap and heap in
freebios/src/lib/malloc.c: 

    void *malloc(size_t size)
    {
            void *p;
 
    +    printk_info("heap = 0x%lx, eheap = 0x%lx\n", (long)_heap, (long)_eheap);
            MALLOCDBG((__FUNCTION__ " Enter, size %d, free_mem_ptr %p\n", size, 
free_mem_ptr));

what is so strange is that this fixed the problem and it is
repeatable, if I remove the printk, the error will reappear.  Has
anyone seen anything like this?  Could it be gcc acting up?

    bash$ gcc -v
    Reading specs from /usr/lib/gcc-lib/i486-suse-linux/2.95.3/specs
    gcc version 2.95.3 20010315 (SuSE)

    bash$ ld -v
    GNU ld version 2.11.90.0.29 (with BFD 2.11.90.0.29)

It could also be timing related, I'll try to explore a bit more.

  /Christer

diff -x CVS -x SCCS -x BitKeeper -x ChangeSet -x *.o -x *.a -x .*depend -x System.map 
-x .version -x .config.old -x *.stamp -x *.flags -x *.ver -x *.rej -x *.orig -x *~ -x 
.#* -ur freebios.orig/src/mainboard/nano/nano/Config 
freebios/src/mainboard/nano/nano/Config
--- freebios.orig/src/mainboard/nano/nano/Config        Mon Jul  8 19:21:23 2002
+++ freebios/src/mainboard/nano/nano/Config     Mon Jul  8 22:21:52 2002
@@ -37,7 +37,7 @@
 # Where the Disk On Chip Chip Select pin is mapped in memory. 
 # See the SCx200 databook for more information.
 
-option SCx200_DOCCS_BASE=0xc0000000
+option SCx200_DOCCS_BASE=0x80000000
 option SCx200_DOCCS_CTRL=0x070007ff
 
 ########################################################################
@@ -93,10 +93,10 @@
 option SCx200_PP_IRQ=7
 
 # ACCESS.bus 1
-option SCx200_ACB1_BASE=0x8200
+option SCx200_ACB1_BASE=0x820
 option SCx200_ACB1_IRQ=0
 # ACCESS.bus 2
-option SCx200_ACB2_BASE=0x8400
+option SCx200_ACB2_BASE=0x840
 option SCx200_ACB2_IRQ=0
 
 # Interrupt steering, same as a Cx5530
@@ -106,12 +106,12 @@
 option SCx200_INTD=12
 
 # This is probably the same as a Cx5530
-option SCx200_PRIMARY_IDE
-#option SCx200_SECONDARY_IDE
+option SCx200_PRIMARY_IDE=1
+#option SCx200_SECONDARY_IDE=1
 
 ########################################################################
 
-option NO_KEYBOARD
+option NO_KEYBOARD=1
 option FINAL_MAINBOARD_FIXUP=1
 object mainboard.o
 
diff -x CVS -x SCCS -x BitKeeper -x ChangeSet -x *.o -x *.a -x .*depend -x System.map 
-x .version -x .config.old -x *.stamp -x *.flags -x *.ver -x *.rej -x *.orig -x *~ -x 
.#* -ur freebios.orig/src/mainboard/nano/nano/config.example 
freebios/src/mainboard/nano/nano/config.example
--- freebios.orig/src/mainboard/nano/nano/config.example        Mon Jul  8 19:21:23 
2002
+++ freebios/src/mainboard/nano/nano/config.example     Wed Jul 10 01:47:01 2002
@@ -15,10 +15,10 @@
 option TTYS0_BAUD=38400
 
 option DEFAULT_CONSOLE_LOGLEVEL=9
-option DEBUG
+option DEBUG=1
 
-#option INBUF_COPY
-option RAMTEST
+#option INBUF_COPY=1
+option RAMTEST=1
 #option BOOT_IDE=1
 #option BOOT_TFTP=1
 
diff -x CVS -x SCCS -x BitKeeper -x ChangeSet -x *.o -x *.a -x .*depend -x System.map 
-x .version -x .config.old -x *.stamp -x *.flags -x *.ver -x *.rej -x *.orig -x *~ -x 
.#* -ur freebios.orig/src/southbridge/nsc/scx200/scx200_setup.inc 
freebios/src/southbridge/nsc/scx200/scx200_setup.inc
--- freebios.orig/src/southbridge/nsc/scx200/scx200_setup.inc   Mon Jul  8 19:21:33 
2002
+++ freebios/src/southbridge/nsc/scx200/scx200_setup.inc        Mon Jul  8 22:43:23 
+2002
@@ -230,7 +230,7 @@
 #endif
 
 #ifdef SCx200_ACB2_BASE
-       .byte   0x07, 0x05              /* Device 6 -- ACCESS.bus 2 */
+       .byte   0x07, 0x06              /* Device 6 -- ACCESS.bus 2 */
        .byte   0x30, 0x00              /* Disable */
        .byte   0x60, SCx200_ACB2_BASE>>8 /* I/O Base Address */
        .byte   0x61, SCx200_ACB2_BASE&0xff

-- 
I'm a freelance consultant specializing in Linux device drivers
<[EMAIL PROTECTED]> -- for consulting related mail
<[EMAIL PROTECTED]> -- for private stuff
<[EMAIL PROTECTED]> -- for anything related to the Nano Computer

Reply via email to