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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pci.c

?? u-boot-1.1.6 源碼包
?? 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);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看视频一区二区| 精品日韩在线观看| 日韩欧美一二三四区| 国产精品国产三级国产aⅴ中文 | 国产精品久久久久久久午夜片| 一区二区三区欧美激情| 国产资源在线一区| 欧美福利电影网| 亚洲免费观看在线观看| 国产99久久久国产精品潘金网站| 欧美一级电影网站| 亚洲妇女屁股眼交7| 成人国产精品视频| 国产亚洲成aⅴ人片在线观看 | 国产一区在线不卡| 欧美日本一区二区三区四区| 亚洲精品视频一区| 99九九99九九九视频精品| 精品国产乱码久久久久久久| 午夜精品福利在线| 欧美视频第二页| 亚洲精品久久久久久国产精华液| k8久久久一区二区三区| 欧美国产一区视频在线观看| 国产精品一二一区| 久久久精品日韩欧美| 国产在线精品一区二区夜色| 欧美一级高清大全免费观看| 日本v片在线高清不卡在线观看| 欧美日韩黄色影视| 午夜久久久影院| 在线播放亚洲一区| 蜜桃视频在线观看一区二区| 日韩欧美一区二区三区在线| 日本美女一区二区| 久久综合色8888| 国产不卡在线一区| 1024精品合集| 欧美羞羞免费网站| 日韩精品一级二级| 精品国产91乱码一区二区三区| 精品亚洲国内自在自线福利| 久久蜜桃一区二区| 99免费精品在线| 亚洲在线成人精品| 日韩一级免费一区| 国产精品一区一区三区| 中文字幕乱码亚洲精品一区| 一本久道久久综合中文字幕 | 国产精品亚洲一区二区三区妖精 | www.成人在线| 婷婷久久综合九色综合绿巨人 | 亚洲欧美日本在线| 在线成人免费视频| 国产精品白丝jk白祙喷水网站| 中文字幕乱码久久午夜不卡| 91国偷自产一区二区开放时间| 亚洲风情在线资源站| 日韩美女视频在线| 国产99久久久国产精品| 亚洲最大成人综合| 2014亚洲片线观看视频免费| 91免费视频大全| 久久99国产精品免费| 国产精品久久久久精k8| 欧美日韩高清影院| 国产91精品一区二区麻豆亚洲| 亚洲欧美另类久久久精品| 日韩欧美在线不卡| 97久久精品人人澡人人爽| 日本亚洲欧美天堂免费| 国产精品国产精品国产专区不片| 欧美疯狂做受xxxx富婆| 国产激情视频一区二区在线观看| 一区二区三区免费| 久久久国产午夜精品| 欧美另类z0zxhd电影| 国产91高潮流白浆在线麻豆| 五月婷婷另类国产| 国产精品乱人伦| ww亚洲ww在线观看国产| 在线观看一区二区视频| 成人丝袜18视频在线观看| 免费成人在线观看| 一二三区精品福利视频| 欧美国产综合色视频| 日韩久久久久久| 欧美日韩在线三级| 91在线国内视频| 国产九色sp调教91| 蜜桃传媒麻豆第一区在线观看| 一区二区三区高清在线| 国产日产欧美一区| 亚洲精品一区二区三区影院| 精品视频色一区| 91国在线观看| 成人精品高清在线| 国产成人在线观看| 久久精品国产第一区二区三区| 婷婷久久综合九色综合绿巨人 | 韩国av一区二区三区四区| 亚洲福利国产精品| 亚洲午夜影视影院在线观看| 日韩一区日韩二区| 国产精品免费网站在线观看| 国产亚洲视频系列| 久久精品水蜜桃av综合天堂| 日韩欧美激情在线| 日韩精品综合一本久道在线视频| 欧美人xxxx| 欧美电影在哪看比较好| 欧美日韩久久久| 欧美一区二区三区在线观看| 欧美绝品在线观看成人午夜影视| 欧美性生活大片视频| 91视频精品在这里| 色偷偷一区二区三区| 色欲综合视频天天天| 91久久一区二区| 欧美午夜宅男影院| 91麻豆精品国产91久久久 | 免费欧美在线视频| 精品一区二区三区免费播放 | 99re热这里只有精品视频| 91麻豆国产自产在线观看| 91蜜桃传媒精品久久久一区二区| 99精品一区二区三区| 欧美做爰猛烈大尺度电影无法无天| 色狠狠综合天天综合综合| 欧美日韩一区三区| 精品日韩在线观看| 国产午夜精品美女毛片视频| 国产精品国产精品国产专区不片 | 欧美中文字幕久久| 欧美高清视频在线高清观看mv色露露十八 | 91精品欧美福利在线观看| 日韩区在线观看| 国产清纯白嫩初高生在线观看91| 国产精品久久久久久久久果冻传媒 | 日韩亚洲电影在线| 国产欧美一区二区精品忘忧草 | 欧美亚男人的天堂| 日韩欧美精品在线视频| 国产精品素人一区二区| 樱花草国产18久久久久| 久久疯狂做爰流白浆xx| 99国产精品久久久久久久久久久| 精品1区2区3区| 欧美国产综合色视频| 亚洲成a人v欧美综合天堂下载 | 免费在线观看视频一区| 国产成人av一区二区三区在线观看| 91浏览器在线视频| 精品国产一区二区三区忘忧草 | 欧美日韩国产综合一区二区| 精品福利在线导航| 一区二区三区91| 国产一区欧美一区| 欧美夫妻性生活| 亚洲天堂免费在线观看视频| 美女久久久精品| 色综合咪咪久久| 国产亚洲va综合人人澡精品| 婷婷综合五月天| 99精品国产91久久久久久| 日韩美女在线视频| 亚洲国产成人av网| 99精品视频一区| 欧美激情一区三区| 久久成人免费网站| 欧美亚洲自拍偷拍| 亚洲日本va午夜在线电影| 国产一区二区三区不卡在线观看 | 欧美一区二区啪啪| 亚洲精选视频免费看| 国产91高潮流白浆在线麻豆| 日韩欧美国产系列| 婷婷综合五月天| 欧美三级电影在线看| 国产精品成人免费精品自在线观看| 九九精品一区二区| 日韩三级视频在线观看| 亚洲国产精品久久人人爱| 色婷婷综合久久久中文字幕| 欧美激情中文不卡| 国产夫妻精品视频| 国产亚洲一本大道中文在线| 精品一区二区三区av| 日韩午夜av电影| 日韩高清不卡一区二区三区| 欧美性大战xxxxx久久久| 亚洲视频狠狠干| 色香蕉久久蜜桃| 亚洲激情在线激情| 欧美在线短视频| 偷拍自拍另类欧美| 日韩欧美中文字幕精品| 久久99精品久久久久久国产越南| 日韩午夜小视频| 韩国精品主播一区二区在线观看 |