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

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

?? mv_eth.c

?? u-boot1.3.0的原碼,從配了網(wǎng)絡(luò)驅(qū)動和FLASH的驅(qū)動,并該用ESC竟如
?? C
?? 第 1 頁 / 共 5 頁
字號:
 *		1) Operations (i.e. port init, start, reset etc'). *		2) Data flow (i.e. port send, receive etc'). *		Each Gigabit Ethernet port is controlled via ETH_PORT_INFO *		struct. *		This struct includes user configuration information as well as *		driver internal data needed for its operations. * *		Supported Features: *		- This low level driver is OS independent. Allocating memory for *		  the descriptor rings and buffers are not within the scope of *		  this driver. *		- The user is free from Rx/Tx queue managing. *		- This low level driver introduce functionality API that enable *		  the to operate Marvell's Gigabit Ethernet Controller in a *		  convenient way. *		- Simple Gigabit Ethernet port operation API. *		- Simple Gigabit Ethernet port data flow API. *		- Data flow and operation API support per queue functionality. *		- Support cached descriptors for better performance. *		- Enable access to all four DRAM banks and internal SRAM memory *		  spaces. *		- PHY access and control API. *		- Port control register configuration API. *		- Full control over Unicast and Multicast MAC configurations. * *		Operation flow: * *		Initialization phase *		This phase complete the initialization of the ETH_PORT_INFO *		struct. *		User information regarding port configuration has to be set *		prior to calling the port initialization routine. For example, *		the user has to assign the port_phy_addr field which is board *		depended parameter. *		In this phase any port Tx/Rx activity is halted, MIB counters *		are cleared, PHY address is set according to user parameter and *		access to DRAM and internal SRAM memory spaces. * *		Driver ring initialization *		Allocating memory for the descriptor rings and buffers is not *		within the scope of this driver. Thus, the user is required to *		allocate memory for the descriptors ring and buffers. Those *		memory parameters are used by the Rx and Tx ring initialization *		routines in order to curve the descriptor linked list in a form *		of a ring. *		Note: Pay special attention to alignment issues when using *		cached descriptors/buffers. In this phase the driver store *		information in the ETH_PORT_INFO struct regarding each queue *		ring. * *		Driver start *		This phase prepares the Ethernet port for Rx and Tx activity. *		It uses the information stored in the ETH_PORT_INFO struct to *		initialize the various port registers. * *		Data flow: *		All packet references to/from the driver are done using PKT_INFO *		struct. *		This struct is a unified struct used with Rx and Tx operations. *		This way the user is not required to be familiar with neither *		Tx nor Rx descriptors structures. *		The driver's descriptors rings are management by indexes. *		Those indexes controls the ring resources and used to indicate *		a SW resource error: *		'current' *		This index points to the current available resource for use. For *		example in Rx process this index will point to the descriptor *		that will be passed to the user upon calling the receive routine. *		In Tx process, this index will point to the descriptor *		that will be assigned with the user packet info and transmitted. *		'used' *		This index points to the descriptor that need to restore its *		resources. For example in Rx process, using the Rx buffer return *		API will attach the buffer returned in packet info to the *		descriptor pointed by 'used'. In Tx process, using the Tx *		descriptor return will merely return the user packet info with *		the command status of  the transmitted buffer pointed by the *		'used' index. Nevertheless, it is essential to use this routine *		to update the 'used' index. *		'first' *		This index supports Tx Scatter-Gather. It points to the first *		descriptor of a packet assembled of multiple buffers. For example *		when in middle of Such packet we have a Tx resource error the *		'curr' index get the value of 'first' to indicate that the ring *		returned to its state before trying to transmit this packet. * *		Receive operation: *		The eth_port_receive API set the packet information struct, *		passed by the caller, with received information from the *		'current' SDMA descriptor. *		It is the user responsibility to return this resource back *		to the Rx descriptor ring to enable the reuse of this source. *		Return Rx resource is done using the eth_rx_return_buff API. * *		Transmit operation: *		The eth_port_send API supports Scatter-Gather which enables to *		send a packet spanned over multiple buffers. This means that *		for each packet info structure given by the user and put into *		the Tx descriptors ring, will be transmitted only if the 'LAST' *		bit will be set in the packet info command status field. This *		API also consider restriction regarding buffer alignments and *		sizes. *		The user must return a Tx resource after ensuring the buffer *		has been transmitted to enable the Tx ring indexes to update. * *		BOARD LAYOUT *		This device is on-board.  No jumper diagram is necessary. * *		EXTERNAL INTERFACE * *	 Prior to calling the initialization routine eth_port_init() the user *	 must set the following fields under ETH_PORT_INFO struct: *	 port_num	      User Ethernet port number. *	 port_phy_addr		    User PHY address of Ethernet port. *	 port_mac_addr[6]	    User defined port MAC address. *	 port_config	      User port configuration value. *	 port_config_extend    User port config extend value. *	 port_sdma_config      User port SDMA config value. *	 port_serial_control   User port serial control value. *	 *port_virt_to_phys ()	User function to cast virtual addr to CPU bus addr. *	 *port_private	      User scratch pad for user specific data structures. * *	 This driver introduce a set of default values: *	 PORT_CONFIG_VALUE	     Default port configuration value *	 PORT_CONFIG_EXTEND_VALUE    Default port extend configuration value *	 PORT_SDMA_CONFIG_VALUE	     Default sdma control value *	 PORT_SERIAL_CONTROL_VALUE   Default port serial control value * *		This driver data flow is done using the PKT_INFO struct which is *		a unified struct for Rx and Tx operations: *		byte_cnt	Tx/Rx descriptor buffer byte count. *		l4i_chk		CPU provided TCP Checksum. For Tx operation only. *		cmd_sts		Tx/Rx descriptor command status. *		buf_ptr		Tx/Rx descriptor buffer pointer. *		return_info	Tx/Rx user resource return information. * * *		EXTERNAL SUPPORT REQUIREMENTS * *		This driver requires the following external support: * *		D_CACHE_FLUSH_LINE (address, address offset) * *		This macro applies assembly code to flush and invalidate cache *		line. *		address	       - address base. *		address offset - address offset * * *		CPU_PIPE_FLUSH * *		This macro applies assembly code to flush the CPU pipeline. * *******************************************************************************//* includes *//* defines *//* SDMA command macros */#define ETH_ENABLE_TX_QUEUE(tx_queue, eth_port) \ MV_REG_WRITE(MV64460_ETH_TRANSMIT_QUEUE_COMMAND_REG(eth_port), (1 << tx_queue))#define ETH_DISABLE_TX_QUEUE(tx_queue, eth_port) \ MV_REG_WRITE(MV64460_ETH_TRANSMIT_QUEUE_COMMAND_REG(eth_port),\ (1 << (8 + tx_queue)))#define ETH_ENABLE_RX_QUEUE(rx_queue, eth_port) \MV_REG_WRITE(MV64460_ETH_RECEIVE_QUEUE_COMMAND_REG(eth_port), (1 << rx_queue))#define ETH_DISABLE_RX_QUEUE(rx_queue, eth_port) \MV_REG_WRITE(MV64460_ETH_RECEIVE_QUEUE_COMMAND_REG(eth_port), (1 << (8 + rx_queue)))#define CURR_RFD_GET(p_curr_desc, queue) \ ((p_curr_desc) = p_eth_port_ctrl->p_rx_curr_desc_q[queue])#define CURR_RFD_SET(p_curr_desc, queue) \ (p_eth_port_ctrl->p_rx_curr_desc_q[queue] = (p_curr_desc))#define USED_RFD_GET(p_used_desc, queue) \ ((p_used_desc) = p_eth_port_ctrl->p_rx_used_desc_q[queue])#define USED_RFD_SET(p_used_desc, queue)\(p_eth_port_ctrl->p_rx_used_desc_q[queue] = (p_used_desc))#define CURR_TFD_GET(p_curr_desc, queue) \ ((p_curr_desc) = p_eth_port_ctrl->p_tx_curr_desc_q[queue])#define CURR_TFD_SET(p_curr_desc, queue) \ (p_eth_port_ctrl->p_tx_curr_desc_q[queue] = (p_curr_desc))#define USED_TFD_GET(p_used_desc, queue) \ ((p_used_desc) = p_eth_port_ctrl->p_tx_used_desc_q[queue])#define USED_TFD_SET(p_used_desc, queue) \ (p_eth_port_ctrl->p_tx_used_desc_q[queue] = (p_used_desc))#define FIRST_TFD_GET(p_first_desc, queue) \ ((p_first_desc) = p_eth_port_ctrl->p_tx_first_desc_q[queue])#define FIRST_TFD_SET(p_first_desc, queue) \ (p_eth_port_ctrl->p_tx_first_desc_q[queue] = (p_first_desc))/* Macros that save access to desc in order to find next desc pointer  */#define RX_NEXT_DESC_PTR(p_rx_desc, queue) (ETH_RX_DESC*)(((((unsigned int)p_rx_desc - (unsigned int)p_eth_port_ctrl->p_rx_desc_area_base[queue]) + RX_DESC_ALIGNED_SIZE) % p_eth_port_ctrl->rx_desc_area_size[queue]) + (unsigned int)p_eth_port_ctrl->p_rx_desc_area_base[queue])#define TX_NEXT_DESC_PTR(p_tx_desc, queue) (ETH_TX_DESC*)(((((unsigned int)p_tx_desc - (unsigned int)p_eth_port_ctrl->p_tx_desc_area_base[queue]) + TX_DESC_ALIGNED_SIZE) % p_eth_port_ctrl->tx_desc_area_size[queue]) + (unsigned int)p_eth_port_ctrl->p_tx_desc_area_base[queue])#define LINK_UP_TIMEOUT		100000#define PHY_BUSY_TIMEOUT    10000000/* locals *//* PHY routines */static void ethernet_phy_set (ETH_PORT eth_port_num, int phy_addr);static int ethernet_phy_get (ETH_PORT eth_port_num);/* Ethernet Port routines */static void eth_set_access_control (ETH_PORT eth_port_num,				    ETH_WIN_PARAM * param);static bool eth_port_uc_addr (ETH_PORT eth_port_num, unsigned char uc_nibble,			      ETH_QUEUE queue, int option);#if 0				/* FIXME */static bool eth_port_smc_addr (ETH_PORT eth_port_num,			       unsigned char mc_byte,			       ETH_QUEUE queue, int option);static bool eth_port_omc_addr (ETH_PORT eth_port_num,			       unsigned char crc8,			       ETH_QUEUE queue, int option);#endifstatic void eth_b_copy (unsigned int src_addr, unsigned int dst_addr,			int byte_count);void eth_dbg (ETH_PORT_INFO * p_eth_port_ctrl);typedef enum _memory_bank { BANK0, BANK1, BANK2, BANK3 } MEMORY_BANK;u32 mv_get_dram_bank_base_addr (MEMORY_BANK bank){	u32 result = 0;	u32 enable = MV_REG_READ (MV64460_BASE_ADDR_ENABLE);	if (enable & (1 << bank))		return 0;	if (bank == BANK0)		result = MV_REG_READ (MV64460_CS_0_BASE_ADDR);	if (bank == BANK1)		result = MV_REG_READ (MV64460_CS_1_BASE_ADDR);	if (bank == BANK2)		result = MV_REG_READ (MV64460_CS_2_BASE_ADDR);	if (bank == BANK3)		result = MV_REG_READ (MV64460_CS_3_BASE_ADDR);	result &= 0x0000ffff;	result = result << 16;	return result;}u32 mv_get_dram_bank_size (MEMORY_BANK bank){	u32 result = 0;	u32 enable = MV_REG_READ (MV64460_BASE_ADDR_ENABLE);	if (enable & (1 << bank))		return 0;	if (bank == BANK0)		result = MV_REG_READ (MV64460_CS_0_SIZE);	if (bank == BANK1)		result = MV_REG_READ (MV64460_CS_1_SIZE);	if (bank == BANK2)		result = MV_REG_READ (MV64460_CS_2_SIZE);	if (bank == BANK3)		result = MV_REG_READ (MV64460_CS_3_SIZE);	result += 1;	result &= 0x0000ffff;	result = result << 16;	return result;}u32 mv_get_internal_sram_base (void){	u32 result;	result = MV_REG_READ (MV64460_INTEGRATED_SRAM_BASE_ADDR);	result &= 0x0000ffff;	result = result << 16;	return result;}/******************************************************************************** eth_port_init - Initialize the Ethernet port driver** DESCRIPTION:*	This function prepares the ethernet port to start its activity:*	1) Completes the ethernet port driver struct initialization toward port*	    start routine.*	2) Resets the device to a quiescent state in case of warm reboot.*	3) Enable SDMA access to all four DRAM banks as well as internal SRAM.*	4) Clean MAC tables. The reset status of those tables is unknown.*	5) Set PHY address.*	Note: Call this routine prior to eth_port_start routine and after setting*	user values in the user fields of Ethernet port control struct (i.e.*	port_phy_addr).** INPUT:*	ETH_PORT_INFO	*p_eth_port_ctrl       Ethernet port control struct** OUTPUT:*	See description.** RETURN:*	None.********************************************************************************/static void eth_port_init (ETH_PORT_INFO * p_eth_port_ctrl){	int queue;	ETH_WIN_PARAM win_param;	p_eth_port_ctrl->port_config = PORT_CONFIG_VALUE;	p_eth_port_ctrl->port_config_extend = PORT_CONFIG_EXTEND_VALUE;	p_eth_port_ctrl->port_sdma_config = PORT_SDMA_CONFIG_VALUE;	p_eth_port_ctrl->port_serial_control = PORT_SERIAL_CONTROL_VALUE;	p_eth_port_ctrl->port_rx_queue_command = 0;	p_eth_port_ctrl->port_tx_queue_command = 0;	/* Zero out SW structs */	for (queue = 0; queue < MAX_RX_QUEUE_NUM; queue++) {		CURR_RFD_SET ((ETH_RX_DESC *) 0x00000000, queue);		USED_RFD_SET ((ETH_RX_DESC *) 0x00000000, queue);		p_eth_port_ctrl->rx_resource_err[queue] = false;	}	for (queue = 0; queue < MAX_TX_QUEUE_NUM; queue++) {		CURR_TFD_SET ((ETH_TX_DESC *) 0x00000000, queue);		USED_TFD_SET ((ETH_TX_DESC *) 0x00000000, queue);		FIRST_TFD_SET ((ETH_TX_DESC *) 0x00000000, queue);		p_eth_port_ctrl->tx_resource_err[queue] = false;	}	eth_port_reset (p_eth_port_ctrl->port_num);	/* Set access parameters for DRAM bank 0 */	win_param.win = ETH_WIN0;	/* Use Ethernet window 0 */	win_param.target = ETH_TARGET_DRAM;	/* Window target - DDR	*/	win_param.attributes = EBAR_ATTR_DRAM_CS0;	/* Enable DRAM bank   */#ifndef CONFIG_NOT_COHERENT_CACHE	win_param.attributes |= EBAR_ATTR_DRAM_CACHE_COHERENCY_WB;#endif	win_param.high_addr = 0;	/* Get bank base */	win_param.base_addr = mv_get_dram_bank_base_addr (BANK0);	win_param.size = mv_get_dram_bank_size (BANK0); /* Get bank size */	if (win_param.size == 0)		win_param.enable = 0;	else		win_param.enable = 1;	/* Enable the access */	win_param.access_ctrl = EWIN_ACCESS_FULL;	/* Enable full access */	/* Set the access control for address window (EPAPR) READ & WRITE */	eth_set_access_control (p_eth_port_ctrl->port_num, &win_param);	/* Set access parameters for DRAM bank 1 */	win_param.win = ETH_WIN1;	/* Use Ethernet window 1 */	win_param.target = ETH_TARGET_DRAM;	/* Window target - DDR */	win_param.attributes = EBAR_ATTR_DRAM_CS1;	/* Enable DRAM bank */#ifndef CONFIG_NOT_COHERENT_CACHE	win_param.attributes |= EBAR_ATTR_DRAM_CACHE_COHERENCY_WB;#endif	win_param.high_addr = 0;	/* Get bank base */	win_param.base_addr = mv_get_dram_bank_base_addr (BANK1);	win_param.size = mv_get_dram_bank_size (BANK1); /* Get bank size */	if (win_param.size == 0)		win_param.enable = 0;	else		win_param.enable = 1;	/* Enable the access */	win_param.access_ctrl = EWIN_ACCESS_FULL;	/* Enable full access */	/* Set the access control for address window (EPAPR) READ & WRITE */	eth_set_access_control (p_eth_port_ctrl->port_num, &win_param);	/* Set access parameters for DRAM bank 2 */	win_param.win = ETH_WIN2;	/* Use Ethernet window 2 */	win_param.target = ETH_TARGET_DRAM;	/* Window target - DDR */	win_param.attributes = EBAR_ATTR_DRAM_CS2;	/* Enable DRAM bank */#ifndef CONFIG_NOT_COHERENT_CACHE

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
韩国视频一区二区| 欧美激情在线免费观看| 亚洲欧美另类久久久精品| 国产久卡久卡久卡久卡视频精品| 欧美一区二区在线视频| 性久久久久久久久久久久| 在线观看国产91| 亚洲成人av在线电影| 欧美午夜宅男影院| 五月天精品一区二区三区| 色婷婷av一区二区| 国产精品电影一区二区三区| av一本久道久久综合久久鬼色| 自拍偷拍欧美激情| 欧美视频一区二区三区四区| 一区免费观看视频| 99久久99久久精品免费观看| 亚洲国产精品精华液ab| 91香蕉视频污| 亚洲欧美日本韩国| 久久综合久色欧美综合狠狠| 国产精品一区二区91| 综合色中文字幕| 欧美美女黄视频| 丁香天五香天堂综合| 亚洲女人的天堂| 欧美一区二区黄色| 麻豆高清免费国产一区| 国产精品美女久久久久久久网站| 91蜜桃网址入口| 精品一区二区在线观看| 亚洲天堂a在线| 欧美mv和日韩mv的网站| 91美女精品福利| 国内精品久久久久影院色| 亚洲精品综合在线| 久久久国产午夜精品| 欧美在线观看一二区| 国产成人免费视频一区| 午夜av一区二区三区| 国产精品久久久久久久久免费相片| 色噜噜狠狠一区二区三区果冻| 天堂在线亚洲视频| 亚洲视频一区二区在线| 日韩免费福利电影在线观看| 日本韩国精品在线| 99精品欧美一区二区蜜桃免费| 国产在线看一区| 青青草91视频| 亚洲国产aⅴ成人精品无吗| 亚洲欧洲av另类| 国产午夜亚洲精品午夜鲁丝片| 欧美日韩国产精品自在自线| 欧美日韩一级视频| 欧美日高清视频| 5566中文字幕一区二区电影| 欧美在线不卡视频| 欧美日韩电影一区| 欧美一卡2卡三卡4卡5免费| 欧美精品国产精品| 欧美一区二区日韩一区二区| 欧美精品免费视频| 欧美va亚洲va国产综合| 日韩精品一区国产麻豆| 国产区在线观看成人精品| 亚洲国产成人午夜在线一区| 国产精品国产三级国产aⅴ入口| 亚洲欧美一区二区三区孕妇| 国产精品久久夜| 亚洲精品视频免费看| 日韩激情中文字幕| 国产成人av电影在线播放| 91麻豆精品在线观看| 欧美精品免费视频| 亚洲国产精品ⅴa在线观看| 亚洲天堂免费看| 国产综合久久久久影院| 91玉足脚交白嫩脚丫在线播放| 欧美亚洲愉拍一区二区| 国产日韩欧美综合在线| 亚洲日本在线视频观看| 青青草视频一区| 91九色02白丝porn| 国产丝袜在线精品| 日韩成人午夜精品| 国产乱码精品一区二区三区五月婷| 国产精品中文欧美| 日韩视频一区二区| 香蕉影视欧美成人| 成人不卡免费av| 精品sm在线观看| 亚洲综合一区二区三区| 色婷婷亚洲精品| 亚洲欧美福利一区二区| 久久国产精品免费| 欧美剧在线免费观看网站| 国产女主播视频一区二区| 亚洲电影一级黄| 欧美日韩综合不卡| 亚洲午夜久久久久久久久电影网| 粉嫩av亚洲一区二区图片| 日韩欧美国产电影| 一区二区三区精品在线| 色欧美日韩亚洲| 中文字幕永久在线不卡| 国产精品自拍av| 久久精品网站免费观看| 麻豆精品在线播放| 国产欧美一区二区精品性色超碰| 日本va欧美va欧美va精品| 91精品国产综合久久精品性色 | 狠狠色丁香婷综合久久| 日韩欧美中文字幕制服| 免费不卡在线视频| 欧美第一区第二区| 精品一区二区三区免费播放 | 国产成人免费视频网站高清观看视频| 中文字幕成人在线观看| voyeur盗摄精品| 最新久久zyz资源站| 欧洲精品一区二区三区在线观看| 亚洲图片欧美色图| 欧美成人一区二区三区片免费 | 亚洲电影中文字幕在线观看| 欧美一区二区三区视频免费播放| 美女视频黄免费的久久 | 亚洲天堂福利av| 欧美成va人片在线观看| 成人激情综合网站| 日本欧美久久久久免费播放网| 亚洲精品在线一区二区| 欧美日韩亚洲国产综合| 天天影视色香欲综合网老头| 欧美日韩aaaaaa| 99久久99久久精品免费看蜜桃| 亚洲制服丝袜一区| 中文字幕一区二| 欧美电影免费提供在线观看| 91国产精品成人| 成人中文字幕合集| 国产成人一区在线| 蜜桃视频在线一区| 午夜激情一区二区| 亚洲自拍另类综合| 亚洲欧美另类图片小说| 国产精品久久免费看| 国产精品色哟哟| 久久久国产精华| 国产亚洲精久久久久久| 久久精品视频免费| 国产性天天综合网| 国产精品毛片a∨一区二区三区| 26uuu国产一区二区三区| 日韩精品一区二区三区在线| 欧美日韩国产大片| 337p亚洲精品色噜噜| 777a∨成人精品桃花网| 日韩一级二级三级| 欧美不卡视频一区| xvideos.蜜桃一区二区| 2021久久国产精品不只是精品| 国产丝袜欧美中文另类| 中文字幕一区二区5566日韩| 亚洲一级在线观看| 麻豆国产欧美日韩综合精品二区| 美女mm1313爽爽久久久蜜臀| 国产伦精一区二区三区| 97久久久精品综合88久久| 欧美三区在线视频| 久久综合久久综合久久综合| 欧美极品美女视频| 亚洲午夜成aⅴ人片| 国产一区二区三区不卡在线观看| 91网页版在线| 精品国产制服丝袜高跟| 亚洲欧美色一区| 久久99国产精品久久99果冻传媒| 日本韩国一区二区| 欧美一区二区三区白人| 亚洲6080在线| 欧美综合一区二区| 亚洲综合一区二区| 欧美日韩精品久久久| 五月天激情综合| 欧美成人在线直播| 国产精品99久久久久久宅男| 欧美疯狂性受xxxxx喷水图片| 亚洲精品日韩专区silk| 欧美日韩一区国产| 美女视频第一区二区三区免费观看网站| 日韩一级完整毛片| 国产精一品亚洲二区在线视频| 国产欧美日韩不卡免费| 欧美少妇一区二区| 亚洲午夜私人影院| 精品区一区二区| 欧美伊人久久久久久午夜久久久久| 夜夜嗨av一区二区三区中文字幕| 制服丝袜在线91| 成人中文字幕在线|