⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 skgeinit.c

📁 F:worksip2440a board可启动u-boot-like.tar.gz F:worksip2440a board可启动u-boot-like.tar.gz
💻 C
📖 第 1 页 / 共 5 页
字号:
/****************************************************************************** * * Name:	skgeinit.c * Project:	GEnesis, PCI Gigabit Ethernet Adapter * Version:	$Revision: 1.1.1.1 $ * Date:	$Date: 2005/06/27 17:05:09 $ * Purpose:	Contains functions to initialize the GE HW * ******************************************************************************//****************************************************************************** * *	(C)Copyright 1998-2003 SysKonnect GmbH. * *	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. * *	The information in this file is provided "AS IS" without warranty. * ******************************************************************************//****************************************************************************** * * History: * *	$Log: skgeinit.c,v $ *	Revision 1.1.1.1  2005/06/27 17:05:09  linuxpark *	Initial import. *	 *	Revision 1.85  2003/02/05 15:30:33  rschmidt *	Corrected setting of GIHstClkFact (Host Clock Factor) and *	GIPollTimerVal (Descr. Poll Timer Init Value) for YUKON. *	Editorial changes. * *	Revision 1.84  2003/01/28 09:57:25  rschmidt *	Added detection of YUKON-Lite Rev. A0 (stored in GIYukonLite). *	Disabled Rx GMAC FIFO Flush for YUKON-Lite Rev. A0. *	Added support for CLK_RUN (YUKON-Lite). *	Added additional check of PME from D3cold for setting GIVauxAvail. *	Editorial changes. * *	Revision 1.83  2002/12/17 16:15:41  rschmidt *	Added default setting of PhyType (Copper) for YUKON. *	Added define around check for HW self test results. *	Editorial changes. * *	Revision 1.82  2002/12/05 13:40:21  rschmidt *	Added setting of Rx GMAC FIFO Flush Mask register. *	Corrected PhyType with new define SK_PHY_MARV_FIBER when *	YUKON Fiber board was found. *	Editorial changes. * *	Revision 1.81  2002/11/15 12:48:35  rschmidt *	Replaced message SKERR_HWI_E018 with SKERR_HWI_E024 for Rx queue error *	in SkGeStopPort(). *	Added init for pAC->GIni.GIGenesis with SK_FALSE in YUKON-branch. *	Editorial changes. * *	Revision 1.80  2002/11/12 17:28:30  rschmidt *	Initialized GIPciSlot64 and GIPciClock66 in SkGeInit1(). *	Reduced PCI FIFO watermarks for 32bit/33MHz bus in SkGeInitBmu(). *	Editorial changes. * *	Revision 1.79  2002/10/21 09:31:02  mkarl *	Changed SkGeInitAssignRamToQueues(), removed call to *	SkGeInitAssignRamToQueues in SkGeInit1 and fixed compiler warning in *	SkGeInit1. * *	Revision 1.78  2002/10/16 15:55:07  mkarl *	Fixed a bug in SkGeInitAssignRamToQueues. * *	Revision 1.77  2002/10/14 15:07:22  rschmidt *	Corrected timeout handling for Rx queue in SkGeStopPort() (#10748) *	Editorial changes. * *	Revision 1.76  2002/10/11 09:24:38  mkarl *	Added check for HW self test results. * *	Revision 1.75  2002/10/09 16:56:44  mkarl *	Now call SkGeInitAssignRamToQueues() in Init Level 1 in order to assign *	the adapter memory to the queues. This default assignment is not suitable *	for dual net mode. * *	Revision 1.74  2002/09/12 08:45:06  rwahl *	Set defaults for PMSCap, PLinkSpeed & PLinkSpeedCap dependent on PHY. * *	Revision 1.73  2002/08/16 15:19:45  rschmidt *	Corrected check for Tx queues in SkGeCheckQSize(). *	Added init for new entry GIGenesis and GICopperType *	Replaced all if(GIChipId == CHIP_ID_GENESIS) with new entry GIGenesis. *	Replaced wrong 1st para pAC with IoC in SK_IN/OUT macros. * *	Revision 1.72  2002/08/12 13:38:55  rschmidt *	Added check if VAUX is available (stored in GIVauxAvail) *	Initialized PLinkSpeedCap in Port struct with SK_LSPEED_CAP_1000MBPS *	Editorial changes. * *	Revision 1.71  2002/08/08 16:32:58  rschmidt *	Added check for Tx queues in SkGeCheckQSize(). *	Added start of Time Stamp Timer (YUKON) in SkGeInit2(). *	Editorial changes. * *	Revision 1.70  2002/07/23 16:04:26  rschmidt *	Added init for GIWolOffs (HW-Bug in YUKON 1st rev.) *	Minor changes * *	Revision 1.69  2002/07/17 17:07:08  rwahl *	- SkGeInit1(): fixed PHY type debug output; corrected init of GIFunc *	  table & GIMacType. *	- Editorial changes. * *	Revision 1.68  2002/07/15 18:38:31  rwahl *	Added initialization for MAC type dependent function table. * *	Revision 1.67  2002/07/15 15:45:39  rschmidt *	Added Tx Store & Forward for YUKON (GMAC Tx FIFO is only 1 kB) *	Replaced SK_PHY_MARV by SK_PHY_MARV_COPPER *	Editorial changes * *	Revision 1.66  2002/06/10 09:35:08  rschmidt *	Replaced C++ comments (//) *	Editorial changes * *	Revision 1.65  2002/06/05 08:33:37  rschmidt *	Changed GIRamSize and Reset sequence for YUKON. *	SkMacInit() replaced by SkXmInitMac() resp. SkGmInitMac() * *	Revision 1.64  2002/04/25 13:03:20  rschmidt *	Changes for handling YUKON. *	Removed reference to xmac_ii.h (not necessary). *	Moved all defines into header file. *	Replaced all SkXm...() functions with SkMac...() to handle also *	YUKON's GMAC. *	Added handling for GMAC FIFO in SkGeInitMacFifo(), SkGeStopPort(). *	Removed 'goto'-directive from SkGeCfgSync(), SkGeCheckQSize(). *	Replaced all XMAC-access macros by functions: SkMacRxTxDisable(), *	SkMacFlushTxFifo(). *	Optimized timeout handling in SkGeStopPort(). *	Initialized PLinkSpeed in Port struct with SK_LSPEED_AUTO. *	Release of GMAC Link Control reset in SkGeInit1(). *	Initialized GIChipId and GIChipRev in GE Init structure. *	Added GIRamSize and PhyType values for YUKON. *	Removed use of PRxCmd to setup XMAC. *	Moved setting of XM_RX_DIS_CEXT to SkXmInitMac(). *	Use of SkGeXmitLED() only for GENESIS. *	Changes for V-CPU support. *	Editorial changes. * *	Revision 1.63  2001/04/05 11:02:09  rassmann *	Stop Port check of the STOP bit did not take 2/18 sec as wanted. * *	Revision 1.62  2001/02/07 07:54:21  rassmann *	Corrected copyright. * *	Revision 1.61  2001/01/31 15:31:40  gklug *	fix: problem with autosensing an SR8800 switch * *	Revision 1.60  2000/10/18 12:22:21  cgoos *	Added workaround for half duplex hangup. * *	Revision 1.59  2000/10/10 11:22:06  gklug *	add: in manual half duplex mode ignore carrier extension errors * *	Revision 1.58  2000/10/02 14:10:27  rassmann *	Reading BCOM PHY after releasing reset until it returns a valid value. * *	Revision 1.57  2000/08/03 14:55:28  rassmann *	Waiting for I2C to be ready before de-initializing adapter *	(prevents sensors from hanging up). * *	Revision 1.56  2000/07/27 12:16:48  gklug *	fix: Stop Port check of the STOP bit does now take 2/18 sec as wanted * *	Revision 1.55  1999/11/22 13:32:26  cgoos *	Changed license header to GPL. * *	Revision 1.54  1999/10/26 07:32:54  malthoff *	Initialize PHWLinkUp with SK_FALSE. Required for Diagnostics. * *	Revision 1.53  1999/08/12 19:13:50  malthoff *	Fix for 1000BT. Do not owerwrite XM_MMU_CMD when *	disabling receiver and transmitter. Other bits *	may be lost. * *	Revision 1.52  1999/07/01 09:29:54  gklug *	fix: DoInitRamQueue needs pAC * *	Revision 1.51  1999/07/01 08:42:21  gklug *	chg: use Store & forward for RAM buffer when Jumbos are used * *	Revision 1.50  1999/05/27 13:19:38  cgoos *	Added Tx PCI watermark initialization. *	Removed Tx RAM queue Store & Forward setting. * *	Revision 1.49  1999/05/20 14:32:45  malthoff *	SkGeLinkLED() is completly removed now. * *	Revision 1.48  1999/05/19 07:28:24  cgoos *	SkGeLinkLED no more available for drivers. *	Changes for 1000Base-T. * *	Revision 1.47  1999/04/08 13:57:45  gklug *	add: Init of new port struct fiels PLinkResCt *	chg: StopPort Timer check * *	Revision 1.46  1999/03/25 07:42:15  malthoff *	SkGeStopPort(): Add workaround for cache incoherency. *			Create error log entry, disable port, and *			exit loop if it does not terminate. *	Add XM_RX_LENERR_OK to the default value for the *	XMAC receive command register. * *	Revision 1.45  1999/03/12 16:24:47  malthoff *	Remove PPollRxD and PPollTxD. *	Add check for GIPollTimerVal. * *	Revision 1.44  1999/03/12 13:40:23  malthoff *	Fix: SkGeXmitLED(), SK_LED_TST mode does not work. *	Add: Jumbo frame support. *	Chg: Resolution of parameter IntTime in SkGeCfgSync(). * *	Revision 1.43  1999/02/09 10:29:46  malthoff *	Bugfix: The previous modification again also for the second location. * *	Revision 1.42  1999/02/09 09:35:16  malthoff *	Bugfix: The bits '66 MHz Capable' and 'NEWCAP are reset while *		clearing the error bits in the PCI status register. * *	Revision 1.41  1999/01/18 13:07:02  malthoff *	Bugfix: Do not use CFG cycles after during Init- or Runtime, because *		they may not be available after Boottime. * *	Revision 1.40  1999/01/11 12:40:49  malthoff *	Bug fix: PCI_STATUS: clearing error bits sets the UDF bit. * *	Revision 1.39  1998/12/11 15:17:33  gklug *	chg: Init LipaAutoNeg with Unknown * *	Revision 1.38  1998/12/10 11:02:57  malthoff *	Disable Error Log Message when calling SkGeInit(level 2) *	more than once. * *	Revision 1.37  1998/12/07 12:18:25  gklug *	add: refinement of autosense mode: take into account the autoneg cap of LiPa * *	Revision 1.36  1998/12/07 07:10:39  gklug *	fix: init values of LinkBroken/ Capabilities for management * *	Revision 1.35  1998/12/02 10:56:20  gklug *	fix: do NOT init LoinkSync Counter. * *	Revision 1.34  1998/12/01 10:53:21  gklug *	add: init of additional Counters for workaround * *	Revision 1.33  1998/12/01 10:00:49  gklug *	add: init PIsave var in Port struct * *	Revision 1.32  1998/11/26 14:50:40  gklug *	chg: Default is autosensing with AUTOFULL mode * *	Revision 1.31  1998/11/25 15:36:16  gklug *	fix: do NOT stop LED Timer when port should be stopped * *	Revision 1.30  1998/11/24 13:15:28  gklug *	add: Init PCkeckPar struct member * *	Revision 1.29  1998/11/18 13:19:27  malthoff *	Disable packet arbiter timeouts on receive side. *	Use maximum timeout value for packet arbiter *	transmit timeouts. *	Add TestStopBit() function to handle stop RX/TX *	problem with active descriptor poll timers. *	Bug Fix: Descriptor Poll Timer not started, because *	GIPollTimerVal was initialized with 0. * *	Revision 1.28  1998/11/13 14:24:26  malthoff *	Bug Fix: SkGeStopPort() may hang if a Packet Arbiter Timout *	is pending or occurs while waiting for TX_STOP and RX_STOP. *	The PA timeout is cleared now while waiting for TX- or RX_STOP. * *	Revision 1.27  1998/11/02 11:04:36  malthoff *	fix the last fix * *	Revision 1.26  1998/11/02 10:37:03  malthoff *	Fix: SkGePollTxD() enables always the synchronounous poll timer. * *	Revision 1.25  1998/10/28 07:12:43  cgoos *	Fixed "LED_STOP" in SkGeLnkSyncCnt, "== SK_INIT_IO" in SkGeInit. *	Removed: Reset of RAM Interface in SkGeStopPort. * *	Revision 1.24  1998/10/27 08:13:12  malthoff *	Remove temporary code. * *	Revision 1.23  1998/10/26 07:45:03  malthoff *	Add Address Calculation Workaround: If the EPROM byte *	Id is 3, the address offset is 512 kB. *	Initialize default values for PLinkMode and PFlowCtrlMode. * *	Revision 1.22  1998/10/22 09:46:47  gklug *	fix SysKonnectFileId typo * *	Revision 1.21  1998/10/20 12:11:56  malthoff *	Don't dendy the Queue config if the size of the unused *	Rx qeueu is zero. * *	Revision 1.20  1998/10/19 07:27:58  malthoff *	SkGeInitRamIface() is public to be called by diagnostics. * *	Revision 1.19  1998/10/16 13:33:45  malthoff *	Fix: enabling descriptor polling is not allowed until *	the descriptor addresses are set. Descriptor polling *	must be handled by the driver. * *	Revision 1.18  1998/10/16 10:58:27  malthoff *	Remove temp. code for Diag prototype. *	Remove lint warning for dummy reads. *	Call SkGeLoadLnkSyncCnt() during SkGeInitPort(). * *	Revision 1.17  1998/10/14 09:16:06  malthoff *	Change parameter LimCount and programming of *	the limit counter in SkGeCfgSync(). * *	Revision 1.16  1998/10/13 09:21:16  malthoff *	Don't set XM_RX_SELF_RX in RxCmd Reg, because it's *	like a Loopback Mode in half duplex. * *	Revision 1.15  1998/10/09 06:47:40  malthoff *	SkGeInitMacArb(): set recovery counters init value *	to zero although this counters are not uesd. *	Bug fix in Rx Upper/Lower Pause Threshold calculation. *	Add XM_RX_SELF_RX to RxCmd. * *	Revision 1.14  1998/10/06 15:15:53  malthoff *	Make sure no pending IRQ is cleared in SkGeLoadLnkSyncCnt(). * *	Revision 1.13  1998/10/06 14:09:36  malthoff *	Add SkGeLoadLnkSyncCnt(). Modify *	the 'port stopped' condition according *	to the current problem report. * *	Revision 1.12  1998/10/05 08:17:21  malthoff *	Add functions: SkGePollRxD(), SkGePollTxD(), *	DoCalcAddr(), SkGeCheckQSize(), *	DoInitRamQueue(), and SkGeCfgSync(). *	Add coding for SkGeInitMacArb(), SkGeInitPktArb(), *	SkGeInitMacFifo(), SkGeInitRamBufs(), *	SkGeInitRamIface(), and SkGeInitBmu(). * *	Revision 1.11  1998/09/29 08:26:29  malthoff *	bug fix: SkGeInit0() 'i' should be increment. * *	Revision 1.10  1998/09/28 13:19:01  malthoff *	Coding time: Save the done work. *	Modify SkGeLinkLED(), add SkGeXmitLED(), *	define SkGeCheckQSize(), SkGeInitMacArb(), *	SkGeInitPktArb(), SkGeInitMacFifo(), *	SkGeInitRamBufs(), SkGeInitRamIface(), *	and SkGeInitBmu(). Do coding for SkGeStopPort(), *	SkGeInit1(), SkGeInit2(), and SkGeInit3(). *	Do coding for SkGeDinit() and SkGeInitPort(). * *	Revision 1.9  1998/09/16 14:29:05  malthoff *	Some minor changes. * *	Revision 1.8  1998/09/11 05:29:14  gklug *	add: init state of a port * *	Revision 1.7  1998/09/04 09:26:25  malthoff *	Short temporary modification. * *	Revision 1.6  1998/09/04 08:27:59  malthoff *	Remark the do-while in StopPort() because it never ends *	without a GE adapter. * *	Revision 1.5  1998/09/03 14:05:45  malthoff *	Change comment for SkGeInitPort(). Do not *	repair the queue sizes if invalid. * *	Revision 1.4  1998/09/03 10:03:19  malthoff *	Implement the new interface according to the *	reviewed interface specification. * *	Revision 1.3  1998/08/19 09:11:25  gklug *	fix: struct are removed from c-source (see CCC) * *	Revision 1.2  1998/07/28 12:33:58  malthoff *	Add 'IoC' parameter in function declaration and SK IO macros. * *	Revision 1.1  1998/07/23 09:48:57  malthoff *	Creation. First dummy 'C' file. *	SkGeInit(Level 0) is card_start for GE. *	SkGeDeInit() is card_stop for GE. * * ******************************************************************************/#include <config.h>#ifdef CONFIG_SK98#include "h/skdrv1st.h"#include "h/skdrv2nd.h"/* global variables ***********************************************************//* local variables ************************************************************/static const char SysKonnectFileId[] =	"@(#)$Id: skgeinit.c,v 1.1.1.1 2005/06/27 17:05:09 linuxpark Exp $ (C) SK ";struct s_QOffTab {	int	RxQOff;		/* Receive Queue Address Offset */	int	XsQOff;		/* Sync Tx Queue Address Offset */	int	XaQOff;		/* Async Tx Queue Address Offset */};static struct s_QOffTab QOffTab[] = {	{Q_R1, Q_XS1, Q_XA1}, {Q_R2, Q_XS2, Q_XA2}};/****************************************************************************** * *	SkGePollRxD() - Enable / Disable Descriptor Polling of RxD Ring * * Description: *	Enable or disable the descriptor polling of the receive descriptor *	ring (RxD) for port 'Port'. *	The new configuration is *not* saved over any SkGeStopPort() and *	SkGeInitPort() calls. * * Returns: *	nothing */void SkGePollRxD(SK_AC	*pAC,		/* adapter context */SK_IOC	IoC,		/* IO context */int		Port,		/* Port Index (MAC_1 + n) */SK_BOOL PollRxD)	/* SK_TRUE (enable pol.), SK_FALSE (disable pol.) */{	SK_GEPORT *pPrt;	pPrt = &pAC->GIni.GP[Port];

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -