vxWorks的config.h注释

本文档详细介绍了PPC405GP评估板的配置参数,包括BSP版本标识、内存分配、缓存选项、定时器设置、实时时钟、网络驱动等内容,为读者提供了全面深入的理解。

/*
This file contains the configuration parameters for the CPU evaluation board.
*/

#ifndef INCconfigh
#define INCconfigh

/* BSP version/revision identification, before configAll.h */
#define BSP_VER_1_2 1
#define BSP_VER_1_1 1
#define BSP_VERSION "1.2" /* A Tornado 2.0 BSP */
#define BSP_REV "/3" /* 0 for first revision */

#include "configAll.h"        /* 这个文件定义了VxWorks所有的缺省设置 */

/*
* Define ONE of the following to specify the revision of the PPC405GP chip
* you are using. Undefine all others. sysModel() will return
* "Unknown processor" if the correct selection is not made.
*/

/*
* Default boot line
*/

/*

解释: 这一行对配置网络,连通Target Server及下载调试程序非常重要

DEFAULT_BOOT_LINE 的原意是为没有NVRAM的target设计的,这样用户就不需要在每次系统启动是手工输入这些参数了.

系统启动网络时xxxEndLoad()会解释这一行并按这一行的定义进行加载.

Emac(0,0) : 启动设备,可是是软盘,硬盘,PCMCIA卡等 其他的设备名称如:

fd为软盘,(0,0)表示第一个软驱,3.5寸盘.
dc则表示从DEC 21x4x 芯片启动,即系统有NVRAM存在,这种方式现在已不采用.
elpci表示启动设备为3COM EtherLink XL PCI网卡.
fei:Intel 82559 EtherExpress网卡.
ene: NE2000网卡
ELT: 3COM以太网卡
EEX: Intel网卡
ata: ATA/IDE 硬盘 ............

405GP: 主机名
vXworks 从主机加载的VxWorks文件
h=172.16.1.159   主机的IP地址    

e=172.16.254.52 目标机的IP地址,若网络启动Target Server时,这个IP必须和主机上Target Server配置的Target IP地址一致,且设置Back End选项为wdbrpc
u=xxx 用户名,pw=xxx 密码: 若通过网络加载调试时,主机的Ftp服务器和目标机的用户名和密码必须相同
tn=vxTarget 目标机名称

*/

#define DEFAULT_BOOT_LINE /
        "Emac(0,0)405GP:vxWorks h="172".16.1.159 e="172".16.254.52 /
                u="xxx" pw="xxx" tn="vxTarget""

/*
* 内存设置.
* 如果定义了LOCAL_MEM_AUTOSIZE则SDRAM的大小会在Boot时指定
*/

#undef LOCAL_MEM_AUTOSIZE                    /* 运行时内存大小 */
#define LOCAL_MEM_SIZE 0x02000000            /* 32MB 内存缺省 */
#define LOCAL_MEM_LOCAL_ADRS 0x00000000     /* 内存基地址为 0 */
#define USER_RESERVED_MEM 0                  /* see sysMemTop() */

/*
* Define SDRAM_ECC_ENABLE to enable ECC if an ECC SDRAM DIMM is detected
* during SDRAM auto-configuration. If not defined, ECC will not be enabled
* if an ECC SDRAM DIMM is detected, and the DIMM will be used as a normal DIMM.
*/

