Bug in am29f040b.c causes flash device not to be recognised

Peter Fox peter.fox at aeroflex.com
Thu Nov 6 03:31:01 CET 2003


That also works, here's the assembly difference between
my version with volatiles in the cast, and yours with
the bios type changed:

--- am29f040b-v.s       Wed Nov  5 14:20:34 2003
+++ am29f040b.s Thu Nov  6 08:54:13 2003
@@ -23,12 +23,12 @@
        subl    $24, %esp
        movl    8(%ebp), %edx
        movl    12(%edx), %eax
-       movb    $-86, 1365(%eax)
+       movb    $170, 1365(%eax)
        movb    $85, 682(%eax)
-       movb    $-112, 1365(%eax)
+       movb    $144, 1365(%eax)
        movzbl  (%eax), %esi
        movb    1(%eax), %bl
-       movb    $-16, (%eax)
+       movb    $240, (%eax)
        movzbl  %bl, %edi
        pushl   $10
        call    myusec_delay

-- 
Peter Fox <peter.fox at aeroflex.com>     Aeroflex Test Solutions
Principal Design Engineer                            Stevenage
Any opinions expressed above are      http://www.aeroflex.com/
not necessarily those of Aeroflex.   Tel: + 44 (0) 1438 742200

  -----Original Message-----
  From: linuxbios-admin at clustermatic.org
  [mailto:linuxbios-admin at clustermatic.org]On Behalf Of ron minnich
  Sent: 05 November 2003 16:38
  To: Peter Fox
  Cc: Linuxbios
  Subject: Re: Bug in am29f040b.c causes flash device not to be recognised
  
  
  I applied the fix in a slightly different way, can you test this for me?
  
  It looks like this now:
  
  int probe_29f040b (struct flashchip * flash)
  {
          volatile unsigned char * bios = flash->virt_addr;
          unsigned char id1, id2;
  
          *(bios + 0x555) = 0xAA;
          *(bios + 0x2AA) = 0x55;
          *(bios + 0x555) = 0x90;
     
          id1 = * bios;
          id2 = * (bios + 0x01);
  
          *bios = 0xF0;
  
          myusec_delay(10);
     
          printf("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, id1, id2);
          if (id1 == flash->manufacture_id && id2 == flash->model_id)
                  return 1;
  
          return 0;
  }
  
  
  ron
  
  _______________________________________________
  Linuxbios mailing list
  Linuxbios at clustermatic.org
  http://www.clustermatic.org/mailman/listinfo/linuxbios



More information about the coreboot mailing list