2009-06-15 10:53:21     Atmel AT45 Power of Two (BF532 + AT45DB321D)

Document created by Aaronwu Employee on Sep 18, 2013
Version 1Show Document
  • View in full screen mode

2009-06-15 10:53:21     Atmel AT45 Power of Two (BF532 + AT45DB321D)

JF Duval (CANADA)

Message: 75737   

 

Hello everybody,

 

I work on a custom BF532 board with an Atmel AT45DB321D SPI Flash.  I know that the Blackfin can't boot with this Flash if it's still in Dataflash mode (528 bytes).

 

Is there any tool included in U-Boot to change my flash to the Power of 2 mode?

 

 

 

Thanks in advance,

 

 

 

JFDuval

QuoteReplyEditDelete

 

 

2009-06-15 10:56:10     Re: Atmel AT45 Power of Two (BF532 + AT45DB321D)

Mike Frysinger (UNITED STATES)

Message: 75738   

 

there is no tool.  i imagine you could use the sspi command to manually shift out the sequence to program the OTP register though.

QuoteReplyEditDelete

 

 

2009-06-15 15:27:58     Re: Atmel AT45 Power of Two (BF532 + AT45DB321D)

JF Duval (CANADA)

Message: 75751   

 

Hello Mike,

 

I'm using the 1.1.6 version.  It seems that sspi is only in the unreleased version, am I right?

QuoteReplyEditDelete

 

 

2009-06-16 01:15:07     Re: Atmel AT45 Power of Two (BF532 + AT45DB321D)

Mike Frysinger (UNITED STATES)

Message: 75760   

 

correct.  for u-boot-1.1.6, you'd have to write all the C code to drive the SPI bus.  probably be easier to boot into linux and do something there with spidev.

QuoteReplyEditDelete

 

 

2009-06-16 08:38:49     Re: Atmel AT45 Power of Two (BF532 + AT45DB321D)

JF Duval (CANADA)

Message: 75808    Hello, I wrote a simple function in spi_flash.c:

 

//Power-of-two Mode

int atmel_po2(void)

{

    printf("Atmel Power-of-Two conversion program:\n");

 

    //Open SPI

    SPI_ON();

  

    //Send the 4 configuration bytes

    printf("Byte: 0x3D\n");

    spi_write_read_byte(0x3D);

    printf("Byte: 0x2A\n");

    spi_write_read_byte(0x2A);

    printf("Byte: 0x80\n");

    spi_write_read_byte(0x80);

    printf("Byte: 0xA6\n");

    spi_write_read_byte(0xA6);

 

    printf("Wait a moment than cycle power.\n");

 

    //Close SPI

    SPI_OFF();

}

(Yes, it's over-commented... I wanted to be sure that everything would be as planned) I called it once in int eeprom_info(void) and now my AT45 is seen with 512 bytes pages.

QuoteReplyEditDelete

 

 

2009-06-16 08:42:57     Re: Atmel AT45 Power of Two (BF532 + AT45DB321D)

Mike Frysinger (UNITED STATES)

Message: 75809   

 

thanks, i think this is useful enough to include into u-boot itself.  i'll look into it down the line.

Attachments

    Outcomes