#undef SDRAM_ECC_ENABLE
/* 解释: 这里主要设置系统的内存分配定义,若分配不当,则系统不能正常加载和运行.

ROM_TEXT_ADRS, ROM_SIZE, RAM_HIGH_ADRS, 和RAM_LOW_ADRS 在config.h和Makefile文件中都要定义,且必须要保持一致,这些地址的定义一定要参照VxWorks 加载执行过程,硬件手册,MMU和VxWorks的大小进行.主要原则是保证VxWorks image 在ROM和RAM中都要有一定的运行空间且高效运行

*/
#define ROM_BASE_ADRS 0xfff80000                  /* ROM的基地址 */
#define ROM_TEXT_ADRS (ROM_BASE_ADRS + 0x100)    /* 程序指针和堆栈指针 */
#define ROM_WARM_ADRS (ROM_TEXT_ADRS+0x0004)     /* 热启动入口地址 */
#define ROM_SIZE 0x0007f000                       /* ROM大小 512KB */
#define RAM_LOW_ADRS 0x00010000                   /* RAM 低地址运行 vxWorks */
#define RAM_HIGH_ADRS 0x00C00000                  /* RAM 高地址存储 bootrom */
#define USER_RESERVED_MEM 0                       /* 用户保留地址 */


/*
* Cache options    定义缓存
*/

#define INCLUDE_CACHE_SUPPORT

#define USER_D_CACHE_ENABLE
#define USER_I_CACHE_ENABLE
#undef USER_D_CACHE_MODE
#define USER_D_CACHE_MODE (CACHE_COPYBACK)

/*
* 405 timers (PIT, FIT, WDT) 可由外部时钟驱动或者CPU驱动
*/

#define TIMER_CLOCK_EXTERNAL

/*
* Optional timestamp support
*/

#undef INCLUDE_TIMESTAMP

/*
* Auxilliary Timer rates    定义辅助计时器频率
*/

#ifdef TIMER_CLOCK_EXTERNAL
#define AUX_CLK_RATE_MIN (EXT_TIMER_CLK_FREQ / (1 << 21) )
#define AUX_CLK_RATE_MAX (EXT_TIMER_CLK_FREQ / (1 << 9) )
#define AUX_CLK_RATE_DEFAULT (EXT_TIMER_CLK_FREQ / (1 << 17) )
#else

/* ZZZZZZZZZZZ todo put rates in for system clock derived timer clock */

#endif

/*
* Watchdog Timer rates   
*/

#define WDT_RATE_MIN 1 /* minimum watchdog timer rate */
#define WDT_RATE_MAX 5000 /* maximum watchdog timer rate */

/* 实时时钟设置 */

#define INCLUDE_RTC

/* 去除不需要的网络驱动 */

#undef INCLUDE_EI
#undef INCLUDE_EX
#undef INCLUDE_ENP
#undef INCLUDE_LN
#undef INCLUDE_SM_NET
#undef INCLUDE_SM_SEQ_ADDR

/* #define for software floating point support */

#undef INCLUDE_SW_FP

/* 定义串口 Serial port configuration */

#define INCLUDE_SERIAL

/* PCI 设置,PCI configuration */

#define INCLUDE_PCI

#ifdef INCLUDE_PCI
/*
* Three programmable processor local memory address to PCI memory address
* mappings. If a region is enabled, PMMx_LOCAL_ADRS must be between
* PCI_MEMORY_START and PCI_MEMORY_END. If PMMx_PCI_HIGH_ADRS is non-zero in
* an enabled region, 64 bit dual cycle addresses will be generated on the
* PCI bus for this region.
*/

//定义PCI设备的初始化地址


# define PMM0_LOCAL_ADRS PCI_MEMORY_START      // 定义PCI空间起始地址
# define PMM0_PCI_LOW_ADRS 0x80000000           // 定义PCI空间低位地址
# define PMM0_PCI_HIGH_ADRS 0x00000000         // 定义PCI空间高位地址
# define PMM0_PCI_MASK_ATTRIB (PMM_MASK_512MB | PMM_ENABLE)

# define PMM1_LOCAL_ADRS PMM_UNUSED
# define PMM1_PCI_LOW_ADRS PMM_UNUSED
# define PMM1_PCI_HIGH_ADRS PMM_UNUSED
# define PMM1_PCI_MASK_ATTRIB PMM_UNUSED

