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

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

?? pci.c

?? UBOOT 源碼
?? 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一区二区三区免费野_久草精品视频
欧美激情一区在线| 亚洲一区二区三区激情| 这里只有精品视频在线观看| 波多野结衣中文字幕一区二区三区 | 激情欧美一区二区| 日韩精品免费专区| 美女脱光内衣内裤视频久久影院| 午夜视黄欧洲亚洲| 午夜久久久久久电影| 蜜臀av在线播放一区二区三区 | 亚洲一区二区三区小说| 同产精品九九九| 国内精品伊人久久久久av影院 | 色综合av在线| 欧美美女一区二区三区| 欧美一区二区视频免费观看| 久久精品人人做| 亚洲情趣在线观看| 美女网站视频久久| 色偷偷88欧美精品久久久| 91麻豆精品国产91久久久久久| 久久久久久久久97黄色工厂| 亚洲丝袜另类动漫二区| 蜜臀精品久久久久久蜜臀| 国产麻豆视频精品| 欧美性大战久久久| 一区二区三区高清不卡| 国产激情精品久久久第一区二区| 99久久夜色精品国产网站| 久久久精品天堂| 久久se这里有精品| 欧美日韩另类国产亚洲欧美一级| 久久综合网色—综合色88| 日韩精品成人一区二区在线| 波多野结衣一区二区三区| 精品人伦一区二区色婷婷| 亚洲h在线观看| 欧美视频中文一区二区三区在线观看| 中文字幕在线免费不卡| 成人精品国产一区二区4080| 日韩一区二区视频| 琪琪一区二区三区| 精品毛片乱码1区2区3区| 亚洲综合在线视频| 日本国产一区二区| 日韩成人午夜电影| 日韩久久久久久| 成人激情图片网| 亚洲美女视频在线| 欧美日韩一区在线观看| 免费亚洲电影在线| 国产精品久久久一区麻豆最新章节| 国产成人啪午夜精品网站男同| 亚洲另类中文字| 日韩亚洲欧美一区二区三区| 三级在线观看一区二区| 日韩一区二区三区视频| 国产精品乡下勾搭老头1| 1024亚洲合集| 亚洲精品伦理在线| 国内精品伊人久久久久影院对白| 精品视频在线免费观看| 精品一区二区三区免费观看| 国产激情偷乱视频一区二区三区| 亚洲欧洲综合另类| 日韩欧美一级在线播放| 色哦色哦哦色天天综合| 理论片日本一区| 视频在线观看国产精品| 亚洲人精品午夜| 亚洲人成网站在线| 亚洲欧洲国产日韩| 午夜国产不卡在线观看视频| 成人免费av网站| 中文字幕精品三区| 亚洲美腿欧美偷拍| 国产一区二区三区久久久| 中文字幕欧美三区| 国产成人久久精品77777最新版本| 国产日产精品1区| 91精品欧美综合在线观看最新| 韩国视频一区二区| 国产精品996| 色婷婷香蕉在线一区二区| 久久九九全国免费| 91在线视频播放| 亚洲美腿欧美偷拍| 国产在线观看一区二区| 国产成人精品在线看| 色综合咪咪久久| 成人免费看的视频| 在线观看免费视频综合| 久久久国产一区二区三区四区小说 | 日韩亚洲欧美成人一区| 国产精品影视在线观看| 天堂久久久久va久久久久| 99精品在线免费| 欧美精品一区二区三区蜜臀| 亚洲在线中文字幕| 国产剧情一区二区| 日韩一区二区在线观看视频播放| 中文字幕一区av| 成人午夜视频在线观看| 久久噜噜亚洲综合| 亚洲女子a中天字幕| 成人黄动漫网站免费app| 欧美色综合久久| 国产激情精品久久久第一区二区| 亚洲高清视频中文字幕| 91福利国产精品| 综合色天天鬼久久鬼色| 国产一区二区在线观看免费| 精品国产99国产精品| 美日韩黄色大片| 日韩欧美在线影院| 免费视频最近日韩| 日韩欧美另类在线| 高清国产一区二区| 亚洲日本韩国一区| 欧美精品日韩精品| 麻豆91在线播放| 久久精品国产99| 亚洲国产毛片aaaaa无费看| 亚洲欧美区自拍先锋| 综合电影一区二区三区 | 精品国产伦一区二区三区观看体验| 亚洲不卡av一区二区三区| 91精品国产综合久久久久久久久久 | 不卡免费追剧大全电视剧网站| 亚洲三级在线免费| 精品国产乱码久久久久久牛牛| 91丨porny丨首页| 国产成都精品91一区二区三| 不卡一区在线观看| 国产亚洲欧美一级| 成人免费视频免费观看| 精品视频免费在线| 91年精品国产| 亚洲一区二区三区三| av在线免费不卡| 7878成人国产在线观看| 精品日韩在线一区| 日韩精品一区国产麻豆| 一色屋精品亚洲香蕉网站| 午夜精品福利一区二区蜜股av| 欧美精品一区二区三区在线播放| 国产一区美女在线| 91在线小视频| 午夜精品一区二区三区电影天堂 | 欧美精品丝袜中出| 热久久久久久久| 91精品国产综合久久久蜜臀粉嫩| 亚洲人成在线观看一区二区| 91精品国产高清一区二区三区蜜臀| 亚洲国产精品久久人人爱蜜臀| bt欧美亚洲午夜电影天堂| 亚洲va欧美va人人爽| 一本大道久久精品懂色aⅴ| 国产欧美日韩三区| 制服丝袜国产精品| 亚洲国产成人av网| 欧美久久免费观看| 成人免费视频免费观看| 欧美高清在线一区二区| 亚洲人一二三区| 精品电影一区二区三区| 免费看日韩a级影片| 欧美日韩在线免费视频| 国产精品99精品久久免费| 日本一区二区成人| 国产福利一区二区| 午夜激情久久久| 欧美大度的电影原声| 男人操女人的视频在线观看欧美| 欧美一级久久久| 国产成人自拍网| 偷拍一区二区三区四区| 欧美电视剧免费观看| 久久99国内精品| 性感美女久久精品| 久久综合久久99| 精品国产伦一区二区三区免费| av电影一区二区| 韩国成人福利片在线播放| 一区二区高清在线| 久久精品男人天堂av| 日韩丝袜情趣美女图片| 欧美性色黄大片| 国产91精品在线观看| 国产最新精品免费| 亚洲国产成人av| 亚洲欧美激情一区二区| 3atv一区二区三区| 色婷婷av一区二区| 懂色av一区二区三区蜜臀| 日本免费在线视频不卡一不卡二| 中文字幕欧美日本乱码一线二线| 精品噜噜噜噜久久久久久久久试看 | 91尤物视频在线观看| 激情久久五月天|