tizen 2.4 release
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-sc8810 / flash_drv.h
1 /******************************************************************************
2  ** File Name:      flash_drvapi.h                                                   *
3  ** Author:         lin.liu                                                   *
4  ** DATE:           27/11/2001                                                *
5  ** Copyright:      2001 Spreatrum, Incoporated. All Rights Reserved.         *
6  ** Description:                                                              *
7  **                 Flash Driver                                              *
8  **                                                                           *
9  **                 used by flash.c                                           *
10  **                                                                           *
11  **                 user can modify and replace the file, but all functions   *
12  **                 must be supported                                         *
13  ******************************************************************************
14
15  ******************************************************************************
16  **                        Edit History                                       *
17  ** ------------------------------------------------------------------------- *
18  ** DATE           NAME             DESCRIPTION                               *
19  ** 27/11/2001     Lin.liu          Create.                                   *
20  ******************************************************************************/
21 #ifndef _FLASH_DRVAPI_H_
22 #define _FLASH_DRVAPI_H_
23
24 /**---------------------------------------------------------------------------*
25  **                         Dependencies                                      *
26  **---------------------------------------------------------------------------*/
27
28 /**---------------------------------------------------------------------------*
29  **                         Compiler Flag                                     *
30  **---------------------------------------------------------------------------*/
31 #ifdef __cplusplus
32 extern   "C"
33 {
34 #endif
35
36 #include "sci_types.h"
37
38 /**---------------------------------------------------------------------------*
39  **                         DEFINE                                            *
40  **---------------------------------------------------------------------------*/
41
42 //flash basic WR/RD
43 #define FLASH_WR(b,d)         *( (FLASH_PTR_TYPE)(b)) = (d)
44 #define FLASH_RD(b)           *( (FLASH_PTR_TYPE)(b))
45
46
47
48 //nor flash manufacture ID
49 #define FLASH_SAMSUNG_ID        (0xEC)
50 #define FLASH_AMD_ID                (0x1)
51 #define FLASH_INTEL_ID              (0x89)
52 #define FLASH_ST_ID                 (0x20)
53 #define FLASH_SST_ID                (0xBF)
54 #define FLASH_TSB_ID            (0x98)
55 #define FLASH_CFEON_ID              (0x7F)
56
57 //reset Intel/AMD flash
58 #define RESET_FLASH             *(FLASH_PTR_TYPE)(0x0) = 0xF0;\
59     *(FLASH_PTR_TYPE)(0x0) = 0xFF
60 //disable irq/fiq
61 #define FLASH_IRQ_FIQ_DISABLE  0xC0
62
63 /* Below is the raw definitions for Threadx. */
64 #define FLASH_TX_DISABLE                  s_flash_interrupt_save =  _tx_thread_interrupt_control(FLASH_IRQ_FIQ_DISABLE);
65 #define FLASH_TX_RESTORE                  _tx_thread_interrupt_control(s_flash_interrupt_save);
66
67 //Disable irq/fiq and cache(M)
68 #define FLASH_DISABLE_IRQ   FLASH_TX_DISABLE    \
69     DISABLE_CACHE
70 //Enable irq/fiq and cache(M)
71 #define FLASH_RESTORE_IRQ   ENABLE_CACHE \
72     FLASH_TX_RESTORE
73 //Enable the system tick count
74 #define ENABLE_SYSTEM_TICK_COUNT  *(volatile uint32 *)(GR_GEN1) |= BIT_13;
75
76 //check any irq/fiq status be set.
77 #define GET_INTERRUPT_FLAG (CHIP_REG_GET(INT_IRQ_STS) | CHIP_REG_GET(INT_FIQ_STS))
78
79 //invert the high/low byte of the given word.
80 #define INVERT_WORD( _w )           _w = ((_w) >> 8) + ((_w) << 8)
81
82 //ARM target, Big-Endian
83 #define FIRST_BYTE( _word )         (uint8)( (_word) >> 8 )
84 #define SECOND_BYTE( _word )        (uint8)( (_word) & 0xFF )
85
86 //ARM target, big-endian
87 #define MAKE_WORD( _fst, _snd ) ((uint16)(_fst) << 8) + ((uint16)(uint8)(_snd))
88
89 #define FLASH_INIT_MAGIC        (0xFAACCAAF)
90
91 #define FLASH_ADDR_IS_VALID( _addr )  \
92     ((((_addr) >= s_flash_efs_start_addr   ) && ((_addr) <= s_flash_efs_end_addr           ))\
93      ||(((_addr) >= s_flash_fixed_nvitem_addr) && ((_addr) <= s_flash_fixed_nvitem_end_addr  ))\
94      ||(((_addr) >= s_flash_product_info_addr) && ((_addr) <= (s_flash_product_info_addr + s_flash_sector_size)              )))
95
96 //FLASH_OPTR_STATUS_FAILED    : the optr failed
97 //FLASH_OPTR_STATUS_COMPLETED : the optr success
98 //FLASH_OPTR_STATUS_RUNNING   : the optr is running, need check it again.
99
100 #define FLASH_OPTR_STATUS_FAILED        (0)
101 #define FLASH_OPTR_STATUS_COMPLETED (1)
102 #define FLASH_OPTR_STATUS_RUNNING       (2)
103
104 //running optr status
105 #define FLASH_STORE_OPTR_MAGIC          (0x4D534F46)    // FOSM
106 #define FLASH_STORE_OPTR_PROGRAMING (0x464F5350)    // FOSP
107 #define FLASH_STORE_OPTR_ERASING        (0x464F5345)    // FOSE
108 #define FLASH_STORE_OPTR_SUSPEND        (0x464F5353)    // FOSS
109 #define FLASH_STORE_OPTR_IDLE           (0x0)
110
111 //store optr status
112 #define STORE_FLASH_OPTR(optr , ptr)     *ptr = optr;\
113     *(ptr + 1) = (optr ^ FLASH_STORE_OPTR_MAGIC);
114 //get optr status
115 #define GET_FLASH_STORE_OPTR(ptr)       ((FLASH_STORE_OPTR_MAGIC == ((*ptr) ^ (*(ptr + 1)))) ? (*ptr) : 0)
116
117 // add error trace information
118 #define FLASH_OPTR_ERASE                (0xB7)
119 #define FLASH_OPTR_PROGRAM          (0xCF)
120 #define FLASH_OPTR_RESUME               (0xDE)
121 #define FLASH_OPTR_SUSPEND              (0xE3)
122
123 #define FLASH_INVALID_ADDR              ((uint32)(-1))
124 #define FLASH_INVALID_SECTOR            ((uint16)(-1))
125
126
127
128 #define FLASH_SAVE_TRACE_INFOR_INIT     flash_trace_infor.flag = 0x46544946  // FTIF   
129
130 #define FLASH_SAVE_TRACE_INFOR_ERASE    flash_trace_infor.optr = FLASH_OPTR_ERASE
131 #define FLASH_SAVE_TRACE_INFOR_PROGRAM( _data ) \
132     flash_trace_infor.optr = FLASH_OPTR_PROGRAM; \
133     flash_trace_infor.data = _data
134
135 #define FLASH_SAVE_TRACE_INFOR_RESUME   flash_trace_infor.optr = FLASH_OPTR_RESUME
136 #define FLASH_SAVE_TRACE_INFOR_SUSPEND  flash_trace_infor.optr = FLASH_OPTR_SUSPEND
137
138 #define FLASH_SAVE_TRACE_INFOR_CHECK_STATUS\
139     flash_trace_infor.address  = (volatile uint32)(addr_ptr);\
140     flash_trace_infor.tick_1   = old_tick;                    \
141     flash_trace_infor.tick_2   = cur_tick;                    \
142     flash_trace_infor.max_tick = tick_count;                  \
143     flash_trace_infor.status_1 = d;                           \
144     flash_trace_infor.status_2 = tmp;                         \
145     flash_trace_infor.content  = *addr_ptr
146
147 #define FLASH_DELAY_20US_COUNT    100 //(20*100)/3/70
148 #define FLASH_DELAY_20US\
149     {\
150         volatile uint32  i;\
151         for(i = 0; i < FLASH_DELAY_20US_COUNT; i++){};\
152     }
153
154 /**---------------------------------------------------------------------------*
155  **                         Data Structures                                   *
156  **---------------------------------------------------------------------------*/
157
158 //Flash type define
159 typedef VOLATILE uint16 *FLASH_PTR_TYPE;
160
161 //Flash ID enum
162 typedef enum
163 {
164     FLASH_AMD = 0,
165     FLASH_SST,
166     FLASH_INTEL,
167     FLASH_ST,
168     FLASH_SAMSUNG,
169     FLASH_OTHER
170 } FLASH_TYPE_E;
171
172 //Flash erasing status enum
173 typedef enum FLASH_ERASE_STATUS_TAG
174 {
175     FLASH_ERASE_COMPLETED_S    = 0,     /* erase has completed  */
176     FLASH_ERASE_PROCESSING_S      ,     /* erase is processing  */
177     FLASH_ERASE_SUSPEND_S         ,     /* erase suspend        */
178     FLASH_ERASE_FAILED_S                /* erase failed         */
179 } FLASH_ERASE_STATUS_E;
180
181 //NOR_MCP config  for flash/sram connect to emc
182 typedef struct NORMCP_CONFIG_s
183 {
184     EMC_CS_NUM_E                cs_num;
185     EMC_MODE_CFG_T          cs_mode;
186 } NORMCP_CONFIG_T, *NORMCP_CONFIG_PTR;
187
188 //Flash Struct Configuration for platform application
189 typedef struct  nor_flash_config_s
190 {
191     uint32     bank_num;
192     uint32     sect_num;
193     uint32     file_sect_num;
194     uint32     sect_size;
195     uint32     start_addr;
196     uint32     efs_start_addr;
197     uint32     flash_size;
198     uint32     fixnv_addr;
199     uint32     prodinfo_addr;
200     uint32     mmi_res;
201     uint32     umem_addr;
202     uint32     umem_size;
203     uint32     bl_addr;
204 } NOR_FLASH_CONFIG_T,* NOR_FLASH_CONFIG_PTR;
205
206
207
208 //nor flash operate function
209 typedef struct nor_flash_operate_s
210 {
211     void (*_init) (void);
212     uint16 (*_readword) (uint32 addr);
213     BOOLEAN (*_read) (uint32 addr, uint8 *buf, uint32 read_len);
214     BOOLEAN (*_writeword) (uint32 addr, uint16 data);
215     BOOLEAN (*_write) (uint32 addr, const uint8 *buf, uint32 len);
216     BOOLEAN (*_erase) (uint32 addr);
217     BOOLEAN (*_iserasecompleted) (void);
218     void (*_suspend) (void);
219     void (*_resume) (void);
220     void (*_unlock) (uint32 addr);
221     void (*_lock) (uint32 addr);
222     void (*_enter_read) (void);
223     void (*_exit_read) (void);
224     void (*_close) (void);
225     void (*_config) (NOR_FLASH_CONFIG_PTR,NORMCP_SPEC_PTR);
226     /*start added by victorxu*/
227     uint32 (*_addrconvert) (uint32 addr);
228     /*end added by victorxu*/
229 } NOR_FLASH_DRIVER_T,* NOR_FLASH_DRIVER_PTR;
230
231 //NOR_MCP entity type contain some id and ptr
232 typedef struct normcp_entity_s
233 {
234     NORMCP_SPEC_PTR        normcp_spec_ptr;
235     NORMCP_CONFIG_PTR      normcp_config_ptr;
236
237     NOR_FLASH_CONFIG_PTR   nor_flash_cfg_ptr;
238 } NORMCP_ENTITY_T,* NORMCP_ENTITY_PTR;
239
240 typedef struct
241 {
242     volatile uint32  flag;      // So we can locate it if can't get map file.
243     volatile uint32  address;   // The address that will be problem/erase.
244     volatile uint32  tick_1;    // the start tick count
245     volatile uint32  tick_2;    // the end tick count
246     volatile uint32  max_tick;  // the max tick count
247     volatile uint16  optr;      // see the FLASH_OPTR_????
248     volatile uint16  data;      // the data will be write
249     volatile uint16  content;   // the content of this address
250     volatile uint16  status_1;  // the status read first time
251     volatile uint16  status_2;  // the status read second time
252 } FLASH_TRACE_INFOR_T;
253
254 /**---------------------------------------------------------------------------*
255  **                    prototype                                              *
256  **              flash initialization and infomation                          *
257  **---------------------------------------------------------------------------*/
258 /*****************************************************************************/
259 //  Description :
260 //     init flash config and get flash driver ptr.
261 //  Global resource dependence :
262 //      s_Normcp_spec_ptr s_Nor_Config_ptr s_Nor_Driver_ptr
263 //
264 //  Author:
265 //      Younger.yang
266 //  Note:
267 //
268 /*****************************************************************************/
269 BOOLEAN FLASH_Init (void); /* If Init success, return true, else return false */
270
271 /*****************************************************************************/
272 //  Description :
273 //      Close the flash device.
274 //
275 //  Global resource dependence :
276 //      None
277 //  Author:
278 //      Lin.liu
279 //  Note:
280 //      This function should be called when power down.
281 /*****************************************************************************/
282 void FLASH_Close (void);
283
284 /*****************************************************************************/
285 //  Description :
286 //      Get sector size and sector number of the device.
287 //
288 //  Global resource dependence :
289 //      None
290 //  Author:
291 //      Lin.liu
292 //  Note:
293 //
294 /*****************************************************************************/
295 void FLASH_GetDeviceInfo (
296     uint32   *sector_size_ptr,    /* output the sector size  */
297     uint16   *sector_num_ptr,        /* output the sector number  */
298     uint16   *file_system_sector_num_ptr);  // output the file system sector num.
299
300 /*****************************************************************************/
301 //  Description :
302 //      Convert address to sector number.
303 //
304 //  Global resource dependence :
305 //      None
306 //  Author:
307 //      Lin.liu
308 //  Note:
309 //      sector no. 0 is the first sector we managered
310 /*****************************************************************************/
311 uint16  FLASH_AddrToSector (  /* the no. of the sector, If addr isn't in flash, return 0xFFFF  */
312     uint32 addr);     /* physical address  that will be converted */
313
314 /*****************************************************************************/
315 //  Description :
316 //      Convert sector no. to physical address.
317 //
318 //  Global resource dependence :
319 //      None
320 //  Author:
321 //      Lin.liu
322 //  Note:
323 /*****************************************************************************/
324 uint32 FLASH_SectorToAddr (  /* start physical address of the sector */
325     uint16 sector_no);   /* sector's no.                         */
326
327
328
329
330 /**---------------------------------------------------------------------------*
331  **                    flash optr function                                    *
332  **                                                                           *
333  **---------------------------------------------------------------------------*/
334
335 /*****************************************************************************/
336 //  Description :
337 //      Read the given count from device.
338 //
339 //  Global resource dependence :
340 //      None
341 //  Author:
342 //      Lin.liu
343 //  Note:
344 //      the address MUST be word boundary.
345 /*****************************************************************************/
346 void FLASH_ReadWordByCount (uint32  addr, uint16 *w16_ptr, uint32  count);
347 /*****************************************************************************/
348 //  Description :
349 //      Read word(two byte) from the given address.
350 //
351 //  Global resource dependence :
352 //      None
353 //  Author:
354 //      Lin.liu
355 //  Note:
356 //      the address MUST be word boundary.
357 /*****************************************************************************/
358 uint16 FLASH_ReadWord ( // The word that has read from the given address.
359     uint32 addr);        // the address that will be read.
360 /*****************************************************************************/
361 //  Description :
362 //      The function reads up to size bytes from the device and stores them in buffer.
363 //
364 //  Global resource dependence :
365 //      None
366 //  Author:
367 //      Lin.liu
368 //  Note:
369 //
370 /*****************************************************************************/
371 BOOLEAN FLASH_Read (     // If read successfully, return true, else false;
372     uint32    addr,      // the start address that will be read
373     uint8    *buf,       // store the data that being read to this buffer.
374     uint32    read_len);  // the count of bytes that will be read.
375
376 /*****************************************************************************/
377 //  Description :
378 //    write a uint16 , the addr must be even.
379 //    we check first to avoid flash-reset,
380 //    if can't program( 0-->1 ), return false;
381 //  Global resource dependence :
382 //      None
383 //  Author:
384 //      Lin.liu
385 //  Note:
386 //
387 /*****************************************************************************/
388
389 BOOLEAN  FLASH_WriteWord (
390     uint32      addr,
391     uint16      data);
392
393 /*****************************************************************************/
394 //  Description :
395 //      The function write data to flash.
396 //
397 //  Global resource dependence :
398 //      None
399 //
400 //  Author:
401 //      Lin.liu
402 //  Note:
403 //
404 //      We not verify the data that written.
405 //      If some bit can't convert from 0 to 1, the data that has written
406 //      is not correct.
407 /*****************************************************************************/
408 BOOLEAN FLASH_Write (   // If the data being written to flash, return TRUE.
409     uint32       addr,  // the start address that will be written.
410     const uint8       *buf,   // Pointer to the buffer containing the data to be written.
411     uint32       len);   // number of bytes to write.
412
413 /*****************************************************************************/
414 //  Description :
415 //      Copy data from one area to another.
416 //
417 //  Global resource dependence :
418 //      None
419 //
420 //  Author:
421 //      Lin.liu
422 //  Note:
423 //      Not check before write.
424 /*****************************************************************************/
425 BOOLEAN FLASH_Copy (
426     uint32 dest,   /* the area we copy to   */
427     uint32 sour,   /* the area we copy from */
428     uint32  len);  /* the length we want copy*/
429
430 /*****************************************************************************/
431 //  Description :
432 //      Check can we write data to the area?
433 //      If some bits of the area from 0 to 1, the write wouldn't success,
434 //      and return false;
435 //
436 //  Global resource dependence :
437 //      None
438 //
439 //  Author:
440 //      Lin.liu
441 //  Note:
442 //      Not check before write.
443 //      This function called from EFS Task, so needn't  check erase status.
444 //
445 /*****************************************************************************/
446 BOOLEAN FLASH_CheckRevisable (
447     uint32      addr,  // the start address of the area that will be checked.
448     const uint8  *buf, // the buffer that contain the data.
449     uint32      len);   // the data length.
450
451 /*****************************************************************************/
452 //  Description :
453 //      Is the last erase optr completed?
454 //
455 //  Global resource dependence :
456 //      None
457 //
458 //  Return :
459 //      If the erase has been completely, return true, other false
460 //  Author:
461 //      Lin.liu
462 //  Note:
463 //      This function MUST be called when system assert only,
464 /*****************************************************************************/
465 BOOLEAN FLASH_IsEraseCompleted (void);
466
467 /*****************************************************************************/
468 //  Description :
469 //      Erase the sector that contain the address.
470 //
471 //  Global resource dependence :
472 //      None
473 //
474 //  Author:
475 //      Lin.liu
476 //  Note:
477 //      This will take a long time, typecal 1 second.
478 //      And this function must be called from a thread.
479 //
480 /*****************************************************************************/
481 BOOLEAN FLASH_Erase (
482     uint32 addr);
483 /*****************************************************************************/
484 //  Description :
485 //      Suspend the program/erase operation
486 //
487 //  Global resource dependence :
488 //      None
489 //
490 //  Author:
491 //      Lin.liu
492 //  Note:
493 //
494 /*****************************************************************************/
495 void FLASH_Suspend (void);
496
497 /*****************************************************************************/
498 //  Description :
499 //      Resume the program/erase operation
500 //
501 //  Global resource dependence :
502 //      None
503 //
504 //  Author:
505 //      Lin.liu
506 //  Note:
507 //
508 /*****************************************************************************/
509 void FLASH_Resume (void);
510 /*****************************************************************************/
511 //  Description :
512 //      The function unlock the sector that contain the address.
513 //
514 //  Global resource dependence :
515 //      None
516 //  Author:
517 //      Lin.liu
518 //  Note:
519 //
520 /*****************************************************************************/
521 void FLASH_Unlock (uint32  addr);
522 /*****************************************************************************/
523 //  Description :
524 //      The function lock down the sector that contain the address.
525 //
526 //  Global resource dependence :
527 //      None
528 //  Author:
529 //      Lin.liu
530 //  Note:
531 //
532 /*****************************************************************************/
533 void FLASH_Lock (uint32   addr);
534
535 /*****************************************************************************/
536 //  Description :
537 //      Get fixed nvitem address
538 //
539 //  Global resource dependence :
540 //      None
541 //
542 //  Author:
543 //      Lin.liu
544 //  Note:
545 //
546 /*****************************************************************************/
547 void FLASH_GetFixedNvitemAddr (uint32 *start, uint32 *end);
548
549 /*****************************************************************************/
550 //  Description :
551 //      Check use SRAM for simulate ?
552 //
553 //  Global resource dependence :
554 //      None
555 //
556 //  Author:
557 //      Lin.liu
558 //  Note:
559 //
560 /*****************************************************************************/
561 BOOLEAN FLASH_IsSimulate (void);
562 /*****************************************************************************/
563 //  Description:    This function is used to get manufacture ID and device ID
564 //  Global resource dependence:
565 //  Author:         younger.yang
566 //  Note:
567 /*****************************************************************************/
568 PUBLIC uint32 FLASH_ReadID (uint32 *pManu_id, uint32 *pDev_id, uint32 *pExtend_id);
569
570 /*****************************************************************************/
571 //  Description:    This function is used to get manufacture ID and device ID(already have been read)
572 //  Global resource dependence:
573 //  Author:         younger.yang
574 //  Note:
575 /*****************************************************************************/
576 PUBLIC void FLASH_GetID (uint32 *pManu_id, uint32 *pDev_id, uint32 *pExtend_id);
577
578 /*****************************************************************************/
579 //  Description :
580 //  Get flash semaphore to make sure some flash operation be mutual exclusion
581 //
582 //  Global resource dependence :
583 //      s_flash_semaphore_ptr
584 //
585 //  Author:
586 //      Younger.yang
587 //  Note:
588 //
589 /*****************************************************************************/
590 void FLASH_GetSemaphore (void);
591 /*****************************************************************************/
592 //  Description :
593 //  Releas flash semaphore
594 //
595 //  Global resource dependence :
596 //      s_flash_semaphore_ptr
597 //
598 //  Author:
599 //      Younger.yang
600 //  Note:
601 //
602 /*****************************************************************************/
603 void FLASH_ReleaseSemaphore (void);
604 /*****************************************************************************/
605 //  Description:    This function is used to get flash info,
606 //                  and config flash struct.
607 //  Global resource dependence:
608 //  Author:         younger.yang
609 //  Note:
610 /*****************************************************************************/
611 void FLASH_Config_struct (void);
612 /*****************************************************************************/
613 //  Description :
614 //      Set the flag if the erasing/programming sector be in code bank
615 //      .
616 //  Global resource dependence :
617 //      flash_bank_num
618 //
619 //  Author:
620 //      Younger.yang
621 //  Note:
622 //
623 /*****************************************************************************/
624 void FLASH_SetSuspendFlag (BOOLEAN flag);
625 /*****************************************************************************/
626 //  Description :
627 //      get the flag if the erasing/programming sector be in code bank
628 //      .
629 //  Global resource dependence :
630 //      flash_bank_num
631 //
632 //  Author:
633 //      Younger.yang
634 //  Note:
635 //
636 /*****************************************************************************/
637 PUBLIC uint32 FLASH_GetSuspendFlag (void);
638
639 /*****************************************************************************/
640 //  Description:    This function is used to get Flash end address.
641 //                  It equals FLASH_BASE_ADDR + FLASH_SIZE.
642 //  Global resource dependence:
643 //  Author:         Xueliang.Wang
644 //  Note:
645 /*****************************************************************************/
646 PUBLIC uint32 FLASH_GetEndAddr (void);
647 /*****************************************************************************/
648 //  Description :
649 //     init flash config and get flash driver ptr.
650 //  Global resource dependence :
651 //      s_Normcp_spec_ptr s_Nor_Config_ptr s_Nor_Driver_ptr
652 //
653 //  Author:
654 //      Younger.yang
655 //  Note:
656 //
657 /*****************************************************************************/
658 PUBLIC uint32 FLASH_InitHAL (NORMCP_ENTITY_PTR entity_ptr);
659
660 /*****************************************************************************/
661 //  Description :
662 //  get g_normcp_entity_table and entity count of the table
663 //  Global resource dependence :
664 //     None
665 //
666 //  Author:
667 //
668 //  Note:
669 //
670 /*****************************************************************************/
671 PUBLIC NORMCP_ENTITY_PTR NORMCP_GetEntityTab (uint32 *entity_cnt);
672
673 /*****************************************************************************/
674 //  Description :
675 //  By manu_id,devc_id and extend_id,find correct g_normcp_entity_table item.
676 //  Global resource dependence :
677 //     None
678 //
679 //  Author:
680 //      Younger.yang
681 //  Note:
682 //
683 /*****************************************************************************/
684 NORMCP_ENTITY_PTR NORMCP_GetEntity (uint32 manu_id, uint32 devc_id, uint32 extend_id, uint32 *index);
685
686 /*****************************************************************************/
687 //  Description :
688 //  Get extend id to distinguish different flash with same manu_id and dev_id
689 //  Using CFI in autoselect mode.
690 //  Global resource dependence :
691 //     None
692 //
693 //  Author:
694 //      Younger.yang
695 //  Note:
696 //
697 /*****************************************************************************/
698 uint32 FLASH_GetExtID (uint32 manu_id,uint32 dev_id);
699
700 /*****************************************************************************/
701 //  Description:    This function is used to get
702 //                  flash product infomation address
703 //  Global resource dependence:
704 //  Author:         younger.yang
705 //  Note:
706 /*****************************************************************************/
707 uint32 FLASH_GetProductInfoAddr (void);
708
709 /*start added by victorxu*/
710 /*start added by feng tao*/
711 /*****************************************************************************/
712 //  Description :
713 //   get flash type, mainly determine  whether this flash is numonyx m18 flash or not
714 //
715 //  Global resource dependence :
716 //      None
717 //  Author:
718 //      Lin.liu
719 //  Note:
720 //
721 /*****************************************************************************/
722 PUBLIC BOOLEAN FLASH_M18_Type_Get (void);
723 /*end added by feng tao*/
724 /*end added by victorxu*/
725
726 unsigned int  _tx_thread_interrupt_control (unsigned int);
727 /**---------------------------------------------------------------------------*
728  **                         Compiler Flag                                     *
729  **---------------------------------------------------------------------------*/
730 #ifdef __cplusplus
731 }
732 #endif
733
734 #endif //_FLASH_DRVAPI_H_
735