BIOS signature recovery??

juanba juanba at suinsa.com
Fri Oct 25 09:38:55 EDT 2002


Playing with a Milenium DOC/ mts Linux tools i have lost the magic
number 0x55aa. 

Howto recovery the stuff ?

I am using directly the interface WriteDOC but it doesn't work.
Is there any quick DOC register map/scheme reference guide?
Are their some kinda ronly register?

The device is really good, in fact is already ext2 formatted and it can
be mounted for r/w operations. I have hack the docprobe stuff adding
some interface/control for the detection and so on but i wanna have also
an extra module parameter to recover the BIOS word. 
 

#ifdef CONFIG_MTD_DOCPROBE_55AA
  /* Check for 0x55 0xAA signature at beginning of window,
     this is no longer true once we remove the IPL (for Millennium */
  o_1 = ReadDOC( window, Sig1 );
  o_2 = ReadDOC( window, Sig2 );
  b_sig_lost = ( o_1 != 0x55 || o_2 != 0xaa );
  if( b_sig_lost ){
    if( !doc_config_location )
      return 0;
     printk( KERN_WARNING "docprobe: signature lost? $%02x/$%02x\n", 
	     o_1, o_2 );
     printk( KERN_WARNING "docprobe: OK. We trust you ;-)\n");
  }
#endif /* CONFIG_MTD_DOCPROBE_55AA */

#ifndef DOC_PASSIVE_PROBE	
  /* It's not possible to cleanly detect the DiskOnChip - the
   * bootup procedure will put the device into reset mode, and
   * it's not possible to talk to it without actually writing
   * to the DOCControl register. So we store the current contents
   * of the DOCControl register's location, in case we later decide
   * that it's not a DiskOnChip, and want to put it back how we
   * found it. 
   */
  tmp2 = ReadDOC(window, DOCControl);
	
  /* Reset the DiskOnChip ASIC */
  WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_RESET, 
	   window, DOCControl);
  WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_RESET, 
	   window, DOCControl);
	
  /* Enable the DiskOnChip ASIC */
  WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_NORMAL, 
	   window, DOCControl);
  WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_NORMAL, 
	   window, DOCControl);
#endif /* !DOC_PASSIVE_PROBE */	

  if( b_sig_lost && doc_recovery ){
     WriteDOC( 0x55, window, Sig1 );
     WriteDOC( 0xaa, window, Sig2 );
     o_1 = ReadDOC( window, Sig1 );
     o_2 = ReadDOC( window, Sig2 );
     b_sig_lost = ( o_1 != 0x55 || o_2 != 0xaa );
     if( b_sig_lost )
       printk(KERN_WARNING "docprobe: signature recovery: FAILs\n");
     printk( KERN_WARNING "docprobe: [ $%02x/$%02x ][ $%02x/$%02x ]\n", 
	     0x55, 0xaa, o_1, o_2 );
  }







More information about the linux-mtd mailing list