2008-04-28 03:30:01     Booting From Secure Flash

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

2008-04-28 03:30:01     Booting From Secure Flash

Appalayagari Sreedhar (INDIA)

Message: 55085   

 

Hi,

 

I am working with a Custom board. It has ST Micro Secure NOR Flash.

 

I am able to write the U-boot.bin file into the Flash memory and boot succesfully.

 

After booting, When i try to do the following

 

set serverip 172.16.6.45

 

set  ipaddr 172.16.15.46

 

set ethaddr 00:15:52:43:CE:CD

 

saveenv

 

I am getting a flash write error at offset 0x20000

 

when i do the system reset and boot the u-boot.

 

I used printenv command to check the configured values.

 

it showed nothing, seems the Flash write has not happened.

 

I think the flash driver is the problem, can anyone help me how to enable the secure flash driver if available in u-boot.

 

Can you please guide me where i should change the flash driver.

 

 

QuoteReplyEditDelete

 

 

2008-04-28 03:51:47     Re: Booting From Secure Flash

Mike Frysinger (UNITED STATES)

Message: 55087    there is no such thing as a "secure flash driver" in U-Boot.  it only cares if you're using a CFI-conforming flash.  if you arent, then you need to code your own driver.  how did you write the u-boot.bin into the flash in the first place ?

 

please post your board config file as an attachment as well as the output of `flinfo`.

QuoteReplyEditDelete

 

 

2008-04-28 05:45:53     Re: Booting From Secure Flash

Appalayagari Sreedhar (INDIA)

Message: 55113   

 

Thanks Mike,

 

Flash chip is CFI interface only.

 

but the command sequence is different from the NOR Flash device on ezkit.

 

Program, erase etc commands squence are different.

 

So i am facing the problem.

 

I wrote the Flash Write program in VDSP and wrote the u-boot.bin file into the Flash chip using that program.

 

BF533 is interfacec in BMODE : 00.

 

I am able to boot succesfully the u-boot.

 

reply me  if i am missing any information from my side.

 

I have not made any changes in config file.

 

Teraterm output i am attaching here.

 

Suggest me some steps for making the flash work properly / some docs .

 

U-Boot 1.1.6-svn (ADI-2007R1) (Apr 17 2008 - 22:35:29)

 

CPU:   ADSP BF533 Rev.: 0.5

Board: ADI BF533 EZ-Kit Lite board

       Support: http://blackfin.uclinux.org/

Clock: VCO: 594 MHz, Core: 594 MHz, System: 118 MHz

SDRAM: 64 MB

FLASH:   2.1 MB

*** Warning - bad CRC, using default environment

 

In:    serial

Out:   serial

Err:   serial

I2C:   ready

Hit any key to stop autoboot:  0

ezkit> set serverip 172.16.6.45

ezkit> set ipaddr 172.16.15.46

ezkit> set ethaddr 00:15:52:23:CE:CD

ezkit> saveenv

Saving Environment to Flash...

Un-Protected 1 sectors

Erasing Flash...

Erasing Flash locations, Please Wait

Erased 1 sectors

Writing to Flash... Flash not erased at offset 0x20000 Please erase to reprogram

 

Flash not Erased

Protected 1 sectors

 

Thankyou, Sreedhar.

 

 

QuoteReplyEditDelete

 

 

2008-04-28 06:10:42     Re: Booting From Secure Flash

Mike Frysinger (UNITED STATES)

Message: 55115    please post the information i asked for in my first reply

QuoteReplyEditDelete

 

 

2008-04-28 07:00:14     Re: Booting From Secure Flash

Appalayagari Sreedhar (INDIA)

Message: 55119   

 

Hi Mike,

 

flinfo command details information is below.

 

ezkit> flinfo

 

Bank # 1: Unknown Vendor: (0x00000059)

    20000000 (RO) 20010000 (RO) 20020000      20030000      20040000

    20050000      20060000      20070000      20080000      20090000

    200A0000      200B0000      200C0000      200D0000      200E0000

    200F0000      20100000      20110000      20120000      20130000

    20140000      20150000      20160000      20170000      20180000

    20190000      201A0000      201B0000      201C0000      201D0000

    201E0000      201F0000

 

Bank # 2: Unknown Vendor: (0x00000059)

    20200000      20204000      20206000      20208000

 

