You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
520 lines
18 KiB
520 lines
18 KiB
3 weeks ago
|
\" ft2000-4/target.ref - ����FT-2000�ĺ˿����������ĵ�
|
||
|
|
||
|
\"--------------------------------------------------------------------------------
|
||
|
����
|
||
|
FT-2000/4 ��һ����������Ӧ�õĸ�����ͨ��4 �˴�������ÿ2 ���˹���1
|
||
|
���������˴أ�Cluster����������L2 Cache����Ҫ�����������£�
|
||
|
|
||
|
* ����ARM v8 64 λָ��ϵͳ������32 λָ��
|
||
|
* ֧�ֵ����ȡ�˫���ȸ�������ָ��
|
||
|
* ֧��ASIMD ����ָ��
|
||
|
* L2 Cache��ÿ��Cluster����2MB����4MB��FT-2000/4��ҵ�����˰�L2Cache 2MB
|
||
|
* L3 Cache����Ϊ8��Bank����4MB
|
||
|
* ����2 ��DDR4-3200������
|
||
|
* ����34 Lanes PCIe3.0 �ӿڣ�2 ��X16��ÿ���ɲ��ֳ�2 ��X8����2 ��X1
|
||
|
* ����2 ��ǧ��Ethernet��RGMII �ӿڣ���֧��10/100/1000Mbps ����Ӧ
|
||
|
* ����1 ��SD ��������������SD 2.0 �淶
|
||
|
* ����4 ��UART��32 ��GPIO��4 ��I2C��1 ��QSPI��2 ��ͨ��SPI��3 ��CAN��2 ��WDT��16 ���ⲿ�ж�
|
||
|
* �����¶ȴ�����
|
||
|
* ����128KB On Chip Memory
|
||
|
|
||
|
\"--------------------------------------------------------------------------------
|
||
|
|
||
|
\"--------------------------------------------------------------------------------
|
||
|
VxWorks���뻷���
|
||
|
1. ����Դ��
|
||
|
�ѱ���Ŀ��Դ�밴��Ӧλ�ø��ơ��滻��VxWorks6.9����������(WIND_HOME������װ��Ŀ¼)
|
||
|
��ЩԴ���������֣�BSP�Ϳ�
|
||
|
BSP��·���ǣ� <WIND_HOME>\vxworks-6.9\target\config\<BSP-source>
|
||
|
���ĸ�·���ǣ�<WIND_HOME>\vxworks-6.9\target\{src,h}\
|
||
|
����ֻ����BSP������ֱ����Workbench���뻷�����п�����
|
||
|
��������Դ�ļ����κθ��£����ȱ����⣬����Workbench������
|
||
|
|
||
|
2. ���������
|
||
|
��������ģʽ�����֣�SMP��Symmetrical Multi-Processing����UP��Uni-Processing�������ƶ��˺͵��ˡ�
|
||
|
����������ȷ���ö��ˣ����ǵ���ģʽ�����������IJ��裬ѡ�����е�һ��ģʽ���б��롣
|
||
|
����CMD����ڣ����ÿ���������
|
||
|
cd <WIND_HOME>
|
||
|
wrenv.exe -p vxworks-6.9
|
||
|
cd <WIND_HOME>\vxworks-6.9\target\src
|
||
|
��1������SMP�⣺
|
||
|
make CPU=ARMARCH7 TOOL=diab VXBUILD=SMP
|
||
|
��������������<WIND_HOME>\vxworks-6.9\target\lib_smp\��Ŀ¼�µ��ļ����¡�
|
||
|
��2������UP�⣺
|
||
|
make CPU=ARMARCH7 TOOL=diab
|
||
|
��������������<WIND_HOME>\vxworks-6.9\target\lib\��Ŀ¼�µ��ļ����¡�
|
||
|
|
||
|
����˵����
|
||
|
(1)������������rcleanĿ�꣬���磺
|
||
|
|
||
|
make CPU=ARMARCH7 TOOL=diab rclean //ɾ������UP��
|
||
|
make CPU=ARMARCH7 TOOL=diab //���±�������UP��
|
||
|
make CPU=ARMARCH7 TOOL=diab VXBUILD=SMP rclean //ɾ������SMP��
|
||
|
make CPU=ARMARCH7 TOOL=diab VXBUILD=SMP //���±�������SMP��
|
||
|
|
||
|
3. ͼ�λ�������
|
||
|
���������б������ķ�����������Workbench���ߵ�VxWorks Source Build(Kernel Library) Project�˵�������ȫ������
|
||
|
����VSB���̡� ֻ��VSB���̲�����ϵͳĬ�Ͽ� <WIND_HOME>\vxworks-6.9\target\lib��lib_smp��������VSB����
|
||
|
Ŀ¼�±����µĿ��ļ����½�VxWorks Image Project������VIP���̣�ʱ��Ҫ���ڴ�VSB��
|
||
|
�Ƽ�ʹ��ͼ�λ����롣
|
||
|
|
||
|
|
||
|
|
||
|
\"--------------------------------------------------------------------------------
|
||
|
VxWorks������
|
||
|
�ο���ʹ��uboot����vxWorks����ϵͳ����bin��ʽ�ľ���Ĭ���ļ���ΪvxWorks.bin
|
||
|
��������ϵͳ�����ķ�����ֹһ�֣������硢USB�̡�SATAӲ�̵ȷ�ʽ���أ��û�ѡ����
|
||
|
һ�ּ��ɡ�
|
||
|
|
||
|
|
||
|
1. ͨ��tftp�������ؾ���
|
||
|
Workbench���ɿ���������������Ĭ������ vxWorks �����ļ�����ELF��ʽ�ġ����Խ�һ��ָ��
|
||
|
����vxWorks.bin�ļ���������������bin��ʽ�� һ���أ������ָ�ʽ��uboot���ǿ��Լ������еġ�
|
||
|
���صĹ��̺ͷ�������һ���ģ������������ڴ�����ַ��ͬ��
|
||
|
|
||
|
(1)����bin��ʽ��ȡ����ַ 0x80100000
|
||
|
(2)����ELF��ʽ��ȡ����ַ 0x90100000
|
||
|
|
||
|
uboot�������0xǰ����ʡ�ԡ�
|
||
|
|
||
|
1.1 PC������ TFTP ������
|
||
|
|
||
|
PC���Ͳο���ͨ��������������PC��������TFTP����������windowsϵͳΪ����ֱ��˫��
|
||
|
<workbench��װĿ¼>\vxworks-6.9\host\x86-win32\bin\Tftpd32.exe
|
||
|
ֻ��Ҫ���� Current Directory ָ��vxWorks.bin(��vxWorks)�ļ����ڵ�·�����ɣ����������á�
|
||
|
|
||
|
1.2 �������uboot��������
|
||
|
�ο�����PC��ͨ��TTL��ƽ��3��UART�������ӡ���PC���ϴ����ն�����(���糬���նˡ�TeraTerm��)��
|
||
|
���Ӵ˴��ڣ�����������Ϊ 115200�������������á��ϵ磬���ն�������ֹͣuboot���Զ���������
|
||
|
uboot��ʾ���У�������������:
|
||
|
|
||
|
setenv ethaddr 98:0e:24:00:11:22
|
||
|
setenv eth1addr 98:0e:24:00:11:23
|
||
|
|
||
|
setenv ipaddr 192.168.3.119
|
||
|
setenv serverip 192.168.3.118
|
||
|
saveenv
|
||
|
|
||
|
1.3 ���غ���������ϵͳ����
|
||
|
|
||
|
(1)bin��ʽ������
|
||
|
��uboot��ִ������:
|
||
|
tftpboot 0x80100000 vxWorks.bin
|
||
|
bootvx32 0x80100000
|
||
|
��������vxWorksϵͳ
|
||
|
|
||
|
(2)ELF��ʽ������
|
||
|
��uboot��ִ������:
|
||
|
tftpboot 0x90100000 vxWorks
|
||
|
bootvx32 0x90100000
|
||
|
��������vxWorksϵͳ
|
||
|
|
||
|
������������ͬ������bin��ʽΪ������ELF��ʽʱ��ֻ��Ҫ�滻����ַ���ļ������ɣ�����������ͬ����
|
||
|
|
||
|
2. ͨ���ļ�ϵͳ���ؾ���
|
||
|
2.1 USB�̼���
|
||
|
��vxWorks.bin�ļ���ǰ������FAT32��ʽ��USB���У��ٰѴ��̲����ο�����USB�ڣ��ϵ磬ִ��uboot����:
|
||
|
usb xhci start
|
||
|
fatload usb 0 0x80100000 vxWorks.bin
|
||
|
bootvx32 0x80100000
|
||
|
|
||
|
2.2 FAT32Ӳ�̼���
|
||
|
��vxWorks.bin�ļ���ǰ������FAT32��ʽ��Ӳ���У��ٰѴ��̲����ο�����SATA�ڣ��ϵ磬ִ��uboot����:
|
||
|
fatload scsi 0:1 0x80100000 vxWorks.bin
|
||
|
bootvx32 0x80100000
|
||
|
|
||
|
2.3 EXT4Ӳ�̼���
|
||
|
��vxWorks.bin�ļ���ǰ������ext4��ʽ��Ӳ���У��ٰѴ��̲����ο�����SATA�ڣ��ϵ磬ִ��uboot����:
|
||
|
ext4load scsi 0:1 0x80100000 vxWorks.bin
|
||
|
bootvx32 0x80100000
|
||
|
|
||
|
�ļ�ϵͳ���غ�����vxWorks����ʱ������gmac���粻ͨ������Ȼ��Ҫ��uboot����ǰ����һ����Ч������MAC��ַ:
|
||
|
setenv ethaddr 98:0e:24:00:11:22
|
||
|
setenv eth1addr 98:0e:24:00:11:23
|
||
|
|
||
|
3. ���ð���FLASH�Զ������������˹���Ԥ
|
||
|
|
||
|
���������ǰ�vxworks���浽��UBOOT��ͬ��NOR FLASHоƬ���оƬһ��32MB��Ŀǰuboot����flash��д�������֧��16MB��
|
||
|
����uboot�̼�һ��4MB���ҡ������������ӣ���ǰ6MB��uboot����6MB��16MB�Ŀռ���VxWorks�����á�VxWorks��ELF��ʽ���ļ��������������£�
|
||
|
|
||
|
tftpboot 0x90100000 vxWorks �������ص��ڴ�
|
||
|
|
||
|
flashe 0x600000 0xa00000
|
||
|
flashw 0x90100000 0x600000 0xa00000
|
||
|
cmp.b 0x600000 0x90100000 0xa00000
|
||
|
cp.b 0x600000 0x90100000 0xa00000
|
||
|
|
||
|
setenv bootcmd "cp.b 0x600000 0x90100000 0xa00000; bootvx32 0x90100000"
|
||
|
saveenv
|
||
|
|
||
|
Ȼ���Ϳ����µ硢�ϵ��������Զ�����ϵͳ��������vxWorks.bin�ļ�������0x90100000�ij�0x80100000���ɡ�
|
||
|
|
||
|
4. CPU IDӳ��
|
||
|
|
||
|
����UP�汾��ֻ��һ���������в���ϵͳ�����漰CPU IDӳ�䡣
|
||
|
ֻ��SMP�汾ʱ������Ҫӳ�䡣��sysLib.c�ʹ������cpuIndexMap[]��������ID�ź���ID�ŵ�ת����
|
||
|
����ID��ȡ��MPIDR��Multiprocessor Affinity Register���Ĵ����ĵ�24λ�� cpuIndexMap[0] ����
|
||
|
Ϊ����ϵͳ�����ˣ����ˣ���MPIDR�������Ӻ˵�����ID��������cpuIndexMap[]�������������������
|
||
|
������ID���ϲ㺯��usrSmpInit����ÿ�����ˣ��Ͷ�ӦcpuIndexMap[]����������ÿ��ʵ�������ˡ�
|
||
|
|
||
|
\"--------------------------------------------------------------------------------
|
||
|
��������
|
||
|
|
||
|
1. �ο���֧�ֵ�Ӳ���ӿ������б�:
|
||
|
|
||
|
|
||
|
Hardware Interface | Controller | Driver/Component | Status | Component
|
||
|
---------------------------------------------------------------------------------------------
|
||
|
UART:0 | PrimeCell PL011 | vxbPrimeCellSio.c | SUPPORTED | DRV_SIO_PRIMECELL
|
||
|
UART:1 | PrimeCell PL011 | vxbPrimeCellSio.c | SUPPORTED | DRV_SIO_PRIMECELL
|
||
|
UART:2 | PrimeCell PL011 | vxbPrimeCellSio.c | SUPPORTED | DRV_SIO_PRIMECELL
|
||
|
UART:3 | PrimeCell PL011 | vxbPrimeCellSio.c | SUPPORTED | DRV_SIO_PRIMECELL
|
||
|
10/100/1000Mb-ETHERNET | FT GAMC | vxbFtGmacEnd.c | SUPPORTED | DRV_VXBEND_FTGMAC
|
||
|
TIMER | generic timer | vxbArmv7GenTimer.c | SUPPORTED | DRV_ARM_GEN_SYS_TIMER
|
||
|
TIMER | auxiliary timer | vxbArmv7AuxTimer.c | SUPPORTED | DRV_ARM_GEN_AUX_TIMER
|
||
|
PCIe | FT pcie | vxbFtPcie.c | SUPPORTED | DRV_PCIBUS_FT, INCLUDE_PCI_BUS
|
||
|
USB Bus | D720201 | XHCI | SUPPORTED | INCLUDE_USB_XHCI_HCD_INIT
|
||
|
USB Disk | D720201 | XHCI | SUPPORTED | INCLUDE_USB_GEN2_STORAGE_INIT
|
||
|
USB Keyboard | D720201 | XHCI | SUPPORTED | INCLUDE_USB_GEN2_KEYBOARD_INIT
|
||
|
USB Mouse | D720201 | XHCI | SUPPORTED | INCLUDE_USB_GEN2_MOUSE_INIT
|
||
|
SATA | AHCI | vxbAhciStorage.c | SUPPORTED | INCLUDE_DRV_STORAGE_AHCI
|
||
|
I2C | FT I2C | vxbFtI2c.c | SUPPORTED | DRV_FTI2C, INCLUDE_I2C_BUS
|
||
|
RTC | DS1339 | vxbI2cRtc.c | SUPPORTED | DRV_I2C_RTC, INCLUDE_TIMER_RTC
|
||
|
CAN | FT CAN | vxbFtCan.c | SUPPORTED | DRV_FTCAN
|
||
|
SD Card | FT SD | vxbFtSdCtrl.c | SUPPORTED | INCLUDE_FT_SD
|
||
|
PHY | YT8521 | vxbYt8521Phy.c | SUPPORTED | INCLUDE_YT8521PHY
|
||
|
QSPI | FT QSPI | vxbFtQspi.c | SUPPORTED | DRV_FTQSPI, INCLUDE_SPI_BUS
|
||
|
SP25FLASH | FT QSPI | vxbSp25SpiFlash.c | SUPPORTED | DRV_SPIFLASH_SP25
|
||
|
DisplayPort | X100 | vxbM6845Vga.c & lib | SUPPORTED | INCLUDE_PC_CONSOLE
|
||
|
EEPROM | AT24C32 | vxbI2cEeprom.c | SUPPORTED | DRV_I2C_EEPROM, INCLUDE_EEPROMDRV
|
||
|
GPIO | FT_GPIO | vxbFtGpio.c | SUPPORTED | DRV_FTGPIO
|
||
|
|
||
|
�ӷ��ڹٷ���վ https://www.phytium.com.cn/ �������ر����ֲ�
|
||
|
<< FT-2000_4���������ֲ�.pdf >>�� �û����������°档
|
||
|
|
||
|
|
||
|
2. ��������
|
||
|
�ĸ� PrimeCell UART ���ڣ�Ĭ������Ϊ
|
||
|
|
||
|
\ts
|
||
|
Baud Rate : 115200
|
||
|
Data : 8 bit
|
||
|
Parity : None
|
||
|
Stop : 1 bit
|
||
|
Flow Control: None
|
||
|
\te
|
||
|
|
||
|
|
||
|
3. ������MAC��ַ
|
||
|
�����Ǽ��ɵ� SOC GMACs 10/100/1000 MAC �� PHY.
|
||
|
MAC��ַ��ʽ: 98:0e:24:xx:xx:xx. ����ǰ�����ֽ� 98:0e:24 �������ڹ�˾
|
||
|
|
||
|
\ts
|
||
|
`gmac0' | - Ethernet
|
||
|
`gmac1' | - Ethernet
|
||
|
\te
|
||
|
|
||
|
vxWorks��ifconfig�����������ʱ�����Բ鿴������Ϣ��
|
||
|
����IP��ַʱ�����������¸�ʽ:
|
||
|
-> ifconfig "gmac0 192.168.100.100 up"
|
||
|
|
||
|
|
||
|
4. ���豸�ļ�ϵͳ
|
||
|
|
||
|
���豸 SD/USB/SATA ���豸��һ����Ҫ�����ļ�ϵͳ��
|
||
|
VxWorks ֧�������ļ�ϵͳ dosFs �� HRFS. ����dosFsʱ��������Ҫ���³�������:
|
||
|
|
||
|
\cs
|
||
|
#define INCLUDE_DOSFS
|
||
|
#define INCLUDE_DOSFS_MAIN
|
||
|
#define INCLUDE_DOSFS_CHKDSK
|
||
|
#define INCLUDE_DOSFS_FMT
|
||
|
#define INCLUDE_DOSFS_FAT
|
||
|
#define INCLUDE_DOSFS_SHOW
|
||
|
#define INCLUDE_DOSFS_DIR_VFAT
|
||
|
#define INCLUDE_DOSFS_DIR_FIXED
|
||
|
#define INCLUDE_FS_MONITOR
|
||
|
#define INCLUDE_FS_EVENT_UTIL
|
||
|
#define INCLUDE_ERF
|
||
|
#define INCLUDE_XBD
|
||
|
#define INCLUDE_XBD_BLKDEV
|
||
|
#define INCLUDE_XBD_TRANS
|
||
|
#define INCLUDE_DEVICE_MANAGER
|
||
|
#define INCLUDE_XBD_BLK_DEV
|
||
|
#define INCLUDE_XBD_PART_LIB
|
||
|
#define INCLUDE_DISK_UTIL
|
||
|
\ce
|
||
|
|
||
|
��ʽ������:
|
||
|
\cs
|
||
|
dosFsVolFormat ("NameOfTheBlockDevice", 0x20, 0); /@ FAT32 format @/
|
||
|
����
|
||
|
dosFsVolFormat ("NameOfTheBlockDevice", 0x10, 0); /@ FAT16 format @/
|
||
|
\ce
|
||
|
|
||
|
��ʽ���������ļ�ϵͳ�������������
|
||
|
|
||
|
\cs
|
||
|
copy ("vxWorks", "NameOfTheBlockDevice/vxWorks");
|
||
|
pwd
|
||
|
cd("/ata0:2")
|
||
|
ls
|
||
|
ll
|
||
|
dosFsShow("NameOfTheBlockDevice", level)
|
||
|
\ce
|
||
|
|
||
|
devs �������Բ鿴vxWorksϵͳ���ӵ��豸�б�������:
|
||
|
|
||
|
/tyCo/0
|
||
|
host:
|
||
|
/ata0:1
|
||
|
/bd0
|
||
|
|
||
|
|
||
|
|
||
|
5. CPU ����
|
||
|
|
||
|
�� VX_SMP_NUM_CPUS ��ֵ��SMP�����ĺ˵ĸ�����Ĭ��ȡ����ֵ4�������к˶�������
|
||
|
������Workbench���������У��Ĵ˺���ֵ��ѡ�������ĺ�����
|
||
|
|
||
|
|
||
|
6. I2C�����������ü�ʹ�÷���
|
||
|
�����������ã�
|
||
|
\cs
|
||
|
#define DRV_FTI2C
|
||
|
#define INCLUDE_I2C_BUS
|
||
|
\ce
|
||
|
|
||
|
������hwconf.c������I2C�����������������Լ��ж�ģʽ�����磬��I2C������0����Ϊ��������Ϊ400kHz����ѯģʽ��
|
||
|
\cs
|
||
|
/@ hwconf.c @/
|
||
|
...
|
||
|
struct hcfResource i2cDev0Resources[] = {
|
||
|
...
|
||
|
{ "busSpeed", HCF_RES_INT, {(void *)400000}},
|
||
|
{ "polling", HCF_RES_INT, {(void *)TRUE}},
|
||
|
...
|
||
|
};
|
||
|
...
|
||
|
\ce
|
||
|
|
||
|
��������I2C��RTC�豸������DS1339����������������
|
||
|
\cs
|
||
|
#define INCLUDE_TIMER_RTC
|
||
|
#define DRV_I2C_RTC
|
||
|
\ce
|
||
|
������hwconf.c��I2C�豸�б�������DS1339�豸��
|
||
|
\cs
|
||
|
/@ hwconf.c @/
|
||
|
...
|
||
|
LOCAL struct i2cDevInputs i2cDev1Input[] = {
|
||
|
/* Name */ /* Addr (7-bit) */ /* flag */
|
||
|
...
|
||
|
#ifdef DRV_I2C_RTC
|
||
|
{ "rtc_ds1339", (0xD0>>1), 0 },
|
||
|
#endif
|
||
|
...
|
||
|
};
|
||
|
...
|
||
|
\ce
|
||
|
����RTC�豸���û��ӿ���Ҫ�У�
|
||
|
STATUS vxbRtcGet (struct tm * rtcTime); /*��ȡRTCʱ�䡣*/
|
||
|
STATUS vxbRtcSet (struct tm * rtcTime); /*����RTCʱ�䡣*/
|
||
|
��ϵͳ���������ڶ���RTC�豸���������Զ�ѡ�������ʵ�һ������
|
||
|
|
||
|
|
||
|
��������I2C��EEPROM�豸������at24c32����������������
|
||
|
\cs
|
||
|
# define DRV_I2C_EEPROM
|
||
|
# define INCLUDE_EEPROMDRV
|
||
|
\ce
|
||
|
������hwconf.c��I2C�豸�б�������at24c32�豸��
|
||
|
\cs
|
||
|
/@ hwconf.c @/
|
||
|
...
|
||
|
LOCAL struct i2cDevInputs i2cDev1Input[] = {
|
||
|
/* Name */ /* Addr (7-bit) */ /* flag */
|
||
|
...
|
||
|
#ifdef DRV_I2C_EEPROM
|
||
|
{ "eeprom_at24c32", (0x57), I2C_WORDADDR },
|
||
|
#endif
|
||
|
...
|
||
|
};
|
||
|
...
|
||
|
\ce
|
||
|
���������ļ�ϵͳ��������һ��eeprom�豸��
|
||
|
����ͨ��devs�����鿴��eeprom�豸��
|
||
|
\cs
|
||
|
-> devs
|
||
|
drv name
|
||
|
...
|
||
|
7 /eeprom/0
|
||
|
...
|
||
|
\ce
|
||
|
����ͨ�������ļ�ϵͳ�ӿ�open,read,write,close�Ȳ���������EERROM��
|
||
|
|
||
|
|
||
|
7. CAN��������
|
||
|
�����������ã�
|
||
|
\cs
|
||
|
#define DRV_FTCAN
|
||
|
\ce
|
||
|
���ò����ʵĺ����ӿ�Ϊ:ftCanSetBitrate()����������ʱ�IJ����ʡ�
|
||
|
���������ӿ�ΪftCanSend()���ڲ���������֡��ʽ�ĸ���������
|
||
|
�հ��DZ������첽�ģ�ͨ��ftCanRecvCallback()�ҽӻص�����ʵ�֡����������ã���Ĭ�ϴ�ӡshell��ʾ������Ϣ��
|
||
|
|
||
|
8. SD����������
|
||
|
�����������ã�
|
||
|
\cs
|
||
|
#define INCLUDE_FT_SD
|
||
|
#define RV_SDSTORAGE_CARD
|
||
|
\ce
|
||
|
��֧��FAT32�ļ�ϵͳ ��devs������ʾ��Ĭ���豸���� /sd0:0
|
||
|
|
||
|
9. QSPI�������ü�ʹ�÷���
|
||
|
�����������ã�
|
||
|
\cs
|
||
|
#define DRV_FTQSPI
|
||
|
#define INCLUDE_SPI_BUS
|
||
|
\ce
|
||
|
|
||
|
��������QSPI��FLASH�豸������sp25ϵ������������������
|
||
|
\cs
|
||
|
#define DRV_SPIFLASH_SP25
|
||
|
\ce
|
||
|
������hwconf.c��SPI�豸�б�������sp25������
|
||
|
\cs
|
||
|
/@ hwconf.c @/
|
||
|
...
|
||
|
LOCAL struct vxbSpiDevInfo spiDevTbl[] = {
|
||
|
/* name cs width freq mode */
|
||
|
...
|
||
|
#ifdef DRV_SPIFLASH_SP25
|
||
|
{ SPI_FLASH_DEVICE_NAME, 0, 8, 30000000, 1},
|
||
|
#endif
|
||
|
...
|
||
|
};
|
||
|
...
|
||
|
\ce
|
||
|
����ͨ��TFFS�ļ�ϵͳ����SPIFLASH�����������ο�������"10. TFFS�������ü�ʹ�÷���"һ��
|
||
|
|
||
|
10. TFFS�������ü�ʹ�÷���
|
||
|
��Ҫ֧��TFFS�ļ�ϵͳ����Ҫ����TFFS��dosFs�ļ�ϵͳ������
|
||
|
dosFs�ļ�ϵͳ���������ο������ġ�4.���豸�ļ�ϵͳ��һ�ڣ�
|
||
|
TFFS�ļ�ϵͳ�����������£�
|
||
|
\cs
|
||
|
#define INCLUDE_TFFS
|
||
|
#define INCLUDE_TFFS_MOUNT
|
||
|
#define INCLUDE_TFFS_SHOW
|
||
|
#define INCLUDE_TFFS_STUB_VXBFLASH
|
||
|
\ce
|
||
|
��һ��ʹ��TFFS�ļ�ϵͳʱ����Ҫ��ʽ��FLASH�����Ҹ�ʽ��DOS������
|
||
|
��shell��ִ�У�
|
||
|
-> sysTffsFormat 0 ��FLASH��ʽ��
|
||
|
-> usrTffsConfig 0,0,"/tffs0" �����豸
|
||
|
-> devs ��ʾ�豸/tffs0
|
||
|
-> dosFsVolFormat("/tffs0",0,0) ������ʽ��ΪDOS
|
||
|
|
||
|
�ڶ����ϵ��Ժ���������ʽ����ֻ��Ҫ�����豸�Ϳ����ˣ���shell��ִ�д����豸�Ϳ������ˣ�
|
||
|
-> usrTffsConfig 0,0,"/tffs0"
|
||
|
|
||
|
ʹ�÷���������
|
||
|
-> cd "/tffs0"
|
||
|
-> fd=open("test.txt",0x202,0777)
|
||
|
-> write(fd, "hello world\r\n",13)
|
||
|
-> close (fd)
|
||
|
-> copy "test.txt"
|
||
|
|
||
|
11. PC CONSOLE��������
|
||
|
�����������ã�
|
||
|
\cs
|
||
|
#define INCLUDE_PC_CONSOLE
|
||
|
#define INCLUDE_USB_GEN2_KEYBOARD_INIT
|
||
|
#define INCLUDE_USB_GEN2_KEYBOARD_SHELL_ATTACH
|
||
|
\ce
|
||
|
PC CONSOLE������������ʾ����Ļ����ʾ����̨��Ϣ������ҪX100��ƬӲ����֧�֡�����̨��ҪUSB������Ϊ
|
||
|
�����豸�����ص�vxWorksϵͳ��shell�����ϡ�
|
||
|
|
||
|
12. GPIO�������ü�ʹ�÷���
|
||
|
�����������ã�
|
||
|
|
||
|
#define DRV_FTGPIO
|
||
|
|
||
|
��hwconf.c��GPIO�ܽŹ���ģʽ�б������ø����ܽŵ�Ĭ�Ϲ���ģʽ��
|
||
|
|
||
|
/@ hwconf.c @/
|
||
|
...
|
||
|
/*This table is used to set the default pin mode of portA*/
|
||
|
/* 0:GPIO_MODE_NOT_USED 1:GPIO_MODE_IN
|
||
|
2:GPIO_MODE_OUT 3:GPIO_MODE_INT*/
|
||
|
|
||
|
LOCAL UINT8 gpio0PortAModeTable[] = {
|
||
|
/*portA-pinX: 0 1 2 3 4 5 6 7 */
|
||
|
3, 2, 1, 0, 0, 0, 0, 0
|
||
|
};
|
||
|
...
|
||
|
|
||
|
\"--------------------------------------------------------------------------------
|
||
|
�ο���Դ
|
||
|
|
||
|
\tb ARM Architecture Reference Manual
|
||
|
|
||
|
\tb Wind River Workbench User's Guide
|
||
|
|
||
|
\tb VxWorks Kernel Programmer's Guide
|
||
|
|
||
|
\tb VxWorks Architecture Supplement
|
||
|
|
||
|
\tb FT-2000_4���������ֲ�.pdf
|
||
|
|
||
|
\"--------------------------------------------------------------------------------
|
||
|
��֪�����б�
|
||
|
1. CAN ID����֡����
|
||
|
����������ID���˼Ĵ���֮����һ���յ�ID��ƥ����֡�����ᵼ��������һ��IDƥ����֡
|
||
|
��Ӳ��FIFO�������ݴ����ģ���Ҫ������֡���ڶ���IDƥ��֡�Ժ������������ˡ�
|
||
|
���飺������Ӳ�����ˣ�����֡ȫ�գ���������ʵ��ID���˹��ܡ�
|
||
|
|
||
|
2. Workbench WDB��������SMP�ں�����
|
||
|
����������ʧ��
|
||
|
PC����workbench�����ڽ������ӹ����У�Ĭ�ϻ�����PC���ϳ���ӳ���ļ�����Ŀ�������������е�
|
||
|
�ļ��Ƿ�һ�¡���ͨ�������ļ�checksumʵ�֡�����SMP�汾ӳ���ļ��ϵ�����ʱ����̬���˴��������ݣ�
|
||
|
���ᵼ�¼���ʧ�ܣ�WDB�����˳�����UP�汾ӳ���ļ������⣩
|
||
|
|
||
|
���飺Ϊ��ʹ��WDB��������WDB����ѡ���н��ô�У�顣ֻҪ�û���֤PC����WDBʹ�õ�ӳ���ļ�����Ŀ�������������еij�������ͬһ���ļ�������Ӱ���������ԡ�
|
||
|
|
||
|
����ѡ��Ϊ�� Target Server Options >> Kernel image >> Bypass checksum comparison ���Ϲ�ѡ�С�
|
||
|
|
||
|
|
||
|
3. Workbench WDB����IP��ַ����
|
||
|
������ϵͳ����������ifconfig "���� IP��ַ" ��������IP��ַ����WDB����ʧ�ܡ�
|
||
|
���飺����WDB������ʼ��ʱ��Ҫ��ȡIP��ַ�����˲�Ҫ����������WDB�õ�IP��ַ��
|
||
|
���������ô������ DEFAULT_BOOT_LINE �ַ�������IP��ַ��Ȼ�����뾵����
|
||
|
|
||
|
4. SATAӲ������vxbAhciStorage.c �ļ��汾����
|
||
|
��vxWorks 6.9.4.x �IJ�ͬС�汾֮�䣬vxbAhciStorage.c�����ļ��Ĵ������컹�DZȽ϶��ġ��������ķ����ǴӶ�Ӧ
|
||
|
�汾��<WIND_HOME>\vxworks-6.9\target\src\hwif\storage\Ŀ¼��ȡvxbAhciStorage.c�����ļ��ŵ�BSPĿ¼�£�Ȼ��
|
||
|
��vxbAhciInstInit2()�������������������¼��д��룺
|
||
|
LOCAL void vxbAhciInstInit2
|
||
|
(
|
||
|
VXB_DEVICE_ID pDev
|
||
|
)
|
||
|
{
|
||
|
... ʡ�� ...
|
||
|
if (pDev->busID != VXB_BUSID_PCI)
|
||
|
pAhciDrvCtrl->regHandle = (void *)AHCI_REG_HANDLE_SWAP((ULONG)pAhciDrvCtrl->regHandle);
|
||
|
|
||
|
/*----------------------------- �¼����¼��� ----------------------------------------*/
|
||
|
/* reset AHCI controller. Here we must reset AHCI as soon as early when using PCI legacy interrupt!
|
||
|
* Because both Net Card and SATA Card use int-pin 1, with the same int line 83 for FT1500 board.
|
||
|
* When Net Card init, there are too many SATA interrupts to boot board if the AHCI not reset here.
|
||
|
*/
|
||
|
|
||
|
(void) CTRL_REG_READ(pAhciDrvCtrl, AHCI_GHC);
|
||
|
CTRL_REG_WRITE(pAhciDrvCtrl, AHCI_GHC, AHCI_GHC_HR);
|
||
|
/*------------------------------------------------------------------------------------*/
|
||
|
|
||
|
}
|
||
|
���ڱ�BSP��6.9.4.8֧�֣����ڴ˰汾��vxbAhciStorage.c �ļ���Ϊһ��ʾ���������û��汾���£���ȡ���µİ汾��Ϊ���ߡ�
|
||
|
�ɰ汾ʶ��SATA���ٶȱȽ���һЩ���°汾����ahciDrv()�������ӿ�ʶ���ٶȡ�
|
||
|
|