jnand_test.c

来自「QUALCOMM JNAND DRIVER」· C语言 代码 · 共 146 行

C
146
字号
/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*

          Flash Programming Plug-In Test and Verify Functions

GENERAL DESCRIPTION

  This file implements the Self Test and Verification functions for the
  JNAND flash programming Plug-In


  Copyright (c) 2002 by QUALCOMM Incorporated.  All Rights Reserved.
*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/


/*===========================================================================

                        EDIT HISTORY FOR MODULE

  This section contains comments describing changes made to the module.
  Notice that changes are listed in reverse chronological order.

  $Header: //depot/asic/MSMSHARED/tools/jnand/jnand_test.c#5 $ $DateTime: 2003/08/29 14:06:58 $ $Author: dionh $

when       who     what, where, why
--------   ---     ----------------------------------------------------------
08/29/03   drh     Compile raw test based on two different defines
08/28/03   drh     Add ability to run raw NAND driver test
03/05/03   drh     Changes to implement new spanless boot method including
                   moving some functions to jnand.c.
02/06/03   pg      Moved from ASWP402 server to ASWP401 server.
07/12/02   drh     Added code to test and verify boot block programming.
                   Selftest of boot block is a compile option, not run time.
07/09/02   drh     Added KICK_WATCHDOG macro invocations.
07/05/02   drh     Created.
===========================================================================*/

/*===========================================================================

                     INCLUDE FILES FOR MODULE

===========================================================================*/
#include "jnand.h"
#include "jnand_msm.h"
#include "jnand_tspans.h"

#ifdef UNIX_UNIT_TEST
#error code not present
#endif


/*===========================================================================

                     DEFINES FILES FOR MODULE

===========================================================================*/
#define IMAGE_BUF_SIZE (512*32*3)
#define INIT_TYPE_RAND 1
#define INIT_TYPE_CHAR 2
#define INIT_TYPE_ADDR 3

#ifndef UNIX_UNIT_TEST
#define RAND_MAX 0x7fffffff
#endif

/* Validation of compile switches */
#ifdef RUN_BASIC_TEST
#define __BASIC__ 1
#else
#define __BASIC__ 0
#endif

#ifdef RUN_NAND_DRIVER_TEST
#error code not present
#else
#define __DRIVER__ 0
#endif

#ifdef RUN_JNAND_TEST
#error code not present
#else
#define __JNAND__ 0
#endif

#if __BASIC__ + __JNAND__  + __DRIVER__ > 1
#error cannot define more than one test to run
#endif

/*===========================================================================

                     EXTERNAL REFERENCES FOR MODULE

===========================================================================*/
#ifndef UNIX_UNIT_TEST
extern int rand(void);
#endif

extern void nand_test (void);

/*===========================================================================

                     FORWARD REFERENCES FOR MODULE

===========================================================================*/
extern void dump_char_buf (char *buf, int len);
extern int test_basic_funcs (void);
extern int process_span_array (test_spans *ptr, const char *desc);
extern int init_image(int type);


/*===========================================================================

                     GLOBAL DATA DECLARATIONS FOR MODULE

===========================================================================*/
#ifdef SELF_TEST
#error code not present
#endif

extern unsigned char span_rb_buf[];
extern unsigned char image_rb_buf[];
extern int calc_crc;

/* stuff for running CRC calculation */
unsigned int secret_crc;

int calc_crc_init = FALSE;
unsigned int calc_crc_length;

int secret_boot_block_pages;

/* Pattern to use in printf */
const char *sep = "###############";


/*===========================================================================

                     FUNCTIONS FOR MODULE

===========================================================================*/

#ifdef SELF_TEST
#error code not present
#endif /* SELF_TEST */


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?