⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 syslynx.c

📁 cpc-1631的BSP包for VxWorks操作系统
💻 C
字号:
/* sysLynx.c - bsp initialization code for pcPentium and pcPentiumpro */

/*
modification history
--------------------
01a,29jun01,dmh first draft released to the wild
*/

#include <vxWorks.h>
#include <intLib.h>
#define SILICONMOTION_VENDOR_ID 0x126f
#define LYNX_DEVICE_ID          0x0712

extern STATUS  sysMmuMapAdd (void * address, UINT len,
                             UINT initialStateMask,
                             UINT initialState);

extern int * smiBaseAddress;

/* must be called after pciConfigLibInit and before sysSerialHwInit
   (well before mmuLibInit but that's getting picky) */

void sysLynxInit() 
{
    int bus, device, function;
    int bar0;

	/*I/O command*/
	vt82c686PciConfigWrite( 0,18,0,0x4,1,0x1f);
	/*FrameBuffer base address*/
	vt82c686PciConfigWrite( 0,18,0,0x10,4,PCI_SM712_MEMADDR);

	
    if(pciFindDevice (SILICONMOTION_VENDOR_ID, LYNX_DEVICE_ID, 0,
		      &bus, &device, &function) != ERROR)
	{
	    pciConfigInLong(bus, device, function,
			    PCI_CFG_BASE_ADDRESS_0, &bar0);

	    sysMmuMapAdd((int*)bar0, 0x1000000,
			 VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE 
			 | VM_STATE_MASK_CACHEABLE,
			 VM_STATE_VALID | VM_STATE_WRITABLE 
			 | VM_STATE_CACHEABLE_NOT);
            smiBaseAddress = (int*)bar0;

	}
	
	/*smiBaseAddress = (int*)PCI_SM712_MEMADDR;*/

}

⌨️ 快捷键说明

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