📄 sdconfig.h
字号:
/****************************************************************************
* Name: SDCONFIG.H - HDTK tuning constants
*
* SanDisk Host Developer's Toolkit
*
* Copyright (c) 1996-2000 SanDisk Corporation
* Copyright EBS Inc. 1996
* All rights reserved.
* This code may not be redistributed in source or linkable object form
* without the consent of its author.
*
* Description:
* This file is included in sdapi.h. It contains kernel specific macros
* and structures which must be ported to the target kernel.
*
* It also contains tuning constants.
*
****************************************************************************/
#ifndef __SDCONFIG__
#ifdef __cplusplus
extern "C" {
#endif
#define X86 1
/* ======================== User tunable section ========================= */
/* Number of controllers to support 1, 2, ... */
/* Currently 2 is the maximum for SanDisk ATA support. With a minor
** modification in IOCONST.C, the HDTK can support to n controllers.
**
** For SPI, this is the number of SPI controllers. Normally 1.
** For MMC, this is the number of MMC controller. Normally 1.
*/
#define N_CONTROLLERS 1
/* Number of devices connecting to the first controller */
/* For SPI, the number of devices varies, the max. value can be 4.
** For MMC, the number of devices varies, the max. value can be 4.
*/
#define DRIVES_PER_CONTROLLER1 1
/* Number of devices connecting to the second controller
** For SPI, the number of devices varies, the default is 0.
** For MMC, the number of devices varies, the default is 0.
*/
#define DRIVES_PER_CONTROLLER2 0
/* Total number of drives */
#define TOTAL_DRIVES (DRIVES_PER_CONTROLLER1 + DRIVES_PER_CONTROLLER2)
/****************************************************************************/
/*************************** FILE SYTEM SECTION *****************************/
/****************************************************************************/
/*
--------------------------------------------------------------------
** The HDTK supports the File System or the Peripheral Bus
** Interface. It is configurable to use the File System as a
** way to access data at high level to SanDisk storage devices or
** the Peripheral Bus Interface to access directly to the storage
** devices without any File System calls.
** The USE_FILE_SYSTEM is the option to allow such feature existing
** in the HDTK. The use of USE_FILE_SYSTEM is explained below.
** USE_FILE_SYSTEM 1 Enable the File System
** USE_FILE_SYSTEM 0 Disable the File System
--------------------------------------------------------------------
*/
#define USE_FILE_SYSTEM 0 /* If 1 use the file system */
/*
--------------------------------------------------------------------
** If the File System is enable, the following File System
** options are supported.
** RTFS_SHARE
** RTFS_SUBDIRS
** RTFS_WRITE
** NUM_USERS
** NUSERFILES
** NBLKBUFFS
** FAT_BUFFER_SIZE
--------------------------------------------------------------------
*/
#if (USE_FILE_SYSTEM)
/* The following constants when set to 0 selectively exclude
** portions of the File System to save executable image size.
*/
/* RTFS_SHARE option allows files to be shared. It is defined as
** enable = 1 or disable = 0.
** RTFS_SHARE 1 Enable file sharing
** RTFS_SHARE 0 Disable file sharing
** Note that when set to 0 to disable file share modes saves
** about .5 K of executable image file.
*/
#define RTFS_SHARE 0
/* Sub-directory is a feature supports by the File System. Enable
** or disable this feature is done via RTFS_SUBDIR.
** RTFS_SUBDIR is defined as follows.
** RTFS_SUBDIR 1 Enable sub-directory support
** RTFS_SUBDIR 0 Disable sub-directory support
** Note that set RTFS_SUBDIR to 0 to disable sub-directory support
** saves about 2.5 K of executable image file.
*/
#define RTFS_SUBDIRS 1
/* The File System supports WRITE PROTECTED feature. This feature
** is selected or deselected by the RTFS_WRITE option.
** When RTFS_WRITE is set to 1, writing to the device is permitted.
** When RTFS_WRITE is set to zero, the File System will prevent any
** writing to the device.
** Note that setting RTFS_WRITE to 0 to disable write support saves
** about 5.5 K of executable image file.
*/
#define RTFS_WRITE 1
/* Maximum # of tasks that may use the file system.
** If this constant is larger than 1, multitasking service
** must be implemented. The File System uses MACROs in pckernel.h
** for hooking the multitasking service routines.
*/
#define NUM_USERS 1
/* Number of blocks in the buffer pool. Uses 532 bytes per block.
** Impacts performance during directory traversals. The value
** must be at least 1. The buffer pool is shared by all drives
** in the system. Note that higher value will improve disk
** traversal performance but also increase RAM footage.
*/
#define NBLKBUFFS 2
/* Maximum number of open files. This is the number of simultaneous
** files that may be opened at one time.
*/
#define NUSERFILES 3 /* Maximum Number of open Files */
/* Size of the internal FAT buffer in 512 byte
** chunks (i.e. 12 = 12 * 512 bytes). We statically allocate arrays
** based on this in pc_memry.c.
** Small values should be OK in the SanDisk environment since
** IO is fast. Note that reducing the Buffer size will increase
** the amount of FAT flushing. This value must be at least 1.
*/
#define FAT_BUFFER_SIZE 2
#endif /* USE_FILE_SYSTEM */
/****************************************************************************/
/*************************** INTERFACE SECTION ******************************/
/****************************************************************************/
/*
--------------------------------------------------------------------
** There are four different Peripheral Bus Interfaces that the
** HDTK supports. They are:
** SPI
** MMC
** SPI EMULATION
** MMC EMULATION
** There is only one Peripheral Bus Interface enabled at one time.
** The use of these options is very simple, either it is enabled
** by setting to 1 or disabled by setting to zero.
** USE_SPI 1 Enable SPI interface
** USE_SPI 0 Disable SPI interface
**
** USE_MMC 1 Enable MMC interface
** USE_MMC 0 Disable MMC interface
** and so on...
--------------------------------------------------------------------
*/
#define USE_SPI 0 /* If 1 use SPI interface */
#define USE_MMC 1 /* If 1 use MMC interface */
#define USE_SD 1 /* If 1, use SD interface */
/* if 1 use SPI or MMC Emulation */
#define USE_SPI_EMULATION 0
#define USE_MMC_EMULATION 0
#define USE_SECURITY 0
/*
** When the Peripheral Bus Interface is selected, the following
** options are allowed you to enable different features in the
** Peripheral Bus Interface to take the advantage of SanDisk
** products.
** Note that these options are available depending on the Peripheral
** Bus Interface, and may have different meanings.
** USE_MEMMODE
** USE_CONTIG_IO
** USE_HW_OPTION ***for Motorola ATA environment ONLY***
** WORD_ACCESS_ONLY
** USE_INTERRUPTS
** USE_ONLY_LBA
** USE_MULTI
** USE_SET_FEATURES
** PREERASE_ON_DELETE
** PREERASE_ON_ALLOC
** PREERASE_ON_FORMAT
*/
/* The USE_MEMMODE provides a way to configure the HDTK in memory
** mapped or IO mapped mode of your platform. The use of USE_MEMMODE
** is shown below:
** USE_MEMMODE 1 Enable memory mapped mode.
** USE_MEMMODE 0 Select IO mapped mode.
*/
#define USE_MEMMODE 0 /* if 1 use memory mapped mode Else IO */
/* The USE_CONTIG_IO allows the HDTK to map the ATA Task File Registers
** in any selected contiguous 16 byte IO address spaces.
** The definition of USE_CONTIG_IO is described as follows:
**
** USE_CONTIG_IO 1 Allow IO accessing in any 16-byte
** contiguous IO address spaces.
** USE_CONTIG_IO 0 IO accessing in 2 different IO regions.
** For example,
** Standard PC-AT IDE disk IO address spaces:
** 1F0h-1F7h, 3F6-3F7 (Primary IO)
** 170h-177h, 376-377 (Secondary IO)
*/
#define USE_CONTIG_IO 0 /* if 1 use 16-byte contiguous register range */
/*
NOTE: In Big Endian(Motorola), 16-bit data bus SHOULD be swapped for ATA environment.
Card D15-D8=Host D7-D0 and Card D7-D0=Host D15-D8.
*/
#define USE_HW_OPTION 0 /* Must be set to 1 for Motorola ATA environment */
/* In IO Mode, the WORD_ACCESS_ONLY is valid for Data Register accessing only.
** If set, selected WORD Data Register accessing; otherwise, BYTE accessing.
**
** In Memory Mapped Mode, the WORD_ACCESS_ONLY selects Word accessing to
** ALL Task File Registers.
** If set, selected WORD Task File Register accessing; otherwise, BYTE mode.
*/
#define WORD_ACCESS_ONLY 1 /* if 1 Word accessing else Byte */
/* This option supports data handler or event management interrupts.
** 0 to use polling mode.
** 1 to use interrupt mode for both data and event handlers.
*/
#define USE_INTERRUPTS 0 /* If 1 use interrupt mode, else polling */
/* This option selects different addressing scheme.
** 1 use only LBA (Logical Block Addressing),
** 0 CHS (Cylinder, Head, Sector Addressing).
** Since SanDisk products is configured in LBA mode, the default for
** this option is 1.
*/
#define USE_ONLY_LBA 1
/* This constant when set, enable Read and Write Multiple Commands
** 0 Disable write multiple command.
** 1 Enable write multiple command.
** NOTE: SanDisk supports one sector per block max, so there is no gain.
*/
#define USE_MULTI 1
/* This option allows the use of SanDisk proprietary Set Feature Command.
** 0 Disable SanDisk Set Feature Command.
** 1 Enable Sandisk Set Feature Command.
** (tradeoff between current drawn and read/write speed)
** Refer to SanDisk Product Manual for detail of tradeoff.
** If this option is set to 1, then the IDE_FEATURE_SETPERF_VALUE in
** ATADRV.H should also be set accordingly for the tradeoff.
*/
#define USE_SET_FEATURES 0
/*
#if ( USE_SD && (USE_SPI || USE_SPI_EMULATION) )
#undef USE_SET_FEATURES
#define USE_SET_FEATURES 1
#endif
*/
/* If 1, pre-erase sectors when files are deleted. */
#define PREERASE_ON_DELETE 0
/* If 1, pre-erase allocated clusters when files are extended. */
#define PREERASE_ON_ALLOC 0
/* If 1, pre-erase sectors when volume is formatted. */
#define PREERASE_ON_FORMAT 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -