public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: juanba <juanba@suinsa.com>
To: "'linux-mtd@lists.infradead.org'" <linux-mtd@lists.infradead.org>
Subject: BIOS signature recovery??
Date: 25 Oct 2002 15:38:55 +0200	[thread overview]
Message-ID: <1035553169.29016.18.camel@tau> (raw)

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 );
  }

                 reply	other threads:[~2002-10-25 13:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1035553169.29016.18.camel@tau \
    --to=juanba@suinsa.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox