亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? pci.c

?? 嵌入式試驗箱S3C2410的bootloader源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * IXP PCI Init * (C) Copyright 2004 eslab.whut.edu.cn * Yue Hu(huyue_whut@yahoo.com.cn), Ligong Xue(lgxue@hotmail.com) * * See file CREDITS for list of people who contributed to this * project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */#include <common.h>#ifdef CONFIG_PCI#include <asm/processor.h>#include <asm/io.h>#include <pci.h>#include <asm/arch/ixp425.h>#include <asm/arch/ixp425pci.h>static void non_prefetch_read (unsigned int addr, unsigned int cmd,			       unsigned int *data);static void non_prefetch_write (unsigned int addr, unsigned int cmd,				unsigned int data);static void configure_pins (void);static void sys_pci_gpio_clock_config (void);static void pci_bus_scan (void);static int pci_device_exists (unsigned int deviceNo);static void sys_pci_bar_info_get (unsigned int devnum, unsigned int bus,				  unsigned int dev, unsigned int func);static void sys_pci_device_bars_write (void);static void calc_bars (PciBar * Bars[], unsigned int nBars,		       unsigned int startAddr);#define PCI_MEMORY_BUS		0x00000000#define PCI_MEMORY_PHY		0x48000000#define PCI_MEMORY_SIZE		0x04000000#define PCI_MEM_BUS		0x40000000#define PCI_MEM_PHY		0x00000000#define PCI_MEM_SIZE		0x04000000#define	PCI_IO_BUS		0x40000000#define PCI_IO_PHY		0x50000000#define PCI_IO_SIZE		0x10000000struct pci_controller hose;unsigned int nDevices;unsigned int nMBars;unsigned int nIOBars;PciBar *memBars[IXP425_PCI_MAX_BAR];PciBar *ioBars[IXP425_PCI_MAX_BAR];PciDevice devices[IXP425_PCI_MAX_FUNC_ON_BUS];int pci_read_config_dword (pci_dev_t dev, int where, unsigned int *val){	unsigned int retval;	unsigned int addr;	/*address bits 31:28 specify the device 10:8 specify the function */	/*Set the address to be read */	addr = BIT ((31 - dev)) | (where & ~3);	non_prefetch_read (addr, NP_CMD_CONFIGREAD, &retval);	*val = retval;	return (OK);}int pci_read_config_word (pci_dev_t dev, int where, unsigned short *val){	unsigned int n;	unsigned int retval;	unsigned int addr;	unsigned int byteEnables;	n = where % 4;	/*byte enables are 4 bits active low, the position of each	   bit maps to the byte that it enables */	byteEnables =		(~(BIT (n) | BIT ((n + 1)))) &		IXP425_PCI_BOTTOM_NIBBLE_OF_LONG_MASK;	byteEnables = byteEnables << PCI_NP_CBE_BESL;	/*address bits 31:28 specify the device 10:8 specify the function */	/*Set the address to be read */	addr = BIT ((31 - dev)) | (where & ~3);	non_prefetch_read (addr, byteEnables | NP_CMD_CONFIGREAD, &retval);	/*Pick out the word we are interested in */	*val = (retval >> (8 * n));	return (OK);}int pci_read_config_byte (pci_dev_t dev, int where, unsigned char *val){	unsigned int retval;	unsigned int n;	unsigned int byteEnables;	unsigned int addr;	n = where % 4;	/*byte enables are 4 bits, active low, the position of each	   bit maps to the byte that it enables */	byteEnables = (~BIT (n)) & IXP425_PCI_BOTTOM_NIBBLE_OF_LONG_MASK;	byteEnables = byteEnables << PCI_NP_CBE_BESL;	/*address bits 31:28 specify the device, 10:8 specify the function */	/*Set the address to be read */	addr = BIT ((31 - dev)) | (where & ~3);	non_prefetch_read (addr, byteEnables | NP_CMD_CONFIGREAD, &retval);	/*Pick out the byte we are interested in */	*val = (retval >> (8 * n));	return (OK);}int pci_write_config_byte (pci_dev_t dev, int where, unsigned char val){	unsigned int addr;	unsigned int byteEnables;	unsigned int n;	unsigned int ldata;	n = where % 4;	/*byte enables are 4 bits active low, the position of each	   bit maps to the byte that it enables */	byteEnables = (~BIT (n)) & IXP425_PCI_BOTTOM_NIBBLE_OF_LONG_MASK;	byteEnables = byteEnables << PCI_NP_CBE_BESL;	ldata = val << (8 * n);	/*address bits 31:28 specify the device 10:8 specify the function */	/*Set the address to be written */	addr = BIT ((31 - dev)) | (where & ~3);	non_prefetch_write (addr, byteEnables | NP_CMD_CONFIGWRITE, ldata);	return (OK);}int pci_write_config_word (pci_dev_t dev, int where, unsigned short val){	unsigned int addr;	unsigned int byteEnables;	unsigned int n;	unsigned int ldata;	n = where % 4;	/*byte enables are 4 bits active low, the position of each	   bit maps to the byte that it enables */	byteEnables =		(~(BIT (n) | BIT ((n + 1)))) &		IXP425_PCI_BOTTOM_NIBBLE_OF_LONG_MASK;	byteEnables = byteEnables << PCI_NP_CBE_BESL;	ldata = val << (8 * n);	/*address bits 31:28 specify the device 10:8 specify the function */	/*Set the address to be written */	addr = BIT (31 - dev) | (where & ~3);	non_prefetch_write (addr, byteEnables | NP_CMD_CONFIGWRITE, ldata);	return (OK);}int pci_write_config_dword (pci_dev_t dev, int where, unsigned int val){	unsigned int addr;	/*address bits 31:28 specify the device 10:8 specify the function */	/*Set the address to be written */	addr = BIT (31 - dev) | (where & ~3);	non_prefetch_write (addr, NP_CMD_CONFIGWRITE, val);	return (OK);}void non_prefetch_read (unsigned int addr,			unsigned int cmd, unsigned int *data){	REG_WRITE (PCI_CSR_BASE, PCI_NP_AD_OFFSET, addr);	/*set up and execute the read */	REG_WRITE (PCI_CSR_BASE, PCI_NP_CBE_OFFSET, cmd);	/*The result of the read is now in np_rdata */	REG_READ (PCI_CSR_BASE, PCI_NP_RDATA_OFFSET, *data);	return;}void non_prefetch_write (unsigned int addr,			 unsigned int cmd, unsigned int data){	REG_WRITE (PCI_CSR_BASE, PCI_NP_AD_OFFSET, addr);	/*set up the write */	REG_WRITE (PCI_CSR_BASE, PCI_NP_CBE_OFFSET, cmd);	/*Execute the write by writing to NP_WDATA */	REG_WRITE (PCI_CSR_BASE, PCI_NP_WDATA_OFFSET, data);	return;}/* * PCI controller config registers are accessed through these functions * i.e. these allow us to set up our own BARs etc. */void crp_read (unsigned int offset, unsigned int *data){	REG_WRITE (PCI_CSR_BASE, PCI_CRP_AD_CBE_OFFSET, offset);	REG_READ (PCI_CSR_BASE, PCI_CRP_RDATA_OFFSET, *data);}void crp_write (unsigned int offset, unsigned int data){	/*The CRP address register bit 16 indicates that we want to do a write */	REG_WRITE (PCI_CSR_BASE, PCI_CRP_AD_CBE_OFFSET,		   PCI_CRP_WRITE | offset);	REG_WRITE (PCI_CSR_BASE, PCI_CRP_WDATA_OFFSET, data);}/*struct pci_controller *hose*/void pci_ixp_init (struct pci_controller *hose){	unsigned int regval;	hose->first_busno = 0;	hose->last_busno = 0x00;	/* System memory space */	pci_set_region (hose->regions + 0,			PCI_MEMORY_BUS,			PCI_MEMORY_PHY, PCI_MEMORY_SIZE, PCI_REGION_MEMORY);	/* PCI memory space */	pci_set_region (hose->regions + 1,			PCI_MEM_BUS,			PCI_MEM_PHY, PCI_MEM_SIZE, PCI_REGION_MEM);	/* PCI I/O space */	pci_set_region (hose->regions + 2,			PCI_IO_BUS, PCI_IO_PHY, PCI_IO_SIZE, PCI_REGION_IO);	hose->region_count = 3;	pci_register_hose (hose);/* ========================================================== 		Init IXP PCI ==========================================================*/	REG_READ (PCI_CSR_BASE, PCI_CSR_OFFSET, regval);	regval |= 1 << 2;	REG_WRITE (PCI_CSR_BASE, PCI_CSR_OFFSET, regval);	configure_pins ();	READ_GPIO_REG (IXP425_GPIO_GPOUTR, regval);	WRITE_GPIO_REG (IXP425_GPIO_GPOUTR, regval & (~(1 << 13)));	udelay (533);	sys_pci_gpio_clock_config ();	REG_WRITE (PCI_CSR_BASE, PCI_INTEN_OFFSET, 0);	udelay (100);	READ_GPIO_REG (IXP425_GPIO_GPOUTR, regval);	WRITE_GPIO_REG (IXP425_GPIO_GPOUTR, regval | (1 << 13));	udelay (533);	crp_write (PCI_CFG_BASE_ADDRESS_0, IXP425_PCI_BAR_0_DEFAULT);	crp_write (PCI_CFG_BASE_ADDRESS_1, IXP425_PCI_BAR_1_DEFAULT);	crp_write (PCI_CFG_BASE_ADDRESS_2, IXP425_PCI_BAR_2_DEFAULT);	crp_write (PCI_CFG_BASE_ADDRESS_3, IXP425_PCI_BAR_3_DEFAULT);	crp_write (PCI_CFG_BASE_ADDRESS_4, IXP425_PCI_BAR_4_DEFAULT);	crp_write (PCI_CFG_BASE_ADDRESS_5, IXP425_PCI_BAR_5_DEFAULT);	/*Setup PCI-AHB and AHB-PCI address mappings */	REG_WRITE (PCI_CSR_BASE, PCI_AHBMEMBASE_OFFSET,		   IXP425_PCI_AHBMEMBASE_DEFAULT);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美中文字幕一区| 日本一区二区三区在线不卡| 91精品国产高清一区二区三区 | 国产精品综合一区二区三区| 岛国一区二区三区| 99久久国产综合精品色伊| 色综合天天综合在线视频| 欧美午夜影院一区| 欧美电影免费观看高清完整版在线 | 91久久精品午夜一区二区| 正在播放亚洲一区| 欧美国产日韩亚洲一区| 一区二区视频在线| 六月丁香婷婷久久| 色婷婷久久99综合精品jk白丝| 欧美日韩一级黄| 国产精品毛片a∨一区二区三区| 午夜日韩在线电影| 9i在线看片成人免费| 欧美一卡在线观看| 亚洲欧洲色图综合| 国产精品资源网| 欧美videos大乳护士334| 亚洲国产cao| 在线一区二区三区做爰视频网站| 久久午夜国产精品| 亚洲一区二区三区激情| 91丨国产丨九色丨pron| 久久久www免费人成精品| 亚洲bt欧美bt精品| 在线观看成人免费视频| 国产精品国产三级国产三级人妇 | 亚洲激情图片qvod| 久久99精品一区二区三区| 欧美日本国产一区| 香蕉久久一区二区不卡无毒影院| 成人精品国产免费网站| 国产精品热久久久久夜色精品三区| 粉嫩久久99精品久久久久久夜| 中文成人综合网| 欧美午夜理伦三级在线观看| 亚洲综合一区二区三区| 欧美午夜寂寞影院| 性欧美疯狂xxxxbbbb| 欧美日韩成人一区| 粉嫩高潮美女一区二区三区 | 99re视频这里只有精品| 亚洲综合激情另类小说区| 91理论电影在线观看| 亚洲三级电影全部在线观看高清| 国产精品中文有码| 国产精品卡一卡二卡三| 国产精品乡下勾搭老头1| 久久久久久久综合色一本| 国产精品一区二区在线观看不卡| 久久久精品影视| 色狠狠综合天天综合综合| 午夜视频在线观看一区二区三区| 3d动漫精品啪啪一区二区竹菊| 无码av免费一区二区三区试看| 欧美日韩国产综合久久| 蓝色福利精品导航| 亚洲女子a中天字幕| 欧美精品乱码久久久久久| 美日韩一区二区| 久久久国产精华| 色婷婷亚洲精品| 国内一区二区视频| 一区二区三区在线观看网站| 日韩欧美在线综合网| 一本到不卡精品视频在线观看 | 精品一区二区三区免费视频| 国产女同互慰高潮91漫画| 这里只有精品免费| 色一情一乱一乱一91av| 精品亚洲免费视频| 亚洲国产中文字幕| 一色屋精品亚洲香蕉网站| 欧美电影一区二区三区| 在线观看www91| 91免费版在线| www.66久久| 精品视频在线视频| 欧美三级蜜桃2在线观看| 91丨porny丨最新| 精品制服美女丁香| 久久疯狂做爰流白浆xx| 亚洲永久免费视频| 亚洲国产视频在线| 亚洲国产另类av| 樱桃视频在线观看一区| 国产精品国产三级国产aⅴ原创| 国产精品你懂的在线| 国产精品免费久久久久| 国产亚洲短视频| 国产欧美日韩另类一区| 中文字幕第一区二区| 国产日韩欧美电影| 亚洲丝袜制服诱惑| 亚洲高清三级视频| 国产在线一区二区| 成人av资源在线| 色噜噜夜夜夜综合网| 538prom精品视频线放| 精品sm在线观看| 《视频一区视频二区| 国产亚洲欧美一级| 亚洲精品写真福利| 国产精品白丝jk黑袜喷水| 欧美午夜精品久久久| 日韩欧美的一区二区| 亚洲人精品午夜| 日本美女一区二区| 欧美午夜一区二区| 国产精品色哟哟| 久久国产剧场电影| 91啪九色porn原创视频在线观看| 欧美视频日韩视频在线观看| 国产亚洲精品福利| 日本vs亚洲vs韩国一区三区二区| 国产91精品久久久久久久网曝门| 欧美日韩国产欧美日美国产精品| 国产精品久久久久久妇女6080| 秋霞午夜鲁丝一区二区老狼| 色94色欧美sute亚洲线路二 | 久久久99免费| 美女一区二区久久| 欧美日韩极品在线观看一区| 国产欧美日本一区视频| 卡一卡二国产精品| 欧美一级夜夜爽| 国产成人综合在线观看| 欧美猛男gaygay网站| 国产精品国产a| 国产精品影视天天线| 国产欧美一区二区精品性色超碰| 国产一区二三区| 久久综合色婷婷| 日韩成人午夜电影| 久久精品视频一区| 不卡的av中国片| 亚洲色图.com| 欧美日韩免费观看一区三区| 五月激情综合婷婷| 精品国产乱码久久久久久影片| 国产精品一区二区视频| 欧美aaa在线| 国产精品美女www爽爽爽| 一本大道久久a久久精品综合| 一区二区在线电影| 欧美va亚洲va| 色综合亚洲欧洲| 看国产成人h片视频| 中文欧美字幕免费| 欧美一区二区精美| 成人午夜视频网站| 亚洲va国产va欧美va观看| 久久日韩粉嫩一区二区三区| 色综合婷婷久久| 国产成人精品免费网站| 久久99久久99精品免视看婷婷| 国产亚洲综合性久久久影院| 欧美视频在线一区| 成人午夜电影久久影院| 一区二区三区高清不卡| 欧美va日韩va| 色婷婷亚洲婷婷| 99这里只有精品| 激情伊人五月天久久综合| 亚洲乱码中文字幕综合| 欧美激情一区不卡| 26uuu色噜噜精品一区| 3751色影院一区二区三区| 色乱码一区二区三区88| 成年人午夜久久久| 高清免费成人av| 国产福利91精品| 国产河南妇女毛片精品久久久| 美女在线视频一区| 日韩精品电影一区亚洲| 婷婷久久综合九色国产成人| 亚洲综合在线五月| 午夜精品在线看| 麻豆国产精品777777在线| 美女在线视频一区| 久久精品国产99久久6| 亚洲一区二区三区不卡国产欧美| 亚洲欧美色图小说| 成人sese在线| 色综合久久中文综合久久97| 91美女片黄在线观看91美女| 在线一区二区三区四区| 3d动漫精品啪啪一区二区竹菊| 日韩欧美国产三级| 久久久欧美精品sm网站| 欧美国产精品一区二区| 亚洲一区在线播放| 成人性生交大片免费看中文网站| 欧美日韩精品一区二区| 国产精品无码永久免费888|