# define PMM2_LOCAL_ADRS PMM_UNUSED
# define PMM2_PCI_LOW_ADRS PMM_UNUSED
# define PMM2_PCI_HIGH_ADRS PMM_UNUSED
# define PMM2_PCI_MASK_ATTRIB PMM_UNUSED

/*
* PCI memory address to processor local memory address mapping. If a region
* is enabled, PTMx_LOCAL_ADRS must be within the two Local memory / peripheral
* regions (0x00000000-0x7FFFFFFF, or 0F0000000-0xFFFFFFFF)
*/
# define PTM1_LOCAL_ADRS LOCAL_MEM_LOCAL_ADRS
# define PTM1_SIZE_ATTRIB PTM_SIZE_2GB | PTM_ENABLE

# define PTM2_LOCAL_ADRS PTM_UNUSED
# define PTM2_SIZE_ATTRIB PTM_UNUSED

#endif /* INCLUDE_PCI */

/*
* 如果支持网络,本地EMAC和PCI网卡,必须有一个被选取,两者都是END形式驱动
*/
#define INCLUDE_NETWORK             /* 支持网络 */
#define INCLUDE_EMAC_NETWORK       /* 405GP 本地 EMAC 网络 */
#undef INCLUDE_PCI_NETWORK         /* PCI 网络 */

/*
* The board does not have the Ethernet MAC address of the EMAC stored
* in any sort of NVRAM. Modify the 12 digit string below to match the decal
* that is on your board.
*/

#ifdef INCLUDE_EMAC_NETWORK
    #define DEFAULT_EMAC_HW_ADDR "xxxxxxxxxxxx"         /* 网络硬件地址,即MAC地址 */
#endif

/*
* WDB 通过网络Enhanced Network Driver加载调试程序,若网络加载调试,必须定义此项
*/


#define WDB_COMM_TYPE WDB_COMM_SERIAL /*首先默认使用串口通信*/
#define WDB_TTY_CHANNEL 0 /*使用第一个串口


#ifdef INCLUDE_NETWORK
    #define INCLUDE_END
    #undef WDB_COMM_TYPE
    #define WDB_COMM_TYPE WDB_COMM_END      /* 定义网络通信, END 驱动 */
#else
    #undef WDB_COMM_TYPE
    #define WDB_COMM_TYPE     WDB_COMM_SERIAL /* 定义串口通信,和PC机串口连接 */
    #undef WDB_TTY_CHANNEL
    #define WDB_TTY_CHANNEL 0                        /* 串口1 */
#endif /* INCLUDE_NETWORK */

/*************** 此处定义一些杂项 */
#ifdef NUM_TTY
#undef NUM_TTY
#endif
#define NUM_TTY 2             /* 定义了两个串口终端,*/

#ifdef WDB_TTY_BAUD
#undef WDB_TTY_BAUD
#endif
#define WDB_TTY_BAUD 57600 /* 波特率设置 9600, 19200, 38400, 57600, 115200 */

#ifdef CONSOLE_BAUD_RATE
#undef CONSOLE_BAUD_RATE
#endif
#define CONSOLE_BAUD_RATE 57600

#undef INCLUDE_ENV_VARS /* unix compatable environment variables */
#undef INCLUDE_TIMEX /* timexLib for exec timing */
#undef INCLUDE_HW_FP
#undef INCLUDE_TFTP_CLIENT /* used by autoboot from ftp server*/

#define INCLUDE_SW_FP
#define INCLUDE_ELF
#define INCLUDE_NET_SHOW
#define INCLUDE_PING
#undef INCLUDE_DEMO /* only for vxWorks bsp test */
#define ETHERNET_ADR_SET /* only for bootrom used */
#define INCLUDE_USER_APPL /* Startup the user's application in dos makefile project */
#undef PCIDEBUG

#ifdef INCLUDE_USER_APPL
#define USER_APPL_INIT _appEntry()
#endif

#endif /* INCconfigh */
#if defined(PRJ_BUILD)
#include "prjParams.h"
#endif

个人前几年学习Vxworks时,整理的笔记,总给大家了。 1 基于硬盘启动的Vxworks环境搭建 3 2 Vxworks引导盘制作 6 2.1 通过DOS加载VxWorks方法 6 2.2 Bootrom三种类型 7 2.3 VxWorks映象 7 2.4 Bootrom.sys最快制作方法 8 2.5 从网络引导 8 2.6 从本地硬盘引导 9 2.7 制作bootrom文件 9 2.8 Bootrom编译步骤 11 2.9 用BSP生成Bootable工程(即我们的程序文件) 12 2.10 FTP Server下载VxWorks 14 3 Tornado调试环境的建立 17 3.1.1 配置文件config.h 17 3.1.2 网络连接 18 6 从主机搭接(attach)到目标机 21 7.1.3 串口连接 21 4 4.Config.h文件注释说明 22 4.1 启动行说明 #define DEFAULT_BOOT_LINE \: 22 4.2 Config.h 文件说明 23 4.3 启动参数结构体 BOOT_PARAMS 35 4.4 booting过程介绍,比较详细 38 5 sysClkRateGet();返回系统时钟每秒的tick数量, tick详解 43 6 中断应用设计要点 44 7 驱动程序设计 49 8 缩短vxworks的启动时间 51 9 调试篇 54 10 驱动编程步骤 54 10.1 将驱动程序增加到“系统驱动程序列表”中 54 10.2 将设备增加到“系统设备列表”中 55 10.3 打开设备,得到文件描述符 55 10.4 SELECT机制的使用 55 10.4.1 select( )函数翻译 57 11 VxWorks系统的网络驱动(END) 60 12 VXworks操作系统中信号量用于多任务同步与互斥的讨论 62 12.1 二进制信号量实现互斥和同步 64 12.1.1 互斥的实现: 64 12.1.2 同步的实现: 65 12.2 互斥信号量 67 13 Tornado的文件目说明录 68 14 Shell 内置命令说明 72 14.1 任务管理 72 14.2 任务状态信息 72 14.3 系统修改和调试 73 14.4 对象命令( WindSh Commands for Object Display ) 73 14.5 WindShell and Browser, Shell 命令 74 15 驱动篇 81 16 中断篇 83 16.1 中断服务程序ISR编写注意事项 83 16.2 中断号与中断向量的转换 83 16.3 安装中断服务程序 intConnect() 83 16.4 调试中断服务程序方法 84 17 mkboot批处理命令详细解释 84 18 MakeFile 说明 85 19 VxWorks5.4中的输入输出重定向 89 19.1 vxworks屏幕输出, 一般来说用printf都是串口/shell输出,串口输出就可以到屏幕上了? 89 19.2 20.2 VxWorks中针对X86开发时标准输入输出的重定向? 90 20 怎样加入外部.o文件? 92 21 如何在Vxworks中使用 cd ,pwd , ls 命令:启用File System and Disk Utilities组件(INCLUDE_DISK_UTIL),可在shell下用pwd/cd/ls等命令 93 22 Error: image is larger than 524288 bytes 94 23 proxyArpDefaultOn()未定义解决方法? 94 24 如何将VxWorks的系统定时间隔或系统Ticks设置为1ms????? 95 25 read/write、fread/fwrite、fopen/open有什么区别 96 26 快速启动??????????????? 100 27 启动时报ATA0a和硬盘启动相关问题 100 28 如何安装USB2.2新版本及编译USB驱动? 101 29 WindML、图形界面相关问题 102 29.1 WindML,ugldemo出错? 102 29.2 5101 VxWorks黑屏问题? 102 29.3 添加ugldemo.c后,编译报undefined reference to “ugltextdraw” 错误一大堆? 102 29.4 WindML 中文字库显示? 103 30 VxWork6.8相关问题 105 30.1 ELF和bin文件的区别? 105 30.2 diab和GNU的区别? 106 31 No such file or directory错误? 107
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值