Changeset 3386


Ignore:
Timestamp:
Oct 26, 2012, 7:36:10 AM (2 years ago)
Author:
quozl
Message:

spiflash - identify some second source parts by JEDEC ID rather than the short ID

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dev/olpc/spiflash/spiflash.fth

    r3359 r3386  
    304304: spi-identify  ( -- ) 
    305305   ab-id to spi-id# 
    306    \ ST, Spansion, and WinBond all identify as 13 
    307    \ For now, we only need to distinguish between if it's 
    308    \ a common page-write part or the SST part with its 
    309    \ unique auto-increment address writing scheme. 
    310306   spi-id# case 
     307      \ ST, Spansion, and WinBond 
    311308      h# 13  of  ['] common-write  1mb-flash  endof 
    312       h# 34  of  ['] common-write  1mb-flash  endof 
     309      h# 34  of  ['] common-write  1mb-flash 
     310         jedec-id h# 3425c2 =  if  2mb-flash  then  \ MXIC 25E8035 
     311      endof 
     312      \ the SST part with its unique auto-increment address writing scheme 
    313313      h# bf  of  ['] sst-write     1mb-flash  endof 
    314       h# 14  of  ['] common-write  1mb-flash  endof 
    315       h# 35  of  ['] common-write  2mb-flash  endof 
    316 \ On some old board the ID would read as 14 when it should have been something else. 
    317 \ On CL4, 14 is the expected ID. 
    318 \         ." The SPI FLASH ID reads as 14.  This is due to an infrequent hardware problem."  cr 
    319 \         ." If you power cycle and try again, it will probably work the next time." cr 
    320 \         abort 
    321 \      endof 
    322  
    323 \      ( default )  true abort" Unsupported SPI FLASH ID" 
    324        ( default )  ." Bad SPI FLASH ID " dup . cr  ['] null-write swap 
    325    endcase 
     314      h# 14  of  ['] common-write  1mb-flash 
     315         jedec-id h# 1540c8 =  if  2mb-flash  then  \ XO-4 B1 
     316      endof 
     317      h# 35  of  ['] common-write  2mb-flash  endof  \ W25Q16CV 3525c2 
     318      ( default )  ." Bad SPI FLASH ID " dup . cr  ['] null-write swap 
     319   endcase                                      ( writer ) 
    326320   to write-spi-flash 
    327321   spi-unprotect 
     
    337331      spi-id#  case 
    338332         h# 13  of  ." type 13 - Spansion, Winbond, or ST"  endof 
    339          h# 14  of  ." type 14 - 2 MB"  endof 
     333         h# 14  of  ." type 14"  endof 
    340334         h# 34  of  ." type 34 - Macronyx"  endof 
    341335         h# 35  of  ." type 35 - 2 MB"  endof 
Note: See TracChangeset for help on using the changeset viewer.