2008-06-13 12:57:11     Parallel NOR CFI Flash in u-boot

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

2008-06-13 12:57:11     Parallel NOR CFI Flash in u-boot

Appalayagari Sreedhar (INDIA)

Message: 57246   

 

Hi,

 

In my custom board with BF533 and the CFI complaint NOR Flash, Flash chip part number M28W640HSxxx.

 

Flash chip is of size 8MB.

 

I want to enable the CFI flash driver,  I have gone through the following documentation.

 

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

 

I did all the changes mentioned in the document.

 

in the board bf533-custom( I have enabled only the libbf533-ezkit.a in the make file)

 

In the drivers folder, i have enabled the cfi_flash.c in the make file.

 

In my custom board Flash is connected to only AMS#0 only, remaining 7 MB address is controlled by latch control bits.

 

This i need to take care in the driver, i beleive this i need to implement.

 

I want to know whether "libbf533-ezkit.a" mapping to my custom board is ok. or shall i need to enable some other files in the u-boot?

 

I would like to know from where the flash related apis are called.

 

So that i can easily proceed, please provide me your valauable comments/suggestions.

 

 

 

I am attaching the console output. and also my config.h file.

 

NP2x00> tftp 0x1200000 u-boot.bin

LAN9x18 (0x115a0000) detected at 0x20100000

start Auto negotiation... (take ~2sec)

Auto negotiation complete, 100BaseTX, full duplex

TFTP from server 172.16.6.45; our IP address is 172.16.15.45

Filename 'u-boot.bin'.

Load address: 0x1200000

Loading: #######################

done

Bytes transferred = 116064 (1c560 hex)

NP2x00> go 0x1200000

 

# Starting application at 0x01200000 ...

adding 00 00 0xffa00000 0x00020007

adding 16 01 0x03c00000 0x00031007

adding 01 02 0x00000000 0x00031005

adding 02 03 0x00400000 0x00031005

adding 03 04 0x00800000 0x00031005

adding 04 05 0x00c00000 0x00031005

adding 05 06 0x01000000 0x00031005

adding 06 07 0x01400000 0x00031005

adding 07 08 0x01800000 0x00031005

adding 08 09 0x01c00000 0x00031005

adding 09 10 0x02000000 0x00031005

adding 10 11 0x02400000 0x00031005

adding 11 12 0x02800000 0x00031005

adding 12 13 0x02c00000 0x00031005

adding 13 14 0x03000000 0x00031005

adding 14 15 0x03400000 0x00031005

skip   00 00 0xff800000 0x00030219

skip   01 00 0x00000000 0x0003d21d

skip   02 00 0x00400000 0x0003d21d

skip   03 00 0x00800000 0x0003d21d

skip   04 00 0x00c00000 0x0003d21d

skip   05 00 0x01000000 0x0003d21d

skip   06 00 0x01400000 0x0003d21d

skip   07 00 0x01800000 0x0003d21d

skip   08 00 0x01c00000 0x0003d21d

skip   09 00 0x02000000 0x0003d21d

skip   10 00 0x02400000 0x0003d21d

skip   11 00 0x02800000 0x0003d21d

skip   12 00 0x02c00000 0x0003d21d

skip   13 00 0x03000000 0x0003d21d

skip   14 00 0x03400000 0x0003d21d

skip   15 00 0x03800000 0x0003d21d

adding 16 00 0x03c00000 0x0003d21f

skip   17 01 0x20000000 0x0003c21d

adding 00 01 0xff800000 0x00030219

adding 01 02 0x00000000 0x0003d21d

adding 02 03 0x00400000 0x0003d21d

adding 03 04 0x00800000 0x0003d21d

adding 04 05 0x00c00000 0x0003d21d

adding 05 06 0x01000000 0x0003d21d

adding 06 07 0x01400000 0x0003d21d

adding 07 08 0x01800000 0x0003d21d

adding 08 09 0x01c00000 0x0003d21d

adding 09 10 0x02000000 0x0003d21d

adding 10 11 0x02400000 0x0003d21d

adding 11 12 0x02800000 0x0003d21d

adding 12 13 0x02c00000 0x0003d21d

adding 13 14 0x03000000 0x0003d21d

adding 14 15 0x03400000 0x0003d21d

U-Boot 1.1.6-svn (ADI-2007R1) (Jun 13 2008 - 22:45:01)

 

data (00)= 0xff800000 : 0x00030219    intr = 0xffa00000 : 0x00020007

data (01)= 0x00000000 : 0x0003d21d    intr = 0x00000000 : 0x00031005

data (02)= 0x00400000 : 0x0003d21d    intr = 0x00400000 : 0x00031005

data (03)= 0x00800000 : 0x0003d21d    intr = 0x00800000 : 0x00031005

data (04)= 0x00c00000 : 0x0003d21d    intr = 0x00c00000 : 0x00031005

data (05)= 0x01000000 : 0x0003d21d    intr = 0x01000000 : 0x00031005

data (06)= 0x01400000 : 0x0003d21d    intr = 0x01400000 : 0x00031005

data (07)= 0x01800000 : 0x0003d21d    intr = 0x01800000 : 0x00031005

data (08)= 0x01c00000 : 0x0003d21d    intr = 0x01c00000 : 0x00031005

data (09)= 0x02000000 : 0x0003d21d    intr = 0x02000000 : 0x00031005

data (10)= 0x02400000 : 0x0003d21d    intr = 0x02400000 : 0x00031005

data (11)= 0x02800000 : 0x0003d21d    intr = 0x02800000 : 0x00031005

data (12)= 0x02c00000 : 0x0003d21d    intr = 0x02c00000 : 0x00031005

data (13)= 0x03000000 : 0x0003d21d    intr = 0x03000000 : 0x00031005

data (14)= 0x03400000 : 0x0003d21d    intr = 0x03400000 : 0x00031005

data (15)= 0x03800000 : 0x0003d21d    intr = 0x03800000 : 0x00031005

data (16)= 0x03c00000 : 0x0003d21f    intr = 0x03c00000 : 0x00031007

data (17)= 0x20000000 : 0x0003c21d    intr = 0x20000000 : 0x00030005

CPU:   ADSP BF533 Rev.: 0.5

Board: ADI BF533 NP2x00 board

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

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

SDRAM: Serial Port initialized with Baud rate = 57600

SDRAM attributes:

tRCD 3 SCLK Cycles,tRP 3 SCLK Cycles,tRAS 6 SCLK CyclestWR 2 SCLK Cycles,CAS Lat

ency 3 SCLK cycles

SDRAM Begin: 0x0

Bank size = 64 MB

64 MB

 

Max Flash Banks = 1

flash detect cfi

fwc addr 20000000 cmd 0 0000 16bit x 8 bit

found 17 0x20000000

skipping 0 ffe00200 - 0003d21f

remove 1 0xff800000  0x00030219

replace 1 0xffe00104  0xffe00108

replace 2 0xffe00108  0xffe0010c

replace 3 0xffe0010c  0xffe00110

replace 4 0xffe00110  0xffe00114

replace 5 0xffe00114  0xffe00118

replace 6 0xffe00118  0xffe0011c

replace 7 0xffe0011c  0xffe00120

replace 8 0xffe00120  0xffe00124

replace 9 0xffe00124  0xffe00128

replace 10 0xffe00128  0xffe0012c

replace 11 0xffe0012c  0xffe00130

replace 12 0xffe00130  0xffe00134

replace 13 0xffe00134  0xffe00138

replace 14 0xffe00138  0xffe0013c

0 0x03c00000  0x0003d21f

1 0x00000000  0x0003d21d

2 0x00400000  0x0003d21d

3 0x00800000  0x0003d21d

4 0x00c00000  0x0003d21d

5 0x01000000  0x0003d21d

6 0x01400000  0x0003d21d

7 0x01800000  0x0003d21d

8 0x01c00000  0x0003d21d

9 0x02000000  0x0003d21d

10 0x02400000  0x0003d21d

11 0x02800000  0x0003d21d

12 0x02c00000  0x0003d21d

13 0x03000000  0x0003d21d

14 0x03400000  0x0003d21d

15 0x20000000  0x0003c21d

fwc addr 200000aa cmd 98 9898 16bit x 8 bit

is= cmd 51(Q) addr 20000020 is= 0051 5151

fwc addr 20000000 cmd 0 0000 16bit x 16 bit

fwc addr 200000aa cmd 98 0098 16bit x 16 bit

