亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
久久九九99视频| 久久亚洲欧美国产精品乐播 | 天堂一区二区在线免费观看| 亚洲国产精品成人久久综合一区 | 久久色.com| 亚洲精品在线观看网站| 日韩限制级电影在线观看| 欧美一区二区三区啪啪| 日韩欧美成人午夜| 2020国产精品自拍| 日本一区二区免费在线观看视频| 精品国产乱码久久久久久1区2区| 精品成人免费观看| 国产精品美女一区二区三区| 亚洲欧美在线另类| 午夜在线成人av| 久久国产欧美日韩精品| 国产剧情在线观看一区二区 | 亚洲人成网站影音先锋播放| 亚洲欧美日韩综合aⅴ视频| 亚洲精品成人悠悠色影视| 日韩和的一区二区| 韩国三级在线一区| 99热这里都是精品| 欧美久久一二区| 欧美精品一区在线观看| 国产精品私人自拍| 午夜精品福利一区二区三区av| 麻豆传媒一区二区三区| 成人白浆超碰人人人人| 精品视频色一区| 国产欧美一区二区精品仙草咪| 玉足女爽爽91| 国产一区不卡在线| 欧美视频一区二区| 久久精品男人天堂av| 亚洲一区二区在线免费看| 黑人巨大精品欧美一区| 色综合天天狠狠| 久久综合999| 午夜伊人狠狠久久| 国产福利电影一区二区三区| 欧美色综合网站| 国产精品久线观看视频| 蜜臀va亚洲va欧美va天堂 | 久久久久久毛片| 亚洲成av人片观看| 成人黄色片在线观看| 日韩片之四级片| 亚洲大片精品永久免费| 成人黄色小视频| 久久精品亚洲国产奇米99| 亚洲高清中文字幕| 欧洲一区在线电影| 国产精品国产a级| 国产精品77777| 欧美成人激情免费网| 亚洲va国产va欧美va观看| 99re免费视频精品全部| 国产亚洲午夜高清国产拍精品 | 国产九九视频一区二区三区| 欧美久久婷婷综合色| 国产精品乱码一区二区三区软件| 国模套图日韩精品一区二区 | 成人三级伦理片| 久久久久亚洲综合| 黄色小说综合网站| 欧美成va人片在线观看| 蓝色福利精品导航| 精品国产亚洲在线| 狠狠色狠狠色综合| 久久尤物电影视频在线观看| 免费观看日韩电影| 欧美成人综合网站| 久久69国产一区二区蜜臀| 欧美大胆人体bbbb| 精品一区二区久久| 欧美精品一区二区三区四区| 黄色精品一二区| 国产欧美一区二区精品性色| 国产99精品国产| 亚洲视频每日更新| 欧洲一区在线电影| 日韩国产欧美视频| 久久久久久久久久电影| 国产成人aaa| 日韩美女精品在线| 欧美三级在线播放| 精品在线播放午夜| 国产精品沙发午睡系列990531| 成人精品在线视频观看| 亚洲欧美一区二区不卡| 在线观看国产日韩| 日韩av电影天堂| 久久精品亚洲乱码伦伦中文| 不卡av电影在线播放| 亚洲国产欧美在线人成| 91精品国产综合久久福利软件| 久久se精品一区精品二区| 国产精品家庭影院| 欧美亚洲一区二区在线| 欧美aaa在线| 中文字幕精品—区二区四季| 欧美性videosxxxxx| 美女国产一区二区| 中文字幕视频一区二区三区久| 欧美日韩免费观看一区三区| 激情欧美日韩一区二区| 亚洲欧美综合色| 91精品国产91久久久久久一区二区 | 亚洲成人精品影院| 日韩视频一区二区| 99久久久久免费精品国产| 日韩国产精品久久久久久亚洲| 久久久久久久综合狠狠综合| 一本色道久久综合狠狠躁的推荐| 视频一区欧美精品| 自拍视频在线观看一区二区| 日韩免费一区二区三区在线播放| 成人福利电影精品一区二区在线观看| 亚洲高清免费一级二级三级| 久久精品视频免费观看| 欧美裸体bbwbbwbbw| 99久久免费精品| 国产高清在线精品| 日韩主播视频在线| 亚洲欧美另类在线| 亚洲国产精品国自产拍av| 欧美一级片在线观看| 成人黄色软件下载| 国产麻豆精品一区二区| 久久狠狠亚洲综合| 亚洲成人av在线电影| 亚洲美女偷拍久久| 中文字幕av一区二区三区高| 欧美一区二区三区在| 欧美日韩大陆一区二区| 色综合久久久久久久久| 成人av综合在线| 国产成人激情av| 国产成人av电影在线观看| 久久99精品久久久久婷婷| 午夜不卡av免费| 日产精品久久久久久久性色| 天天色综合成人网| 丝袜美腿亚洲一区二区图片| 亚洲第一综合色| 一区二区三区国产精华| 亚洲制服丝袜在线| 亚洲午夜电影在线观看| 亚洲第一狼人社区| 亚洲国产一区二区三区青草影视 | 91精品国产91久久久久久最新毛片| 91麻豆成人久久精品二区三区| jlzzjlzz亚洲日本少妇| 波多野结衣精品在线| 成人av手机在线观看| 成人国产精品免费网站| av资源网一区| 91在线码无精品| 欧美影院一区二区三区| 欧美久久久久久蜜桃| 日韩美女一区二区三区四区| 精品国产制服丝袜高跟| 国产清纯美女被跳蛋高潮一区二区久久w| 久久精品欧美日韩精品| 国产精品福利影院| 亚洲一区二区av在线| 日本成人在线看| 国产成人自拍高清视频在线免费播放| 国产不卡高清在线观看视频| av不卡免费在线观看| 欧美乱熟臀69xxxxxx| 欧美精品一区二区三区蜜桃视频| 国产婷婷一区二区| 一区二区三区在线观看视频| 日本vs亚洲vs韩国一区三区二区| 久草中文综合在线| 91在线视频免费观看| 9191成人精品久久| 国产日韩精品一区二区浪潮av| 亚洲六月丁香色婷婷综合久久 | 日韩理论片一区二区| 午夜精彩视频在线观看不卡| 精品亚洲免费视频| 一本色道综合亚洲| 日韩精品一区在线观看| 亚洲私人黄色宅男| 韩国av一区二区三区四区| 99国内精品久久| 日韩视频一区二区三区| 亚洲同性gay激情无套| 精品中文av资源站在线观看| 在线观看视频一区二区| 久久精品视频在线免费观看| 亚洲成人免费观看| 99riav一区二区三区| 欧美mv和日韩mv的网站| 亚洲女爱视频在线| 国产美女在线观看一区|