README
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:12k
源码类别:

VxWorks

开发平台:

C/C++

  1. The socket drivers provided in this directory are intended to be informational. They were used to test the TrueFFS core on each of the respective BSPs and will
  2. work in their default environments. It is highly likely that you will have to 
  3. modify them to suite your BSP and it's implementation of Flash support. The 
  4. following instructions describe the modifications you will need to make to the
  5. BSP to build vxWorks with TrueFFS support in each of the respective BSPs. The
  6. current BSP REV Level is 1.1. Future revisions of BSPs might have these changes
  7. incorporated in them.
  8. The names of each of the socket drivers, sysTffs.c,is prepended by the name
  9. of the BSP that it belongs to. Example: mv177-sysTffs.c contains the socket
  10. drivers used for the mv177 BSP. If you were using the mv177 BSP you would
  11. copy mv177-sysTffs.c to target/config/mv177/sysTffs.c and follow the 
  12. instructions in this document in the section mv177:. You can then rebuild
  13. your vxWorks image and boot it on the target and have TrueFFS support for
  14. the Flash part.
  15. The driver pc386-sysTffs.c and the pc386 BSP modification instructions were
  16. tested on the pc486 BSP as well. Similarly, the pid7t driver and BSP 
  17. modifications were tested on pid7t_t as well.
  18. -------------------------------------------------------------------------------
  19. ads860:
  20. -------------------------------------------------------------------------------
  21. Makefile modifications:
  22.   - Add MACH_EXTRA configuration macro as follows.
  23.       MACH_EXTRA = sysTffs.o
  24. config.h modifications:
  25.   - Define INCLUDE_TFFS to link in tffsDrv() which is called in 
  26.     usrConfig.c or bootConfig.c to initialize the TFFS.
  27.   - Define INCLUDE_SHOW_ROUTINES to link in tffsShow() which shows 
  28.     a relationship between a drive number and a socket interface.
  29.   - Define INCLUDE_DOSFS to link in DOS File System.
  30.   - Change ROM_SIZE from 1MB to 2MB.
  31.       #define ROM_SIZE 0x00200000  /* 2M ROM space */
  32. sysLib.c modifications:
  33.   - Add two entries in sysPhysMemDesc[] for a flash memory area as follows.
  34.     PHYS_MEM_DESC sysPhysMemDesc [] =
  35.     {
  36.     {
  37.     (void *) LOCAL_MEM_LOCAL_ADRS,
  38.     (void *) LOCAL_MEM_LOCAL_ADRS,
  39.     LOCAL_MEM_SIZE ,
  40.     VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE,
  41.     VM_STATE_VALID      | VM_STATE_WRITABLE      | VM_STATE_CACHEABLE
  42.     },
  43.     {
  44.     (void *) PC_BASE_ADRS_0,
  45.     (void *) PC_BASE_ADRS_0,
  46.     PC_SIZE_0, /* 1 m - PCMCIA window 0 */
  47.     VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE,
  48.     VM_STATE_VALID      | VM_STATE_WRITABLE      | VM_STATE_CACHEABLE_NOT
  49.     },
  50.     :
  51.     {
  52.     (void *) PC_BASE_ADRS_1,
  53.     (void *) PC_BASE_ADRS_1,
  54.     PC_SIZE_1, /* 32 m - PCMCIA window 1 */
  55.     VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE,
  56.     VM_STATE_VALID      | VM_STATE_WRITABLE      | VM_STATE_CACHEABLE_NOT
  57.     }
  58.     };
  59. ads860.h modifications:
  60.   - Define macros for PCMCIA memory mapping as follows.
  61.      #define PC_BASE_ADRS_0 0x02000000 /* PCMCIA base address */
  62.      #define PC_SIZE_0 0x00100000 /* PCMCIA mapping size */
  63.      #define PC_BASE_ADRS_1 0x04000000 /* PCMCIA base address */
  64.      #define PC_SIZE_1 0x02000000 /* PCMCIA mapping size */
  65. tffsBootImagePut:
  66.   - Second parameter "offset" is (ROM_TEXT_ADRS - ROM_BASE_ADRS), 
  67.     so it is 0x100 for the default configuration.
  68.   - elfToBin should be used to get the boot-image for tffsBootImagePut.
  69.     elfToBin < bootrom > bootrom.bin
  70. -------------------------------------------------------------------------------
  71. hkbaja47:
  72. -------------------------------------------------------------------------------
  73. Makefile modifications:
  74.   - Add MACH_EXTRA configuration macro as follows.
  75.       MACH_EXTRA = vxLib.obj sysTffs.o
  76. config.h modifications:
  77.   - Define INCLUDE_TFFS to link in tffsDrv() which is called in 
  78.     usrConfig.c or bootConfig.c to initialize the TFFS.
  79.   - Define INCLUDE_SHOW_ROUTINES to link in tffsShow() which shows 
  80.     a relationship between a drive number and a socket interface.
  81.   - Define INCLUDE_DOSFS to link in DOS File System.
  82. -------------------------------------------------------------------------------
  83. iq960rp:
  84. -------------------------------------------------------------------------------
  85. The patch provided by WRS for IQ960RD must be installed before
  86. making any changes.
  87. Makefile modifications:
  88.   - Add MACH_EXTRA configuration macro as follows.
  89.       MACH_EXTRA = sysTffs.o
  90. config.h modifications:
  91.   - Define INCLUDE_TFFS to link in tffsDrv() which is called in 
  92.     usrConfig.c or bootConfig.c to initialize the TFFS.
  93.   - Define INCLUDE_SHOW_ROUTINES to link in tffsShow() which shows 
  94.     a relationship between a drive number and a socket interface.
  95.   - Define INCLUDE_DOSFS to link in DOS File System.
  96. -------------------------------------------------------------------------------
  97. mv177:
  98. -------------------------------------------------------------------------------
  99. Makefile modifications:
  100.   - Add MACH_EXTRA configuration macro as follows.
  101.       MACH_EXTRA = sysTffs.o
  102. config.h modifications:
  103.   - Define INCLUDE_TFFS to link in tffsDrv() which is called in 
  104.     usrConfig.c or bootConfig.c to initialize the TFFS.
  105.   - Define INCLUDE_SHOW_ROUTINES to link in tffsShow() which shows 
  106.     a relationship between a drive number and a socket interface.
  107.   - Define INCLUDE_DOSFS to link in DOS File System.
  108. sysLib.c modifications:
  109.   - Make ROM area writable, as follows:
  110.     /* ROM */
  111.     {
  112.     (void *) ROM_BASE_ADRS,
  113.     (void *) ROM_BASE_ADRS,
  114.     0x400000,
  115.     VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE,
  116.     VM_STATE_VALID | VM_STATE_WRITABLE      | VM_STATE_CACHEABLE_NOT
  117.     },
  118. -------------------------------------------------------------------------------
  119. pc386/pc486:
  120. -------------------------------------------------------------------------------
  121. Makefile modifications:
  122.   - Add MACH_EXTRA configuration macro as follows.
  123.       MACH_EXTRA = sysTffs.o
  124. config.h modifications:
  125.   - Define INCLUDE_TFFS or INCLUDE_PCMCIA configuration macro as follows.
  126.       #define INCLUDE_TFFS
  127.       or
  128.       #define INCLUDE_PCMCIA
  129.     INCLUDE_TFFS pulls in and uses its own PCIC(PCMCIA controller chip) driver.
  130.     INCLUDE_PCMCIA uses a driver provided by PCMCIA package.  
  131.     The TFFS's PCIC driver doesn't check a type of PC card and it assumes the
  132.     accessing PC card is a flash PC card.  However, the size of the driver is
  133.     small.  Thus it might be suitable for people who have memory constraint.
  134.     On the other hand, the PCMCIA package checks a type of PC card and allows
  135.     TFFS driver to access the PC card only if it is a flash PC card. 
  136.     If you wish to use the TrueFFS services with the PCMCIA services you
  137.     must add it to the list of services that PCMCIA will include in to 
  138.     vxWorks.
  139. #ifdef  INCLUDE_PCMCIA
  140. #define INCLUDE_TFFS /* include TFFS driver */  
  141. #define INCLUDE_ATA             /* include ATA driver */
  142. #define INCLUDE_SRAM            /* include SRAM driver */
  143. #ifdef  INCLUDE_NETWORK
  144. #define INCLUDE_ELT             /* include 3COM EtherLink III driver */
  145. #endif  /* INCLUDE_NETWORK */
  146. #endif  /* INCLUDE_PCMCIA */
  147.   - Redefine  CIS macros to avoid address conflicts with DiskOnChip 2000. 
  148.     If you are using the M-System DiskOnCHip2000 product you might run in
  149.     to address conflicts with the vxWorks PCMICA product. To resolve this 
  150.     you can add the following to config.h
  151.     
  152. #ifdef INCLUDE_TFFS
  153. #undef CIS_MEM_START
  154. #undef CIS_MEM_STOP
  155. #undef CIS_REG_START
  156. #undef CIS_REG_STOP
  157. #define CIS_MEM_START 0xc8000 /* mapping addr for CIS tuple */
  158. #define CIS_MEM_STOP 0xcbfff
  159. #define CIS_REG_START 0xcc000 /* mapping addr for config reg */
  160. #define CIS_REG_STOP 0xccfff 
  161. #endif /* INCLUDE_TFFS */
  162.   - Define the warm boot parameter for reboot
  163.         #define SYS_WARM_TFFS_DRIVE     0       /* 0 = c: (DOC) */
  164.     
  165.   - Define INCLUDE_SHOW_ROUTINES to link in tffsShow() which shows 
  166.     a relationship between a drive number and a socket interface.
  167. sysLib.c
  168.   - If your C: drive is Disk On Chip and you are booting from it instead of 
  169.     floppy disk, set sysWarmType global variable to 3 for warm start from 
  170.     the Disk On Chip.
  171.   - The following changes need to be made to sysLib.c if you wish to reboot
  172.     from the Truffs Flash drive.
  173. Look for the declaration of the variable sysWarmAtaDrive and add 
  174. the following line after it.
  175. int sysWarmTffsDrive= SYS_WARM_TFFS_DRIVE; /* TFFS drive 0 (DOC) */
  176. In the function sysToMonitor you will find the clause that defines
  177. the reboot process for the reboot device ATA. Add the the following 
  178. after the #endif statement for INCLUDE_ATA :
  179. #ifdef INCLUDE_TFFS
  180.     if (sysWarmType == 3)
  181. {
  182. IMPORT int dosFsDrvNum;
  183.  
  184.          tffsDrv (); /* initialize TFFS */
  185.   if (dosFsDrvNum == ERROR)
  186.           dosFsInit (NUM_DOSFS_FILES); /* initialize DOS-FS */
  187.  
  188.   if (usrTffsConfig (sysWarmTffsDrive, FALSE, "/vxboot/") == ERROR)
  189.       {
  190.       printErr ("usrTffsConfig failed.n");
  191.       return (ERROR);
  192.       }
  193. }
  194. #endif /* INCLUDE_TFFS */
  195.  
  196. Search for the lines that appear as follows :
  197. #if (defined (INCLUDE_FD) || defined (INCLUDE_ATA))
  198.     if ((sysWarmType == 1) || (sysWarmType == 2))
  199. replace them with the following :
  200. #if (defined(INCLUDE_FD) || defined(INCLUDE_ATA) || defined(INCLUDE_TFFS))
  201.     if ((sysWarmType == 1) || (sysWarmType == 2) || (sysWarmType == 3))
  202. Search for the line that appears as follows :
  203. #endif /* defined (INCLUDE_FD) || defined (INCLUDE_ATA) */
  204. replace them with the following :
  205. #endif /* (INCLUDE_FD) || (INCLUDE_ATA) || (INCLUDE_TFFS) */
  206. -------------------------------------------------------------------------------
  207. pid7t/pid7t_t:
  208. -------------------------------------------------------------------------------
  209. Makefile modifications:
  210.   - Add MACH_EXTRA configuration macro as follows.
  211.       MACH_EXTRA = if_oli.obj sysTffs.o
  212. config.h modifications:
  213.   - Define INCLUDE_TFFS to link in tffsDrv() which is called in 
  214.     usrConfig.c or bootConfig.c to initialize the TFFS.
  215.   - Define INCLUDE_SHOW_ROUTINES to link in tffsShow() which shows 
  216.     a relationship between a drive number and a socket interface.
  217.   - Define INCLUDE_DOSFS to link in DOS File System.
  218. tffsBootImagePut:
  219.   - Second parameter "offset" is (ROM_TEXT_ADRS - ROM_BASE_ADRS), 
  220.     so it is 0 for the default configuration.
  221.   - coffArmToBin should be used to get the boot-image for tffsBootImagePut.
  222.     coffArmToBin < bootrom > bootrom.bin
  223. -------------------------------------------------------------------------------
  224. sony4520:
  225. -------------------------------------------------------------------------------
  226. Makefile modifications:
  227.   - Add MACH_EXTRA configuration macro as follows.
  228.       MACH_EXTRA = sysTffs.o
  229. config.h modifications:
  230.   - Define INCLUDE_TFFS to link in tffsDrv() which is called in 
  231.     usrConfig.c or bootConfig.c to initialize the TFFS.
  232.   - Define INCLUDE_SHOW_ROUTINES to link in tffsShow() which shows 
  233.     a relationship between a drive number and a socket interface.
  234.   - Define INCLUDE_DOSFS to link in DOS File System.
  235. -------------------------------------------------------------------------------
  236. ss5:
  237. -------------------------------------------------------------------------------
  238. Makefile modifications:
  239.   - Add MACH_EXTRA configuration macro as follows.
  240.       MACH_EXTRA = memDesc.o sysTffs.o
  241. config.h modifications:
  242.   - Define INCLUDE_TFFS to link in tffsDrv() which is called in 
  243.     usrConfig.c or bootConfig.c to initialize the TFFS.
  244.   - Define INCLUDE_SHOW_ROUTINES to link in tffsShow() which shows 
  245.     a relationship between a drive number and a socket interface.
  246.   - Define INCLUDE_DOSFS to link in DOS File System.
  247.   - Undefine USER_D_CACHE_ENABLE to disable the data cache since TFFS assumes
  248.     that it is directly accessing the flash memory.
  249.   - Define INCLUDE_FLASH to make the flash memory writable.
  250. -------------------------------------------------------------------------------
  251. Disk On Chip 2000
  252. -------------------------------------------------------------------------------
  253. The socket driver doc2k-sysTffs.c is specific to a system that has only a Disk
  254. On Chip 2000 component from M-Systems.  The socket driver has been tested with
  255. pc386 and pc486 BSPs and the mbx860 BSP but is believed to be portable to any
  256. BSP. Since the DOC2_SCAN addresses are board specific they have been placed in
  257. conditional compilation constants. To compile this file you must make the 
  258. following change to the Makefile in the BSP directory. 
  259. If the Makefile already has a variable called EXTRA_DEFINE then add
  260. -D$(BSP_NAME) to it. If not add the line
  261. EXTRA_DEFINE = -D$(BSP_NAME)