Bank # 3: Unknown Vendor: (0x00000059)

    20280000      20284000      20286000      20288000

 

config.mk file from the following path.

 

u-boot-1.1.6/board/bf533-ezkit

 

config.mk

QuoteReplyEditDelete

 

 

2008-04-28 10:57:35     Re: Booting From Secure Flash

Mike Frysinger (UNITED STATES)

Message: 55145    if you arent using a psd4256 flash device, then why are you attempting to use the psd4256 driver ?  that is what the bf533-ezkit has.  use the common CFI flash driver.

QuoteReplyEditDelete

 

 

2008-04-29 09:36:39     Re: Booting From Secure Flash

Appalayagari Sreedhar (INDIA)

Message: 55225   

 

Thanks Mike,

 

I tried to enable the CFI_flash.c driver in driver section.

 

I have compiled the u-boot and flashed it into the flash chip.

 

when i did the system reset, this is the response i could see in the teraterm.

 

U-Boot 1.1.6-svn (ADI-2007R1) (Apr 29 2008 - 18:58:15)

 

CPU:   ADSP BF533 Rev.: 0.5

Board: ADI BF533 EZ-Kit Lite board

       Support: http://blackfin.uclinux.org/

Clock: VCO: 594 MHz, Core: 594 MHz, System: 118 MHz

SDRAM: 64 MB

 

I have enabled the CFI_flash.o in driver makefile.

 

in the board makefile i have disabled the flash.o

 

it is not coming upto the ez-kit prompt.

 

Can you tell where i am doing wrong.

 

By the way my flash chip number is m28w640hst

 

Rgds,Sreedhar

 

 

QuoteReplyEditDelete

 

 

2008-04-29 18:53:28     Re: Booting From Secure Flash

Mike Frysinger (UNITED STATES)

Message: 55251    i dont know how you enabled things, but by your description, it sounds like you're doing it wrong.  you should not be modifying any files whatsoever under drivers directory.  please read the documentation instead of hacking the source code apart:

http://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:parallel-flash

QuoteReplyEditDelete

 

 

2008-05-03 07:26:53     Re: Booting From Secure Flash

Appalayagari Sreedhar (INDIA)

Message: 55418   

 

Hi Mike,

 

Flash chip i am having is 8 MB. Flash higher order address lines are controlled by the latch bits.

 

Flash chip in my custom board is CFI interafce but some comamnds are different from the existing cfi_flash.c driver commands.

 

I need to change these comands and make the flash driver to work for my flash chip.

 

can i edit the existing cfi_flash driver file for my work.

 

Rgds,Sreedhar.

QuoteReplyEditDelete

 

 

2008-05-03 07:46:11     Re: Booting From Secure Flash

Mike Frysinger (UNITED STATES)

Message: 55421   

 

the CFI driver already handles AMD and Intel command sets just fine.  if you're saying those dont work, i'm guessing you need support for the SST command set.  if that's the case, the driver does not support it and you'll have to add it.  once you do though, you should post the patch and send it to sr@denx.de as he can review/integrate it into u-boot.

QuoteReplyEditDelete

 

 

2008-05-03 09:22:39     Re: Booting From Secure Flash

Appalayagari Sreedhar (INDIA)

Message: 55424   

 

Hi Mike,

 

thankyou very much.

 

Rgds,Sreedhar.

QuoteReplyEditDelete

 

 

2008-05-06 08:13:10     Re: Booting From Secure Flash

Appalayagari Sreedhar (INDIA)

Message: 55561   

 

Hi Mike,

 

Flash chip size in my board is 8MB. bottom boot. AMS bank 0 is mapped to the flash device.

 

control for writing and reading the data after 1 MB is through latch bits(Flash higher order address lines)

 

My application size is 4 MB, how i can write more than 1 MB into the flash device?

 

is there any sample code available for writing the data more than 1 MB into the flash device.

 

Mike, can you please confirm the flash related apis (flash_init etc)care called from the libbf533-ezkit.a library? or they are called from any other flash interface file?.

 

Best Regards,Sreedhar.

 

 

QuoteReplyEditDelete

 

 

2008-05-06 08:25:05     Re: Booting From Secure Flash

Mike Frysinger (UNITED STATES)

Message: 55563   

 

you will need to write a board-specific flash driver then to handle the weird latching.  the common cfi driver only works on fully memory mapped flashes.

Attachments

Outcomes