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

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

?? pci.c

?? u-boot1.3德國DENX小組開發的用于多種嵌入式CPU的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);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩精品电影| 亚洲欧美一区二区三区国产精品| 亚洲成人自拍网| 欧美成va人片在线观看| 国产一区二区三区精品欧美日韩一区二区三区| 欧美精品久久天天躁| 国产在线精品免费| 一区二区三区日韩精品视频| 56国语精品自产拍在线观看| 国产一区二区女| 亚洲一二三四在线| 欧美成人精精品一区二区频| 高清不卡一二三区| 天堂久久一区二区三区| 国产日韩欧美综合一区| 欧美日本一区二区三区| 成人国产亚洲欧美成人综合网| 婷婷开心激情综合| 亚洲免费观看高清完整版在线 | 国产成人综合视频| 亚洲成人精品一区| 亚洲女同一区二区| 中文字幕精品一区二区精品绿巨人| 国产成人h网站| 国内精品免费在线观看| 免费欧美高清视频| 日韩av中文字幕一区二区三区| 国产精品久久久久久久久免费丝袜| 欧美一区二区免费视频| 欧美日韩久久一区| 4438亚洲最大| 欧美一级片免费看| 欧美一二三四在线| 91精品在线免费观看| 欧美日韩一本到| 日韩午夜三级在线| 欧美精品一区二区三区蜜桃视频| 4hu四虎永久在线影院成人| 日韩欧美精品三级| 精品久久久久久最新网址| 欧美一级精品在线| 久久精品视频在线看| 国产精品嫩草99a| 亚洲va韩国va欧美va精品| 麻豆91免费观看| 成人sese在线| 欧美卡1卡2卡| 国产香蕉久久精品综合网| 亚洲欧美日本在线| 一区二区三区四区在线免费观看| 亚洲精品一区二区三区香蕉| 在线看一区二区| 日韩欧美不卡在线观看视频| 中文一区一区三区高中清不卡| 一区二区三区影院| 国内精品伊人久久久久av影院| 成人综合日日夜夜| 在线不卡欧美精品一区二区三区| 久久综合九色综合97婷婷女人| 一区二区三区中文免费| 国产美女久久久久| 日韩精品一区二区三区老鸭窝| 日韩综合小视频| 丁香六月综合激情| 久久久无码精品亚洲日韩按摩| 亚洲成人一区二区在线观看| 色婷婷激情久久| 国产精品麻豆视频| 99久久综合精品| 国产精品久久久久久久蜜臀 | 国产亚洲成av人在线观看导航 | 婷婷成人激情在线网| 色狠狠色狠狠综合| 日韩美女视频一区二区 | 9191久久久久久久久久久| 亚洲国产aⅴ成人精品无吗| 欧美性感一区二区三区| 亚洲综合色丁香婷婷六月图片| 成人看片黄a免费看在线| 国产亚洲欧美日韩俺去了| 成人免费毛片嘿嘿连载视频| 国产精品青草综合久久久久99| 成人综合激情网| 亚洲福中文字幕伊人影院| 91.麻豆视频| 成人一区在线看| 一区二区三区.www| 精品欧美一区二区三区精品久久| 久久99国产精品麻豆| 成人欧美一区二区三区1314| 欧美视频一区在线观看| 久久99精品一区二区三区| 中文字幕在线播放不卡一区| 91久久免费观看| 国产成人精品综合在线观看| 亚洲私人影院在线观看| 欧美精品一区二区高清在线观看| 成人黄色国产精品网站大全在线免费观看| 一区二区高清视频在线观看| 欧美一区二区女人| 色一区在线观看| heyzo一本久久综合| 久草这里只有精品视频| 一区二区不卡在线播放| 国产精品成人免费精品自在线观看| 欧美在线播放高清精品| 国产suv一区二区三区88区| 免费的成人av| 久久精品国产精品亚洲综合| 一区二区久久久| 亚洲一区在线视频| 中文字幕欧美一区| 亚洲精品欧美激情| 综合婷婷亚洲小说| 亚洲人午夜精品天堂一二香蕉| 国产日韩综合av| 亚洲特黄一级片| 午夜视频在线观看一区| 亚洲黄色免费网站| 亚洲国产sm捆绑调教视频 | 欧美va天堂va视频va在线| 日韩精品在线网站| 久久久蜜桃精品| 国产精品福利一区| 亚洲国产精品自拍| 国内成+人亚洲+欧美+综合在线| 国模大尺度一区二区三区| 丁香天五香天堂综合| 色欧美乱欧美15图片| 3atv一区二区三区| 欧美激情一区二区三区不卡| 中文字幕+乱码+中文字幕一区| 亚洲欧美二区三区| 久久精品国内一区二区三区| 欧美午夜宅男影院| 中文字幕在线不卡一区 | 久久久久久免费| 亚洲欧美激情一区二区| 久久精品国产成人一区二区三区 | 亚洲一区二区成人在线观看| 国产一区二区三区美女| 日韩免费看的电影| 国产精品你懂的| 久久99这里只有精品| 欧美系列亚洲系列| 国产精品视频线看| 国产成人自拍高清视频在线免费播放| 色综合久久综合| 国产精品三级电影| 国产成人免费视频精品含羞草妖精 | 在线观看国产精品网站| 精品国产sm最大网站免费看| 亚洲成av人影院| 欧美日韩激情在线| 亚洲一区av在线| 欧美伊人精品成人久久综合97| 亚洲视频在线观看三级| 成人性生交大片免费看视频在线 | 欧美精品在线一区二区三区| 一区二区三区不卡视频| 欧美精品一卡两卡| 日本不卡的三区四区五区| 6080日韩午夜伦伦午夜伦| 亚洲图片欧美激情| 欧洲av一区二区嗯嗯嗯啊| 五月天激情小说综合| 日韩欧美电影一二三| 狠狠色综合日日| 中文字幕综合网| 欧美日韩国产免费一区二区| 精品一区二区在线免费观看| 国产精品美女久久久久高潮| 色一情一乱一乱一91av| 免费成人在线观看| 一区二区三区精品视频| 久久久久国产免费免费| 欧美伊人久久久久久午夜久久久久| 青青草原综合久久大伊人精品| 久久人人97超碰com| 欧美日韩综合色| 成人妖精视频yjsp地址| 日本色综合中文字幕| 亚洲六月丁香色婷婷综合久久 | 香蕉久久一区二区不卡无毒影院| 51午夜精品国产| 色诱亚洲精品久久久久久| 天使萌一区二区三区免费观看| 国产视频视频一区| 日韩一级大片在线观看| 在线视频亚洲一区| 波多野结衣亚洲一区| 韩国一区二区三区| 日韩国产欧美三级| 日本韩国一区二区三区视频| 成人免费高清在线| 精品一区中文字幕| 日韩电影一区二区三区| 免费观看在线综合色| 日韩电影在线观看电影| 亚洲国产精品天堂|