is= cmd 51(Q) addr 20000020 is= 0051 0051

is= cmd 52(R) addr 20000022 is= 0052 0052

is= cmd 59(Y) addr 20000024 is= 0059 0059

ushort addr is at 20000050 info->portwidth = 2

addr[0] = 0x1

addr[1] = 0x0

addr[2] = 0x0

addr[3] = 0x0

retval = 0x1

device interface is 1

found port 2 chip 2 port 16 bits chip 16 bits

ushort addr is at 20000026 info->portwidth = 2

addr[0] = 0x3

addr[1] = 0x0

addr[2] = 0x0

addr[3] = 0x0

retval = 0x3

20000020 : 51 00 52 00 59 00 03 00 00 00 35 00 00 00 00 00  Q.R.Y.....5.....

20000030 : 00 00 00 00 00 00 27 00 36 00 b4 00 c6 00 04 00  ......'.6.......

20000040 : 04 00 0a 00 00 00 05 00 05 00 03 00 00 00 17 00  ................

20000050 : 01 00 00 00 03 00 00 00 02 00 07 00 00 00 20 00  .............. .

20000060 : 00 00 7e 00 00 00 00 00 01 00 50 00 52 00 49 00  ..~.......P.R.I.

20000070 : 31 00 30 00 e6 00 00 00 00 00 00 00 01 00 03 00  1.0.............

20000080 : 00 00 30 00 c0 00 01 00 80 00 00 00 03 00 04 00  ..0.............

20000090 : 03 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................

ushort addr is at 2000002a info->portwidth = 2

addr[0] = 0x35

addr[1] = 0x0

addr[2] = 0x0

addr[3] = 0x0

retval = 0x35

manufacturer is 3

size_ratio 1 port 16 bits chip 16 bits

found 2 erase regions

long addr is at 2000005a info->portwidth = 2

addr[0] = 0x7

addr[1] = 0x0

addr[2] = 0x0

addr[3] = 0x0

addr[4] = 0x20

addr[5] = 0x0

addr[6] = 0x0

addr[7] = 0x0

erase_region_count = 8 erase_region_size = 8192

long addr is at 20000062 info->portwidth = 2

addr[0] = 0x7e

addr[1] = 0x0

addr[2] = 0x0

addr[3] = 0x0

addr[4] = 0x0

addr[5] = 0x0

addr[6] = 0x1

addr[7] = 0x0

erase_region_count = 127 erase_region_size = 65536

something is really wrong

 

Best Regards,Sreedhar.

 

bf533-ezkit.h

QuoteReplyEditDelete

 

 

2008-06-13 14:53:59     Re: Parallel NOR CFI Flash in u-boot

Mike Frysinger (UNITED STATES)

Message: 57255   

 

the bf533-ezkit does not have a CFI compliant flash nor does it use the CFI driver ... do not base any of your code on the bf533-ezkit board

 

look at the bf533-stamp

QuoteReplyEditDelete

 

 

2008-06-16 03:45:50     Re: Parallel NOR CFI Flash in u-boot

Appalayagari Sreedhar (INDIA)

Message: 57324   

 

Hi Mike,

 

Sorry for not providing the details clearly, I am not using EZkit for my work, i am working on the custom board having BF533 and CFI complaint NOR Flash.

 

I want to make use of existing cfi_flash.c driver file for my work. for writing and reading the flash.

 

I have read the document for enabling the parallel NOR flash in u-boot.

 

I have made the changes in the bf533-customboard.h file as mentioned in the document.

 

but i could not succeed much.

 

when i call saveenv command it is showing flash erase error.

 

I am unable to proceed further, can you please guide me how to make use of cfi_flash.c flash driver in u-boot.

 

Best Regards,Sreedhar.

 

 

QuoteReplyEditDelete

 

 

2008-06-16 04:06:23     Re: Parallel NOR CFI Flash in u-boot

Mike Frysinger (UNITED STATES)

Message: 57327   

 

i know you're not using the bf533-ezkit, but what i said is still relevant ... do not look at the bf533-ezkit as an example of how to use CFI flash ... look at the bf533-stamp

 

that means there should be no flash code at all in your board specific directory

 

before you attempt to erase/write things, make sure you can read them using the regular md and flinfo commands

QuoteReplyEditDelete

Attachments

Outcomes