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

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

?? pci.c

?? 嵌入式試驗(yàn)箱S3C2410的bootloader源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
/* * 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
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区视频在线| 国产毛片精品国产一区二区三区| 日韩一级免费一区| 丁香另类激情小说| 蜜臀av性久久久久蜜臀aⅴ四虎| 亚洲视频免费看| 久久精品视频在线看| 欧美男同性恋视频网站| 成人午夜在线视频| 国产一二精品视频| 裸体一区二区三区| 亚洲黄色小说网站| 国产精品理伦片| 国产视频在线观看一区二区三区 | 色婷婷综合激情| 韩国一区二区三区| 免费观看日韩av| 亚洲成av人片在线观看无码| 国产精品久久久久久久裸模| 久久久久亚洲蜜桃| 精品成人私密视频| 91精品国产色综合久久久蜜香臀| 91啦中文在线观看| 成人黄色一级视频| 国产91高潮流白浆在线麻豆| 久久精品久久精品| 日本不卡1234视频| 日韩成人一区二区| 日韩精品国产精品| 日韩精品亚洲一区| 青椒成人免费视频| 日韩成人午夜电影| 青青草成人在线观看| 视频一区二区不卡| 免费成人性网站| 蜜臀av性久久久久蜜臀aⅴ| 日韩一区精品视频| 日本怡春院一区二区| 日本不卡在线视频| 久久福利资源站| 国产老妇另类xxxxx| 国产老肥熟一区二区三区| 国产精品1024久久| 成人av在线看| 91性感美女视频| 在线看日本不卡| 精品视频一区三区九区| 欧美精品777| 精品伦理精品一区| 国产精品色哟哟| 综合色中文字幕| 一区二区三区中文在线| 亚洲h精品动漫在线观看| 日本欧美一区二区在线观看| 蜜臀91精品一区二区三区| 国产最新精品精品你懂的| 国产成人av电影在线播放| 91在线无精精品入口| 91丨九色丨尤物| 欧美日精品一区视频| 91精品国产综合久久久久久久久久| 日韩精品一区二区三区在线 | 亚洲国产aⅴ天堂久久| 日韩国产精品久久| 国产精品白丝jk黑袜喷水| 99久久99精品久久久久久 | 欧美妇女性影城| 欧美一级高清片| 久久久久久久久免费| 综合久久久久久久| 亚欧色一区w666天堂| 久久狠狠亚洲综合| 91亚洲精品久久久蜜桃网站| 欧美高清精品3d| 国产蜜臀97一区二区三区| 亚洲一卡二卡三卡四卡| 精品一区二区精品| 91麻豆国产精品久久| 日韩一级免费一区| 亚洲男同1069视频| 麻豆一区二区三| 91免费国产在线| 日韩欧美成人一区| 一区二区在线观看视频| 韩国av一区二区三区| 97超碰欧美中文字幕| 日韩精品一区二区三区视频在线观看| 国产精品伦一区| 美女精品一区二区| 99re亚洲国产精品| 欧美xxxx老人做受| 香蕉影视欧美成人| 成人动漫一区二区在线| 在线电影院国产精品| 国产精品天美传媒沈樵| 天天影视色香欲综合网老头| 成人激情免费网站| 精品免费一区二区三区| 亚洲成人激情av| 成人av动漫网站| 久久久一区二区| 免费视频一区二区| 欧美日韩一区二区三区免费看| 久久午夜老司机| 琪琪一区二区三区| 欧美午夜精品理论片a级按摩| 国产日韩亚洲欧美综合| 免费在线欧美视频| 欧美日韩高清一区二区| 亚洲视频一二区| 岛国精品在线播放| 久久精品一区四区| 精品亚洲成a人| 91精品蜜臀在线一区尤物| 樱花草国产18久久久久| 成人动漫视频在线| 中文字幕成人在线观看| 国产精品综合视频| 久久只精品国产| 激情国产一区二区| 日韩一区和二区| 日韩精品欧美成人高清一区二区| 欧美在线一二三四区| 亚洲视频一区在线观看| 91在线观看污| 亚洲欧洲一区二区三区| 成人黄色小视频| 中文字幕的久久| hitomi一区二区三区精品| 国产色91在线| 国产宾馆实践打屁股91| 久久久www免费人成精品| 国产在线视频一区二区| 精品国产伦一区二区三区免费 | 色网站国产精品| 亚洲图片激情小说| 91在线看国产| 亚洲毛片av在线| 欧美唯美清纯偷拍| 亚洲成av人**亚洲成av**| 欧美视频一区二区三区四区| 夜色激情一区二区| 欧美老女人在线| 蜜臀av在线播放一区二区三区| 欧美一二三四在线| 狠狠色丁香九九婷婷综合五月| 欧美mv日韩mv国产| 国产一区二区三区精品视频| 国产女主播视频一区二区| 成人精品亚洲人成在线| 亚洲视频在线观看三级| 欧美性猛交xxxxxxxx| 日韩不卡一区二区| 久久综合丝袜日本网| 成人午夜av在线| 一区二区三区四区不卡在线 | 久久精品国产免费看久久精品| 日韩欧美亚洲国产另类| 国产乱人伦精品一区二区在线观看 | 日韩精品91亚洲二区在线观看| 91精品国产aⅴ一区二区| 美女网站视频久久| 国产精品天天看| 欧美色图在线观看| 国产在线播精品第三| 国产精品久久久久aaaa| 欧美日韩亚洲另类| 国产毛片精品视频| 亚洲激情男女视频| 日韩免费性生活视频播放| 粉嫩在线一区二区三区视频| 亚洲免费在线视频| 日韩一区二区在线看片| 成人激情小说网站| 日日骚欧美日韩| 国产精品免费视频网站| 欧美日韩国产高清一区二区 | 欧美性感一区二区三区| 黑人精品欧美一区二区蜜桃| 日韩一区欧美小说| 日韩欧美一二三区| 日本乱人伦一区| 国产一区二区三区久久悠悠色av| 亚洲图片欧美激情| 精品国产伦一区二区三区观看方式 | 亚洲视频网在线直播| 欧美成人免费网站| 色欧美乱欧美15图片| 久久99精品久久久久久国产越南| 综合婷婷亚洲小说| 久久久久久久久久久99999| 欧美私模裸体表演在线观看| 国产美女精品人人做人人爽| 亚洲成a人v欧美综合天堂下载| 日本一二三不卡| 日韩免费一区二区三区在线播放| 日本韩国精品在线| 高潮精品一区videoshd| 毛片av中文字幕一区二区| 玉米视频成人免费看|